Index: /branches/rsr.v5.1.dev/gpl.txt
===================================================================
--- /branches/rsr.v5.1.dev/gpl.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/gpl.txt	(revision 1)
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: /branches/rsr.v5.1.dev/install.txt
===================================================================
--- /branches/rsr.v5.1.dev/install.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/install.txt	(revision 1)
@@ -0,0 +1,36 @@
+installation
+
+
+-------------------------------------- prÃ©requis
+
+un serveur avec php/mysql
+pour fonctionner, la site a besoin au minimum de la version 5 de Php
+
+
+
+-------------------------------------- upload des fichiers
+
+le rÃ©pertoire "web" correspond Ã  la racine du site.
+copiez les fichiers et les dossiers de ce rÃ©pertoire sur votre serveur,
+Ã  la racine ou dans un sous-dossier.
+
+
+-------------------------------------- installation en ligne
+
+une fois les fichiers uploadÃ©s, rendez-vous sur l'URL :
+
+http://votre.domaine.tld/(.. dossier de votre installation ...)/install
+
+et suivez les instructions pour l'installation.
+
+
+-------------------------------------- premiere utilisation
+
+une fois le site installÃ©, un compte administrateur est disponible :
+
+login : admin
+pass : rsradminpass
+
+Pensez Ã  changer le mot de passe !
+
+plus de documentation le site : http://wiki.rsr.free.fr/wiki
Index: /branches/rsr.v5.1.dev/license.txt
===================================================================
--- /branches/rsr.v5.1.dev/license.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/license.txt	(revision 1)
@@ -0,0 +1,16 @@
+rsr.v5 Copyright 2011 dj3c1t
+
+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 (gpl.txt).
+
+If not, see <http://www.gnu.org/licenses/>.
Index: /branches/rsr.v5.1.dev/web/app/config.xml
===================================================================
--- /branches/rsr.v5.1.dev/web/app/config.xml	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/config.xml	(revision 1)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<config>
+
+  <pathes>
+    <punbb>../punbb/</punbb>
+    <tinymce>plugins/tinymce/</tinymce>
+    <player>plugins/players/player_mp3_js.swf</player>
+    <dist_out>out/dist/</dist_out>
+  </pathes>
+
+  <prefix>e_</prefix>
+  <sql_prefix>#--</sql_prefix>
+
+  <params>
+    <e>e</e>
+    <action>a</action>
+    <next>next</next>
+    <from>from</from>
+    <start>start</start>
+    <path>path</path>
+    <menus>m</menus>
+    <menus_categorie>mc</menus_categorie>
+    <alpha>alpha</alpha>
+    <user>user</user>
+    <edito>edito</edito>
+    <spotlight>spotlight</spotlight>
+    <categorie>c</categorie>
+    <news>n</news>
+    <artiste>artiste</artiste>
+    <is_artiste>ia</is_artiste>
+    <download>d</download>
+    <album>album</album>
+    <url>u</url>
+    <page>page</page>
+    <login>log</login>
+    <id>id</id>
+    <edit>edit</edit>
+    <format>f</format>
+  </params>
+
+</config>
Index: /branches/rsr.v5.1.dev/web/app/data/data.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/data.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/data.php	(revision 1)
@@ -0,0 +1,69 @@
+<?php
+
+  class data
+  {
+    public $env;
+    public $sql;
+    public $modules;
+
+    public $parent;
+
+    function __construct($sql, $env, $parent = null)
+    { $this->env = $env;
+      $this->sql = $sql;
+      $this->modules = array();
+      $this->parent = $parent;
+    }
+
+    function load($file_path)
+    { if($file_path && file_exists($file_path))
+      { $v_path = explode("/", $file_path);
+        $file = $v_path[count($v_path) - 1];
+        if(strcasecmp(substr($file, -4), ".php") == 0)
+        { $class_name = substr($file, 0, -4);
+          require_once $file_path;
+          if(class_exists($class_name) && !$this->modules[$class_name])
+          { $this->modules[$class_name] = new $class_name($this->sql, $this->env, $this);
+          }
+        }
+      }
+    }
+
+    function load_modules($modules_path, $recursif = false)
+    { if($dh = opendir($modules_path))
+      { while(($file = readdir($dh)) !== false)
+        { if(is_dir($modules_path.$file))
+          { if($recursif && substr($file, 0, 1) != ".") $this->load_modules($modules_path.$file."/", $recursif);
+          }
+          elseif(strcasecmp(substr($file, -4), ".php") == 0) $this->load($modules_path.$file);
+        }
+        closedir($dh);
+      }
+    }
+
+    function __call($method_name, $arguments)
+    { $root = $this;
+      while(isset($root->parent)) $root = $root->parent;
+      return $this->data_call($root, $method_name, $arguments);
+    }
+
+    function data_call($data_impl, $method_name, $arguments)
+    { $r = false;
+      $args = "";
+      foreach($arguments as $i => $arg) $args .= ($args ? ", " : "")."\$arguments[".$i."]";
+      foreach($data_impl->modules as $module_name => $module)
+      { if(method_exists($module, $method_name))
+        { eval("\$r = \$module->".$method_name."(".$args.");");
+          break;
+        }
+        else
+        { $r = $this->data_call($module, $method_name, $arguments);
+          if($r !== false) break;
+        }
+      }
+      return $r;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_albums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_albums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_albums.php	(revision 1)
@@ -0,0 +1,161 @@
+<?php
+
+  class da_albums extends data
+  {
+
+    function artiste_albums($id_artiste, $actif = null)
+    { $albums = array();
+      try
+      { $sql = "SELECT * FROM #--albums WHERE id_artiste=".$this->eq($id_artiste);
+        if(isset($actif)) $sql .= " AND actif=".($actif ? "1" : "0");
+        $sql .= " ORDER BY ordre ASC";
+        $rst = $this->sql->query($sql);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $albums[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $albums = false; }
+      return $albums;
+    }
+
+    /**
+
+      $max === null : la requete recupere tous les resultats
+      $max === true : la requete recupere $this->env->config("max_list") resultats
+      $max === n : la requete recupere n resultats
+
+    **/
+
+    function albums($start = 0, $max = null, $order_by = null, $order = null, $WHERE = "")
+    { $albums = array();
+      try
+      { $sql =
+         "SELECT #--albums.*, #--artistes.nom as artiste, #--artistes.id as id_artiste FROM #--albums, #--artistes"
+        ." WHERE #--albums.id_artiste=#--artistes.id"
+        .($WHERE ? " AND ".$WHERE : "")
+        .(isset($order_by) ? " ORDER BY ".$order_by.(isset($order) ? " ".$order: "") : "")
+        .( isset($max) ?
+             ( $max === true ?
+                 ($this->env->config("max_list") ? " LIMIT ".$start.",".$this->env->config("max_list") : "")
+               : " LIMIT ".$start.",".$max
+             )
+           : ""
+         );
+        $rst = $this->sql->query($sql);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $albums[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $albums = false; }
+      return $albums;
+    }
+
+    function set_artiste_albums($id_artiste, $ordre, $actif)
+    { if(($albums = $this->artiste_albums($id_artiste)) !== false)
+      { try
+        { foreach($albums as $id => $album)
+          { $query =
+             "UPDATE #--albums SET"
+            ."  ordre=".$ordre[$id]
+            .", actif=".($actif[$id] ? 1 : 0)
+            ." WHERE id=".$id;
+            $this->sql->query($query);
+          }
+        }
+        catch(Exception $_e) { return false; }
+      }
+      return true;
+    }
+
+    function artiste_album($id)
+    { $album = array();
+      try
+      { $sql = "SELECT * FROM #--albums WHERE id=".$this->eq($id);
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $album = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $album = false; }
+      return $album;
+    }
+
+    function add_artiste_album($id_artiste, $titre, $image, $description, $url, $format, $taille, $date_creation)
+    { $id_album;
+      try
+      { $sql =
+         "INSERT INTO #--albums"
+        ."( id_artiste"
+        .", titre"
+        .", image"
+        .", description"
+        .", url"
+        .", format"
+        .", taille"
+        .", date_creation"
+        .", date_publication"
+        .", compteur"
+        .", actif"
+        .") VALUES"
+        ."( ".$this->eq($id_artiste)
+        .", ".$this->eq($titre)
+        .", ".$this->eq($image)
+        .", ".$this->eq($description)
+        .", ".$this->eq($url)
+        .", ".$this->eq($format)
+        .", ".$this->eq($taille)
+        .", ".$this->eq($date_creation)
+        .", NOW()"
+        .", 0"
+        .", 1"
+        .")";
+        $this->sql->query($sql);
+        $id_album = $this->sql->insert_id();
+      }
+      catch(Exception $_e) { $id_album = false; }
+      return $id_album;
+    }
+
+    function set_artiste_album($id, $titre, $image, $description, $url, $format, $taille, $date_creation)
+    { try
+      { $sql =
+         "UPDATE #--albums SET"
+        ."  titre=".$this->eq($titre)
+        .", image=".$this->eq($image)
+        .", description=".$this->eq($description)
+        .", url=".$this->eq($url)
+        .", format=".$this->eq($format)
+        .", taille=".$this->eq($taille)
+        .", date_creation=".$this->eq($date_creation)
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($sql);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_artiste_album($id)
+    { try
+      { $sql = "DELETE FROM #--albums WHERE id=".$this->eq($id);
+        $this->sql->query($sql);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function inc_album_compteur($id_album)
+    { $url = false;
+      try
+      { $sql = "SELECT url FROM #--albums WHERE id=".$id_album;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $url = $v_rst["url"];
+        if($url);
+        { $sql =
+           "UPDATE #--albums SET compteur=(compteur + 1) WHERE id=".$id_album; 
+          $this->sql->query($sql);
+        }
+      }
+      catch(Exception $_e) { $url = false; }
+      return $url;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_artistes.php	(revision 1)
@@ -0,0 +1,226 @@
+<?php
+
+  class da_artistes extends data
+  {
+
+    function artistes_au_hasard($max = null, $get_size = false)
+    { $ARTISTES = array();
+      $IMG_WIDTH  = 60;
+      $IMG_HEIGHT = 60;
+      try
+      { $query =
+         "SELECT id, nom, style, image"
+        ." FROM #--artistes"
+        ." ORDER BY RAND()"
+        .(isset($max) ? " LIMIT ".$max : "");
+        $rst = $this->sql->query($query);
+        $artistes = array();
+        $i = 0;
+        while($v_rst = $this->sql->fetch_assoc($rst))
+        { $ARTISTES[$i] = Array();
+          $ARTISTES[$i]["id"]   = $v_rst["id"];
+          $ARTISTES[$i]["nom"]   = $v_rst["nom"];
+          $ARTISTES[$i]["style"] = $v_rst["style"];
+          $width = $IMG_WIDTH;
+          $height = $IMG_HEIGHT;
+          $EXISTS = true;
+          if($get_size)
+          { list($width, $height, $type, $attr) = @getimagesize($v_rst["image"]);
+            $EXISTS = false;
+            if($width) $EXISTS = true;
+            if($EXISTS)
+            { $div = 1;
+              if(($width / $div) > $IMG_WIDTH) $div = $width / $IMG_WIDTH;
+              if(($height / $div) > $IMG_HEIGHT) $div = $height / $IMG_HEIGHT;
+              $width = floor($width / $div);
+              $height = floor($height / $div);
+            }
+            else
+            { $width = $IMG_WIDTH;
+              $height = $IMG_HEIGHT;
+            }
+          }
+          $ARTISTES[$i]["image"] = Array();
+          $ARTISTES[$i]["image"]["src"] = $EXISTS ? $v_rst["image"] : "";
+          $ARTISTES[$i]["image"]["width"] = $width;
+          $ARTISTES[$i]["image"]["height"] = $height;
+          $i++;
+        }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $artistes = false; }
+      return $ARTISTES;
+    }
+
+    function artistes($pun_user = null)
+    { $artistes = array();
+      try
+      { $query =
+         "SELECT * FROM #--artistes"
+        .(isset($pun_user) ? " WHERE pun_user=".$pun_user : "")
+        ." ORDER BY nom";
+        $rst = $this->sql->query($query);
+        $artistes = array();
+        while($v_rst = $this->sql->fetch_assoc($rst)) { $artistes[$v_rst["id"]] = $v_rst; }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $artistes = false; }
+      return $artistes;
+    }
+
+    function artiste($id)
+    { $artiste = array();
+      try
+      { $query =
+         "SELECT *"
+        ." FROM #--artistes"
+        ." WHERE ".$this->env->bdd["prefix"]."artistes.id=".$id;
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $artiste = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $artiste = false; }
+      return $artiste;
+    }
+
+    function artiste_presentation($id)
+    { $presentation = "";
+      try
+      { $query =
+         "SELECT presentation"
+        ." FROM #--artistes"
+        ." WHERE id=".$id;
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $presentation = $v_rst["presentation"];
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $presentation = false; }
+      return $presentation;
+    }
+
+    function set_artiste_presentation($id, $presentation)
+    { try
+      { $query =
+         "UPDATE #--artistes"
+        ." SET presentation=".$this->eq($presentation)
+        ." WHERE id=".$id;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function add_artiste($pun_user, $nom, $forum = null, $dossier_personnel = null)
+    { try
+      { $sql =
+         "INSERT INTO #--artistes(nom, pun_user, pun_forum, dossier_personnel) VALUES"
+        ."( ".$this->eq($nom)
+        .", ".$pun_user
+        .", ".$this->eq($forum)
+        .", ".$this->eq($dossier_personnel)
+        .")";
+        $this->sql->query($sql);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function admin_set_artiste($id, $nom, $forum = null, $dossier_personnel = null)
+    { try
+      { $query =
+         "UPDATE #--artistes SET"
+        ."  nom=".$this->eq($nom)
+        .", pun_forum=".$this->eq($forum)
+        .", dossier_personnel=".$this->eq($dossier_personnel)
+        ." WHERE id=".$id;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_artiste
+    ( $id,
+      $nom,
+      $image,
+      $style,
+      $pays,
+      $site,
+      $email_contact,
+      $hide_email,
+      $contact_form,
+      $identifiant_paypal,
+      $lien_boutique,
+      $lien_facebook,
+      $lien_flickr,
+      $lien_twitter,
+      $lien_youtube,
+      $dossier_personnel = null
+    )
+    { try
+      { $query =
+         "UPDATE #--artistes SET"
+        ."  nom=".$this->eq($nom)
+        .", image=".$this->eq($image)
+        .", style=".$this->eq($style)
+        .", pays=".$this->eq($pays)
+        .", site=".$this->eq($site)
+        .", email_contact=".$this->eq($email_contact)
+        .", hide_email=".$hide_email
+        .", contact_form=".$contact_form
+        .", identifiant_paypal=".$this->eq($identifiant_paypal)
+        .", lien_boutique=".$this->eq($lien_boutique)
+        .", lien_facebook=".$this->eq($lien_facebook)
+        .", lien_flickr=".$this->eq($lien_flickr)
+        .", lien_twitter=".$this->eq($lien_twitter)
+        .", lien_youtube=".$this->eq($lien_youtube)
+        .", dossier_personnel=".$this->eq($dossier_personnel)
+        ." WHERE id=".$id;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_artiste($id_artiste)
+    { try
+      { if(($id_artiste_news_categorie = $this->id_categorie(array("root", "artistes", "news", $id_artiste))) !== false)
+        { if($id_artiste_news_categorie)
+          { $sql =
+             "DELETE FROM #--contenus"
+            ." WHERE categorie=".$id_artiste_news_categorie;
+            $this->sql->query($sql);
+            $sql = "DELETE FROM #--categories WHERE id=".$id_artiste_news_categorie;
+            $this->sql->query($sql);
+            $sql = "DELETE FROM #--categories_tree WHERE child=".$id_artiste_news_categorie;
+            $this->sql->query($sql);
+          }
+        }
+        else return false;
+        $sql = "DELETE FROM #--albums WHERE id_artiste=".$this->eq($id_artiste);
+        $this->sql->query($sql);
+        $sql = "DELETE FROM #--concerts WHERE id_artiste=".$this->eq($id_artiste);
+        $this->sql->query($sql);
+        $sql = "DELETE FROM #--videos WHERE id_artiste=".$this->eq($id_artiste);
+        $this->sql->query($sql);
+        $downloads = array();
+        $sql = "SELECT id FROM #--downloads WHERE id_artiste=".$this->eq($id_artiste);
+        $rst = $this->sql->query($sql);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $downloads[] = $v_rst["id"];
+        $this->sql->free_result($rst);
+        foreach($downloads as $id_download)
+        { $sql = "DELETE FROM #--download_urls WHERE id_download=".$id_download; 
+          $this->sql->query($sql);
+          $sql = "DELETE FROM #--downloads WHERE id=".$id_download;
+          $this->sql->query($sql);
+        }
+        $sql = "DELETE FROM #--artistes WHERE id=".$this->eq($id_artiste);
+        $this->sql->query($sql);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_downloads.php	(revision 1)
@@ -0,0 +1,284 @@
+<?php
+
+  class da_downloads extends data
+  {
+
+    function artiste_downloads($id = null, $public = false, $album = null, $_sql = null)
+    { $downloads = array();
+      try
+      { $query =
+         "SELECT #--downloads.*"
+        .", #--artistes.nom as auteur"
+        .", #--licences.nom as licence"
+        .", #--licences.lien as licence_url"
+        ." FROM #--artistes"
+        .", #--downloads"
+        .", #--licences"
+        ." WHERE #--downloads.id_artiste=#--artistes.id"
+        .(isset($id) ? " AND #--artistes.id=".$id : "")
+        ." AND #--downloads.id_licence=#--licences.id"
+        .($public ? " AND actif=1" : "")
+        .(isset($album) ? " AND id_album=".$album : "")
+        .(isset($_sql) ? $_sql : " ORDER BY #--downloads.ordre ASC");
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst))
+        { $downloads[$v_rst["id"]] = $v_rst;
+          $downloads[$v_rst["id"]]["compteur"] = 0;
+          $downloads[$v_rst["id"]]["urls"] = array();
+          $u_query =
+           "SELECT #--download_urls.*, #--formats.nom as format"
+          ." FROM #--download_urls, #--formats"
+          ." WHERE id_download=".$v_rst["id"]
+          ." AND #--download_urls.id_format=#--formats.id";
+          $u_rst = $this->sql->query($u_query);
+          while($v_u_rst = $this->sql->fetch_assoc($u_rst))
+          { $downloads[$v_rst["id"]]["urls"][$v_u_rst["id"]] = $v_u_rst;
+            $downloads[$v_rst["id"]]["compteur"] += $v_u_rst["compteur"];
+            if($v_u_rst["format"] === "mp3")
+            { $downloads[$v_rst["id"]]["mp3_id_url"] = $v_u_rst["id"];
+              $downloads[$v_rst["id"]]["mp3_url"] = $v_u_rst["url"];
+            }
+          }
+          $this->sql->free_result($u_rst);
+        }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $downloads = false; }
+      return $downloads;
+    }
+
+    function nb_downloads($public = false)
+    { $n = 0;
+      try
+      { $select =
+         "SELECT count(*) as n"
+        ." FROM #--downloads";
+        $where = $public ? " WHERE actif=1 AND id_licence IS NOT NULL" : "";
+        $rst = $this->sql->query($select.$where);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $n = $v_rst["n"];
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $n = false; }
+      return $n;
+    }
+
+    function nb_mp3($id, $public = false, $album = null)
+    { $n = 0;
+      try
+      { $query =
+         "SELECT #--downloads.id"
+        ." FROM #--artistes, #--downloads"
+        ." WHERE #--downloads.id_artiste=#--artistes.id"
+        ." AND #--artistes.id=".$id
+        .($public ? " AND actif=1 AND id_licence IS NOT NULL" : "")
+        .(isset($album) ? " AND id_album=".$album : "");
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst))
+        { $u_query =
+           "SELECT count(*) as n"
+          ." FROM #--download_urls, #--formats"
+          ." WHERE id_download=".$v_rst["id"]
+          ." AND #--download_urls.id_format=#--formats.id"
+          ." AND #--formats.nom='mp3'";
+          $u_rst = $this->sql->query($u_query);
+          if($v_u_rst = $this->sql->fetch_assoc($u_rst)) $n += $v_u_rst["n"];
+          $this->sql->free_result($u_rst);
+        }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $n = false; }
+      return $n;
+    }
+
+    function artiste_download($id)
+    { $download = array();
+      try
+      { $query =
+         "SELECT #--downloads.*"
+        .", #--licences.nom as licence"
+        .", #--licences.lien as licence_url"
+        ." FROM #--downloads, #--licences"
+        ." WHERE #--downloads.id=".$id
+        ." AND #--downloads.id_licence=#--licences.id";
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst))
+        { $download = $v_rst;
+          $download["urls"] = array();
+          $u_query =
+           "SELECT #--download_urls.*, #--formats.nom as format"
+          ." FROM #--download_urls, #--formats"
+          ." WHERE id_download=".$v_rst["id"]
+          ." AND #--download_urls.id_format=#--formats.id";
+          $u_rst = $this->sql->query($u_query);
+          while($v_u_rst = $this->sql->fetch_assoc($u_rst))
+          { $download["urls"][$v_u_rst["id"]] = $v_u_rst;
+            if($v_u_rst["format"] === "mp3") $download["mp3_url"] = $v_u_rst["url"];
+          }
+          $this->sql->free_result($u_rst);
+        }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $download = false; }
+      return $download;
+    }
+
+    function licences()
+    { $licences = array();
+      try
+      { $query = "SELECT * FROM #--licences";
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $licences[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $licences = false; }
+      return $licences;
+    }
+
+    function formats()
+    { $formats = array();
+      try
+      { $query = "SELECT * FROM #--formats";
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $formats[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $formats = false; }
+      return $formats;
+    }
+
+    function add_download($id_artiste, $nom, $album, $style, $id_licence, $date_creation, $id_format, $url)
+    { try
+      { $query =
+         "INSERT INTO #--downloads VALUES"
+        ."(NULL"
+        .", ".$id_artiste
+        .", ".$this->eq($album)
+        .", ".$id_licence
+        .", ".$this->eq($nom)
+        .", '".$date_creation."'"
+        .", ".$this->eq($style)
+        .", NULL"
+        .", 0"
+        .", 1"
+        .")";
+        $this->sql->query($query);
+        $id_download = $this->sql->insert_id();
+        $query =
+         "INSERT INTO #--download_urls VALUES"
+        ."(NULL"
+        .", ".$id_download
+        .", ".$id_format
+        .", NULL"
+        .", ".$this->eq($url)
+        .", NULL"
+        .", '".date("Y-m-d")."'"
+        .", 0"
+        .")";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_download($id, $nom, $album, $style, $id_licence, $date_creation)
+    { try
+      { $query =
+         "UPDATE #--downloads SET"
+        ."  nom=".$this->eq($nom)
+        .", id_album=".$this->eq($album)
+        .", style=".$this->eq($style)
+        .", id_licence=".$id_licence
+        .", date_creation='".$date_creation."'"
+        ." WHERE id=".$id;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_download($id_download)
+    { try
+      { $this->sql->query("DELETE FROM #--downloads WHERE id=".$this->eq($id_download));
+        $this->sql->query("DELETE FROM #--download_urls WHERE id_download=".$this->eq($id_download));
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function add_download_url($id_download, $url, $id_format)
+    { try
+      { $query =
+         "INSERT INTO #--download_urls(id_download, id_format, url, date_publication) VALUES"
+        ."( ".$id_download
+        .", ".$id_format
+        .", ".$this->eq($url)
+        .", '".date("Y-m-d")."'"
+        .")";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_download_url($id_download_url, $url, $id_format)
+    { try
+      { $query =
+         "UPDATE #--download_urls SET"
+        ."  url=".$this->eq($url)
+        .", id_format=".$id_format
+        ." WHERE id=".$id_download_url;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_download_url($id_download, $id_download_url)
+    { if(($download = $this->artiste_download($id_download)) !== false)
+      { try
+        { $this->sql->query("DELETE FROM #--download_urls WHERE id=".$this->eq($id_download_url));
+          if(count($download["urls"]) <= 1)
+          { if($this->del_download($id_download)) return 2;
+            else return false;
+          }
+        }
+        catch(Exception $_e) { return false; }
+      }
+      else return false;
+      return 1;
+    }
+
+    function set_downloads($ordre, $actif)
+    { try
+      { foreach($ordre as $id => $_ordre)
+        { $query =
+           "UPDATE #--downloads SET"
+          ."  ordre=".$_ordre
+          .", actif=".($actif[$id] ? 1 : 0)
+          ." WHERE id=".$id;
+          $this->sql->query($query);
+        }
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function inc_download_compteur($id_download)
+    { $url = false;
+      try
+      { $sql = "SELECT url FROM #--download_urls WHERE id=".$id_download;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $url = $v_rst["url"];
+        if($url)
+        { $sql =
+           "UPDATE #--download_urls SET compteur=(compteur + 1) WHERE id=".$id_download; 
+          $this->sql->query($sql);
+        }
+      }
+      catch(Exception $_e) { $url = false; }
+      return $url;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/artistes/da_news.php	(revision 1)
@@ -0,0 +1,51 @@
+<?php
+
+  class da_news extends data
+  {
+
+    function artiste_news($id_artiste, $start = 0, $public = false, $max = null, $id_contenu = null)
+    { if(isset($id_contenu))
+      { if(($contenu = $this->contenu($id_contenu)) !== false)
+        { return array
+          ( "total" => 1,
+            "list" => array($contenu["id"] => $contenu)
+          );
+        }
+        return false;
+      }
+      return $this->contenus
+      ( array("root", "artistes", "news", $id_artiste),
+        $start,
+        $max,
+        ($public ? " AND public=1 AND date_publication <= NOW()" : ""),
+        0
+      );
+    }
+
+    function add_artiste_news($id_artiste, $id_user, $titre, $contenu, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("root", "artistes", "news", $id_artiste))) !== false)
+      { if(!isset($id_categorie))
+        { if(($id_artiste_news_root = $this->id_categorie(array("root", "artistes", "news"))) !== false)
+          { if(($id_categorie = $this->add_categorie($id_artiste, null, null, null, "", $id_artiste_news_root)) === false) return false;
+          }
+          else return false;
+        }
+        return $this->add_contenu(null, $id_categorie, $titre, "", $contenu, $id_user, $date_publication, $public);
+      }
+      return false;
+    }
+
+    function set_artiste_news($id_artiste, $id_user, $id, $titre, $contenu, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("root", "artistes", "news", $id_artiste))) !== false)
+      { return $this->set_contenu($id, null, $id_categorie, $titre, "", $contenu, $id_user, $date_publication, $public);
+      }
+      return false;
+    }
+
+    function del_artiste_news($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_editos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_editos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_editos.php	(revision 1)
@@ -0,0 +1,52 @@
+<?php
+
+  class dc_editos extends data
+  {
+
+    function editos($start = 0)
+    { return $this->contenus(array("editos"), $start);
+    }
+
+    function edito($id = null)
+    { if
+      ( ( $contenus = $this->contenus
+          ( array("editos"),
+            0,
+            1,
+            isset($id) ?
+              " AND #--contenus.id=".$this->eq($id)
+            : " AND public=1 AND date_publication <= NOW()"
+          )
+        ) !== false
+      )
+      { $edito = (($edito = current($contenus["list"])) !== false ? $edito : (isset($id) ? false : array()));
+        return $edito;
+      }
+      return false;
+    }
+
+    function add_edito($titre, $contenu, $auteur, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("editos"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->add_contenu("", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+        }
+      }
+      return false;
+    }
+
+    function set_edito($id, $titre, $contenu, $auteur, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("editos"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->set_contenu($id, "", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+        }
+      }
+      return false;
+    }
+
+    function del_edito($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_links.php	(revision 1)
@@ -0,0 +1,48 @@
+<?php
+
+  class dc_links extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                               categories
+    #
+
+    function links_categories($path)
+    { return $this->categories($path);
+    }
+
+    function all_links($path = array())
+    { $_path = array("root", "links");
+      foreach($path as $__path) $_path[] = $__path;
+      if(($id = $this->id_categorie($_path)) !== false)
+      { return $this->sub_categories($id, null);
+      }
+      return false;
+    }
+
+    function links_categorie($id)
+    { return $this->categorie($id);
+    }
+
+    function add_links_categorie($nom, $titre, $description, $url = null, $parent = null)
+    { return $this->add_categorie
+      ( $nom,
+        $titre,
+        null,
+        $description,
+        $url,
+        isset($parent) ? $parent : $this->id_categorie(array("root", "menus"))
+      );
+    }
+
+    function set_links_categorie($id, $nom, $titre, $description, $url, $ordre = null)
+    { return $this->set_categorie($id, $nom, $titre, null, $description, $url, $ordre);
+    }
+
+    function del_links_categorie($id)
+    { return $this->del_categorie($id, true);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_menus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_menus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_menus.php	(revision 1)
@@ -0,0 +1,71 @@
+<?php
+
+  class dc_menus extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                               categories
+    #
+
+    function menus_categories($path)
+    { return $this->categories($path);
+    }
+
+    function all_menus($path = array())
+    { $_path = array("root", "menus");
+      foreach($path as $__path) $_path[] = $__path;
+      if(($id = $this->id_categorie($_path)) !== false)
+      { return $this->sub_categories($id, null);
+      }
+      return false;
+    }
+
+    function menus_categorie($id)
+    { return $this->categorie($id);
+    }
+
+    function add_menus_categorie($titre, $url = null, $parent = null)
+    { return $this->add_categorie
+      ( null,
+        $titre,
+        null,
+        null,
+        $url,
+        isset($parent) ? $parent : $this->id_categorie(array("root", "menus"))
+      );
+    }
+
+    function set_menus_categorie($id, $titre, $url, $ordre = null)
+    { if(($categorie = $this->categorie($id)) !== false)
+      { return $this->set_categorie($id, $categorie["nom"], $titre, null, null, $url, $ordre);
+      }
+      else return false;
+    }
+
+    function del_menus_categorie($id)
+    { return $this->del_categorie($id, true);
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                    liens
+    #
+
+    function menus($path, $start = 0, $depth = 0, $public = false)
+    { return $this->contenus($path, $start, null, $public ? " AND public=1 AND date_publication <= NOW()" : "", $depth);
+    }
+
+    function add_menu($categorie, $nom, $titre, $description, $url, $auteur, $date_publication, $public)
+    { return $this->add_contenu($nom, $categorie, $titre, $description, $url, $auteur, $date_publication, $public);
+    }
+
+    function set_menu($id, $categorie, $nom, $titre, $description, $url, $auteur, $date_publication, $public)
+    { return $this->set_contenu($id, $nom, $categorie, $titre, $description, $url, $auteur, $date_publication, $public);
+    }
+
+    function del_menu($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_news.php	(revision 1)
@@ -0,0 +1,57 @@
+<?php
+
+  class dc_news extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                               categories
+    #
+
+    function news_categories()
+    { return $this->categories(array("root", "news"));
+    }
+
+    function all_news_categories()
+    { return $this->categories(array("root", "news"), 0, null, "", true);
+    }
+
+    function news_categorie($id)
+    { return $this->categorie($id);
+    }
+
+    function add_news_categorie($titre, $icone, $description)
+    { return $this->add_categorie(null, $titre, $icone, $description, "", $this->id_categorie(array("root", "news")));
+    }
+
+    function set_news_categorie($id, $titre, $icone, $description)
+    { return $this->set_categorie($id, null, $titre, $icone, $description);
+    }
+
+    function del_news_categorie($id, $dest)
+    { if($this->move_contenus($id, $dest)) return $this->del_categorie($id);
+      return false;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                 contenus
+    #
+
+    function news($path, $start = 0, $depth = 0, $public = false, $max = null)
+    { return $this->contenus($path, $start, $max, $public ? " AND public=1 AND date_publication <= NOW()" : "", $depth);
+    }
+
+    function add_news($categorie, $titre, $contenu, $auteur, $date_publication, $public)
+    { return $this->add_contenu(null, $categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+    }
+
+    function set_news($id, $categorie, $titre, $contenu, $auteur, $date_publication, $public)
+    { return $this->set_contenu($id, null, $categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+    }
+
+    function del_news($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_pages.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_pages.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_pages.php	(revision 1)
@@ -0,0 +1,58 @@
+<?php
+
+  class dc_pages extends data
+  {
+
+    function pages($start = 0, $public = null)
+    { return $this->contenus
+      ( array("root", "pages"),
+        $start,
+        null,
+        isset($public) ? " AND public=".($public ? "1" : "0") : "",
+        null,
+        true,
+        true
+      );
+    }
+
+    function page($id)
+    { if
+      ( ( $contenus = $this->contenus
+          ( array("root", "pages"),
+            0,
+            1,
+            " AND #--contenus.id=".$this->eq($id)
+          )
+        ) !== false
+      )
+      { $page = (($page = current($contenus["list"])) !== false ? $page : (isset($id) ? false : array()));
+        return $page;
+      }
+      return false;
+    }
+
+    function add_page($titre, $fichier, $contenu, $public, $user)
+    { if(($id_categorie = $this->id_categorie(array("root", "pages"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->add_contenu($fichier, $id_categorie, $titre, "", $contenu, $user, "", $public);
+        }
+      }
+      return false;
+    }
+
+    function set_page($id, $titre, $fichier, $contenu, $public, $user)
+    { if(($id_categorie = $this->id_categorie(array("root", "pages"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->set_contenu($id, $fichier, $id_categorie, $titre, "", $contenu, $user, "", $public);
+        }
+      }
+      return false;
+    }
+
+    function del_page($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_spotlights.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_spotlights.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_spotlights.php	(revision 1)
@@ -0,0 +1,52 @@
+<?php
+
+  class dc_spotlights extends data
+  {
+
+    function spotlights($start = 0)
+    { return $this->contenus(array("spotlights"), $start);
+    }
+
+    function spotlight($id = null)
+    { if
+      ( ( $contenus = $this->contenus
+          ( array("spotlights"),
+            0,
+            1,
+            isset($id) ?
+              " AND #--contenus.id=".$this->eq($id)
+            : " AND public=1 AND date_publication <= NOW()"
+          )
+        ) !== false
+      )
+      { $spotlight = (($spotlight = current($contenus["list"])) !== false ? $spotlight : (isset($id) ? false : array()));
+        return $spotlight;
+      }
+      return false;
+    }
+
+    function add_spotlight($titre, $contenu, $auteur, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("spotlights"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->add_contenu("", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+        }
+      }
+      return false;
+    }
+
+    function set_spotlight($id, $titre, $contenu, $auteur, $date_publication, $public)
+    { if(($id_categorie = $this->id_categorie(array("spotlights"))) !== false)
+      { if(isset($id_categorie))
+        { return $this->set_contenu($id, "", $id_categorie, $titre, "", $contenu, $auteur, $date_publication, $public);
+        }
+      }
+      return false;
+    }
+
+    function del_spotlight($id)
+    { return $this->del_contenu($id);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_utils.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_utils.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/contenus/dc_utils.php	(revision 1)
@@ -0,0 +1,468 @@
+<?php
+
+  class dc_utils extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                               categories
+    #
+
+    # $path un tableau qui contient une suite de categories, qui peut commencer ou non a la
+    # racine des categories et finir ou non par une categorie feuille.
+    # dans le tableau, chaque categorie est indiquee soit par son nom (champ "nom" dans la
+    # table "categories") soit par son identifiant (champ id). par convention, la fonction
+    # fait la distinction entre un nom et un id en fonction du type de variable. si la
+    # variable est un entier (verifie avec la fonction php is_int), la fonction considere
+    # que c'est un id, sinon, que c'est un nom.
+    #
+    # retourne l'identifiant de la derniere categorie du tableau $path
+
+    function id_categorie($path)
+    { try
+      { $ids = null;
+        $id = null;
+        $path_ok = true;
+        foreach($path as $nom)
+        { if(is_int($nom)) $id = $nom;
+          else
+          { $query =
+             "SELECT id"
+            ." FROM #--categories".(isset($id) ? ", #--categories_tree" : "")
+            ." WHERE #--categories.nom=".$this->eq($nom)
+            .( isset($id) ?
+                " AND #--categories_tree.parent=".$this->eq($id)
+               ." AND #--categories_tree.child=#--categories.id"
+               :""
+             );
+             $rst = $this->sql->query($query);
+             if($v_rst = $this->sql->fetch_assoc($rst)) $id = (int)$v_rst["id"];
+             else $path_ok = false;
+             $this->sql->free_result($rst);
+             if(!$path_ok) return null;
+          }
+        }
+        return $id;
+      }
+      catch(Exception $_e) { return false; }
+    }
+
+    # retourne les sous-categories de la categorie dont l'id est passe en parametre
+    # depth indique la profondeur. si depth vaut 1, seules les sous-categories directes
+    # seront retournÃ©es. si depth vaut 0, la fonction retournera toute la sous-arborescence
+    #
+    # le parametre list precise le format de retour. si $list vaut true, la fonction
+    # retournera une chaine de caractÃšres comprenant les id des sous-categories, separes
+    # par des virgules (pour sql). si $list vaut false, la fonction retournera un array. 
+    #
+    # la fonction peut prendre un chemin (path, voir plus haut, fonction id_categorie)
+    # a la place de l'id.
+
+    function sub_categories($id, $depth = 0, $list = false)
+    { if($list) $subs = "";
+      else
+      { $subs = array();
+        $subs["subs"] = array();
+      }
+      if(!is_int($id)) $id = $this->id_categorie($id);
+      if($id !== false)
+      { if($list || ($subs = $this->categorie($id)) !== false)
+        { if(!$list) $subs["subs"] = array();
+          try
+          { $query =
+             "SELECT child"
+            ." FROM #--categories_tree, #--categories"
+            ." WHERE #--categories_tree.child=#--categories.id"
+            ." AND #--categories_tree.parent=".$this->eq($id)
+            ." ORDER BY #--categories.ordre ASC";
+            $rst = $this->sql->query($query);
+            while($v_rst = $this->sql->fetch_assoc($rst))
+            { $_subs = null;
+              if(!isset($depth) || $depth > 0) $_subs = $this->sub_categories((int)$v_rst["child"], isset($depth) ? ($depth - 1) : null, $list);
+              if(isset($_subs) && $_subs === false) return false;
+              if($list)
+              { $subs .=
+                 ($subs ? "," : "")
+                .$v_rst["child"]
+                .(isset($_subs) ? $_subs : "");
+              }
+              else $subs["subs"][$v_rst["child"]] = $_subs;
+            }
+          }
+          catch(Exception $_e) { $subs = false; }
+        }
+      }
+      else $subs = false;
+      return $subs;
+    }
+
+    function categories($path, $start = 0, $max = null, $WHERE = "", $all = false)
+    { $categories = array();
+      try
+      { if(($parent = $this->id_categorie($path)) !== false)
+        { $categories["list"] = array();
+          $categories["total"] = 0;
+          $query =
+           "SELECT count(*) as n"
+          ." FROM #--categories, #--categories_tree"
+          ." WHERE #--categories.id=#--categories_tree.child"
+          ." AND #--categories_tree.parent=".$this->eq($parent)
+          .$WHERE;
+          $rst = $this->sql->query($query);
+          if($v_rst = $this->sql->fetch_assoc($rst)) $categories["total"] = $v_rst["n"];
+          $this->sql->free_result($rst);
+          if($categories["total"] > 0)
+          { $query =
+             "SELECT #--categories.*"
+            ." FROM #--categories, #--categories_tree"
+            ." WHERE #--categories.id=#--categories_tree.child"
+            ." AND #--categories_tree.parent=".$this->eq($parent)
+            .$WHERE
+            ." ORDER BY ordre ASC"
+            .( $all ?
+                 ""
+               : ( isset($max) ?
+                     " LIMIT ".$start.",".$max
+                   : ($this->env->config("max_list") ? " LIMIT ".$start.",".$this->env->config("max_list") : "")
+                 )
+             );
+            $rst = $this->sql->query($query);
+            while($v_rst = $this->sql->fetch_assoc($rst)) $categories["list"][$v_rst["id"]] = $v_rst;
+            $this->sql->free_result($rst);
+          }
+        }
+        else $categories = false;
+      }
+      catch(Exception $_e) { $categories = false; }
+      return $categories;
+    }
+
+    function categorie($id)
+    { $categorie = array();
+      try
+      { $query =
+         "SELECT *"
+        ." FROM #--categories"
+        ." WHERE #--categories.id=".$this->eq($id);
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $categorie = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $categorie = false; }
+      return $categorie;
+    }
+
+    function add_categorie($nom = null, $titre = null, $icone = null, $description = null, $contenu = null, $parent = null)
+    { try
+      { $query =
+         "INSERT #--categories(nom, titre, icone, description, contenu) VALUES"
+        ."( ".$this->eq($nom)
+        .", ".$this->eq($titre)
+        .", ".$this->eq($icone)
+        .", ".$this->eq($description)
+        .", ".$this->eq($contenu)
+        .")";
+        $this->sql->query($query);
+        $id = $this->sql->insert_id();
+        if(isset($parent) && $this->set_in_categorie($parent, $id)) return $id;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function set_categorie($id, $nom = null, $titre = null, $icone = null, $description = null, $contenu = null, $ordre = null)
+    { try
+      { $query =
+         "UPDATE #--categories SET"
+        ."  nom=".$this->eq($nom)
+        .", titre=".$this->eq($titre)
+        .", icone=".$this->eq($icone)
+        .", description=".$this->eq($description)
+        .", contenu=".$this->eq($contenu)
+        .(isset($ordre) ? ", ordre=".$this->eq($ordre) : "")
+        ." WHERE ".$this->env->bdd["prefix"]."categories.id=".$this->eq($id);
+        $this->sql->query($query);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function del_categorie($id, $recursif = false)
+    { if(($categorie = $this->categorie($id)) !== false)
+      { if($recursif) return $this->r_del_categorie($categorie);
+        return $this->_del_categorie($categorie);
+      }
+      return false;
+    }
+
+    function _del_categorie($categorie)
+    { try
+      { $sql =
+         "DELETE FROM #--categories"
+        ." WHERE #--categories.id=".$this->eq($categorie["id"]);
+        $this->sql->query($sql);
+        $sql =
+         "DELETE FROM #--categories_tree"
+        ." WHERE #--categories_tree.child=".$this->eq($categorie["id"]);
+        $this->sql->query($sql);
+        $this->del_categorie_icone($categorie["icone"]);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function r_del_categorie($categorie)
+    { $OK = true;
+      try
+      { $sql =
+         "SELECT #--categories.*"
+        ." FROM #--categories"
+        .", #--categories_tree"
+        ." WHERE #--categories.id=#--categories_tree.child"
+        ." AND #--categories_tree.parent=".$this->eq($categorie["id"]);
+        $rst = $this->sql->query($sql);
+        while($OK && $v_rst = $this->sql->fetch_assoc($rst)) $OK = $this->r_del_categorie($v_rst);
+        $this->sql->free_result($rst);
+        if($OK)
+        { $sql =
+           "SELECT id"
+          ." FROM #--contenus"
+          ." WHERE #--contenus.categorie=".$this->eq($categorie["id"]);
+          $rst = $this->sql->query($sql);
+          while($OK && $v_rst = $this->sql->fetch_assoc($rst)) $OK = $this->del_contenu($v_rst["id"]);
+          $this->sql->free_result($rst);
+          if($OK) $OK = $this->_del_categorie($categorie);
+        }
+      }
+      catch(Exception $_e) { $OK = false;  }
+      return $OK;
+    }
+
+    function del_categorie_icone($icone)
+    { try
+      { $delete_icone = false;
+        if($icone && file_exists($icone))
+        { try
+          { $query =
+             "SELECT count(*) as n"
+            ." FROM #--categories"
+            ." WHERE icone=".$this->eq($icone);
+            $rst = $this->sql->query($query);
+            if($v_rst = $this->sql->fetch_assoc($rst)) $delete_icone = $v_rst["n"] == 1;
+            $this->sql->free_result($rst);
+          }
+          catch(Exception $_e) { return false; }
+        }
+        if($delete_icone) @unlink($icone);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function in_categorie($parent, $child)
+    { $n = false;
+      try
+      { $query =
+         "SELECT count(*) as n FROM #--categories_tree"
+        ." WHERE parent=".$parent
+        ." AND child=".$child;
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $n = $v_rst["n"]; 
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) {}
+      return $n;
+    }
+
+    function set_in_categorie($parent, $child)
+    { try
+      { if(($n = $this->in_categorie($parent, $child)) !== false)
+        { if($n == 0)
+          { $query =
+             "INSERT INTO #--categories_tree VALUES"
+            ."( ".$parent
+            .", ".$child
+            .")";
+            $this->sql->query($query);
+          }
+          return true;
+        }
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function remove_from_categorie($parent, $child)
+    { try
+      { $query =
+         "DELETE FROM #--categories_tree"
+        ." WHERE parent=".$parent
+        ." AND child=".$child;
+        $this->sql->query($query);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                 contenus
+    #
+
+    function contenus($path, $start = 0, $max = null, $WHERE = "", $depth = null, $ALL = false, $ORDRE = false)
+    { $contenus = false;
+      if(($id_categorie = $this->id_categorie($path)) !== false)
+      { if(isset($id_categorie))
+        { if(!isset($depth) || $depth > 0)
+          { if(($subs = $this->sub_categories($id_categorie, $depth, true)) !== false)
+            { $id_categorie .= $subs ? ",".$subs : "";
+            }
+            else $id_categorie = false;
+          }
+          if($id_categorie !== false)
+          { try
+            { $all = $id_categorie == $id_news_root;
+              $contenus = array("list" => array(), "total" => 0);
+              $query =
+               "SELECT count(*) as n"
+              ." FROM #--contenus"
+              ." WHERE #--contenus.categorie IN (".$id_categorie.")"
+              .$WHERE;
+              $rst = $this->sql->query($query);
+              if($v_rst = $this->sql->fetch_assoc($rst)) $contenus["total"] = $v_rst["n"];
+              $this->sql->free_result($rst);
+              if($contenus["total"] > 0)
+              { $query =
+                 "SELECT #--contenus.*"
+                .", #--pun_users.username as auteur"
+                .", #--categories.nom as categorie_nom"
+                .", #--categories.titre as categorie_titre"
+                .", #--categories.icone as categorie_icone"
+                ." FROM #--pun_users, #--contenus"
+                ." LEFT JOIN #--categories"
+                ." ON #--categories.id=#--contenus.categorie"
+                ." WHERE #--contenus.auteur_creation=#--pun_users.id"
+                ." AND #--contenus.categorie IN (".$id_categorie.")"
+                .$WHERE
+                .($ORDRE ? " ORDER BY #--contenus.ordre ASC" : " ORDER BY date_publication DESC")
+                .( $ALL ?
+                     ""
+                   : ( isset($max) ?
+                         " LIMIT ".$start.",".$max
+                       : ($this->env->config("max_list") ? " LIMIT ".$start.",".$this->env->config("max_list") : "")
+                     )
+                 );
+                $rst = $this->sql->query($query);
+                while($v_rst = $this->sql->fetch_assoc($rst)) $contenus["list"][$v_rst["id"]] = $v_rst;
+                $this->sql->free_result($rst);
+              }
+            }
+            catch(Exception $_e) { $contenus = false; }
+          }
+        }
+        else $contenus = array("list" => array(), "total" => 0);
+      }
+      return $contenus;
+    }
+
+    function contenu($id)
+    { $contenu = array();
+      try
+      { $query =
+         "SELECT #--contenus.*"
+        .", #--pun_users.username as auteur"
+        .", #--categories.id as categorie_id"
+        .", #--categories.titre as categorie_titre"
+        .", #--categories.icone as categorie_icone"
+        ." FROM #--pun_users, #--contenus"
+        ." LEFT JOIN #--categories"
+        ." ON #--categories.id=#--contenus.categorie"
+        ." WHERE #--contenus.auteur_creation=#--pun_users.id"
+        ." AND #--contenus.id=".$this->eq($id);
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $contenu = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $contenu = false; }
+      return $contenu;
+    }
+
+    function add_contenu($nom, $categorie, $titre, $description, $contenu, $auteur, $date_publication, $public)
+    { try
+      { $query =
+         "INSERT INTO #--contenus(nom, categorie, titre, description, contenu, auteur_creation, date_creation, date_publication, public) VALUES"
+        ."( ".$this->eq($nom)
+        .", ".$this->eq($categorie)
+        .", ".$this->eq($titre)
+        .", ".$this->eq($description)
+        .", ".$this->eq($contenu)
+        .", '".$auteur."'"
+        .", NOW()"
+        .", ".(strlen($date_publication) > 0 ? "'".$date_publication."'" : "NOW()")
+        .", '".$public."'"
+        .")";
+        $rst = $this->sql->query($query);
+        return true;
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_contenu($id, $nom, $categorie, $titre, $description, $contenu, $auteur, $date_publication, $public)
+    { try
+      { $query =
+         "UPDATE #--contenus SET"
+        ."  nom=".$this->eq($nom)
+        .", categorie=".$this->eq($categorie)
+        .", titre=".$this->eq($titre)
+        .", description=".$this->eq($description)
+        .", contenu=".$this->eq($contenu)
+        .", auteur_modification='".$auteur."'"
+        .", date_modification=NOW()"
+        .", date_publication=".($date_publication ? "'".$date_publication."'" : "NOW()")
+        .", public='".$public."'"
+        ." WHERE id=".$id;
+        $rst = $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_contenu_ordre($id, $ordre)
+    { try
+      { $query = "UPDATE #--contenus SET ordre=".(strlen($ordre) > 0 ? $ordre : "NULL")." WHERE id=".$id;
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    # deplace tous les contenus (sans recursion) de la categorie $from
+    # dans la categorie $to
+
+    function move_contenus($from, $to = null)
+    { try
+      { $sql =
+         "UPDATE #--contenus SET"
+        ." categorie=".$this->eq($to)
+        ." WHERE categorie=".$from;
+        $this->sql->query($sql);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_contenu($id)
+    { try
+      { $query = "DELETE FROM #--contenus WHERE id=".$id;
+        $rst = $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_boxes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_boxes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_boxes.php	(revision 1)
@@ -0,0 +1,155 @@
+<?php
+
+  class data_boxes extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                    emplacements de blocs
+    #
+
+    function box_emplacements()
+    { $emplacements = array();
+      if($this->env->out_file_exists("emplacements.xml"))
+      { $emplacements_config = simplexml_load_file($this->env->out_file("emplacements.xml"));
+        foreach($emplacements_config as $emplacement)
+        { $emplacements[utf8_decode($emplacement->id)] = array();
+          foreach($emplacement as $emplacement_key => $emplacement_value)
+          { $emplacements[utf8_decode($emplacement->id)][utf8_decode($emplacement_key)] = utf8_decode($emplacement_value);
+          }
+        }
+      }
+      else $emplacements = false;
+      return $emplacements;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                    blocs
+    #
+
+    function box_files()
+    { $box_files = array();
+      $boxes_dir = $this->env->path("out")."boxes/";
+      if(is_dir($boxes_dir))
+      { if($dh = opendir($boxes_dir))
+        { while(($file = readdir($dh)) !== false)
+          { if(substr($file, 0, 1) != "." && substr($file, -4) == ".php")
+            { $box_files[] = $file;
+            }
+          }
+        }
+        closedir($dh);
+      }
+      return $box_files;
+    }
+
+    function boxes($start = 0, $emplacement = null, $public = null)
+    { $boxes = array();
+      try
+      { $boxes = array("list" => array(), "total" => 0);
+        $query =
+         "SELECT count(*) as n"
+        ." FROM #--boxes"
+        .(isset($emplacement) ? " WHERE #--boxes.emplacement".($emplacement ? "=".$this->eq($emplacement) : " IS NULL") : "")
+        .(isset($public) ? (isset($emplacement) ? " AND" : " WHERE")." public=".($public ? "1" : "0") : "");
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $boxes["total"] = $v_rst["n"];
+        $this->sql->free_result($rst);
+        if($boxes["total"] > 0)
+        { $query =
+           "SELECT #--boxes.*"
+          .", #--pun_users.username as auteur"
+          ." FROM #--pun_users, #--boxes"
+          ." WHERE #--boxes.auteur_creation=#--pun_users.id"
+          .(isset($emplacement) ? " AND #--boxes.emplacement".($emplacement ? "=".$this->eq($emplacement) : " IS NULL") : "")
+          .(isset($public) ? " AND public=".($public ? "1" : "0") : "")
+          ." ORDER BY #--boxes.ordre";
+          $rst = $this->sql->query($query);
+          while($v_rst = $this->sql->fetch_assoc($rst)) $boxes["list"][$v_rst["id"]] = $v_rst;
+          $this->sql->free_result($rst);
+        }
+      }
+      catch(Exception $_e) { $boxes = false; }
+      return $boxes;
+    }
+
+    function box($id)
+    { $box = array();
+      try
+      { $query =
+         "SELECT #--boxes.*"
+        .", #--pun_users.username as auteur"
+        ." FROM #--pun_users, #--boxes"
+        ." WHERE #--boxes.auteur_creation=#--pun_users.id"
+        ." AND #--boxes.id=".$this->eq($id);
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $box = $v_rst;
+      }
+      catch(Exception $_e) { $box = false; }
+      return $box;
+    }
+
+    function add_box($titre, $public, $nom, $emplacement, $fichier, $contenu, $user)
+    { try
+      { $query =
+         "INSERT INTO #--boxes"
+        ."(nom, emplacement, titre, fichier, contenu, auteur_creation, date_creation, public) VALUES"
+        ."( ".$this->eq($nom)
+        .", ".$this->eq($emplacement)
+        .", ".$this->eq($titre)
+        .", ".$this->eq($fichier)
+        .", ".$this->eq($contenu)
+        .", ".$this->eq($user)
+        .", NOW()"
+        .", ".$this->eq($public)
+        .")";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_box($id, $titre, $public, $nom, $emplacement, $fichier, $contenu, $user)
+    { try
+      { $query =
+         "UPDATE #--boxes SET"
+        ."  nom=".$this->eq($nom)
+        .", emplacement=".$this->eq($emplacement)
+        .", titre=".$this->eq($titre)
+        .", fichier=".$this->eq($fichier)
+        .", contenu=".$this->eq($contenu)
+        .", auteur_modification=".$this->eq($user)
+        .", date_modification=NOW()"
+        .", public=".$this->eq($public)
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_box_ordre($id, $ordre)
+    { try
+      { $query =
+         "UPDATE #--boxes SET"
+        ."  ordre=".$this->eq($ordre)
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_box($id)
+    { try
+      { $query =
+         "DELETE FROM #--boxes"
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_config.php	(revision 1)
@@ -0,0 +1,59 @@
+<?php
+
+  class data_config extends data
+  {
+
+    function config($key = null)
+    { $value = false;
+      try
+      {
+        if(isset($key))
+        { $sql = "SELECT `value` FROM #--configuration WHERE `key`=".$this->eq($key);
+          $rst = $this->sql->query($sql);
+          if($v_rst = $this->sql->fetch_assoc($rst)) $value = $v_rst["value"];
+          else $value = "";
+          $this->sql->free_result($rst);
+        }
+        else
+        { $value = array();
+          $sql = "SELECT * FROM #--configuration";
+          $rst = $this->sql->query($sql);
+          while($v_rst = $this->sql->fetch_assoc($rst)) $value[$v_rst["key"]] = $v_rst["value"];
+          $this->sql->free_result($rst);
+        }
+      }
+      catch(Exception $_e) { $value = false; }
+      return $value;
+    }
+
+    function config_exists($key)
+    { $exists = false;
+      try
+      { $sql = "SELECT count(*) as n FROM #--configuration WHERE `key`=".$this->eq($key);
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $exists = $v_rst["n"];
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) {}
+      return $exists;
+    }
+
+    function set_config($key, $value)
+    { try
+      { if($this->config_exists($key)) $sql =
+         "UPDATE #--configuration"
+        ." SET `value`=".$this->eq($value)
+        ." WHERE `key`=".$this->eq($key);
+        else $sql =
+         "INSERT INTO #--configuration"
+        ." VALUES(".$this->eq($key).", ".$this->eq($value).")";
+        $this->sql->query($sql);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_forum.php	(revision 1)
@@ -0,0 +1,58 @@
+<?php
+
+  class data_forum extends data
+  {
+    function forums()
+    { $forums = array();
+      try
+      { $sql = "SELECT * FROM #--pun_forums";
+        $rst = $this->sql->query($sql);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $forums[$v_rst["id"]] = $v_rst;
+      }
+      catch(Exception $_e) { $forums = false; }
+      return $forums;
+    }
+
+    function forum_last_messages($max, $id_forum = null)
+    { $messages = array();
+      try
+      { $query =
+         "SELECT p.id as post_id, p.posted, t.id as topic_id, t.subject, f.forum_name"
+        ." FROM #--pun_posts p, #--pun_topics t, #--pun_forums f"
+        ." WHERE p.topic_id=t.id"
+        ." AND t.forum_id=f.id"
+        .(isset($id_forum) ? " AND f.id=".$id_forum : "")
+        ." ORDER BY p.posted DESC"
+        ." LIMIT 0,".$max;
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $messages[$v_rst["post_id"]] = $v_rst;
+      }
+      catch(Exception $_e) { $messages = false; }
+      return $messages;
+    }
+
+    function nous_y_etions()
+    {
+      // adapter ici avec l'identifiant du forum
+      $forum_id = 84;
+
+      $post = array();
+      try
+      { $query =
+         "SELECT p.id as post_id, p.posted, t.id as topic_id, t.subject, f.forum_name"
+        ." FROM #--pun_posts p, #--pun_topics t, #--pun_forums f"
+        ." WHERE p.topic_id=t.id"
+        ." AND t.forum_id=f.id"
+        ." AND f.id=".$forum_id
+        ." ORDER BY RAND()"
+        ." LIMIT 0,1";
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $post = $v_rst;
+      }
+      catch(Exception $_e) { $post = false; }
+      return $post;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_images.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_images.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_images.php	(revision 1)
@@ -0,0 +1,193 @@
+<?php
+
+  class data_images extends data
+  {
+    public $image_error = "";
+    public $image_message = "";
+
+    function get_image_error() { return $this->image_error; }
+    function get_image_message() { return $this->image_message; }
+
+    function img_size($file, $max_width, $max_height)
+    { $img_infos = getimagesize($file);
+      if($img_infos)
+      { if($img_infos[0] > $max_width || $img_infos[1] > $max_height)
+        { $r = $max_width / $img_infos[0];
+          if($r * $img_infos[1] > $max_height) $r = $max_height / $img_infos[1];
+          $img_size = array
+          ( "width" => floor($r * $img_infos[0]),
+            "height" => floor($r * $img_infos[1]) 
+          );
+        }
+        else $img_size = array
+        ( "width" => $img_infos[0],
+          "height" => $img_infos[1] 
+        );
+        return $img_size;
+      }
+      return false;
+    }
+
+    function unique_file_name($dest, $file_name, $prefix = "img_")
+    { $dest .= strlen($dest) > 0 && substr($dest, -1) != "/" ? "/" : "";
+      if(is_dir($dest))
+      { $ext = "";
+        if(strpos($file_name, ".") !== false)
+        { $v_ext_path = explode(".", $file_name);
+          $ext = ".".$v_ext_path[count($v_ext_path) - 1];
+        }
+        $i = 0;
+        while(file_exists($dest.$prefix.$i.$ext)) $i++;
+        return $prefix.$i.$ext;
+      }
+      return false;
+    }
+
+    function upload_image($image, $dest, $img_file = null)
+    { switch($_FILES[$image]["error"])
+      { case UPLOAD_ERR_OK : break;
+        default : $this->image_error = "Impossible d'uploader l'image.";
+      }
+      if(!$this->image_error)
+      { $img_file = isset($img_file) ? $img_file : $_FILES[$image]["name"];
+        $v_name = explode(".", $img_file);
+        $ext = $v_name[count($v_name) - 1];
+        if
+        ( strcasecmp($ext, "png") == 0 ||
+          strcasecmp($ext, "gif") == 0 ||
+          strcasecmp($ext, "jpg") == 0 ||
+          strcasecmp($ext, "jpeg") == 0
+        )
+        { if(file_exists($dest))
+          { if(!is_dir($dest)) $this->image_error = "le dossier d'upload est un fichier. Impossible d'y uploader l'image";
+          }
+          else
+          { @mkdir($dest);
+            clearstatcache();
+            if(!file_exists($dest) && !is_dir($dest)) $this->image_error = "Impossible de creer le dossier d'upload";
+          }
+          if(!$this->image_error)
+          { if
+            ( @move_uploaded_file
+              ( $_FILES[$image]["tmp_name"],
+                $dest."/".$img_file
+              ) !== false
+            ) return $img_file;
+            else $this->image_error = "Impossible de copier l'image uploadee";
+          }
+        }
+        else $this->image_message = "Le fichier image doit &ecirc;tre au format png, gif ou jpg";
+      }
+      return false;
+    }
+
+    function img_thumb($src, $max_width, $max_height, $thumbs_dir = "")
+    { if(strlen($thumbs_dir) > 0)
+      { if(!@is_dir($thumbs_dir)) @mkdir($thumbs_dir);
+        if(!@is_dir($thumbs_dir)) return false;
+      }
+      $thumb = array();
+      try
+      { $sql =
+         "SELECT *"
+        ." FROM #--thumbs"
+        ." WHERE src=".$this->eq($src)
+        ." AND max_width=".$this->eq($max_width)
+        ." AND max_height=".$this->eq($max_height);
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $thumb = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $thumb = false; }
+      if($thumb !== false)
+      { if($thumb) return $thumb;
+        $thumbs_dir .= strlen($thumbs_dir) > 0 && substr($thumbs_dir, -1) != "/" ? "/" : "";
+        $thumb_dir = $max_width."x".$max_height."/";
+        if(!@is_dir($thumbs_dir.$thumb_dir)) @mkdir($thumbs_dir.$thumb_dir);
+        if(!@is_dir($thumbs_dir.$thumb_dir)) return false;
+        $thumb_file = $thumb_dir.$this->unique_file_name($thumbs_dir.$thumb_dir, $src, "img_");
+        if($thumb_file === false) return false;
+        if(($thumb = $this->make_thumb($src, $max_width, $max_height, $thumbs_dir, $thumb_file)) !== false)
+        { try
+          { $sql =
+             "INSERT INTO #--thumbs"
+            ."(src, src_width, src_height, max_width, max_height, thumb_file, thumb_width, thumb_height, creation_date) VALUES"
+            ."( ".$this->eq($thumb["src"])
+            .", ".$this->eq($thumb["src_width"])
+            .", ".$this->eq($thumb["src_height"])
+            .", ".$this->eq($max_width)
+            .", ".$this->eq($max_height)
+            .", ".$this->eq($thumb["thumb_file"])
+            .", ".$this->eq($thumb["thumb_width"])
+            .", ".$this->eq($thumb["thumb_height"])
+            .", ".$this->eq($thumb["creation_date"])
+            .")";
+            $rst = $this->sql->query($sql);
+            return $thumb;
+          }
+          catch(Exception $_e) {}
+        }
+      }
+      return false;
+    }
+
+    function make_thumb($src, $max_width, $max_height, $thumbs_dir, $thumb_file, $quality = null)
+    { $dest = $thumbs_dir.$thumb_file;
+      $size = getimagesize($src);
+      if($size[0])
+      { if($size[0] > $size[1])
+        { $width = $max_width;
+          $height = ($size[1] * ($width / $size[0]));
+        }
+        else
+        { $height = $max_height;
+          $width = $size[0] * ($height / $size[1]);
+        }
+        $v_ext_path = explode(".", $src);
+        $ext = $v_ext_path[count($v_ext_path) - 1];
+        if(strcasecmp($ext, "jpg") == 0 || strcasecmp($ext, "jpeg") == 0)  $ext = "jpg";
+        elseif(strcasecmp($ext, "gif") == 0)  $ext = "gif";
+        elseif(strcasecmp($ext, "png") == 0)  $ext = "png";
+        else $ext = "";
+        $create_function = "";
+        $thumb_function = "";
+        if(strcasecmp($ext, "jpg") == 0)
+        { $create_function = "imagecreatefromjpeg";
+          $thumb_function = "imagejpeg";
+        }
+        elseif(strcasecmp($ext, "gif") == 0)
+        { $create_function = "imagecreatefromgif";
+          $thumb_function = "imagegif";
+          $quality = NULL;
+        }
+        elseif(strcasecmp($ext, "png") == 0)
+        { $create_function = "imagecreatefrompng";
+          $thumb_function = "imagepng";
+        }
+        if($create_function)
+        { $src_img = $create_function($src);
+          $thumb_img = imagecreatetruecolor($width, $height);
+          imagecopyresampled($thumb_img, $src_img, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
+          if(isset($quality)) $thumb_img = $thumb_function($thumb_img, $dest, $quality);
+          else $thumb_img = $thumb_function($thumb_img, $dest);
+          if($thumb_img !== false)
+          { return array
+            ( "src" => $src,
+              "src_width" => $size[0],
+              "src_height" => $size[1],
+              "max_width" => $max_width,
+              "max_height" => $max_height,
+              "thumb_file" => $thumb_file,
+              "thumb_width" => $width,
+              "thumb_height" => $height,
+              "creation_date" => date("Y-m-d H:i:s")
+            );
+          }
+        }
+      }
+      return false;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_map.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_map.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_map.php	(revision 1)
@@ -0,0 +1,205 @@
+<?php
+
+  class data_map extends data
+  {
+
+    function map_emplacements()
+    { $emplacements = false;
+      try
+      { $query =
+         "SELECT * FROM #--map_emplacement";
+        $rst = $this->sql->query($query);
+        $emplacements = array();
+        while($v_rst = $this->sql->fetch_assoc($rst))
+        { $emplacements[$v_rst["id"]] = $v_rst;
+          $emplacements[$v_rst["id"]]["editable"] = $this->edit_emplacement_ok($emplacements[$v_rst["id"]]);
+        }
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $emplacements = false; }
+      return $emplacements;
+    }
+
+    function map_emplacement($id)
+    { $emplacement = false;
+      try
+      { $query =
+         "SELECT * FROM #--map_emplacement WHERE id=".$id;
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $emplacement = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $emplacement = false; }
+      return $emplacement;
+    }
+
+    function map_emplacement_types()
+    { $emplacement_types = false;
+      try
+      { $query =
+         "SELECT * FROM #--map_emplacement_type";
+        $rst = $this->sql->query($query);
+        $emplacement_types = array();
+        while($v_rst = $this->sql->fetch_assoc($rst)) $emplacement_types[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $emplacement_types = false; }
+      return $emplacement_types;
+    }
+
+    function map_emplacement_type($id)
+    { $emplacement_type = false;
+      try
+      { $query =
+         "SELECT * FROM #--map_emplacement_type"
+        ." WHERE id=".$this->eq($id);
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $emplacement_type = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $emplacement_type = false; }
+      return $emplacement_type;
+    }
+
+    function add_map_emplacement_type($intitule, $descriptif, $icone)
+    { try
+      { $query =
+         "INSERT INTO #--map_emplacement_type(intitule, descriptif, icone) VALUES"
+        ."( ".$this->eq($intitule)
+        .", ".$this->eq($descriptif)
+        .", ".$this->eq($icone)
+        .")";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_map_emplacement_type($id, $intitule, $descriptif, $icone = null)
+    { try
+      { $query =
+         "UPDATE #--map_emplacement_type SET"
+        ."  intitule=".$this->eq($intitule)
+        .", descriptif=".$this->eq($descriptif)
+        .(isset($icone) ? ", icone=".$this->eq($icone) : "")
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_map_emplacement_type($id)
+    { if(($emplacement_type = $this->map_emplacement_type($id)) !== false)
+      { try
+        { $query =
+           "DELETE FROM #--map_emplacement WHERE map_emplacement_type=".$this->eq($id);
+          $this->sql->query($query);
+          $query =
+           "DELETE FROM #--map_emplacement_type WHERE id=".$this->eq($id);
+          $this->sql->query($query);
+          $this->del_map_emplacement_type_icone($emplacement_type["icone"]);
+        }
+        catch(Exception $_e) { return false; }
+        return true;
+      }
+      return false;
+    }
+
+    function del_map_emplacement_type_icone($icone)
+    { try
+      { $delete_icone = false;
+        if($icone && file_exists($icone))
+        { try
+          { $query =
+             "SELECT count(*) as n"
+            ." FROM #--map_emplacement_type"
+            ." WHERE icone=".$this->eq($icone);
+            $rst = $this->sql->query($query);
+            if($v_rst = $this->sql->fetch_assoc($rst)) $delete_icone = $v_rst["n"] == 1;
+            $this->sql->free_result($rst);
+          }
+          catch(Exception $_e) { return false; }
+        }
+        if($delete_icone) @unlink($icone);
+        return true;
+      }
+      catch(Exception $_e) {}
+      return false;
+    }
+
+    function add_map_emplacement($latitude, $longitude, $map_emplacement_type, $info, $user)
+    { if($this->edit_map_ok())
+      { try
+        { $query =
+           "INSERT INTO #--map_emplacement VALUES"
+          ."(NULL"
+          .", ".$latitude
+          .", ".$longitude
+          .", ".$map_emplacement_type
+          .", ".$this->eq($info)
+          .", NOW()"
+          .", ".$user
+          .", NOW()"
+          .", ".$user
+          .")";
+          $this->sql->query($query);
+          return $this->sql->insert_id();
+        }
+        catch(Exception $_e) {}
+      }
+      return false;
+    }
+
+    function set_map_emplacement($id, $latitude, $longitude, $map_emplacement_type, $info, $user)
+    { if(($empl = $this->map_emplacement($id)) !== false)
+      { if($this->edit_emplacement_ok($empl))
+        { try
+          { $query =
+             "UPDATE #--map_emplacement SET"
+            ."  latitude=".$latitude
+            .", longitude=".$longitude
+            .", map_emplacement_type=".$map_emplacement_type
+            .", info=".$this->eq($info)
+            .", modification_date=NOW()"
+            .", modification_user=".$user
+            ." WHERE id=".$id;
+            $this->sql->query($query);
+            return true;
+          }
+          catch(Exception $_e) {}
+        }
+      }
+      return false;
+    }
+
+    function del_map_emplacement($id)
+    { if(($empl = $this->map_emplacement($id)) !== false)
+      { if($this->edit_emplacement_ok($empl))
+        { try
+          { $query =
+             "DELETE FROM #--map_emplacement WHERE id=".$id;
+            $this->sql->query($query);
+            return true;
+          }
+          catch(Exception $_e) {}
+        }
+      }
+      return false;
+    }
+
+    function view_map_ok()
+    { return !$this->env->pun_user["is_guest"];
+    }
+
+    function edit_map_ok()
+    { return $this->view_map_ok();
+    }
+
+    function edit_emplacement_ok($empl)
+    { return $this->env->pun_user["group_id"] == 1 || ($this->edit_map_ok() && $this->env->pun_user["id"] == $empl["creation_user"]);
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_playlists.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_playlists.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_playlists.php	(revision 1)
@@ -0,0 +1,91 @@
+<?php
+
+  class data_playlists extends data
+  {
+
+    function pl_last_downloads($n = null)
+    { return $this->dp_playlist
+      ( " ORDER BY #--download_urls.date_publication DESC"
+       .(isset($n) ? " LIMIT ".$n : "")
+      );
+    }
+
+    function pl_rand_downloads($n = null)
+    { return $this->dp_playlist
+      ( " ORDER BY RAND()"
+       .(isset($n) ? " LIMIT ".$n : "")
+      );
+    }
+
+    function pl_artiste_downloads($id_artiste, $album = null)
+    { return $this->dp_playlist
+      (  (isset($album) ? " AND #--downloads.id_album=".$album : "")
+        ." AND #--artistes.id=".$id_artiste
+        ." ORDER BY #--downloads.ordre ASC"
+       .(isset($n) ? " LIMIT ".$n : "")
+      );
+    }
+
+    function dp_playlist($_sql)
+    { $playlist = array();
+      try
+      { $sql =
+         "SELECT *"
+        .", YEAR(date_updated) as year_updated"
+        .", IF(MONTH(date_updated) > 9, MONTH(date_updated), CONCAT('0', MONTH(date_updated))) as month_updated"
+        .", IF(DAYOFMONTH(date_updated) > 9, DAYOFMONTH(date_updated), CONCAT('0', DAYOFMONTH(date_updated))) as day_updated"
+        ." FROM ( SELECT"
+        ."  distinct(#--download_urls.id_download)"
+        .", #--download_urls.id as id_download_url"
+        .", #--download_urls.url"
+        .", #--downloads.nom as titre"
+        .", #--downloads.style"
+        .", #--formats.content_type"
+        .", #--artistes.nom as auteur"
+        .", #--artistes.id as id_auteur"
+        .", #--licences.id as id_licence"
+        .", #--licences.nom as licence"
+        .", #--licences.lien as licence_url"
+        .", #--downloads.date_creation as date_created"
+        .", #--download_urls.date_publication as date_updated"
+        ." FROM"
+        ."  #--download_urls"
+        .", #--formats"
+        .", #--downloads"
+        .", #--artistes"
+        .", #--licences"
+        ." WHERE #--download_urls.id_format=#--formats.id"
+        ." AND #--download_urls.id_download=#--downloads.id"
+        ." AND #--downloads.id_artiste=#--artistes.id"
+        ." AND #--downloads.id_licence=#--licences.id"
+        ." AND actif=1"
+        .$_sql
+        .") t";
+        $rst = $this->sql->query($sql);
+        while($v_rst = $this->sql->fetch_assoc($rst))
+        { $playlist[$v_rst["id_download"]] = $v_rst;
+          $playlist[$v_rst["id_download"]]["urls"] = array();
+          $u_query =
+           "SELECT #--download_urls.*, #--formats.nom as format"
+          ." FROM #--download_urls, #--formats"
+          ." WHERE id_download=".$v_rst["id_download"]
+          ." AND #--download_urls.id_format=#--formats.id";
+          $u_rst = $this->sql->query($u_query);
+          while($v_u_rst = $this->sql->fetch_assoc($u_rst))
+          { $playlist[$v_rst["id_download"]]["urls"][$v_u_rst["id"]] = $v_u_rst;
+            $playlist[$v_rst["id_download"]]["compteur"] += $v_u_rst["compteur"];
+            if($v_u_rst["format"] === "mp3")
+            { $playlist[$v_rst["id_download"]]["mp3_id_url"] = $v_u_rst["id"];
+              $playlist[$v_rst["id_download"]]["mp3_url"] = $v_u_rst["url"];
+            }
+          }
+          $this->sql->free_result($u_rst);
+        }
+      }
+      catch(Exception $_e) { $playlist = false; }
+      return $playlist;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_search.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_search.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_search.php	(revision 1)
@@ -0,0 +1,74 @@
+<?php
+
+  class data_search extends data
+  {
+
+    function search($match)
+    { $results = array
+      ( "has_results" => false,
+        "match" => $match,
+        "artistes" => array(),
+        "downloads" => array(),
+        "albums" => array()
+      );
+      try
+      { if($match)
+        { $sql =
+           "SELECT id, nom, style, image"
+          ." FROM #--artistes"
+          ." WHERE nom LIKE ".$this->eq("%".$match."%")
+          ." OR style LIKE ".$this->eq("%".$match."%");
+          $rst = $this->sql->query($sql);
+          while($v_rst = $this->sql->fetch_assoc($rst)) $results["artistes"][$v_rst["id"]] = $v_rst;
+          $this->sql->free_result($rst);
+
+          $sql =
+           "SELECT #--downloads.*"
+          .", #--downloads.id as id_download"
+          .", #--downloads.nom as titre"
+          .", #--downloads.date_creation as date_created"
+          .", #--artistes.id as id_artiste"
+          .", #--artistes.nom as auteur"
+          .", #--licences.nom as licence"
+          .", #--licences.lien as licence_url"
+          ." FROM #--artistes"
+          .", #--downloads"
+          .", #--licences"
+          ." WHERE #--downloads.id_artiste=#--artistes.id"
+          ." AND #--downloads.id_licence=#--licences.id"
+          ." AND actif=1"
+          ." AND #--downloads.nom LIKE ".$this->eq("%".$match."%");
+          $rst = $this->sql->query($sql);
+          while($v_rst = $this->sql->fetch_assoc($rst))
+          { $results["downloads"][$v_rst["id"]] = $v_rst;
+            $results["downloads"][$v_rst["id"]]["urls"] = array();
+            $u_sql =
+             "SELECT #--download_urls.*, #--formats.nom as format"
+            ." FROM #--download_urls, #--formats"
+            ." WHERE id_download=".$v_rst["id"]
+            ." AND #--download_urls.id_format=#--formats.id";
+            $u_rst = $this->sql->query($u_sql);
+            while($v_u_rst = $this->sql->fetch_assoc($u_rst))
+            { $results["downloads"][$v_rst["id"]]["urls"][$v_u_rst["id"]] = $v_u_rst;
+              if($v_u_rst["format"] === "mp3")
+              { $results["downloads"][$v_rst["id"]]["mp3_id_url"] = $v_u_rst["id"];
+                $results["downloads"][$v_rst["id"]]["mp3_url"] = $v_u_rst["url"];
+              }
+            }
+            $this->sql->free_result($u_rst);
+          }
+          $this->sql->free_result($rst);
+
+          $results["has_results"] =
+             $results["artistes"]
+          || $results["downloads"]
+          || $results["albums"];
+        }
+      }
+      catch(Exception $_e) { $results = false; }
+      return $results;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_users.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_users.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_users.php	(revision 1)
@@ -0,0 +1,158 @@
+<?php
+
+  class data_users extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                    users
+    #
+
+    function users($start = 0, $is_artiste = null, $alpha = null)
+    { $users = array("list" => array(), "total" => 0);
+      try
+      { $SELECT =
+         "SELECT #--pun_users.id"
+        .", #--pun_users.username"
+        .", #--artistes.id as id_artiste";
+        $FROM =
+         " FROM #--pun_users"
+        ." LEFT JOIN #--artistes"
+        ." ON #--pun_users.id=#--artistes.pun_user";
+        $WHERE = " WHERE #--pun_users.id!=1";
+        $WHERE .= (isset($alpha) ? ($WHERE ? " AND" : " WHERE")." LEFT(username, 1)=".$this->eq($alpha) : "");
+        $WHERE .= (isset($is_artiste) ? ($WHERE ? " AND" : " WHERE")." #--artistes.id IS".($is_artiste ? " NOT" : "")." NULL" : "");
+        $GROUP_BY = " GROUP BY #--pun_users.id";
+        $LIMIT = ($this->env->config("max_list") ? " LIMIT ".$this->env->config("max_list")." OFFSET ".$start : "");
+        $sql = "SELECT count(*) as n FROM(".$SELECT.$FROM.$WHERE.$GROUP_BY.") res";
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $users["total"] = $v_rst["n"];
+        $this->sql->free_result($rst);
+        if($users["total"] > 0)
+        { $sql = "SELECT * FROM(".$SELECT.$FROM.$WHERE.$GROUP_BY.$LIMIT.") res";
+          $rst = $this->sql->query($sql);
+          while($v_rst = $this->sql->fetch_assoc($rst)) $users["list"][$v_rst["id"]] = $v_rst;
+          $this->sql->free_result($rst);
+        }
+      }
+      catch(Exception $_e) { $users = false; }
+      return $users;
+    }
+
+    function user($id)
+    { $user = array();
+      try
+      { $sql = "SELECT * from #--pun_users WHERE id=".$id;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $user = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $user = false; }
+      return $user;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                    admin
+    #
+
+    function is_admin($user_id)
+    { $OK = false;
+      try
+      { $sql = "SELECT group_id FROM #--pun_users WHERE id=".$user_id;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $OK = $v_rst["group_id"] == 1;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $OK = false; }
+      return $OK;
+    }
+
+    function is_super_admin($user_id)
+    { $is_super_admin = false;
+      try
+      { $sql = "SELECT * FROM #--super_admins WHERE id_pun_user=".$user_id;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $is_super_admin = true;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $is_super_admin = false; }
+      return $is_super_admin;
+    }
+
+    function is_artiste_admin($id_artise, $pun_user)
+    { $is_artiste_admin = false;
+      try
+      { $sql = "SELECT count(*) as n FROM #--artistes_admins WHERE id_artiste=".$id_artise." AND pun_user=".$pun_user;
+        $rst = $this->sql->query($sql);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $is_artiste_admin = $v_rst["n"] > 0;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $is_artiste_admin = false; }
+      return $is_artiste_admin;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                             log in / out
+    #
+
+    function pun_login_ok($form_username, $form_password, $db)
+    { $username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ?
+       'username=\''.$db->escape($form_username).'\''
+      :'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
+      $result = $db->query
+      ( 'SELECT id, group_id, password, save_pass'
+       .' FROM '.$db->prefix.'users'
+       .' WHERE '.$username_sql
+      ) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+      list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
+      $authorized = false;
+      if(!empty($db_password_hash))
+      { $sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+        $sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
+        $form_password_hash = pun_hash($form_password); // This could result in either an SHA-1 or an MD5 hash (depends on $sha1_available)
+        if($sha1_in_db && $sha1_available && $db_password_hash == $form_password_hash) $authorized = true;
+        else if(!$sha1_in_db && $db_password_hash == md5($form_password))
+        { $authorized = true;
+          if($sha1_available) // There's an MD5 hash in the database, but SHA1 hashing is available, so we update the DB
+          $db->query
+          ( 'UPDATE '.$db->prefix.'users'
+           .' SET password=\''.$form_password_hash.'\''
+           .' WHERE id='.$user_id
+          ) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
+        }
+      }
+      // Update the status if this is the first time the user logged in
+      if($group_id == PUN_UNVERIFIED) $db->query
+      ( 'UPDATE '.$db->prefix.'users'
+       .' SET group_id='.$pun_config['o_default_user_group']
+       .' WHERE id='.$user_id
+      ) or error('Uimpossible de modifier le statut utilisateur', __FILE__, __LINE__, $db->error());
+      // Remove this users guest entry from the online list
+      $db->query
+      ( 'DELETE FROM '.$db->prefix.'online'
+       .' WHERE ident=\''.$db->escape(get_remote_address()).'\''
+      ) or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+      $expire = ($save_pass == '1') ? time() + 31536000 : 0;
+      pun_setcookie($user_id, $form_password_hash, $expire);
+      return $authorized;
+    }
+
+    function pun_logout($pun_user, $db)
+    { if($pun_user["is_guest"] || !isset($_GET["id"]) || $_GET["id"] != $pun_user["id"]) return false;
+      // Remove user from "users online" list.
+      $db->query
+      ( 'DELETE FROM '.$db->prefix.'online'
+       .' WHERE user_id='.$pun_user['id']
+      ) or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+      // Update last_visit (make sure there's something to update it with)
+      if(isset($pun_user['logged'])) $db->query
+      ( 'UPDATE '.$db->prefix.'users'
+       .' SET last_visit='.$pun_user['logged']
+       .' WHERE id='.$pun_user['id']
+      ) or error('Impossible de modifier les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+      pun_setcookie(1, random_pass(8), time() + 31536000);
+      return true;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/modules/data_utils.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/modules/data_utils.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/modules/data_utils.php	(revision 1)
@@ -0,0 +1,194 @@
+<?php
+
+  class data_utils extends data
+  {
+
+    # ----------------------------------------------------------------------------------------
+    #                                              fonction de modification de champ generique
+    #
+
+    function get($table, $champ, $where_champ, $where_valeur)
+    { $value = "";
+      try
+      { $query =
+         "SELECT `".$champ."` as res"
+        ." FROM #--".$table
+        ." WHERE ".$where_champ."=".$this->eq($where_valeur)
+        ." LIMIT 1";
+        $rst = $this->sql->query($query);
+        if($v_rst = $this->sql->fetch_assoc($rst)) $value = $v_rst["res"];
+      }
+      catch(Exception $_e) { $value = false; }
+      return $value;
+    }
+
+    function set($table, $champ, $valeur, $where_champ, $where_valeur)
+    { try
+      { $query =
+         "UPDATE #--".$table
+        ." SET `".$champ."`=".$this->eq($valeur)
+        ." WHERE `".$where_champ."`=".$this->eq($where_valeur)
+        ." LIMIT 1";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #
+    #   ci-dessous
+    #
+    #    - utils : des fonctions courantes dans le traitement des donnÃ©es
+    #      (dates, echapement des simples quotes...)
+    #
+    #    - fonctions de base : des squelettes de fonctions pour l'accÃšs en base
+    #      (liste, ajout, modification...)
+    #
+    # ----------------------------------------------------------------------------------------
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                                    utils
+    #
+
+    function html($content)
+    { return str_replace
+      ( array("&gt;", "&lt;", "&quot;"),
+        array(">", "<", "\""),
+        $content
+      );
+    }
+
+    function encode_email($email)
+    { return
+       "<a href=\"".$this->ascii_entities("mailto:".$email)."\">"
+      .$this->ascii_entities($email)
+      ."</a>";
+    }
+
+    function ascii_entities($content)
+    { $entities = "";
+      $n = 0;
+      while($n < strlen($content))
+      { $entities .= "&#".ord($content[$n]).";";
+        $n++;
+      }
+      return $entities;
+    }
+
+    function resume($content, $max)
+    { $resume = "";
+      $v_content = explode(" ", $content);
+      for($n = 0; $n < $max; $n++) $resume .= $v_content[$n]." ";
+      return $resume;
+    }
+
+    function eq($content) { return (isset($content) ? "'".str_replace("'", "\'", $content)."'" : "NULL"); }
+
+    function frenchdate($i)
+    { if(ereg("([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})", $i, $regs)) $i = $regs[3]."-".$regs[2]."-".$regs[1];
+      return $i;
+    }
+
+    function englishdate($i)
+    { if(ereg("([0-9]{1,2})-([0-9]{1,2})-([0-9]{2,4})", $i, $regs)) $i = $regs[3]."-".$regs[2]."-".$regs[1];
+      return $i;
+    }
+
+    function unix_time($mysql_timestamp)
+    { if
+      (    preg_match('/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/', $mysql_timestamp, $pieces)
+        || preg_match('/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/', $mysql_timestamp, $pieces)
+      )
+      { $unix_time = mktime($pieces[4], $pieces[5], $pieces[6], $pieces[2], $pieces[3], $pieces[1]);
+      }
+      elseif
+      (    preg_match('/\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}/', $mysql_timestamp)
+        || preg_match('/\d{2}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}/', $mysql_timestamp)
+        || preg_match('/\d{4}\-\d{2}\-\d{2}/', $mysql_timestamp)
+        || preg_match('/\d{2}\-\d{2}\-\d{2}/', $mysql_timestamp)
+      )
+      { $unix_time = strtotime($mysql_timestamp);
+      }
+      elseif
+      (    preg_match('/(\d{4})(\d{2})(\d{2})/', $mysql_timestamp, $pieces)
+        || preg_match('/(\d{2})(\d{2})(\d{2})/', $mysql_timestamp, $pieces)
+      )
+      { $unix_time = mktime(0, 0, 0, $pieces[2], $pieces[3], $pieces[1]);
+      }
+      return $unix_time;
+    }
+
+    function str_to_hex($str)
+    { $hex = "";
+      $n = 0;
+      while($n < strlen($str))
+      { $hex_char = dechex(ord($str[$n]));
+        if(strlen($hex_char) == 1) $hex_char = "0".$hex_char;
+        $hex .= $hex_char;
+        $n++;
+      }
+      return $hex;
+    }
+
+    function is_email($email)
+    { $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';
+      $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)';
+      return preg_match
+      ( '/^'.$atom.'+'.'(\.'.$atom.'+)*'.'@'.'('.$domain.'{1,63}\.)+'.$domain.'{2,63}$/i',
+        $email
+      );
+    }
+
+    # ----------------------------------------------------------------------------------------
+    #                                                                        fonctions de base
+    #
+
+    function list_()
+    { $list = array();
+      try
+      { $query = "SELECT * FROM #--table";
+        $rst = $this->sql->query($query);
+        while($v_rst = $this->sql->fetch_assoc($rst)) $list[$v_rst["id"]] = $v_rst;
+        $this->sql->free_result($rst);
+      }
+      catch(Exception $_e) { $list = false; }
+      return $list;
+    }
+
+    function add_($value)
+    { try
+      { $query =
+         "INSERT INTO #--table(value) VALUES"
+        ."( ".$this->eq($value)
+        .")";
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function set_($id, $value)
+    { try
+      { $query =
+         "UPDATE #--table SET"
+        ."  value=".$this->eq($value)
+        ." WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+    function del_($id)
+    { try
+      { $query = "DELETE FROM #--table WHERE id=".$this->eq($id);
+        $this->sql->query($query);
+      }
+      catch(Exception $_e) { return false; }
+      return true;
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/sql.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/sql.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/sql.php	(revision 1)
@@ -0,0 +1,40 @@
+<?php
+
+  class sql
+  {
+    protected $db;
+
+    public $prefix_code;
+    public $prefix_value;
+
+    function __construct($db, $prefix_code = "", $prefix_value = "")
+    { $this->db = $db;
+      $this->prefix_code = $prefix_code;
+      $this->prefix_value = $prefix_value;
+    }
+
+    function query($sql)
+    { $rst = $this->db->query($this->prefix_code ? str_replace($this->prefix_code, $this->prefix_value, $sql) : $sql);
+      if($rst) return $rst;
+      throw new Exception("  [erreur] sql : erreur dans une requete");
+    }
+
+    function insert_id()
+    { return $this->db->insert_id();
+    }
+
+    function fetch_assoc($rst)
+    { return $this->db->fetch_assoc($rst);
+    }
+
+    function free_result($rst)
+    { return $this->db->free_result($rst);
+    }
+
+    function close()
+    { return $this->db->close();
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/data/str_tab.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/data/str_tab.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/data/str_tab.php	(revision 1)
@@ -0,0 +1,84 @@
+<?php
+
+class str_tab
+{
+
+  function tab_to_str($TAB) { return $this->_tab_to_str("", $TAB); }
+
+  function _tab_to_str($pre, $TAB)
+  { $content = "";
+    if($TAB)
+    { foreach($TAB as $key => $value)
+      { if(is_array($value)) $content .= $this->_tab_to_str($pre.strlen($key).":".$key, $TAB[$key]);
+        else $content .= $pre.strlen($key).":".$key.strlen($value).":".$value."\n"; 
+      }
+    }
+    else return $pre."a:\n";
+    return $content;
+  }
+
+  function str_to_tab($content)
+  { $TAB = array();
+    $n = 0;
+    while($n < strlen($content))
+    { $LINE_FOUND = 0;
+      $words = array();
+      while($n < strlen($content) && !$LINE_FOUND)
+      { $length = "";
+        $word = "";
+        $ENDS_WITH_EMPTY_TAB = 0;
+        while($n < strlen($content) && strcmp(substr($content, $n, 1), ":") != 0) { $length .= $content[$n]; $n++; } $n++;
+        if(strcmp($length, "a") == 0) $ENDS_WITH_EMPTY_TAB = 1;
+        else
+        { for($k = 0; $k < $length; $k++) { $word .= $content[$n]; $n++; }
+          $words[] = $word;
+        }
+        $LINE_FOUND = $ENDS_WITH_EMPTY_TAB || $n == strlen($content) || strcmp(substr($content, $n, 1), "\n") == 0;
+      }
+      $n++;
+      if($words) $TAB = $this->affect($TAB, $words, $ENDS_WITH_EMPTY_TAB);
+    }
+    return $TAB; 
+  }
+
+  function affect($TAB, $words, $ENDS_WITH_EMPTY_TAB)
+  { if(count($words) > ($ENDS_WITH_EMPTY_TAB ? 1 : 2))
+      { if(!isset($TAB[$words[0]]) || !is_array($TAB[$words[0]])) $TAB[$words[0]] = array();
+      $_words = array();
+      $FIRST = 1;  
+      foreach($words as $word)
+      { if($FIRST) $FIRST = 0;
+        else $_words[] = $word;
+      }
+      $TAB[$words[0]] = $this->affect($TAB[$words[0]], $_words, $ENDS_WITH_EMPTY_TAB);
+    }
+    else $TAB[$words[0]] = ($ENDS_WITH_EMPTY_TAB ? array() : $words[1]);
+    return $TAB;
+  }
+
+  function str_to_hex($str)
+  { $hex = "";
+    $n = 0;
+    while($n < strlen($str))
+    { $hex_char = dechex(ord($str[$n]));
+      if(strlen($hex_char) == 1) $hex_char = "0".$hex_char;
+      $hex .= $hex_char;
+      $n++;
+    }
+    return $hex;
+  }
+
+  function hex_to_str($hex)
+  { $n = 0;
+    $str = "";
+    while($n + 2 <= strlen($hex)) { $str .= urldecode("%".substr($hex, $n, 2)); $n += 2; }
+    return $str;
+  }
+
+  function request_tab($str) { return $this->str_to_tab($this->hex_to_str(utf8_decode($str))); }
+
+  function response_str($TAB) { return $this->str_to_hex($this->tab_to_str($TAB)); }
+
+}
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/env.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/env.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/env.php	(revision 1)
@@ -0,0 +1,159 @@
+<?php
+
+  class env
+  {
+    public $config_file;
+    public $PATHES;
+    public $PARAMS;
+    public $CONFIG;
+    public $prefix;
+    public $additional_get_params;
+    public $bdd;
+    public $acces;
+    public $mod_path;
+
+    function __construct($config_file, $path_prefix = "")
+    { $this->mod_path = "";
+      $this->config_file = $config_file;
+      if(file_exists($config_file))
+      { $this->PATHES = array();
+        $this->bdd = array();
+        $this->CONFIG = array();
+        require $config_file;
+        if(file_exists($this->path("app")."config.xml"))
+        { $app_config = simplexml_load_file($this->path("app")."config.xml");
+          foreach($app_config->pathes[0] as $path_name => $path_value)
+          { $this->PATHES[$path_name] = $this->path("app").utf8_decode($path_value);
+          }
+          $this->PATHES["punbb"] = str_replace("app/../", "", $this->PATHES["punbb"]);
+          $this->PARAMS = array();
+          foreach($app_config->params[0] as $code_param => $get_param)
+          { $this->PARAMS[$code_param] = utf8_decode($get_param);
+          }
+          $this->init_additional_get_params();
+          $this->prefix = utf8_decode($app_config->prefix);
+          $this->bdd["prefix_code"] = utf8_decode($app_config->sql_prefix);
+        }
+        else
+        { echo "[erreur] config : impossible de trouver le fichier de configuration pour l'application";
+          exit();
+        }
+      }
+      else
+      { echo "[erreur] config : impossible de trouver le fichier de configuration pour l'installation";
+        exit();
+      }
+    }
+
+    function set_config($config)
+    { if(is_array($config))
+      { foreach($config as $key => $value) $this->CONFIG[$key] = $value;
+        return true;
+      }
+      return false;
+    }
+
+    function init_additional_get_params()
+    { $this->additional_get_params = array();
+      $_params = $_SERVER["QUERY_STRING"];
+      $v_params = explode("&", $_params);
+      foreach($v_params as $param)
+      { if($param)
+        { $key = strpos($param, "=") === false ? $param : substr($param, 0, strpos($param, "="));
+          $value = strpos($param, "=") === false ? "" : substr($param, strpos($param, "=") + 1);
+          if(!$this->is_a_param($key)) $this->additional_get_params[$key] = $value;
+        }
+      }
+    }
+
+    function is_a_param($key)
+    { foreach($this->PARAMS as $_key => $_value) if(strcmp($key, $_value) == 0) return true;
+      return false;
+    }
+
+    function path($name) { return $this->PATHES[$name]; }
+    function param($name) { return $this->PARAMS[$name]; }
+    function config($name) { return $this->CONFIG[$name]; }
+
+    function url($_params, $script_name = "index.php", $_url = "")
+    { if($_url)
+      { if
+        ( strpos($_url, "http://") === 0  ||
+          strpos($_url, "https://") === 0 ||
+          strpos($_url, "ftp://") === 0
+        ) $url = $_url;
+        else $url = $this->path("web").$_url;
+      }
+      elseif($_params)
+      { $get_params = "";
+        foreach($this->additional_get_params as $key => $value) $get_params .= ($get_params ? "&amp;" : "?").$key."=".$value;
+        foreach($_params as $key => $value) $get_params .= ($get_params ? "&amp;" : "?").$this->param($key)."=".$value;
+        $url = $this->path("web").$script_name.$get_params;
+      }
+      return $url;
+    }
+
+    function out_file_exists($file)
+    { return
+      ( $this->config("out") ?
+          file_exists($this->config("out").$file) ||
+          file_exists($this->path("out").$file) ||
+          file_exists($this->path("dist_out").$file)
+        : file_exists($this->path("out").$file) ||
+          file_exists($this->path("dist_out").$file)
+      );
+    }
+
+    function out_file($file)
+    { return
+      ( $this->config("out") ?
+          ( file_exists($this->config("out").$file) ?
+              $this->config("out").$file
+            : ( file_exists($this->path("out").$file) ?
+                  $this->path("out").$file
+                : (file_exists($this->path("dist_out").$file) ? $this->path("dist_out").$file : $file)
+              )
+          )
+        : ( file_exists($this->path("out").$file) ?
+              $this->path("out").$file
+            : (file_exists($this->path("dist_out").$file) ? $this->path("dist_out").$file : $file)
+          )
+      );
+    }
+
+    function aff_content()
+    { $env = $this;
+      if($env->message) require $env->out_file("views/message.php");
+      if($env->out_file_exists("content/".$env->prefix.$env->e.".php"))
+      { require $env->out_file("content/".$env->prefix.$env->e.".php");
+      }
+    }
+
+    function aff_emplacement($emplacement)
+    { $env = $this;
+      if($env->out["blocs"]["list"]) foreach($env->out["blocs"]["list"] as $id_bloc => $bloc)
+      { if($bloc["emplacement"] == $emplacement)
+        { $env->out["bloc"] = $bloc;
+          $env->_aff_bloc();
+        }
+      }
+    }
+
+    function aff_bloc($bloc)
+    { $env = $this;
+      if($env->out["blocs"]["list"]) foreach($env->out["blocs"]["list"] as $id_bloc => $_bloc)
+      { if(is_int($bloc) ? $id_bloc == $bloc : $_bloc["nom"] == $bloc)
+        { $env->out["bloc"] = $env->out["blocs"]["list"][$id_bloc];
+          $env->_aff_bloc();
+        }
+      }
+    }
+
+    function _aff_bloc()
+    { $env = $this;
+      require $env->out_file("views/bloc.php");
+    }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/main.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/main.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/main.php	(revision 1)
@@ -0,0 +1,16 @@
+<?php
+
+  if($dh = opendir($env->path("app")."run/"))
+  { $files = array();
+    while(($file = readdir($dh)) !== false) $files[] = $file;
+    closedir($dh);
+    if($files)
+    { sort($files);
+      foreach($files as $file)
+      { if(!is_dir($env->path("app")."run/".$file) && strcmp(substr($file, -4), ".php") == 0) require $env->path("app")."run/".$file;
+      }
+    }
+  }
+  if($env->erreur) $env->e = "erreur";
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_admin_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_admin_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_admin_artiste.php	(revision 1)
@@ -0,0 +1,18 @@
+<?php
+
+  function e_admin_artiste($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_artistes.php	(revision 1)
@@ -0,0 +1,140 @@
+<?php
+
+  function e_artistes($env)
+  {
+    # par dÃ©faut, on n'affiche pas l'onglet d'Ã©dition d'un artiste
+    $env->out["edit_ok"] = false;
+
+    # si $_GET["id"] existe, c'est qu'on demande une fiche artiste
+    if(isset($_GET[$env->param("artiste")]))
+    {
+      # on rÃ©cupÃšre les infos de l'artiste et on vÃ©rifie que l'accÃšs en base s'est bien passÃ©
+      if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+      {
+        # si le visiteur est loggÃ© et qu'il est admin de l'artiste demandÃ©,
+        # on idique ici qu'il faut afficher l'onglet d'Ã©dition
+
+        if
+        (    $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+          || $env->pun_user["is_super_admin"]
+          || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+        ) $env->out["edit_ok"] = true;
+
+        # le paramÃštre $_GET["page"] indique quel onglet afficher
+        $env->page = isset($_GET[$env->param("page")]) ? $_GET[$env->param("page")] : "presentation";
+
+        # on compte les mp3 disponibles pour le player
+        $env->out["mp3"] = $env->data->nb_mp3
+        ( $_GET[$env->param("artiste")],
+          true,
+          $_GET[$env->param("album")] ? $_GET[$env->param("album")] : null
+        );
+        # onglet presentation
+        if(true || $env->page === "presentation")
+        { if(($env->out["presentation"] = $env->data->artiste_presentation($_GET[$env->param("artiste")])) !== false)
+          { if
+            ( !$env->out["artiste"]["pun_forum"] ||
+              ( $env->out["artiste_messages_forum"] = $env->data->forum_last_messages(5, $env->out["artiste"]["pun_forum"])
+              ) !== false
+            )
+            { if(($env->out["artiste_news"] = $env->data->artiste_news($_GET[$env->param("artiste")], 0, true, 5)) !== false)
+              {
+              }
+              else $env->erreur = "Impossible de lire les derni&egrave;res news de cet artiste";
+            }
+            else $env->erreur = "Impossible de lire les derniers posts du forum de cet artiste";
+          }
+          # s'il y a eu un problÃšme lors de la lecture de la prÃ©sentation de l'artiste, on affiche une erreur
+          else $env->erreur = "Impossible de lire la presentation de l'artiste";
+        }
+
+        # onglet news
+        if(true || $env->page === "news")
+        { if(isset($_GET[$env->param("id")]))
+          { if(($env->out["news"] = $env->data->artiste_news($_GET[$env->param("artiste")], 0, true, 1, $_GET[$env->param("id")])) === false)
+            { # s'il y a eu un problÃšme lors de la lecture des news de l'artiste, on affiche une erreur
+              $env->erreur = "Impossible de lire les informations de cette news";
+            }
+          }
+          else
+          { if(($env->out["news"] = $env->data->artiste_news($_GET[$env->param("artiste")], $env->start, true)) === false)
+            { # s'il y a eu un problÃšme lors de la lecture des news de l'artiste, on affiche une erreur
+              $env->erreur = "Impossible de lire les news de l'artiste";
+            }
+          }
+        }
+
+        # onglet downloads
+        if(true || $env->page === "downloads")
+        { if(($env->out["licences"] = $env->data->licences()) !== false)
+          { if
+            ( ( $env->out["downloads"] = $env->data->artiste_downloads
+                ( $_GET[$env->param("artiste")],
+                  true,
+                  $_GET[$env->param("album")] ? $_GET[$env->param("album")] : null
+                )
+              ) !== false
+            )
+            { if(($env->out["albums"] = $env->data->artiste_albums($_GET[$env->param("artiste")], true)) !== false)
+              { if($_GET[$env->param("album")])
+                { if(($env->out["album"] = $env->data->artiste_album($_GET[$env->param("album")])) !== false)
+                  {
+                  }
+                  else $env->erreur = "Impossible de lire les informations de l'album.";
+                }
+              }
+              else $env->erreur = "Impossible de lire la liste des albums.";
+            }
+            else $env->erreur = "Impossible de lire les downloads de l'artiste";
+          }
+          else $env->erreur = "Impossible de lire la liste des licences";
+        }
+
+        # onglet contact
+        if($env->out["artiste"]["contact_form"] && $env->out["artiste"]["email_contact"] && (true || $env->page === "contact"))
+        { require $env->path("app")."plugins/ptitcaptcha.php";
+          if($_POST)
+          { if($_POST["from"] && $env->data->is_email($_POST["from"]))
+            { if(PtitCaptchaHelper::checkCaptcha())
+              { if
+                ( @mail
+                  ( $env->out["artiste"]["email_contact"],
+                    "Message depuis ".$env->config("site_name"),
+                     "Quelqu'un vous a ecrit depuis le formulaire de contact sur votre page artiste\n\n"
+                    ."email de l'expediteur : ".$_POST["from"]."\n"
+                    ."sujet : ".$_POST["sujet"]."\n"
+                    ."message : \n"
+                    ."------------------------------------\n"
+                    .$_POST["message"],
+                    "From: ".$_POST["from"]."\r\n"
+                  )
+                )
+                { _redirect
+                  ( $env,
+                    $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"])),
+                    "Votre message a &eacute;t&eacute; envoy&eacute; &agrave; ".$env->out["artiste"]["nom"],
+                    2
+                  );
+                }
+                else $env->erreur = "Une erreur est survenue. Impossible d'envoyer le message.";
+              }
+              else $env->message = "L'anti-spam ne correspond pas";
+            }
+            else $env->message = "Merci de pr&eacute;ciser votre email";
+          }
+        }
+
+      }
+      # s'il y a eu un problÃšme lors de la lecture des infos de l'artiste, on affiche une erreur
+      else $env->erreur = "Impossible de lire les infos de l'artiste";
+    }
+
+    # si $_GET["id"] n'existe pas, c'est qu'on demande la liste des artistes
+    else
+    { if(($env->out["artistes"] = $env->data->artistes()) === false)
+      { $env->message = "Impossible de r&eacute;cup&eacute;rer la liste des artistes";
+      }
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_backend.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_backend.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_backend.php	(revision 1)
@@ -0,0 +1,212 @@
+<?php
+
+  # -----------------------------------------------------------------------------------
+  #                                                                   fonction generale
+  #
+
+  function e_backend($env)
+  { if($_GET[$env->param("action")])
+    { $function = "a_".$_GET[$env->param("action")];
+      if(function_exists($function))
+      { $function($env);
+      }
+    }
+  }
+
+  # -----------------------------------------------------------------------------------
+  #                                                                             actions
+  #
+
+  # ----------------------------------------
+  # playlists audio generales
+
+  function a_last_downloads($env)
+  { if(($downloads = $env->data->pl_last_downloads(10)) !== false)
+    { if($_GET[$env->param("format")] == "m3u")
+      { echo get_m3u($downloads);
+        exit;
+      }
+      elseif($_GET[$env->param("format")] == "atom")
+      { $env->out["atom"] = get_downloads_atom
+        ( "last_downloads",
+          $env->config("site_name"),
+          "les 10 derniers morceaux",
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "last_downloads", "format" => "atom"), "backend.php"),
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "playlist", "action" => "last_downloads"), "index.php"),
+          $downloads
+        );
+      }
+    }
+    else echo "Erreur lors de l'acc&egrave;s aux downloads";
+  }
+
+  function a_rand_downloads($env)
+  { header('Content-type: application/atom+xml; charset=UTF-8');
+    if(($downloads = $env->data->pl_rand_downloads(10)) !== false)
+    { if($_GET[$env->param("format")] == "m3u")
+      { echo get_m3u($downloads);
+        exit;
+      }
+      elseif($_GET[$env->param("format")] == "atom")
+      { $env->out["atom"] = get_downloads_atom
+        ( "rand_downloads",
+          $env->config("site_name"),
+          "10 morceaux au hasard",
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "rand_downloads", "format" => "atom"), "backend.php"),
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "playlist", "action" => "rand_downloads"), "index.php"),
+          $downloads
+        );
+      }
+    }
+    else echo "Erreur lors de l'acc&egrave;s aux downloads";
+  }
+
+  # ----------------------------------------
+  # playlists artistes
+
+  function a_artiste_downloads($env)
+  { if($_GET[$env->param("format")] == "m3u")
+    { if
+      ( ( $downloads = $env->data->pl_artiste_downloads
+          ( $_GET[$env->param("artiste")],
+            isset($_GET[$env->param("album")]) ? $_GET[$env->param("album")] : null
+          )
+        ) !== false
+      )
+      { echo get_m3u($downloads);
+        exit;
+      }
+      else echo "Erreur lors de l'acc&egrave;s aux downloads";
+    }
+  }
+
+  function a_artiste_mp3($env)
+  { if($_GET[$env->param("format")] == "playlist_xml")
+    { if
+      ( ( $env->out["downloads"] = $env->data->artiste_downloads
+          ( $_GET[$env->param("artiste")],
+            true,
+            $_GET[$env->param("album")] ? $_GET[$env->param("album")] : null
+          )
+        ) !== false
+      )
+      { header("Content-Type: application/xml");
+      }
+      else echo "Erreur lors de l'acc&egrave;s aux downloads";
+    }
+  }
+
+  # ----------------------------------------
+  # news generales
+
+  function a_last_news($env)
+  { if(($news = $env->data->contenus(array("root", "news"), 0, 10, " AND public=1 AND date_publication <= NOW()")) !== false)
+    { $news = $news["list"];
+      foreach($news as $id_news => $_news) $news[$id_news]["url"] =
+      "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "content", "id" => $id_news), "index.php");
+      if($_GET[$env->param("format")] == "atom")
+      { $env->out["atom"] = get_content_atom
+        ( "last_news",
+          $env->config("site_name"),
+          "les 10 dernieres news",
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "last_news", "format" => "atom"), "backend.php"),
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "accueil"), "index.php"),
+          $news
+        );
+      }
+    }
+    else echo "Erreur lors de l'acc&egrave;s aux downloads";
+  }
+
+  # ----------------------------------------
+  # news artistes
+
+  function a_last_artiste_news($env)
+  { if(($news = $env->data->contenus(array("root", "artistes", "news", $_GET[$env->param("artiste")]), 0, 10, " AND public=1 AND date_publication <= NOW()")) !== false)
+    { $news = $news["list"];
+      foreach($news as $id_news => $_news) $news[$id_news]["url"] =
+      "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "content", "id" => $id_news), "index.php");
+      if($_GET[$env->param("format")] == "atom")
+      { $env->out["atom"] = get_content_atom
+        ( "last_news",
+          $env->config("site_name"),
+          "les 10 dernieres news",
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "last_news", "format" => "atom"), "backend.php"),
+          "http://".$_SERVER["HTTP_HOST"].$env->url(array("e" => "accueil"), "index.php"),
+          $news
+        );
+      }
+    }
+    else echo "Erreur lors de l'acc&egrave;s aux downloads";
+  }
+
+  # -----------------------------------------------------------------------------------
+  #                                                                               utils
+  #
+
+  function get_m3u($downloads, $debug = false)
+  { $playlist =
+     "#EXTM3U\n";
+    if($downloads) foreach($downloads as $id => $download)
+    { $playlist .=
+       "#EXTINF:-1,".$download["titre"]."\n"
+      .$download["url"]."\n";
+    }
+    if(!$debug)
+    { header("Content-type: audio/x-mpegurl");
+      header('Content-Disposition: inline; filename=playlist.m3u');
+      header("Content-Length: ".strlen($playlist));
+    }
+    return $playlist;
+  }
+
+  function get_downloads_atom($id, $author, $title, $self, $alternate, $downloads)
+  { $atom = array
+    ( "id" => "tag:".$_SERVER["HTTP_HOST"].",".date("Y-m-d").":".$id,
+      "author_name" => $author,
+      "title" => $title,
+      "updated" => date("Y-m-d")."T".date("H:i:s")."Z",
+      "link" => array("self" => str_replace("&", "&amp;", $self), "alternate" => str_replace("&", "&amp;", $alternate)),
+      "entries" => array()
+    );
+    foreach($downloads as $id_download => $download)
+    { $atom["entries"][$id_download] = array
+      (  "id" => "tag:".$_SERVER["HTTP_HOST"].","
+        .$download["year_updated"]."-".$download["month_updated"]."-".$download["day_updated"]
+        .":download/".$id_download,
+        "title" => $download["auteur"]." - ".$download["titre"],
+        "updated" => $download["year_updated"]."-".$download["month_updated"]."-".$download["day_updated"]."T00:00:00Z",
+        "author_name" => $download["auteur"],
+        "enclosure" => str_replace("&", "&amp;", $download["url"]),
+        "content_type" => $download["content_type"],
+        "link" => array("alternate" => str_replace("&", "&amp;", $download["url"]))
+      );
+    }
+    return $atom;
+  }
+
+  function get_content_atom($id, $author, $title, $self, $alternate, $contents)
+  { $atom = array
+    ( "id" => "tag:".$_SERVER["HTTP_HOST"].",".date("Y-m-d").":".$id,
+      "author_name" => $author,
+      "title" => $title,
+      "updated" => date("Y-m-d")."T".date("H:i:s")."Z",
+      "link" => array("self" => str_replace("&", "&amp;", $self), "alternate" => str_replace("&", "&amp;", $alternate)),
+      "entries" => array()
+    );
+    foreach($contents as $id_content => $content)
+    { $atom["entries"][$id_content] = array
+      (  "id" => "tag:".$_SERVER["HTTP_HOST"].","
+        .$download["year_updated"]."-".$download["month_updated"]."-".$download["day_updated"]
+        .":content/".$id_content,
+        "title" => $content["titre"],
+        "updated" => $content["date_modification"]."T00:00:00Z",
+        "author_name" => $content["auteur"],
+        "summary" => str_replace("&", "&amp;", $content["contenu"]),
+        "link" => array("alternate" => str_replace("&", "&amp;", $content["url"]))
+      );
+    }
+    return $atom;
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_carte.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_carte.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_carte.php	(revision 1)
@@ -0,0 +1,15 @@
+<?php
+
+  function e_carte($env)
+  { if($env->pun_user["is_guest"]) _login($env);
+    else
+    { $env->out["VIEW_MAP"] = $env->data->view_map_ok($env);
+      $env->out["EDIT_MAP"] = $env->data->edit_map_ok($env);
+      $env->out["EDIT_ON"] = isset($_GET[$env->param("edit")]);
+      if(($env->out["emplacement_types"] = $env->data->map_emplacement_types()) === false)
+      { $env->erreur = "Impossible de lire la liste des types d'emplacement"; 
+      }
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_contact.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_contact.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_contact.php	(revision 1)
@@ -0,0 +1,36 @@
+<?php
+
+  function e_contact($env)
+  { require $env->path("app")."plugins/ptitcaptcha.php";
+    if($_POST)
+    { if($_POST["from"] && $env->data->is_email($_POST["from"]))
+      { if(PtitCaptchaHelper::checkCaptcha())
+        { if
+          ( @mail
+            ( $env->config("email_contact"),
+              "Message depuis ".$env->config("site_name"),
+               "Depuis le formulaire de contact du site\n\n"
+              ."email de l'expediteur : ".$_POST["from"]."\n"
+              ."sujet : ".$_POST["sujet"]."\n"
+              ."message : \n"
+              ."------------------------------------\n"
+              .$_POST["message"],
+              "From: ".$_POST["from"]."\r\n"
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "contact", "action" => "ok")),
+              "Votre message a &eacute;t&eacute; envoy&eacute;",
+              2
+            );
+          }
+          else $env->erreur = "Une erreur est survenue. Impossible d'envoyer le message.";
+        }
+        else $env->message = "L'anti-spam ne correspond pas";
+      }
+      else $env->message = "Merci de pr&eacute;ciser votre email";
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_content.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_content.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_content.php	(revision 1)
@@ -0,0 +1,10 @@
+<?php
+
+  function e_content($env)
+  { if(($env->out["content"] = $env->data->contenu($_GET[$env->param("id")])) !== false)
+    {
+    }
+    else $env->erreur .= "<br>Impossible de lire le contenu";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_down.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_down.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_down.php	(revision 1)
@@ -0,0 +1,13 @@
+<?php
+
+  function e_down($env)
+  { if(($url = $env->data->inc_download_compteur($_GET[$env->param("download")])) !== false)
+    { if($force_download = $env->config("force_download"))
+      { $url = preg_replace($force_download["replace_from"], $force_download["replace_to"], $url);
+      }
+      header("Location: ".$url);
+    }
+    else echo "Erreur lors de l'acc&egrave;s au download";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_downalbum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_downalbum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_downalbum.php	(revision 1)
@@ -0,0 +1,10 @@
+<?php
+
+  function e_downalbum($env)
+  { if(($url = $env->data->inc_album_compteur($_GET[$env->param("album")])) !== false)
+    { header("Location: ".$url);
+    }
+    else echo "Erreur lors de l'acc&egrave;s &agrave; l'album";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_edito.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_edito.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_edito.php	(revision 1)
@@ -0,0 +1,18 @@
+<?php
+
+  function e_edito($env)
+  { if(($env->out["edito"] = $env->data->edito()) !== false)
+    { $path = array("root", "news");
+      $depth = 1;
+      if(($env->out["categories"] = $env->data->all_news_categories()) !== false)
+      { if(($env->out["news"] = $env->data->news($path, 0, $depth, true, 5)) !== false)
+        { 
+        }
+        else $env->erreur .= "<br>Impossible de lire la liste des news";
+      }
+      else $env->erreur .= "<br>Impossible de lire la liste des categories de news";
+    }
+    else $env->erreur = "Impossible de lire l'&eacute;dito";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_forum.php	(revision 1)
@@ -0,0 +1,26 @@
+<?php
+
+  function e_forum($env)
+  { global $tpl_main;
+    $env->out["forum"] = array();
+    $env->out["forum"]["head"] = "";
+    $env->out["forum"]["body"] = "";
+    if
+    ( ($head_start = stripos($tpl_main, "<head")) !== false &&
+      ($head_start = stripos($tpl_main, ">", $head_start)) !== false &&
+      ($head_end = stripos($tpl_main, "</head", $head_start)) !== false
+    )
+    { $head_start += 1;
+      $env->out["forum"]["head"] .= substr($tpl_main, $head_start, $head_end - $head_start);
+    }
+    if
+    ( ($body_start = stripos($tpl_main, "<body")) !== false &&
+      ($body_start = stripos($tpl_main, ">", $body_start)) !== false &&
+      ($body_end = stripos($tpl_main, "</body", $body_start)) !== false
+    )
+    { $body_start += 1;
+      $env->out["forum"]["body"] .= substr($tpl_main, $body_start, $body_end - $body_start);
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_links.php	(revision 1)
@@ -0,0 +1,35 @@
+<?php
+
+  function e_links($env)
+  { $env->path = array("root", "links");
+    $env->out["ariane"] = array();
+    if($_GET[$env->param("path")])
+    { $v_path = explode("/", $_GET[$env->param("path")]);
+      foreach($v_path as $_path) if($_path)
+      { $env->path[] = (int)$_path;
+        $env->out["ariane"][$_path] = $env->data->links_categorie($_path);
+      }
+    }
+    if(($env->out["current_categorie"] = $env->data->id_categorie($env->path)) !== false)
+    { $env->a = "links";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Impossible de lire le lien courant";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_links($env)
+  { if(($env->out["link"] = $env->data->links_categorie($env->out["current_categorie"])) !== false)
+    { if(($env->out["links_categories"] = $env->data->links_categories($env->path)) !== false)
+      {
+      }
+      else $env->erreur = "Impossible de lire les liens";
+    }
+    else $env->erreur = "Impossible de lire le lien courant";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_m3u.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_m3u.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_m3u.php	(revision 1)
@@ -0,0 +1,17 @@
+<?php
+
+  function e_m3u($env)
+  { if(($url = $env->data->inc_download_compteur($_GET[$env->param("download")])) !== false)
+    { $playlist =
+       "#EXTM3U\n"
+      ."#EXTINF:-1,playlist.mp3\n"
+      .$url."\n";
+      header("Content-type: audio/x-mpegurl");
+      header('Content-Disposition: inline; filename=playlist.m3u');
+      header("Content-Length: ".strlen($playlist));
+      echo $playlist;
+    }
+    else echo "Erreur lors de l'acc&egrave;s au download";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_news.php	(revision 1)
@@ -0,0 +1,19 @@
+<?php
+
+  function e_news($env)
+  { $path = array("root", "news");
+    $depth = 1;
+    if(isset($_GET[$env->param("categorie")]))
+    { if(strlen($_GET[$env->param("categorie")]) > 0) $path[] = (int)$_GET[$env->param("categorie")];
+      $depth = 0;
+    }
+    if(($env->out["categories"] = $env->data->all_news_categories()) !== false)
+    { if(($env->out["news"] = $env->data->news($path, $env->start, $depth, true)) !== false)
+      {
+      }
+      else $env->erreur .= "<br>Impossible de lire les news";
+    }
+    else $env->erreur .= "<br>Impossible de lire la liste des categories de news";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_page.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_page.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_page.php	(revision 1)
@@ -0,0 +1,10 @@
+<?php
+
+  function e_page($env)
+  { if(($env->out["page"] = $env->data->contenu($_GET[$env->param("id")])) !== false)
+    {
+    }
+    else $env->erreur .= "<br>Impossible de lire la page";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_playlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_playlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_playlist.php	(revision 1)
@@ -0,0 +1,30 @@
+<?php
+
+  function e_playlist($env)
+  { if($_GET[$env->param("action")])
+    { $env->a = $_GET[$env->param("action")];
+      $function = "a_".$env->a;
+      if(function_exists($function))
+      { if(($env->out["licences"] = $env->data->licences()) !== false)
+        { $function($env);
+        }
+        else $env->erreur = "Impossible de lire la liste des licences";
+      }
+    }
+  }
+
+  function a_last_downloads($env)
+  { if(($env->out["downloads"] = $env->data->pl_last_downloads(10)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire la liste des downloads.";
+  }
+
+  function a_rand_downloads($env)
+  { if(($env->out["downloads"] = $env->data->pl_rand_downloads(10)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire la liste des downloads.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_popup_info.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_popup_info.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_popup_info.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  function e_popup_info($env)
+  { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_rechercher.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_rechercher.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_rechercher.php	(revision 1)
@@ -0,0 +1,15 @@
+<?php
+
+  function e_rechercher($env)
+  { if($_POST["match"])
+    { if(($env->out["licences"] = $env->data->licences()) !== false)
+      { if(($env->out["results"] = $env->data->search($_POST["match"])) !== false) 
+        {
+        }
+        else $env->erreur = "Impossible de faire la recherche";
+      }
+      else $env->erreur = "Impossible de lire la liste des licences";
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_albums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_albums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_albums.php	(revision 1)
@@ -0,0 +1,217 @@
+<?php
+
+  function e_set_artiste_albums($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+        $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "albums";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_albums($env)
+  { if(($env->out["albums"] = $env->data->artiste_albums($_GET[$env->param("artiste")])) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les albums de l'artiste";
+  }
+
+  function a_set_albums($env)
+  { $ordre = array();
+    $actif = array();
+    foreach($_POST as $key => $value)
+    { if(strpos($key, "ordre_") === 0 && strlen($value) > 0)
+      { $ordre[substr($key, 6)] = $value;
+      }
+      if(strpos($key, "actif_") === 0 && strlen($value) > 0)
+      { $actif[substr($key, 6)] = $value;
+      }
+    }
+    if($env->data->set_artiste_albums($_GET[$env->param("artiste")], $ordre, $actif) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_artiste_albums", "artiste" => $_GET[$env->param("artiste")])),
+        "Les albums ont &eacute;t&eacute; mis &agrave; jour"
+      );
+    }
+    else $env->erreur = "Impossible de mettre &agrave; jour les albums";
+  }
+
+  function a_add_album($env)
+  { if($_POST)
+    { $image = false;
+      if($_FILES["image"] && $_FILES["image"]["error"] != UPLOAD_ERR_NO_FILE)
+      { switch($_FILES["image"]["error"])
+        { case UPLOAD_ERR_OK : break;
+          default : $env->erreur = "Impossible d'uploader l'image.";
+        }
+        if(!$env->erreur)
+        { $v_name = explode(".", $_FILES["image"]["name"]);
+          $ext = $v_name[count($v_name) - 1];
+          if
+          ( strcasecmp($ext, "png") == 0 ||
+            strcasecmp($ext, "gif") == 0 ||
+            strcasecmp($ext, "jpg") == 0 ||
+            strcasecmp($ext, "jpeg") == 0
+          )
+          { $dest = $env->path("uploads")."artistes/".$env->out["artiste"]["id"];
+            if(file_exists($dest))
+            { if(!is_dir($dest)) $env->erreur = "le dossier d'upload est un fichier. Impossible d'y uploader l'image";
+            }
+            else
+            { @mkdir($dest);
+              clearstatcache();
+              if(!file_exists($dest) && !is_dir($dest)) $env->erreur = "Impossible de creer le dossier d'upload";
+            }
+            if(!$env->erreur)
+            { if
+              ( @move_uploaded_file
+                ( $_FILES["image"]["tmp_name"],
+                  $dest."/".$_FILES["image"]["name"]
+                ) !== false
+              ) $image = $dest."/".$_FILES["image"]["name"];
+              else $env->erreur = "Impossible de copier l'image upload&eacute;e";
+            }
+          }
+          else $env->message = "Le fichier image doit &ecirc;tre au format png, gif ou jpg";
+        }
+      }
+      if(!$env->message && !$env->erreur)
+      { if
+        ( $env->data->add_artiste_album
+          ( $env->out["artiste"]["id"],
+            $_POST["titre"],
+            $image !== false ? $image : "",
+            $_POST["description"],
+            $_POST["url"],
+            $_POST["format"],
+            $_POST["taille"],
+            $_POST["annee_date_creation"]."-".$_POST["mois_date_creation"]."-".$_POST["jour_date_creation"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"])),
+            "L'album a &eacute;t&eacute; ajout&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter l'album";
+      }
+    }
+    else
+    { if(($env->out["formats"] = $env->data->formats()) !== false)
+      {
+      }
+      else $env->erreur = "Impossible de lire la liste des formats";
+    }
+  }
+
+  function a_set_album($env)
+  { if(($env->out["album"] = $env->data->artiste_album($_GET[$env->param("album")])) !== false)
+    { if($_POST)
+      { $image = false;
+        if($_POST["del_image"] && $env->out["album"]["image"] && !is_dir($env->out["album"]["image"]))
+        { @unlink($env->out["album"]["image"]);
+          clearstatcache();
+          if(file_exists($env->out["album"]["image"])) $env->erreur = "Impossible d'effacer l'image";
+          else $image = null;
+        }
+        if(!$env->erreur && $_FILES["image"] && $_FILES["image"]["error"] != UPLOAD_ERR_NO_FILE)
+        { switch($_FILES["image"]["error"])
+          { case UPLOAD_ERR_OK : break;
+            default : $env->erreur = "Impossible d'uploader l'image.";
+          }
+          if(!$env->erreur)
+          { $v_name = explode(".", $_FILES["image"]["name"]);
+            $ext = $v_name[count($v_name) - 1];
+            if
+            ( strcasecmp($ext, "png") == 0 ||
+              strcasecmp($ext, "gif") == 0 ||
+              strcasecmp($ext, "jpg") == 0 ||
+              strcasecmp($ext, "jpeg") == 0
+            )
+            { $dest = $env->path("uploads")."artistes/".$env->out["artiste"]["id"];
+              if(file_exists($dest))
+              { if(!is_dir($dest)) $env->erreur = "le dossier d'upload est un fichier. Impossible d'y uploader l'image";
+              }
+              else
+              { @mkdir($dest);
+                clearstatcache();
+                if(!file_exists($dest) && !is_dir($dest)) $env->erreur = "Impossible de creer le dossier d'upload";
+              }
+              if(!$env->erreur)
+              { if($env->out["album"]["image"] && file_exists($env->out["album"]["image"]))
+                { @unlink($env->out["album"]["image"]);
+                  clearstatcache();
+                  if(file_exists($env->out["artiste"]["image"])) $env->erreur = "Impossible d'effacer l'ancienne image";
+                }
+                if(!$env->erreur)
+                { if
+                  ( @move_uploaded_file
+                    ( $_FILES["image"]["tmp_name"],
+                      $dest."/".$_FILES["image"]["name"]
+                    ) !== false
+                  ) $image = $dest."/".$_FILES["image"]["name"];
+                  else $env->erreur = "Impossible de copier l'image uploadee";
+                }
+              }
+            }
+            else $env->message = "Le fichier image doit &ecirc;tre au format png, gif ou jpg";
+          }
+        }
+        if(!$env->message && !$env->erreur)
+        { if
+          ( $env->data->set_artiste_album
+            ( $_GET[$env->param("album")],
+              $_POST["titre"],
+              $image !== false ? $image : $env->out["album"]["image"],
+              $_POST["description"],
+              $_POST["url"],
+              $_POST["format"],
+              $_POST["taille"],
+              $_POST["annee_date_creation"]."-".$_POST["mois_date_creation"]."-".$_POST["jour_date_creation"]
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"])),
+              "L'album a &eacute;t&eacute; modifi&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible d'enregitrer les modifications";
+        }
+      }
+      else
+      { if(($env->out["formats"] = $env->data->formats()) !== false)
+        {
+        }
+        else $env->erreur = "Impossible de lire la liste des formats";
+      }
+    }
+  }
+
+  function a_del_album($env)
+  { if($env->data->del_artiste_album($_GET[$env->param("album")]))
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"])),
+        "L'album a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer l'album";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_downloads.php	(revision 1)
@@ -0,0 +1,249 @@
+<?php
+
+  function e_set_artiste_downloads($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+        $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "downloads";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_downloads($env)
+  { if(($env->out["downloads"] = $env->data->artiste_downloads($_GET[$env->param("artiste")])) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les downloads de l'artiste";
+  }
+
+  function a_add_download($env)
+  { if($_POST)
+    { if
+      ( $env->data->add_download
+        ( $_GET[$env->param("artiste")],
+          $_POST["nom"],
+          $_POST["album"] ? $_POST["album"] : null,
+          $_POST["style"],
+          $_POST["licence"],
+          $_POST["annee_creation"]."-".$_POST["mois_creation"]."-".$_POST["jour_creation"],
+          $_POST["format"],
+          $_POST["url"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_artiste_downloads", "artiste" => $_GET[$env->param("artiste")])),
+          "Le download a &eacute;t&eacute; ajout&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'ajouter le morceau.";
+    }
+    else
+    { if(($env->out["licences"] = $env->data->licences()) !== false)
+      { if(($env->out["formats"] = $env->data->formats()) !== false)
+        { if(($env->out["albums"] = $env->data->artiste_albums($_GET[$env->param("artiste")])) !== false)
+          {
+          }
+          else $env->erreur = "Impossible de lire la liste des albums.";
+        }
+        else $env->erreur = "Impossible de lire la liste des formats.";
+      }
+      else $env->erreur = "Impossible de lire la liste des licences.";
+    }
+  }
+
+  function a_set_downloads($env)
+  { $ordre = array();
+    $actif = array();
+    foreach($_POST as $key => $value)
+    { if(strpos($key, "ordre_") === 0 && strlen($value) > 0)
+      { $ordre[substr($key, 6)] = $value;
+      }
+      if(strpos($key, "actif_") === 0 && strlen($value) > 0)
+      { $actif[substr($key, 6)] = $value;
+      }
+    }
+    if($env->data->set_downloads($ordre, $actif) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_artiste_downloads", "artiste" => $_GET[$env->param("artiste")])),
+        "Les downloads ont &eacute;t&eacute; mis &agrave; jour"
+      );
+    }
+    else $env->erreur = "Impossible de mettre &agrave; jour les downloads";
+  }
+
+  function a_download($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if(($env->out["licences"] = $env->data->licences()) !== false)
+        { if(($env->out["formats"] = $env->data->formats()) !== false)
+          { if(($env->out["albums"] = $env->data->artiste_albums($_GET[$env->param("artiste")])) !== false)
+            {
+            }
+            else $env->erreur = "Impossible de lire la liste des albums.";
+          }
+          else $env->erreur = "Impossible de lire la liste des formats.";
+        }
+        else $env->erreur = "Impossible de lire la liste des licences.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+  function a_set_download($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if
+        ( $env->data->set_download
+          ( $_GET[$env->param("download")],
+            $_POST["nom"],
+            $_POST["album"] ? $_POST["album"] : null,
+            $_POST["style"],
+            $_POST["licence"],
+            $_POST["annee_date_creation"]."-".$_POST["mois_date_creation"]."-".$_POST["jour_date_creation"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url
+            ( array
+              ( "e" => "set_artiste_downloads",
+                "artiste" => $_GET[$env->param("artiste")],
+                "action" => "download",
+                "download" => $_GET[$env->param("download")]
+              )
+            ),
+            "Le download a &eacute;t&eacute; modifi&eacute;"
+          );
+        }
+        else $env->erreur = "Une erreur s'est produite. Impossible de modifier le morceau.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+  function a_add_download_url($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if
+        ( $env->data->add_download_url
+          ( $_GET[$env->param("download")],
+            $_POST["url"],
+            $_POST["format"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url
+            ( array
+              ( "e" => "set_artiste_downloads",
+                "artiste" => $_GET[$env->param("artiste")],
+                "action" => "download",
+                "download" => $_GET[$env->param("download")]
+              )
+            ),
+            "Le fichier a &eacute;t&eacute; ajout&eacute;"
+          );
+        }
+        else $env->erreur = "Une erreur s'est produite. Impossible d'ajouter l'url.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+  function a_set_download_url($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if
+        ( $env->data->set_download_url
+          ( $_POST["id_url"],
+            $_POST["url"],
+            $_POST["format"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url
+            ( array
+              ( "e" => "set_artiste_downloads",
+                "artiste" => $_GET[$env->param("artiste")],
+                "action" => "download",
+                "download" => $_GET[$env->param("download")]
+              )
+            ),
+            "Le fichier a &eacute;t&eacute; modifi&eacute;"
+          );
+        }
+        else $env->erreur = "Une erreur s'est produite. Impossible de modifier le fichier.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+  function a_del_download_url($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if(($res = $env->data->del_download_url($_GET[$env->param("download")], $_GET[$env->param("url")])) !== false)
+        { $url_back = $env->url
+          ( array
+            ( "e" => "set_artiste_downloads",
+              "artiste" => $_GET[$env->param("artiste")],
+              "action" => "download",
+              "download" => $_GET[$env->param("download")]
+            )
+          );
+          if($res == 2) $url_back = $env->url
+          ( array
+            ( "e" => "set_artiste_downloads",
+              "artiste" => $_GET[$env->param("artiste")],
+            )
+          );
+          _redirect
+          ( $env,
+            $url_back,
+            "Le fichier a &eacute;t&eacute; supprim&eacute;"
+          );
+        }
+        else $env->erreur = "Une erreur s'est produite. Impossible de supprimer le fichier.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+  function a_del_download($env)
+  { if(($env->out["download"] = $env->data->artiste_download($_GET[$env->param("download")])) !== false)
+    { if($env->out["download"]["id_artiste"] == $env->out["artiste"]["id"])
+      { if(($env->data->del_download($_GET[$env->param("download")])) !== false)
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_artiste_downloads", "artiste" => $_GET[$env->param("artiste")])),
+            "Le download a &eacute;t&eacute; supprim&eacute;"
+          );
+        }
+        else $env->erreur = "Une erreur s'est produite. Impossible de supprimer le download.";
+      }
+      else $env->erreur = "Vous n'avez pas les droits necessaires pour &eacute;diter ce morceau.";
+    }
+    else $env->erreur = "Impossible de lire les infos sur ce download.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_infos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_infos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_infos.php	(revision 1)
@@ -0,0 +1,117 @@
+<?php
+
+  function e_set_artiste_infos($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+        a_infos($env);
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_infos($env)
+  { if($_POST)
+    { $image = false;
+      if($_POST["del_image"] && $env->out["artiste"]["image"] && !is_dir($env->out["artiste"]["image"]))
+      { @unlink($env->out["artiste"]["image"]);
+        clearstatcache();
+        if(file_exists($env->out["artiste"]["image"])) $env->erreur = "Impossible d'effacer l'image";
+        else $image = null;
+      }
+      if(!$env->message && $_FILES["image"] && $_FILES["image"]["error"] != UPLOAD_ERR_NO_FILE)
+      { switch($_FILES["image"]["error"])
+        { case UPLOAD_ERR_OK : break;
+          default : $env->erreur = "Impossible d'uploader l'image.";
+        }
+        if(!$env->erreur)
+        { $v_name = explode(".", $_FILES["image"]["name"]);
+          $ext = $v_name[count($v_name) - 1];
+          if
+          ( strcasecmp($ext, "png") == 0 ||
+            strcasecmp($ext, "gif") == 0 ||
+            strcasecmp($ext, "jpg") == 0 ||
+            strcasecmp($ext, "jpeg") == 0
+          )
+          { $dest = $env->path("uploads")."artistes/".$env->out["artiste"]["id"];
+            if(file_exists($dest))
+            { if(!is_dir($dest)) $env->erreur = "le dossier d'upload est un fichier. Impossible d'y uploader l'image";
+            }
+            else
+            { @mkdir($dest);
+              clearstatcache();
+              if(!file_exists($dest) && !is_dir($dest)) $env->erreur = "Impossible de creer le dossier d'upload";
+            }
+            if(!$env->erreur)
+            { if($env->out["artiste"]["image"] && file_exists($env->out["artiste"]["image"]))
+              { @unlink($env->out["artiste"]["image"]);
+                clearstatcache();
+                if(file_exists($env->out["artiste"]["image"])) $env->erreur = "Impossible d'effacer l'ancienne image";
+              }
+              if(!$env->erreur)
+              { if
+                ( @move_uploaded_file
+                  ( $_FILES["image"]["tmp_name"],
+                    $dest."/".$_FILES["image"]["name"]
+                  ) !== false
+                ) $image = $dest."/".$_FILES["image"]["name"];
+                else $env->erreur = "Impossible de copier l'image uploadee";
+              }
+            }
+          }
+          else $env->message = "Le fichier image doit &ecirc;tre au format png, gif ou jpg";
+        }
+      }
+      if(!$env->message && !$env->erreur)
+      { if
+        ( $env->data->set_artiste
+          ( $env->out["artiste"]["id"],
+            $_POST["nom"],
+            $image !== false ? $image : $env->out["artiste"]["image"],
+            $_POST["style"],
+            $_POST["pays"],
+            $_POST["site"],
+            $_POST["email_contact"],
+            $_POST["hide_email"] ? 1 : 0,
+            $_POST["contact_form"] ? 1 : 0,
+            $_POST["identifiant_paypal"],
+            $_POST["lien_boutique"],
+            $_POST["lien_facebook"],
+            $_POST["lien_flickr"],
+            $_POST["lien_twitter"],
+            $_POST["lien_youtube"],
+            $env->out["artiste"]["dossier_personnel"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_artiste_infos", "artiste" => $env->out["artiste"]["id"], "action" => "infos")),
+            "Vos informations ont &eacute;t&eacute; modifi&eacute;es"
+          );
+        }
+        else $env->erreur = "Une erreur est survenue. Impossible d'enregitrer les modifications.";
+      }
+      if(!$env->erreur && $env->message)
+      { $env->out["artiste"]["nom"] = $_POST["nom"];
+        $env->out["artiste"]["style"] = $_POST["style"];
+        $env->out["artiste"]["pays"] = $_POST["pays"];
+        $env->out["artiste"]["site"] = $_POST["site"];
+        $env->out["artiste"]["email_contact"] = $_POST["email_contact"];
+        $env->out["artiste"]["hide_email"] = $_POST["hide_email"] ? 1 : 0;
+        $env->out["artiste"]["contact_form"] = $_POST["contact_form"] ? 1 : 0;
+        $env->out["artiste"]["email_paypal"] = $_POST["email_paypal"];
+      }
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_news.php	(revision 1)
@@ -0,0 +1,113 @@
+<?php
+
+  function e_set_artiste_news($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+        $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "artiste_news";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_artiste_news($env)
+  { if(($env->out["news"] = $env->data->artiste_news($_GET[$env->param("artiste")], $env->start)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les news";
+  }
+
+  function a_add_artiste_news($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "titre" => $_POST["titre"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "contenu" => $_POST["news"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->add_artiste_news
+          ( $_GET[$env->param("artiste")],
+            $env->pun_user["id"],
+            $_POST["titre"],
+            $_POST["news"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_artiste_news", "artiste" => $_GET[$env->param("artiste")])),
+            "La news a &eacute;t&eacute; ajout&eacute;e"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter la news.";
+      }
+    }
+  }
+
+  function a_set_one_artiste_news($env)
+  { if(($env->out["news"] = $env->data->contenu($_GET[$env->param("news")])) !== false)
+    { if($_POST)
+      { if($_POST["preview"])
+        { $env->out["preview"] = array
+          ( "titre" => $_POST["titre"],
+            "auteur" => $env->out["news"]["auteur"],
+            "date_publication" => $_POST["date_publication"],
+            "contenu" => $_POST["news"],
+            "public" => $_POST["public"] ? 1 : 0
+          );
+        }
+        else
+        { if
+          ( $env->data->set_artiste_news
+            ( $_GET[$env->param("artiste")],
+              $env->pun_user["id"],
+              $_GET[$env->param("news")],
+              $_POST["titre"],
+              $_POST["news"],
+              $_POST["date_publication"],
+              $_POST["public"] ? 1 : 0
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_artiste_news", "artiste" => $_GET[$env->param("artiste")])),
+              "La news a &eacute;t&eacute; modifi&eacute;e"
+            );
+          }
+          else $env->erreur = "Impossible de modifier la news.";
+        }
+      }
+    }
+    else $env->erreur = "Impossible de lire la news.";
+  }
+
+  function a_del_artiste_news($env)
+  { if($env->data->del_artiste_news($_GET[$env->param("news")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_artiste_news", "artiste" => $_GET[$env->param("artiste")])),
+        "La news a &eacute;t&eacute; supprim&eacute;e"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer la news.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_presentation.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_presentation.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artiste_presentation.php	(revision 1)
@@ -0,0 +1,35 @@
+<?php
+
+  function e_set_artiste_presentation($env)
+  { $env->out["edit_ok"] = false;
+    if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if
+      (    $env->pun_user["is_super_admin"]
+        || $env->pun_user["id"] === $env->out["artiste"]["pun_user"]
+        || $env->data->is_artiste_admin($_GET[$env->param("artiste")], $env->pun_user["id"])
+      )
+      { $env->out["edit_ok"] = true;
+        a_set_artiste_presentation($env);
+      }
+      else $env->erreur = "Vous n'&ecirc;tes pas identifi&eacute; comme administrateur de cet artiste.";
+    }
+    else $env->erreur = "Impossible de lire les infos de l'artiste";
+  }
+
+  function a_set_artiste_presentation($env)
+  { if($_POST)
+    { if($env->data->set_artiste_presentation($_GET[$env->param("artiste")], $_POST["presentation"]) !== false)
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "admin_artiste", "artiste" => $_GET[$env->param("artiste")])),
+          "La presentation a &eacute;t&eacute; modifi&eacute;e"
+        );
+      }
+      else $env->erreur = "Impossible de modifier la presetation";
+    }
+    elseif(($env->out["presentation"] = $env->data->artiste_presentation($_GET[$env->param("artiste")])) === false)
+    { $env->erreur = "Impossible de lire la presentation";
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_artistes.php	(revision 1)
@@ -0,0 +1,124 @@
+<?php
+
+  function e_set_artistes($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "users";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_users($env)
+  { if
+    ( ( $env->out["users"] = $env->data->users
+        ( $env->start,
+          isset($_GET[$env->param("is_artiste")]) ? ($_GET[$env->param("is_artiste")] ? true : false) : null,
+          isset($_GET[$env->param("alpha")]) ? $_GET[$env->param("alpha")] : null
+        )
+      ) !== false
+    )
+    {
+    }
+    else $env->erreur = "Impossible de lire la liste des utilisateurs";
+  }
+
+  function a_user_artistes($env)
+  { if(($env->out["user"] = $env->data->user($_GET[$env->param("user")])) !== false)
+    { if(($env->out["artistes"] = $env->data->artistes($_GET[$env->param("user")])) !== false)
+      {
+      }
+      else $env->erreur = "Impossible de lire les informations de cet utilisateur";
+    }
+    else $env->erreur = "Impossible de lire la liste des artistes pour cet utilisateur";
+  }
+
+  function a_add_user_artiste($env)
+  { if(($env->out["user"] = $env->data->user($_GET[$env->param("user")])) !== false)
+    { if(($env->out["forums"] = $env->data->forums()) !== false)
+      { if($_POST)
+        { if
+          ( $env->data->add_artiste
+            ( $_GET[$env->param("user")],
+              $_POST["nom"],
+              $_POST["forum"] ? $_POST["forum"] : null,
+              $_POST["dossier_personnel"] ? $_POST["dossier_personnel"] : null
+            ) !== false
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_artistes", "action" => "user_artistes", "user" => $_GET[$env->param("user")])),
+              "Le compte artiste a &eacute;t&eacute; cr&eacute;&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible d'ajouter le compte artiste";
+        }
+      }
+      else $env->erreur = "Impossible de lire la liste des forums";
+    }
+    else $env->erreur = "Impossible de lire les informations de cet utilisateur";
+  }
+
+  function a_set_user_artiste($env)
+  { if(($env->out["artiste"] = $env->data->artiste($_GET[$env->param("artiste")])) !== false)
+    { if(($env->out["user"] = $env->data->user($_GET[$env->param("user")])) !== false)
+      { if(($env->out["forums"] = $env->data->forums()) !== false)
+        { if($_POST)
+          { if
+            ( $env->data->admin_set_artiste
+              ( $_GET[$env->param("artiste")],
+                $_POST["nom"],
+                $_POST["forum"] ? $_POST["forum"] : null,
+                $_POST["dossier_personnel"] ? $_POST["dossier_personnel"] : null
+              ) !== false
+            )
+            { _redirect
+              ( $env,
+                $env->url(array("e" => "set_artistes", "action" => "user_artistes", "user" => $_GET[$env->param("user")])),
+                "Le compte artiste a &eacute;t&eacute; modifi&eacute;"
+              );
+            }
+            else $env->erreur = "Impossible de modifier le compte artiste";
+          }
+        }
+        else $env->erreur = "Impossible de lire la liste des forums";
+      }
+      else $env->erreur = "Impossible de lire les informations de cet utilisateur";
+    }
+    else $env->erreur = "Impossible de lire les informations de l'artiste";
+  }
+
+  function a_del_user_artiste($env)
+  { if($env->data->del_artiste($_GET[$env->param("artiste")]) !== false)
+    { $upload_dir = $env->path("uploads")."artistes/".$_GET[$env->param("artiste")]."/";
+      if(is_dir($upload_dir) && is_writable($upload_dir))
+      { if($dh = opendir($upload_dir))
+        { while(($file = readdir($dh)) !== false)
+          { if(substr($file, 0, 1) !== ".")
+            { @unlink($upload_dir.$file);
+            }
+          }
+          closedir($dh);
+          @rmdir($upload_dir);
+        }
+      }
+      _redirect
+      ( $env,
+        $env->url
+        ( array
+          ( "e" => "set_artistes",
+            "action" => "user_artistes",
+            "user" => $_GET[$env->param("user")]
+          )
+        ),
+        "Le compte artiste a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer l'artiste";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_boxes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_boxes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_boxes.php	(revision 1)
@@ -0,0 +1,120 @@
+<?php
+
+  function e_set_boxes($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "boxes";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_boxes($env)
+  { if
+    ( ( $env->out["boxes"] = $env->data->boxes
+        ( $env->start,
+          isset($_GET[$env->param("categorie")]) ? (strlen($_GET[$env->param("categorie")]) > 0 ? $_GET[$env->param("categorie")] : "") : null
+        )
+      ) !== false
+    )
+    { if($_POST)
+      { foreach($_POST as $key => $value)
+        { if(substr($key, 0, 5) == "ordre")
+          { if(!$env->data->set_box_ordre(substr($key, 5), $value))
+            { $env->erreur = "Impossible d'enregistrer l'ordre";
+              break;
+            }
+          }
+        }
+        if(!$env->erreur)
+        { $redirect = array("e" => "set_boxes");
+          if(isset($_GET[$env->param("categorie")])) $redirect["categorie"] = $_GET[$env->param("categorie")];
+          _redirect
+          ( $env,
+            $env->url($redirect),
+            "L'ordre des blocs a &eacute;t&eacute; enregistr&eacute;"
+          );
+        }
+      }
+    }
+    else $env->erreur = "Impossible de lire les blocs";
+  }
+
+  function a_add_box($env)
+  { if($_POST)
+    { if
+      ( $env->data->add_box
+        ( $_POST["titre"],
+          $_POST["public"] ? 1 : 0,
+          $_POST["nom"],
+          $_POST["emplacement"] ? $_POST["emplacement"] : null,
+          $_POST["fichier"],
+          $_POST["contenu"],
+          $env->pun_user["id"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_boxes")),
+          "Le bloc a &eacute;t&eacute; ajout&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'ajouter le bloc.";
+    }
+    else
+    { if(($env->out["box_files"] = $env->data->box_files()) !== false)
+      {
+      }
+      else $env->erreur = "Impossible de lire la liste des fichiers de bloc.";
+    }
+  }
+
+  function a_set_box($env)
+  { if(($env->out["box"] = $env->data->box($_GET[$env->param("id")])) !== false)
+    { if($_POST)
+      { if
+        ( $env->data->set_box
+          ( $_GET[$env->param("id")],
+            $_POST["titre"],
+            $_POST["public"] ? 1 : 0,
+            $_POST["nom"],
+            $_POST["emplacement"] ? $_POST["emplacement"] : null,
+            $_POST["fichier"],
+            $_POST["contenu"],
+            $env->pun_user["id"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_boxes")),
+            "Le bloc a &eacute;t&eacute; modifi&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible de modifier le bloc.";
+      }
+      else
+      { if(($env->out["box_files"] = $env->data->box_files()) !== false)
+        {
+        }
+        else $env->erreur = "Impossible de lire la liste des fichiers de bloc.";
+      }
+    }
+    else $env->erreur = "Impossible de lire le bloc.";
+  }
+
+  function a_del_box($env)
+  { if($env->data->del_box($_GET[$env->param("id")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_boxes")),
+        "Le bloc a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer le bloc.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_config.php	(revision 1)
@@ -0,0 +1,28 @@
+<?php
+
+  function e_set_config($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { if(($env->out["config"] = $env->CONFIG) !== false)
+      { if($_POST)
+        { $OK = true;
+          foreach($_POST as $key => $value)
+          { if($OK)
+            { $OK = $env->data->set_config($key, $value);
+            }
+          }
+          if($OK)
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_config")),
+              "La configuration &agrave; &eacute;t&eacute; mise &agrave; jour"
+            );
+          }
+          else $env->erreur = "Erreur lors de la mise &agrave; jour de la configuration en base";
+        }
+      }
+      else $env->erreur = "Impossible de lire la configuration en base";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_dons_achats.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_dons_achats.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_dons_achats.php	(revision 1)
@@ -0,0 +1,28 @@
+<?php
+
+  function e_set_dons_achats($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { if(($env->out["config"] = $env->CONFIG) !== false)
+      { if($_POST)
+        { $OK = true;
+          foreach($_POST as $key => $value)
+          { if($OK)
+            { $OK = $env->data->set_config($key, $value);
+            }
+          }
+          if($OK)
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_dons_achats")),
+              "La configuration &agrave; &eacute;t&eacute; mise &agrave; jour"
+            );
+          }
+          else $env->erreur = "Erreur lors de la mise &agrave; jour de la configuration en base";
+        }
+      }
+      else $env->erreur = "Impossible de lire la configuration en base";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_editos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_editos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_editos.php	(revision 1)
@@ -0,0 +1,104 @@
+<?php
+
+  function e_set_editos($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "editos";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_editos($env)
+  { if(($env->out["editos"] = $env->data->editos($env->start)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les &eacute;ditos";
+  }
+
+  function a_add_edito($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "titre" => $_POST["titre"],
+          "contenu" =>  $_POST["edito"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->add_edito
+          ( $_POST["titre"],
+            $_POST["edito"],
+            $env->pun_user["id"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_editos")),
+            "L'&eacute;dito a &eacute;t&eacute; ajout&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter l'&eacute;dito.";
+      }
+    }
+  }
+
+  function a_set_edito($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "titre" => $_POST["titre"],
+          "contenu" =>  $_POST["edito"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->set_edito
+          ( $_GET[$env->param("edito")],
+            $_POST["titre"],
+            $_POST["edito"],
+            $env->pun_user["id"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_editos")),
+            "L'&eacute;dito a &eacute;t&eacute; modifi&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible de modifier l'&eacute;dito.";
+      }
+    }
+    else
+    { if(($env->out["edito"] = $env->data->edito($_GET[$env->param("edito")])) === false)
+      { $env->erreur = "Impossible de lire l'&eacute;dito.";
+      }
+    }
+  }
+
+  function a_del_edito($env)
+  { if($env->data->del_edito($_GET[$env->param("edito")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_editos")),
+        "L'&eacute;dito a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer l'&eacute;dito.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_links.php	(revision 1)
@@ -0,0 +1,123 @@
+<?php
+
+  function e_set_links($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->path = array("root", "links");
+      $env->out["ariane"] = array();
+      if($_GET[$env->param("path")])
+      { $v_path = explode("/", $_GET[$env->param("path")]);
+        foreach($v_path as $_path) if($_path)
+        { $env->path[] = (int)$_path;
+          $env->out["ariane"][$_path] = $env->data->links_categorie($_path);
+        }
+      }
+      if(($env->out["current_categorie"] = $env->data->id_categorie($env->path)) !== false)
+      { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "links";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Impossible de lire le lien courant";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_links($env)
+  { if(($env->out["link"] = $env->data->links_categorie($env->out["current_categorie"])) !== false)
+    { if(($env->out["links_categories"] = $env->data->links_categories($env->path)) !== false)
+      { if($_POST)
+        { $OK = true;
+          foreach($_POST as $key => $value)
+          { if
+            ( (substr($key, 0, 6) == "ordre_") &&
+              ($id_menu = substr($key, 6)) &&
+              $env->out["links_categories"]["list"][$id_menu]
+            )
+            { $OK = $env->data->set_links_categorie
+              ( $id_menu,
+                $env->out["links_categories"]["list"][$id_menu]["nom"],
+                $env->out["links_categories"]["list"][$id_menu]["titre"],
+                $env->out["links_categories"]["list"][$id_menu]["description"],
+                $env->out["links_categories"]["list"][$id_menu]["contenu"],
+                $value
+              );
+            }
+            if(!$OK) break;
+          }
+          if($OK)
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")])),
+              "L'ordre des liens a &eacute;t&eacute; enregistr&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible d'enregistrer l'ordre des liens";
+        }
+      }
+      else $env->erreur = "Impossible de lire les liens";
+    }
+    else $env->erreur = "Impossible de lire le lien courant";
+  }
+
+  function a_add_links_categorie($env)
+  { if($_POST)
+    { if
+      ( $env->data->add_links_categorie
+        ( $_POST["nom"],
+          $_POST["titre"],
+          $_POST["description"],
+          $_POST["url"],
+          $env->out["current_categorie"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")])),
+          "Le lien a &eacute;t&eacute; ajout&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'ajouter le lien";
+    }
+  }
+
+  function a_set_links_categorie($env)
+  { if($_POST)
+    { if
+      ( $env->data->set_links_categorie
+        ( $_GET[$env->param("id")],
+          $_POST["nom"],
+          $_POST["titre"],
+          $_POST["description"],
+          $_POST["url"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")])),
+          "Le lien a &eacute;t&eacute; enregistr&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'enregistrer le lien.";
+    }
+    else
+    { if(($env->out["links_categorie"] = $env->data->links_categorie($_GET[$env->param("id")])) === false)
+      { $env->erreur = "Impossible de lire le lien.";
+      }
+    }
+  }
+
+  function a_del_links_categorie($env)
+  { if($env->data->del_links_categorie($_GET[$env->param("id")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")])),
+        "Le lien a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer le lien.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_map.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_map.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_map.php	(revision 1)
@@ -0,0 +1,128 @@
+<?php
+
+  function e_set_map($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "map_config";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_map_config($env)
+  { if(($env->out["emplacement_types"] = $env->data->map_emplacement_types()) !== false)
+    { if(($env->out["config"] = $env->CONFIG) !== false)
+      { if($_POST)
+        { if($env->data->set_config("google_key", $_POST["google_key"]))
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_map")),
+              "La clef Google a &eacute;&eacute; enregistr&eacute;e"
+            );
+          }
+        }
+      }
+      else $env->erreur = "Impossible de lire la configuration en base";
+    }
+    else $env->erreur = "Impossible de lire la liste des types d'emplacement";
+  }
+
+  function a_add_emplacement_type($env)
+  { if($_POST)
+    { $icone = null;
+      if($_FILES["icone"])
+      { switch($_FILES["icone"]["error"])
+        { case UPLOAD_ERR_NO_FILE :
+            $env->message = "Vous devez pr&eacute;ciser une icone pour le nouvel emplacement.";
+            break;
+          case UPLOAD_ERR_OK :
+            $icone = $env->path("uploads")."map/".$_FILES["icone"]["name"];
+            if
+            ( @move_uploaded_file
+              ( $_FILES["icone"]["tmp_name"],
+                $icone                  
+              ) !== false
+            ) break;
+          default : $env->erreur = "Impossible d'uploader l'icone.";
+        }
+        if(!$env->erreur && !$env->message)
+        { if
+          ( $env->data->add_map_emplacement_type
+            ( $_POST["intitule"],
+              $_POST["descriptif"],
+              $icone
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_map")),
+              "Le type d'emplacement a &eacute;t&eacute; ajout&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible d'ajouter la cat&eacute;gorie.";
+        }
+      }
+      else $env->message = "Vous devez pr&eacute;ciser une icone pour le nouvel emplacement.";
+    }
+  }
+
+  function a_set_emplacement_type($env)
+  { if(($env->out["emplacement_type"] = $env->data->map_emplacement_type($_GET[$env->param("id")])) !== false)
+    { if($_POST)
+      { $icone = null;
+        if($_FILES["icone"])
+        { switch($_FILES["icone"]["error"])
+          { case UPLOAD_ERR_NO_FILE : break;
+            case UPLOAD_ERR_OK :
+              $icone = $env->path("uploads")."map/".$_FILES["icone"]["name"];
+              if
+              ( $env->data->del_map_emplacement_type_icone($env->out["emplacement_type"]["icone"])
+                &&
+                move_uploaded_file
+                ( $_FILES["icone"]["tmp_name"],
+                  $icone
+                ) !== false
+              ) break;
+              else $env->erreur = "Impossible d'uploader l'icone.";
+            default : $env->erreur = "Impossible d'uploader l'icone.";
+          }
+        }
+        if(!$env->erreur)
+        { if
+          ( $env->data->set_map_emplacement_type
+            ( $_GET[$env->param("id")],
+              $_POST["intitule"],
+              $_POST["descriptif"],
+              $icone
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_map")),
+              "Le type d'emplacement a &eacute;t&eacute; modifi&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible de modifier le type d'emplacement.";
+        }
+      }
+    }
+    else $env->erreur = "Impossible de lire les informations pour ce type d'emplacement";
+  }
+
+  function a_del_emplacement_type($env)
+  { if($env->data->del_map_emplacement_type($_GET[$env->param("id")]))
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_map")),
+        "le type d'emplacement a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer le type d'emplacement";
+  }
+
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_menus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_menus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_menus.php	(revision 1)
@@ -0,0 +1,117 @@
+<?php
+
+  function e_set_menus($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->path = array("root", "menus");
+      $env->out["ariane"] = array();
+      if($_GET[$env->param("path")])
+      { $v_path = explode("/", $_GET[$env->param("path")]);
+        foreach($v_path as $_path) if($_path)
+        { $env->path[] = (int)$_path;
+          $env->out["ariane"][$_path] = $env->data->menus_categorie($_path);
+        }
+      }
+      if(($env->out["current_categorie"] = $env->data->id_categorie($env->path)) !== false)
+      { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "menus";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Impossible de lire le menu courant";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_menus($env)
+  { if(($env->out["menu"] = $env->data->menus_categorie($env->out["current_categorie"])) !== false)
+    { if(($env->out["menus_categories"] = $env->data->menus_categories($env->path)) !== false)
+      { if($_POST)
+        { $OK = true;
+          foreach($_POST as $key => $value)
+          { if
+            ( (substr($key, 0, 6) == "ordre_") &&
+              ($id_menu = substr($key, 6)) &&
+              $env->out["menus_categories"]["list"][$id_menu]
+            )
+            { $OK = $env->data->set_menus_categorie
+              ( $id_menu,
+                $env->out["menus_categories"]["list"][$id_menu]["titre"],
+                $env->out["menus_categories"]["list"][$id_menu]["contenu"],
+                $value
+              );
+            }
+            if(!$OK) break;
+          }
+          if($OK)
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_menus", "path" => $_GET[$env->param("path")])),
+              "L'ordre des menus a &eacute;t&eacute; enregistr&eacute;"
+            );
+          }
+          else $env->erreur = "Impossible d'enregistrer l'ordre des menus";
+        }
+      }
+      else $env->erreur = "Impossible de lire les menus";
+    }
+    else $env->erreur = "Impossible de lire le menu courant";
+  }
+
+  function a_add_menus_categorie($env)
+  { if($_POST)
+    { if
+      ( $env->data->add_menus_categorie
+        ( $_POST["titre"],
+          $_POST["url"],
+          $env->out["current_categorie"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_menus", "path" => $_GET[$env->param("path")])),
+          "Le menu a &eacute;t&eacute; ajout&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'ajouter le menu";
+    }
+  }
+
+  function a_set_menus_categorie($env)
+  { if($_POST)
+    { if
+      ( $env->data->set_menus_categorie
+        ( $_GET[$env->param("menus_categorie")],
+          $_POST["titre"],
+          $_POST["url"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_menus", "path" => $_GET[$env->param("path")])),
+          "Le menu a &eacute;t&eacute; enregistr&eacute;"
+        );
+      }
+      else $env->erreur = "Impossible d'enregistrer le menu.";
+    }
+    else
+    { if(($env->out["menus_categorie"] = $env->data->menus_categorie($_GET[$env->param("menus_categorie")])) === false)
+      { $env->erreur = "Impossible de lire le menu.";
+      }
+    }
+  }
+
+  function a_del_menus_categorie($env)
+  { if($env->data->del_menus_categorie($_GET[$env->param("menus_categorie")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_menus", "path" => $_GET[$env->param("path")])),
+        "Le menu a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer le menus.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_news.php	(revision 1)
@@ -0,0 +1,128 @@
+<?php
+
+  function e_set_news($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { if(($env->out["news_root_categorie"] = $env->data->id_categorie(array("root", "news"))) !== false)
+      { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "news";
+        $function = "a_".$env->a;
+        if(function_exists($function))
+        { $catgories_function = "all_news_categories";
+          if($env->a === "del_news") $catgories_function = "news_categories";
+          $r = false;
+          eval("\$r = \$env->data->".$catgories_function."();");
+          if(($env->out["categories"] = $r) !== false)
+          { $function($env);
+          }
+          else $env->erreur = "Impossible de lire la liste des categories de news";
+        }
+      }
+      else $env->erreur = "Impossible de trouver la categorie racine des news.";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_news($env)
+  { $path = array("root", "news");
+    $depth = 1;
+    if(isset($_GET[$env->param("categorie")]))
+    { if(strlen($_GET[$env->param("categorie")]) > 0) $path[] = (int)$_GET[$env->param("categorie")];
+      $depth = 0;
+    }
+    if(($env->out["news"] = $env->data->news($path, $env->start, $depth)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les news";
+  }
+
+  function a_add_news($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "categorie" => $_POST["categorie"],
+          "categorie_titre" => $env->out["categories"]["list"][$_POST["categorie"]]["titre"],
+          "categorie_icone" => $env->out["categories"]["list"][$_POST["categorie"]]["icone"],
+          "titre" => $_POST["titre"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "contenu" => $_POST["news"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->add_news
+          ( $_POST["categorie"],
+            $_POST["titre"],
+            $_POST["news"],
+            $env->pun_user["id"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_news")),
+            "La news a &eacute;t&eacute; ajout&eacute;e"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter la news.";
+      }
+    }
+  }
+
+  function a_set_one_news($env)
+  { if(($env->out["news"] = $env->data->contenu($_GET[$env->param("news")])) !== false)
+    { if($_POST)
+      { if($_POST["preview"])
+        { $env->out["preview"] = array
+          ( "categorie" => $_POST["categorie"],
+            "categorie_titre" => $env->out["categories"]["list"][$_POST["categorie"]]["titre"],
+            "categorie_icone" => $env->out["categories"]["list"][$_POST["categorie"]]["icone"],
+            "titre" => $_POST["titre"],
+            "auteur" => $env->out["news"]["auteur"],
+            "date_publication" => $_POST["date_publication"],
+            "contenu" => $_POST["news"],
+            "public" => $_POST["public"] ? 1 : 0
+          );
+        }
+        else
+        { if
+          ( $env->data->set_news
+            ( $_GET[$env->param("news")],
+              $_POST["categorie"],
+              $_POST["titre"],
+              $_POST["news"],
+              $env->pun_user["id"],
+              $_POST["date_publication"],
+              $_POST["public"] ? 1 : 0
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_news")),
+              "La news a &eacute;t&eacute; modifi&eacute;e"
+            );
+          }
+          else $env->erreur = "Impossible de modifier la news.";
+        }
+      }
+    }
+    else $env->erreur = "Impossible de lire la news.";
+  }
+
+  function a_del_news($env)
+  { if($env->data->del_news($_GET[$env->param("news")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_news")),
+        "La news a &eacute;t&eacute; supprim&eacute;e"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer la news.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_news_categories.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_news_categories.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_news_categories.php	(revision 1)
@@ -0,0 +1,116 @@
+<?php
+
+  function e_set_news_categories($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { if(($env->out["news_root_categorie"] = $env->data->id_categorie(array("root", "news"))) !== false)
+      { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "news_categories";
+        $function = "a_".$env->a;
+        if(function_exists($function)) $function($env);
+      }
+      else $env->erreur = "Impossible de trouver la categorie racine des news.";
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_news_categories($env)
+  { if(($env->out["news_categories"] = $env->data->news_categories($env->start)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les cat&eacute;gories";
+  }
+
+  function a_add_news_categorie($env)
+  { if($_POST)
+    { $icone = null;
+      if($_FILES["icone"])
+      { switch($_FILES["icone"]["error"])
+        { case UPLOAD_ERR_NO_FILE : break;
+          case UPLOAD_ERR_OK :
+            $icone = $env->path("uploads")."categories/".$_FILES["icone"]["name"];
+            if
+            ( @move_uploaded_file
+              ( $_FILES["icone"]["tmp_name"],
+                $icone                  
+              ) !== false
+            ) break;
+          default : $env->erreur = "Impossible d'uploader l'icone.";
+        }
+      }
+      if(!$env->erreur)
+      { if
+        ( $env->data->add_news_categorie
+          ( $_POST["titre"],
+            $icone,
+            $_POST["description"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_news_categories")),
+            "La cat&eacute;gorie a &eacute;t&eacute; ajout&eacute;e"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter la cat&eacute;gorie.";
+      }
+    }
+  }
+
+  function a_set_news_categorie($env)
+  { if(($env->out["news_categorie"] = $env->data->news_categorie($_GET[$env->param("categorie")])) !== false)
+    { if($_POST)
+      { $icone = null;
+        if(!$_POST["del_icone"] && $_FILES["icone"])
+        { switch($_FILES["icone"]["error"])
+          { case UPLOAD_ERR_NO_FILE : break;
+            case UPLOAD_ERR_OK :
+              $icone = $env->path("uploads")."categories/".$_FILES["icone"]["name"];
+              if
+              ( move_uploaded_file
+                ( $_FILES["icone"]["tmp_name"],
+                  $icone                  
+                ) !== false
+                &&
+                $env->data->del_news_categorie_icone($env->out["news_categorie"]["icone"])
+              ) break;
+            default : $env->erreur = "Impossible d'uploader l'icone.";
+          }
+        }
+        if(!$env->erreur)
+        { if($_POST["del_icone"] && !$env->data->del_news_categorie_icone($env->out["news_categorie"]["icone"])) return false;
+          if
+          ( $env->data->set_news_categorie
+            ( $_GET[$env->param("categorie")],
+              $_POST["titre"],
+              $_POST["del_icone"] ? null : (isset($icone) ? $icone : $env->out["news_categorie"]["icone"]),
+              $_POST["description"]
+            )
+          )
+          { _redirect
+            ( $env,
+              $env->url(array("e" => "set_news_categories")),
+              "La cat&eacute;gorie a &eacute;t&eacute; modifi&eacute;e"
+            );
+          }
+          else $env->erreur = "Impossible de modifier la cat&eacute;gorie.";
+        }
+      }
+    }
+    else $env->erreur = "Impossible de lire la cat&eacute;gorie.";
+  }
+
+  function a_del_news_categorie($env)
+  { if($env->data->del_news_categorie($_GET[$env->param("categorie")], $env->out["news_root_categorie"]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_news_categories")),
+        "La cat&eacute;gorie a &eacute;t&eacute; supprim&eacute;e"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer la cat&eacute;gorie.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_pages.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_pages.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_pages.php	(revision 1)
@@ -0,0 +1,80 @@
+<?php
+
+  function e_set_pages($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "pages";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_pages($env)
+  { if(($env->out["pages"] = $env->data->pages($env->start)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les pages";
+  }
+
+  function a_add_page($env)
+  { if($_POST)
+    { if
+      ( $env->data->add_page
+        ( $_POST["titre"],
+          $_POST["fichier"],
+          $_POST["contenu"],
+          $_POST["public"] ? 1 : 0,
+          $env->pun_user["id"]
+        )
+      )
+      { _redirect
+        ( $env,
+          $env->url(array("e" => "set_pages")),
+          "La page a &eacute;t&eacute; ajout&eacute;e"
+        );
+      }
+      else $env->erreur = "Impossible d'ajouter la page.";
+    }
+  }
+
+  function a_set_page($env)
+  { if(($env->out["page"] = $env->data->page($_GET[$env->param("id")])) !== false)
+    { if($_POST)
+      { if
+        ( $env->data->set_page
+          ( $_GET[$env->param("id")],
+            $_POST["titre"],
+            $_POST["fichier"],
+            $_POST["contenu"],
+            $_POST["public"] ? 1 : 0,
+            $env->pun_user["id"]
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_pages")),
+            "La page a &eacute;t&eacute; modifi&eacute;e"
+          );
+        }
+        else $env->erreur = "Impossible de modifier la page.";
+      }
+    }
+    else $env->erreur = "Impossible de lire la page.";
+  }
+
+  function a_del_page($env)
+  { if($env->data->del_page($_GET[$env->param("id")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_pages")),
+        "La page a &eacute;t&eacute; supprim&eacute;e"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer la page.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_set_spotlights.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_set_spotlights.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_set_spotlights.php	(revision 1)
@@ -0,0 +1,104 @@
+<?php
+
+  function e_set_spotlights($env)
+  { if($env->data->is_admin($env->pun_user["id"]))
+    { $env->a = $_GET[$env->param("action")] ? $_GET[$env->param("action")] : "spotlights";
+      $function = "a_".$env->a;
+      if(function_exists($function)) $function($env);
+    }
+    else $env->erreur = "Vous devez &ecirc;tre administrateur pour acc&eacute;der &agrave; cette page.";
+  }
+
+  # ------------------------------------------------------------------------------
+  #                                                                        actions
+  #
+
+  function a_spotlights($env)
+  { if(($env->out["spotlights"] = $env->data->spotlights($env->start)) !== false)
+    {
+    }
+    else $env->erreur = "Impossible de lire les spotlights";
+  }
+
+  function a_add_spotlight($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "titre" => $_POST["titre"],
+          "contenu" =>  $_POST["spotlight"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->add_spotlight
+          ( $_POST["titre"],
+            $_POST["spotlight"],
+            $env->pun_user["id"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_spotlights")),
+            "Le spotlight a &eacute;t&eacute; ajout&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible d'ajouter le spotlight.";
+      }
+    }
+  }
+
+  function a_set_spotlight($env)
+  { if($_POST)
+    { if($_POST["preview"])
+      { $env->out["preview"] = array
+        ( "titre" => $_POST["titre"],
+          "contenu" =>  $_POST["spotlight"],
+          "auteur" => $env->pun_user["username"],
+          "date_publication" => $_POST["date_publication"],
+          "public" => $_POST["public"] ? 1 : 0
+        );
+      }
+      else
+      { if
+        ( $env->data->set_spotlight
+          ( $_GET[$env->param("spotlight")],
+            $_POST["titre"],
+            $_POST["spotlight"],
+            $env->pun_user["id"],
+            $_POST["date_publication"],
+            $_POST["public"] ? 1 : 0
+          )
+        )
+        { _redirect
+          ( $env,
+            $env->url(array("e" => "set_spotlights")),
+            "Le spotlight a &eacute;t&eacute; modifi&eacute;"
+          );
+        }
+        else $env->erreur = "Impossible de modifier le spotlight.";
+      }
+    }
+    else
+    { if(($env->out["_spotlight"] = $env->data->spotlight($_GET[$env->param("spotlight")])) === false)
+      { $env->erreur = "Impossible de lire le spotlight.";
+      }
+    }
+  }
+
+  function a_del_spotlight($env)
+  { if($env->data->del_spotlight($_GET[$env->param("spotlight")]) !== false)
+    { _redirect
+      ( $env,
+        $env->url(array("e" => "set_spotlights")),
+        "Le spotlight a &eacute;t&eacute; supprim&eacute;"
+      );
+    }
+    else $env->erreur = "Impossible de supprimer le spotlight.";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/e_spotlight.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/e_spotlight.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/e_spotlight.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  function e_spotlight($env)
+  {
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/post_request/e_map_emplacements.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/post_request/e_map_emplacements.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/post_request/e_map_emplacements.php	(revision 1)
@@ -0,0 +1,9 @@
+<?php
+
+  function e_map_emplacements($env)
+  { if(($env->reponse["emplacements"] = $env->data->map_emplacements()) === false)
+    { $env->reponse["erreur"] = "impossible de lire les emplacements";
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/mods/post_request/e_save_map.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/mods/post_request/e_save_map.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/mods/post_request/e_save_map.php	(revision 1)
@@ -0,0 +1,36 @@
+<?php
+
+  function e_save_map($env)
+  { $ERREUR = false;
+    foreach($env->DATA["emplacements"] as $id => $values)
+    { if(!$ERREUR)
+      { if(isset($values["deleted"]))
+        { if(strlen($id) < 4 || strcmp(substr($id, 0, 4), "new_") != 0) $ERREUR = $ERREUR || !$env->data->del_map_emplacement($id);
+        }
+        elseif(strlen($id) >= 4 && strcmp(substr($id, 0, 4), "new_") == 0)
+        { $ERREUR = $ERREUR || !$env->data->add_map_emplacement
+          ( $values["latitude"],
+            $values["longitude"],
+            $values["map_emplacement_type"],
+            $values["info"],
+            $values["creation_user"]
+          );
+        }
+        elseif(isset($values["modified"]))
+        { $ERREUR = $ERREUR || !$env->data->set_map_emplacement
+          ( $id,
+            $values["latitude"],
+            $values["longitude"],
+            $values["map_emplacement_type"],
+            $values["info"],
+            $values["modification_user"]
+          );
+        }
+        if($ERREUR) $env->reponse["erreur"] = "erreur lors de la mise a jour des emplacements";
+      }
+      if($ERREUR) break;
+    }
+    if(!$ERREUR) $env->next_e = "map_emplacements";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/backend/atom.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/backend/atom.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/backend/atom.php	(revision 1)
@@ -0,0 +1,29 @@
+<<?= "?" ?>xml version="1.0" encoding="UTF-8" <?= "?" ?>>
+<feed xml:lang="fr" xmlns="http://www.w3.org/2005/Atom">
+  <id><?= $env->out["atom"]["id"] ?></id>
+  <author><name><?= $env->out["atom"]["author_name"] ?></name></author>
+  <updated><?= $env->out["atom"]["updated"] ?></updated>
+  <title><?= $env->out["atom"]["title"] ?></title>
+  <link rel="self" href="<?= $env->out["atom"]["link"]["self"] ?>"/>
+  <link rel="alternate" type="text/html" href="<?= $env->out["atom"]["link"]["alternate"] ?>"/>
+
+<?php if($env->out["atom"]["entries"]) : foreach($env->out["atom"]["entries"] as $id_entry => $entry) : ?>
+<entry xml:lang="fr">
+  <id><?= $entry["id"] ?></id>
+  <updated><?= $entry["updated"] ?></updated>
+  <author><name><?= utf8_encode($entry["author_name"]) ?></name></author>
+  <title><?= utf8_encode($entry["title"]) ?></title>
+  <link rel="alternate" type="text/html" href="<?= str_replace("&amp;", "&", $entry["link"]["alternate"]) ?>" />
+<?php if($entry["enclosure"]) : ?>
+  <link rel="enclosure" type="<?= $entry["content_type"] ?>" href="<?= $entry["enclosure"] ?>"/>
+<?php endif; ?>
+<?php if($entry["summary"]) : ?>
+  <summary type="html"><![CDATA[<?= $entry["summary"] ?>]]></summary>
+<?php endif; ?>
+<?php if($entry["content"]) : ?>
+  <content type="html"><![CDATA[<?= $entry["content"] ?>]]></content>
+<?php endif; ?>
+</entry>
+<?php endforeach; endif; ?>
+
+</feed>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/backend/audio_atom.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/backend/audio_atom.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/backend/audio_atom.php	(revision 1)
@@ -0,0 +1,26 @@
+<<?= "?" ?>xml version="1.0" encoding="UTF-8" <?= "?" ?>>
+<feed xml:lang="fr" xmlns="http://www.w3.org/2005/Atom">
+  <id><?= $env->out["atom"]["id"] ?></id>
+  <author><name><?= $env->out["atom"]["author_name"] ?></name></author>
+  <updated><?= $env->out["atom"]["updated"] ?></updated>
+  <title><?= $env->out["atom"]["title"] ?></title>
+  <link rel="self" href="<?= $env->out["atom"]["link"]["self"] ?>"/>
+  <link rel="alternate" type="text/html" href="<?= $env->out["atom"]["link"]["alternate"] ?>"/>
+
+<?php if($env->out["atom"]["entries"]) : foreach($env->out["atom"]["entries"] as $id_entry => $entry) : ?>
+<entry xml:lang="fr">
+  <id><?= $entry["id"] ?></id>
+  <updated><?= $entry["updated"] ?></updated>
+  <author><name><?= $entry["author_name"] ?></name></author>
+  <title><?= $entry["author_name"] ?> - <?= $entry["title"] ?></title>
+  <link rel="alternate" type="text/html" href="<?= $entry["link"]["alternate"] ?>" />
+<?php if($entry["enclosure"]) : ?>
+  <link rel="enclosure" type="<?= $entry["content_type"] ?>" href="<?= $entry["enclosure"] ?>"/>
+<?php endif; ?>
+<?php if($entry["summary"]) : ?>
+  <summary><?= $entry["summary"] ?></summary>
+<?php endif; ?>
+</entry>
+<?php endforeach; endif; ?>
+
+</feed>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/backend/playlist_xml.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/backend/playlist_xml.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/backend/playlist_xml.php	(revision 1)
@@ -0,0 +1,17 @@
+<playlist version="1" xmlns="http://xspf.org/ns/0/">
+	<trackList>
+
+<?php if($env->out["downloads"]) : ?>
+<?php foreach($env->out["downloads"] as $id_download => $download) : ?>
+<?php if($download["mp3_id_url"]) : ?>
+		<track>
+			<title><?= $download["nom"] ?></title>
+			<creator><?= $download["auteur"] ?></creator>
+			<location><?= $download["mp3_url"] ?></location>
+		</track>
+<?php endif; ?>
+<?php endforeach; ?>
+<?php endif; ?>
+
+	</trackList>
+</playlist>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/backend/test_atom.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/backend/test_atom.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/backend/test_atom.php	(revision 1)
@@ -0,0 +1,21 @@
+<<?= "?" ?>xml version="1.0" encoding="UTF-8" <?= "?" ?>>
+<feed xml:lang="fr" xmlns="http://www.w3.org/2005/Atom">
+  <id><?= $env->out["atom"]["id"] ?></id>
+  <author><name><?= $env->out["atom"]["author_name"] ?></name></author>
+  <updated><?= $env->out["atom"]["updated"] ?></updated>
+  <title><?= $env->out["atom"]["title"] ?></title>
+  <link rel="self" href="<?= str_replace("&", "&amp;", $env->out["atom"]["link"]["self"]) ?>"/>
+
+<?php if($env->out["atom"]["entries"]) : foreach($env->out["atom"]["entries"] as $id_entry => $entry) : ?>
+<entry xml:lang="fr">
+  <id>tag:nom.de.domaine,2009-04-06:id_entry</id>
+  <updated>2009-04-06T11:26:30+02:00</updated>
+  <author><name>entry_author_name</name></author>
+  <title>entry_title</title>
+  <link rel="alternate" type="text/html" href="http://entry.link.alternate/" />
+  <summary>entry_summary</summary>
+  <content type="html">entry_content</content>
+</entry>
+<?php endforeach; endif; ?>
+
+</feed>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/accueil_forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/accueil_forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/accueil_forum.php	(revision 1)
@@ -0,0 +1,8 @@
+<?php if($env->out["messages_forum"]) : ?>
+<?php foreach($env->out["messages_forum"] as $id_message => $message) : ?>
+<div class="message_forum">
+  [ <?= date("H\hi d M Y ", $message["posted"]) ?> ]
+  <a href="<?= $env->path("punbb")."viewtopic.php?id=".$message["topic_id"] ?>"><?= $message["subject"] ?></a>
+</div>
+<?php endforeach; ?>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/admin.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/admin.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/admin.php	(revision 1)
@@ -0,0 +1,21 @@
+<?php if($env->data->is_admin($env->pun_user["id"])) : ?>
+<h4>G&eacute;n&eacute;ral</h4>
+<ul class="menu">
+  <li><a href="<?= $env->url(array("e" => "set_config")); ?>">configuration</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_dons_achats")); ?>">dons et achats</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_artistes")); ?>">comptes artistes</a></li>
+</ul>
+<h4>Contenus</h4>
+<ul class="menu">
+  <li><a href="<?= $env->url(array("e" => "set_menus")); ?>">menus</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_boxes")); ?>">blocs</a></li>
+</ul>
+<h4>La redaction</h4>
+<ul class="menu">
+  <li><a href="<?= $env->url(array("e" => "set_editos")); ?>">&eacute;ditos</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_spotlights")); ?>">spotlights</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_news")); ?>">news</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_news_categories")); ?>">cat&eacute;gories de news</a></li>
+  <li><a href="<?= $env->url(array("e" => "set_pages")); ?>">pages</a></li>
+</ul>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/artistes_au_hasard.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/artistes_au_hasard.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/artistes_au_hasard.php	(revision 1)
@@ -0,0 +1,24 @@
+<?php if($env->out["artistes_au_hasard"]) : ?>
+  <div id="artistes_au_hasard">
+<?php foreach($env->out["artistes_au_hasard"] as $artiste) : ?>
+      <a title="<?= $artiste["nom"]." (".$artiste["style"].")" ?>"
+         href="<?= $env->url(array("e" => "artistes", "artiste" => $artiste["id"])) ?>">
+<?php if($artiste["image"]["src"]) : ?>
+        <img alt="<?= $artiste["nom"]." (".$artiste["style"].")" ?>"
+             src="<?=
+              ( $env->e === "forum" ?
+                  ( strpos($artiste["image"]["src"], "http://") === 0 ?
+                      ""
+                    : "../"
+                  )
+                : ""
+              ).$artiste["image"]["src"]
+             ?>" style="width: <?= $artiste["image"]["width"] ?>px; height: <?= $artiste["image"]["height"] ?>px;" />
+<?php else : ?>
+        <?= $artiste["nom"] ?>
+<?php endif; ?>
+      </a>
+<?php endforeach; ?>
+    <div class="clear"><!-- --></div>
+  </div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/edito.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/edito.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/edito.php	(revision 1)
@@ -0,0 +1,6 @@
+<?php if($env->out["edito"]) : ?>
+  <h3><?= $env->out["edito"]["titre"] ?></h3>
+  <p class="by">par <?= $env->out["edito"]["auteur"] ?><!-- - <?= $env->out["edito"]["date_creation"] ?> --></p>
+  <br />
+<?= $env->data->html($env->out["edito"]["contenu"]) ?>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/flickr.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/flickr.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/flickr.php	(revision 1)
@@ -0,0 +1,87 @@
+<div id="flickr_bloc">
+<?php
+
+  # -------------------------------------------------------------------------------
+  #                                                        configuration API Flickr
+  #
+
+  // renseignez ici les informations fournies par Flickr :
+
+  $flickr_user_id = "XXXXXXXX@XXX";
+
+  $flickr_api_key = "********************************";
+
+  $flickr_pass    = "****************";
+
+
+  # -------------------------------------------------------------------------------
+  #                                                            affichage des images
+  #
+
+  $flickr_sign = md5($flickr_pass."api_key".$flickr_api_key."");
+  $flickr_url =
+   "http://www.flickr.com/services/rest"
+  ."/?method=flickr.photos.search"
+  ."&format=rest"
+  ."&user_id=".$flickr_user_id
+  ."&api_key=".$flickr_api_key;
+
+  if($res = simplexml_load_file($flickr_url))
+  { if(($stat = (string)$res["stat"]) == "ok")
+    { $photos = array();
+      foreach($res->photos->photo as $photo) $photos[] = $photo;
+      if($photos)
+      { shuffle($photos);
+        $total_photos = count($photos);
+        $n = 0;
+        while($n < 4 && $n < $total_photos)
+        { $photo = $photos[$n];
+          $src =
+           "http://farm".utf8_decode($photo["farm"]).".static.flickr.com"
+          ."/".utf8_decode($photo["server"])
+          ."/".utf8_decode($photo["id"])
+          ."_".utf8_decode($photo["secret"])
+          ."_t.jpg";
+          $href =
+           "http://www.flickr.com/photos"
+          ."/".utf8_decode($photo["owner"])
+          ."/".utf8_decode($photo["id"]);
+?>
+
+  <?php
+
+    if(($img_size = $env->data->img_size($src, 100, 100)) !== false)
+    { $margin_top = floor((110 - $img_size["height"]) / 2);
+    }
+    else
+    { $img_size = array
+      ( "width" => "",
+        "height" => ""
+      );
+      $margin_top = 0;
+    }
+
+  ?>
+
+  <a href="<?= $href ?>" title="<?= $photo["title"] ?>">
+    <img src="<?= $src ?>" alt="<?= $photo["title"] ?>"
+         width="<?= $img_size["width"] ?>"
+         height="<?= $img_size["height"] ?>"
+         style="margin-top: <?= $margin_top ?>px;" />
+  </a>
+
+<?php
+          $n++;
+        }
+      }
+      else echo "( pas de photo pour le moment )";
+    }
+    elseif($stat == "fail")
+    { echo "( impossible de lire les images )";
+    }
+  }else echo 'Erreur de lecture du flux RSS';
+
+?>
+
+</div>
+<div class="clear"><!-- --></div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_albums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_albums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_albums.php	(revision 1)
@@ -0,0 +1,56 @@
+<div id="last_albums_bloc">
+<?php if($env->out["last_albums"]) : ?>
+
+<?php foreach($env->out["last_albums"] as $id_album => $album) : ?>
+
+        <a class="artiste_album_linkk"
+           title="<?= $album["artiste"] ?> : <?= str_replace("\"", "\\\"", $album["titre"]) ?>"
+           href="<?= $env->url
+                     ( array
+                       ( "e" => "artistes",
+                         "artiste" => $album["id_artiste"],
+                         "page" => "downloads",
+                         "album" => $id_album
+                       )
+                     ) ?>">
+          <span class="auteur"><?= $album["artiste"] ?></span>
+
+          <?php if($album["image"]) : ?>
+
+          <?php
+
+            $img_src = $album["image"];
+            if(($thumb = $env->data->img_thumb($img_src, 150, 150, $env->path("uploads")."thumbs/")) !== false)
+            { $thumb["thumb_file"] = $env->path("uploads")."thumbs/".$thumb["thumb_file"];
+              $margin_top = floor((150 - $thumb["thumb_height"]) / 2);
+            }
+            else
+            { $thumb = array
+              ( "thumb_file" => $img_src,
+                "thumb_width" => 150,
+                "thumb_height" => 150
+              );
+              $margin_top = 0;
+            }
+
+          ?>
+
+          <img src="<?= $thumb["thumb_file"] ?>"
+               width="<?= $thumb["thumb_width"] ?>"
+               height="<?= $thumb["thumb_height"] ?>"
+               style="margin: <?= $margin_top ?>px 0px <?= $margin_top ?>px 0px;"
+               alt="<?= str_replace("\"", "\\\"", $album["titre"]) ?>" />
+
+          <?php endif; ?>
+
+          <strong><?= $album["titre"] ?></strong>
+        </a>
+
+<?php endforeach; ?>
+        <div class="clear"><!-- --></div>
+<?php else : ?>
+
+<p>Pas d'album pour le moment</p>
+
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/last_news.php	(revision 1)
@@ -0,0 +1,21 @@
+<?php
+
+  if($env->out["news"]["list"]) :
+  $id_news = array_rand($env->out["news"]["list"]);
+  $news = $env->out["news"]["list"][$id_news];
+  $env->out["last_news_id"] = $id_news;
+
+?>
+
+<h3><?= $news["titre"] ?></h3>
+<p class="by">
+  par <?= $news["auteur"] ?> - <?= $news["date_creation"] ?>
+</p>
+<?= $env->data->html($news["contenu"]) ?>
+<div class="clear"><!-- --></div>
+<?php
+
+  reset($env->out["news"]["list"]);
+  endif;
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/login.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/login.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/login.php	(revision 1)
@@ -0,0 +1,38 @@
+<?php if($env->pun_user['is_guest']) : ?>
+<form id="pun_login_form"
+      action="<?= $env->url(array("e" => $env->e, "login" => "in", "from" => urlencode($_SERVER["REQUEST_URI"]))) ?>"
+      method="post">
+  <input type="hidden" name="form_sent" value="1" />
+  <table>
+    <tr>
+      <th>login</th>
+      <td><input class="txt" type="text" name="req_username" /></td>
+    </tr>
+    <tr>
+      <th>pass</th>
+      <td><input class="txt" type="password" name="req_password" /></td>
+    </tr>
+    <tr>
+      <td colspan="2" style="text-align: right"><input class="submit" type="submit" name="login" value="Login" /></td>
+    </tr>
+  </table>
+  <div class="clear"><!-- --></div>
+  <p>
+    <a href="<?= $env->path("punbb") ?>login.php?action=forget">mot de passe oubli&eacute;</a>
+    | <a href="<?= $env->path("punbb") ?>register.php?from=<?= urlencode($_SERVER["REQUEST_URI"]) ?>">s'inscrire</a>
+  </p>
+</form>
+
+<?php else : ?>
+<div id="pun_login_menu">
+  Bienvenue <b><?= $env->pun_user["username"] ?></b>
+  <ul class="menu">
+    <li><a href="<?= $env->path("punbb")."profile.php?id=".$env->pun_user["id"] ?>">mon compte</a></li>
+    <li>| <a href="<?= $env->url(array("e" => "accueil", "login" => "out", "id" => $env->pun_user["id"])) ?>">deconnexion</a></li>
+<?php if($env->data->is_admin($env->pun_user["id"])) : ?>
+    <li>| <a href="<?= $env->url(array("e" => "set_config")) ?>">admin</a></li>
+<?php endif; ?>
+  </ul>
+</div>
+<?php endif; ?>
+<div class="clear"><!-- --></div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/menu_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/menu_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/menu_news.php	(revision 1)
@@ -0,0 +1,22 @@
+
+<ul class="last_news">
+<?php foreach($env->out["b_news"]["list"] as $id_news => $news) : ?>
+  <li><a href="<?= $env->url(array("e" => "content", "id" => $id_news)) ?>"><?= $news["titre"] ?></a></li>
+<?php endforeach; ?>
+</ul>
+
+<?php if($env->out["b_categories"]["list"]) : ?>
+  <div class="news_actegories_menu">
+    <h3>+ de news</h3>
+    <div>
+      <ul>
+        <li><a href="<?= $env->url(array("e" => "news")) ?>">Toutes les cat&eacute;gories</a></li>
+        <li><a href="<?= $env->url(array("e" => "news", "categorie" => "")) ?>">Sans cat&eacute;gorie</a></li>
+<?php foreach($env->out["b_categories"]["list"] as $id_categorie => $categorie) : ?>
+        <li><a href="<?= $env->url(array("e" => "news", "categorie" => $id_categorie)) ?>"><?= $categorie["titre"] ?></a></li>
+<?php endforeach; ?>
+      </ul>
+    </div>
+  </div>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/navigation.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/navigation.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/navigation.php	(revision 1)
@@ -0,0 +1,17 @@
+<?php if($env->out["menu_top"]["subs"]) : ?>
+<ul id="Nav">
+<?php foreach($env->out["menu_top"]["subs"] as $id_menu => $menu) : ?>
+  <li<?= $menu["nom"] ? " id=\"".$menu["nom"]."\"" : ""?> class="menu_name">
+    <?= $menu["contenu"] ? "<a href=\"".$env->url(null, null, url_amps($menu["contenu"]))."\">" : "<a href=\"#\">" ?><?= $menu["titre"] ?><?= $menu["contenu"] ? "</a>" : "</a>" ?>
+<?php if($menu["subs"]) : ?>
+    <ul class="Menu">
+<?php $nsm = 1; foreach($menu["subs"] as $id_sub => $sub) : ?>
+      <li<?= $sub["nom"] ? " id=\"".$sub["nom"]."\"" : ""?> <?= count($menu["subs"]) == $nsm ? "class=\"last\"" : "" ?>><a href="<?= $env->url(null, null, url_amps($sub["contenu"])) ?>"><span><?= $sub["titre"] ?></span></a></li>
+<?php $nsm++; endforeach; ?>
+    </ul>
+<?php endif; ?>
+  </li>
+<?php endforeach; ?>
+</ul>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/news.php	(revision 1)
@@ -0,0 +1,30 @@
+<?php if($env->out["news"]["list"]) : ?>
+<div id="news_box">
+
+<ul class="last_news">
+<?php foreach($env->out["news"]["list"] as $id_news => $news) : ?>
+<?php if(!isset($env->out["last_news_id"]) || $env->out["last_news_id"] != $id_news) : ?>
+  <li><a href="<?= $env->url(array("e" => "content", "id" => $id_news)) ?>"><?= $news["titre"] ?></a></li>
+<?php endif; ?>
+<?php endforeach; ?>
+</ul>
+
+<?php if($env->out["categories"]["list"]) : ?>
+  <div class="news_actegories_menu">
+    <h3>+ de news</h3>
+    <div>
+      <ul>
+        <li><a href="<?= $env->url(array("e" => "news")) ?>">Toutes les cat&eacute;gories</a></li>
+        <li><a href="<?= $env->url(array("e" => "news", "categorie" => "")) ?>">Sans cat&eacute;gorie</a></li>
+<?php foreach($env->out["categories"]["list"] as $id_categorie => $categorie) : ?>
+        <li><a href="<?= $env->url(array("e" => "news", "categorie" => $id_categorie)) ?>"><?= $categorie["titre"] ?></a></li>
+<?php endforeach; ?>
+      </ul>
+    </div>
+  </div>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
+
+</div>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/nous_y_etions.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/nous_y_etions.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/nous_y_etions.php	(revision 1)
@@ -0,0 +1,9 @@
+<?php if(($post = $env->data->nous_y_etions()) !== false) : ?>
+  <h3><?= $post["subject"] ?></h3>
+  <p>
+    photos, sons, commentaires
+    <a href="<?= $env->path("punbb")."viewtopic.php?id=".$post["topic_id"] ?>">ici</a>
+  </p>
+<?php else : ?>
+(impossible de lire l'info)
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/playlists.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/playlists.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/playlists.php	(revision 1)
@@ -0,0 +1,37 @@
+<?php if($env->out["nb_downloads"]) : ?>
+<div id="playlists">
+<h4>10 derniers morceaux</h4>
+<ul>
+  <li class="last"><a href="<?= $env->url(array("e" => "last_downloads", "format" => "atom"), "backend.php"); ?>"
+      title="fil atom : les 10 derniers morceaux">
+      <img src="<?= $env->out_file("icons/rss.png") ?>" alt="fil atom : les 10 derniers morceaux" />
+    </a></li>
+  <li class="sep"><a href="<?= $env->url(array("e" => "last_downloads", "format" => "m3u"), "backend.php"); ?>"
+                     title="playlist m3u : les 10 derniers morceaux">
+      <img src="<?= $env->out_file("icons/ecouter.png") ?>" alt="playlist m3u : les 10 derniers morceaux" />
+    </a></li>
+  <li class="sep"><a href="<?= $env->url(array("e" => "playlist", "action" => "last_downloads")); ?>"
+                     title="afficher les 10 derniers morceaux">
+      voir
+    </a></li>
+</ul>
+<div class="clear"><!-- --></div>
+
+<h4>10 au hasard</h4>
+<ul>
+  <li class="last"><a href="<?= $env->url(array("e" => "rand_downloads", "format" => "atom"), "backend.php"); ?>"
+      title="fil atom : 10 morceaux au hasard">
+      <img src="<?= $env->out_file("icons/rss.png") ?>" alt="fil atom : 10 morceaux au hasard" />
+    </a></li>
+  <li class="sep"><a href="<?= $env->url(array("e" => "rand_downloads", "format" => "m3u"), "backend.php"); ?>"
+                     title="playlist m3u : 10 morceaux au hasard">
+      <img src="<?= $env->out_file("icons/ecouter.png") ?>" alt="playlist m3u : 10 morceaux au hasard" />
+    </a></li>
+  <li class="sep"><a href="<?= $env->url(array("e" => "playlist", "action" => "rand_downloads")); ?>"
+                     title="afficher 10 morceaux au hasard">
+      voir
+    </a></li>
+</ul>
+</div>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/soutenir.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/soutenir.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/soutenir.php	(revision 1)
@@ -0,0 +1,52 @@
+<?php if($env->config("identifiant_paypal") || $env->config("lien_boutique")) : ?>
+
+      <div id="soutenir_site">
+
+<?php if($env->config("identifiant_paypal")) : ?>
+        <div id="don_site">
+
+<span>Don</span>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+  <input type="hidden" name="cmd" value="_donations" />
+  <input type="hidden" name="business" value="<?= $env->config("identifiant_paypal") ?>" />
+  <input type="hidden" name="lc" value="FR" />
+  <input type="hidden" name="no_note" value="0" />
+  <input type="hidden" name="no_shipping" value="2" />
+  <input type="hidden" name="currency_code" value="EUR" />
+  <input type="hidden" name="return" value="http://<?= $_SERVER["HTTP_HOST"].$env->url(array()) ?>" />
+  <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted" />
+  <input type="image" src="<?= $env->out_file("icons/paypal.png") ?>" name="submit" alt="Faire un don avec PayPal" />
+  <img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1" />
+</form>
+
+        </div>
+<?php endif; ?>
+<?php if($env->config("lien_boutique")) : ?>
+        <div id="lien_boutique_site">
+
+<span>Boutique RSR</span>
+<a href="<?= $env->config("lien_boutique") ?>"><img src="<?= $env->out_file("icons/cart.png") ?>" /></a>
+
+        </div>
+<?php endif; ?>
+        <div class="clear"><!-- --></div>
+
+  <a class="thickbox info_mini_right" href="<?= $env->url(array("e" => "popup_info", "action" => "soutenir_site")) ?>&amp;KeepThis=true&amp;TB_iframe=true&amp;height=400&amp;width=600" title="Soutenir notre action">
+    <img src="<?= $env->out_file("icons/aide.png") ?>" alt="Soutenir un artiste" />
+    Pourquoi soutenir, acheter, faire un don ?
+  </a>
+
+        <div class="clear"><!-- --></div>
+
+      </div>
+
+
+
+
+
+
+
+
+<?php else : ?>
+<p>bloc en construction...</p>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/boxes/spotlight.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/boxes/spotlight.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/boxes/spotlight.php	(revision 1)
@@ -0,0 +1,8 @@
+<?php if($env->out["spotlight"]) : ?>
+<h3><?= $env->out["spotlight"]["titre"] ?></h3>
+<br />
+<?= $env->data->resume(strip_tags($env->out["spotlight"]["contenu"]), 50) ?>
+<br /><br />
+<a href="<?php echo $env->url(array("e" => "spotlight")); ?>">lire la suite...</a>
+
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/artistes.php	(revision 1)
@@ -0,0 +1,41 @@
+<h2>Les artistes</h2>
+<div class="bloc_content">
+
+  <ul class="artiste_mini_blocs">
+  <?php foreach($env->out["artistes"] as $id => $artiste) : ?>
+    <li>
+      <a href="<?= $env->url(array("e" => "artistes", "artiste" => $id)) ?>">
+        <?php
+
+          $img_src = $artiste["image"];
+          if($img_src) :
+          if(($thumb = $env->data->img_thumb($img_src, 94, 100, $env->path("uploads")."thumbs/")) !== false)
+          { $thumb["thumb_file"] = $env->path("uploads")."thumbs/".$thumb["thumb_file"];
+            $margin_top = floor((110 - $thumb["thumb_height"]) / 2);
+          }
+          else
+          { $thumb = array
+            ( "thumb_file" => $img_src,
+              "thumb_width" => 94,
+              "thumb_height" => 100
+            );
+            $margin_top = 5;
+          }
+
+        ?>
+        <span class="image">
+          <img src="<?= $thumb["thumb_file"] ?>"
+               width="<?= $thumb["thumb_width"] ?>"
+               height="<?= $thumb["thumb_height"] ?>"
+               style="margin-top:<?= $margin_top ?>px" alt="" />
+        </span>
+        <?php endif; ?>
+        <span class="nom"><?= $artiste["nom"] ?></span>
+        <span class="style"><?= $artiste["style"] ?></span>
+      </a>
+    </li>
+  <?php endforeach; ?>
+  </ul>
+  <div class="clear"><!-- --></div>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/contact.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/contact.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/contact.php	(revision 1)
@@ -0,0 +1,37 @@
+<?php if($env->out["artiste"]["contact_form"] && $env->out["artiste"]["email_contact"]) : ?>
+<h3>Message pour <?= $env->out["artiste"]["nom"] ?></h3>
+
+<br /><br />
+<form name="contact_form"
+      action="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"], "page" => "contact")) ?>"
+      method="post">
+<table class="admin">
+  <tr>
+    <th>Votre&nbsp;email</th>
+    <td><input type="text" name="from" size="30" value="<?= $_POST["from"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>Sujet</th>
+    <td><input type="text" name="sujet" size="30" value="<?= $_POST["sujet"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>Message</th>
+    <td><textarea name="message" cols="45" rows="15"><?= $_POST["message"] ?></textarea></td>
+  </tr>
+  <tr>
+    <th>Anti-spam</th>
+    <td>
+      <p class="info">
+        <?=PtitCaptchaHelper::generateImgTags("./".$env->path("app")."plugins/")?>
+        Recopiez ce que vous voyez sur l'image (cliquez dessus pour la changer)
+      </p>
+      <?=PtitCaptchaHelper::generateHiddenTags()?>
+      <?=PtitCaptchaHelper::generateInputTags()?>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2" style="text-align: right"><input type="submit" value="Envoyer" /></td>
+  </tr>
+</table>
+</form>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/downloads.php	(revision 1)
@@ -0,0 +1,104 @@
+<?php if($env->out["downloads"]) : ?>
+
+<?php if($env->out["album"]) : ?>
+<div class="album">
+<h3>Album : <?= $env->out["album"]["titre"] ?></h3>
+
+
+
+<?php if($env->out["album"]["image"]) : ?>
+<p>
+          <?php
+
+            $img_src = $env->out["album"]["image"];
+            if(($thumb = $env->data->img_thumb($img_src, 150, 150, $env->path("uploads")."thumbs/")) !== false)
+            { $thumb["thumb_file"] = $env->path("uploads")."thumbs/".$thumb["thumb_file"];
+            }
+            else
+            { $thumb = array
+              ( "thumb_file" => $img_src,
+                "thumb_width" => 150,
+                "thumb_height" => 150
+              );
+            }
+
+          ?>
+
+          <img src="<?= $thumb["thumb_file"] ?>"
+               width="<?= $thumb["thumb_width"] ?>"
+               height="<?= $thumb["thumb_height"] ?>"
+               alt="<?= str_replace("\"", "\\\"", $env->out["album"]["titre"]) ?>" />
+
+
+</p>
+<?php endif; ?>
+<p id="album_date"><?= $env->out["album"]["date_creation"] ?></p>
+<div class="dleft">
+<?php if($env->out["album"]["url"]) : ?>
+  <a href="<?= $env->url(array("e" => "downalbum", "album" => $env->out["album"]["id"])) ?>" title="T&eacute;l&eacute;charger l'album">
+    <img src="<?= $env->out_file("icons/download.png") ?>" alt="T&eacute;l&eacute;charger l'album" />
+  </a>
+<?php endif; ?>
+  <a href="<?=
+    $env->url
+    ( array
+      ( "e" => "artiste_downloads",
+        "artiste" => $_GET[$env->param("artiste")],
+        "album" => $env->out["album"]["id"],
+        "format" => "m3u"
+      ),
+      "backend.php"
+    )
+  ?>" title="Tout &eacute;couter" >
+    <img src="<?= $env->out_file("icons/ecouter.png") ?>" alt="Tout &eacute;couter" />
+  </a>
+</div>
+<div class="dright">
+  <a class="thickbox" href="<?= $env->url(array("e" => "popup_info", "action" => "downloads")) ?>&amp;KeepThis=true&amp;TB_iframe=true&amp;height=500&amp;width=600" title="Ecouter et t&eacute;l&eacute;charger sur RSR">
+    <img src="<?= $env->out_file("icons/aide.png") ?>" alt="Aide sur l'&eacute;coute" />
+  </a>
+</div>
+<div style="clear: both">&nbsp;</div>
+<?= $env->out["album"]["description"] ?>
+</div>
+<?php else : ?>
+<div class="album">
+<h3>Tous les downloads</h3>
+<div class="dleft">
+  <br />
+  <a href="<?=
+    $env->url
+    ( array
+      ( "e" => "artiste_downloads",
+        "artiste" => $_GET[$env->param("artiste")],
+        "format" => "m3u"
+      ),
+      "backend.php"
+    )
+  ?>" title="Tout &eacute;couter" >
+    <img src="<?= $env->out_file("icons/ecouter.png") ?>" alt="Tout &eacute;couter" />
+  </a>
+</div>
+<div class="dright">
+  <br />
+  <a class="thickbox" href="<?= $env->url(array("e" => "popup_info", "action" => "downloads")) ?>&amp;KeepThis=true&amp;TB_iframe=true&amp;height=500&amp;width=600" title="Ecouter et t&eacute;l&eacute;charger sur RSR">
+    <img src="<?= $env->out_file("icons/aide.png") ?>" alt="Aide sur l'&eacute;coute" />
+  </a>
+</div>
+<div style="clear: both">&nbsp;</div>
+</div>
+<?php endif; ?>
+
+<?php require $env->out_file("views/downloads.php"); ?>
+
+<?php else: ?>
+  <br />
+<?php if($_GET[$env->param("album")]) : ?>
+  <p>Aucun download dans cet album pour le moment.</p>
+<?php else : ?>
+  <p>Aucun download pour le moment.</p>
+<?php endif; ?>
+
+<?php endif; ?>
+<br />
+<br />
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/news.php	(revision 1)
@@ -0,0 +1,55 @@
+<?php if($env->out["news"]["list"]) : ?>
+<?php foreach($env->out["news"]["list"] as $id_news => $news) : ?>
+<div class="news">
+<h3><a href="<?=
+         $env->url
+         ( array
+           ( "e" => "artistes",
+             "artiste" => $env->out["artiste"]["id"],
+             "page" => "news",
+             "id" => $id_news
+           )
+         )
+       ?>"><?= $news["titre"]; ?></a></h3>
+<p class="by">Par <?= $news["auteur"]; ?> - <?= $news["date_publication"] ?></p>
+<?= $env->data->html($news["contenu"]); ?>
+</div>
+<br />
+<?php endforeach; ?>
+<div class="navig">
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["news"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " news"
+  );
+
+?>
+</div>
+<?php else : ?>
+<p>Aucune news pour le moment</p>
+<?php endif; ?>
+<?php if(!isset($_GET[$env->param("id")])) : ?>
+<ul class="list">
+  <li>
+    <a href="<?=
+         $env->url
+         ( array
+           ( "e" => "last_artiste_news",
+             "artiste" => $env->out["artiste"]["id"],
+             "format" => "atom"
+           ),
+           "backend.php"
+         )
+       ?>">
+      <img src="<?= $env->out_file("icons/rss.png") ?>" alt="fil atom : news artiste" />
+      fil d'infos de <?= $env->out["artiste"]["nom"] ?>
+    </a>
+  </li>
+</ul>
+<?php endif; ?>
+<div style="clear: both">&nbsp;</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/presentation.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/presentation.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/artistes/presentation.php	(revision 1)
@@ -0,0 +1,57 @@
+    <?php if($env->out["presentation"]) : ?>
+      <?php echo $env->data->html($env->out["presentation"]); ?>
+    <?php endif; ?>
+
+<br /><br />
+
+
+<?php if($env->out["artiste_news"]["total"]) : ?>
+    <div class="bloc">
+      <h2><a href="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"], "page" => "news")) ?>">Les news</a></h2>
+      <div class="bloc_content">
+
+<?php
+
+  foreach($env->out["artiste_news"]["list"] as $id_news => $news) :
+  $date_creation = $env->data->unix_time($news["date_creation"]);
+
+?>
+<div class="message_forum">
+  [ <?= date("H\hi d M Y ", $date_creation) ?> ]
+  <a href="<?=
+       $env->url
+       ( array
+         ( "e" => "artistes",
+           "artiste" => $env->out["artiste"]["id"],
+           "page" => "news",
+           "id" => $id_news
+         )
+       )
+     ?>"><?= $news["titre"] ?></a>
+</div>
+<?php endforeach; ?>
+
+      </div>
+    </div>
+
+<?php endif; ?>
+
+
+
+
+    <?php if($env->out["artiste"]["pun_forum"] && $env->out["artiste_messages_forum"]) : ?>
+    <div class="bloc">
+      <h2><a href="<?php echo PUN_ROOT; ?>viewforum.php?id=<?= $env->out["artiste"]["pun_forum"] ?>">Forum</a> : derniers messages</h2>
+      <div class="bloc_content">
+
+<?php foreach($env->out["artiste_messages_forum"] as $id_message => $message) : ?>
+<div class="message_forum">
+  [ <?= date("H\hi d M Y ", $message["posted"]) ?> ]
+  dans <a href="<?= $env->path("punbb")."viewtopic.php?pid=".$id_message."#p".$id_message ?>"><?= $message["subject"] ?></a>
+</div>
+<?php endforeach; ?>
+
+
+      </div>
+    </div>
+    <?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_accueil.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_accueil.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_accueil.php	(revision 1)
@@ -0,0 +1,51 @@
+  <h2>Accueil</h2>
+  <div class="bloc_content">
+
+          <p id="accueil_intro">
+            L'association &laquo;collectif Revolution Sound Records (RSR)&raquo; est n&eacute;e
+            du d&eacute;sir et de la volont&eacute; d'artistes de rendre la culture libre et accessible
+            &agrave; tous, d&eacute;sireux de permettre au public de d&eacute;couvrir gratuitement et
+            l&eacute;galement les oeuvres d'artistes non standardis&eacute;s. Pour ce faire, RSR a choisi
+            le mouvement du libre et de la libre diffusion. Nous souhaitons faire conna&icirc;tre les artistes
+            libres de tous les horizons dans un esprit d'entraide, d'&eacute;change et de partage.
+          </p>
+          <div id="accueil">
+            <img id="etoile" src="<?= $env->out_file("images/etoile.png") ?>" />
+            <img id="etoile_forum" src="<?= $env->out_file("images/etoile_forum.png") ?>" />
+            <img id="etoile_son" src="<?= $env->out_file("images/etoile_son.png") ?>" />
+            <img id="etoile_news" src="<?= $env->out_file("images/etoile_news.png") ?>" />
+            <img id="etoile_contact" src="<?= $env->out_file("images/etoile_contact.png") ?>" />
+            <img id="etoile_association" src="<?= $env->out_file("images/etoile_association.png") ?>" />
+            <div id="accueil_news" class="accueil_block">
+              <a class="accueil_link" href="<?= $env->url(array("e" => "edito")) ?>">Les news</a>
+              <div class="accueil_info">
+                Edito, spotlight, news du collectif, annonces...
+              </div>
+            </div>
+            <div id="accueil_forum" class="accueil_block">
+              <a class="accueil_link" href="punbb">Le forum</a>
+              <div class="accueil_info">
+                Venez discuter, partager, d&eacute;batre sur le forum.
+              </div>
+            </div>
+            <div id="accueil_son" class="accueil_block">
+              <a class="accueil_link" href="<?= $env->url(array("e" => "artistes")) ?>">Le son</a>
+              <div class="accueil_info">
+                Les artistes RSR. T&eacute;l&eacute;chargements, &eacute;coutes...
+              </div>
+            </div>
+            <div id="accueil_association" class="accueil_block">
+              <a class="accueil_link" href="<?= $env->url(array("e" => "page", "id" => 154)) ?>">L'association</a>
+              <div class="accueil_info">
+                Notre association. La charte, les statuts...
+              </div>
+            </div>
+            <div id="accueil_contact" class="accueil_block">
+              <a class="accueil_link" href="<?= $env->url(array("e" => "contact")) ?>">Contactez-nous</a>
+              <div class="accueil_info">
+                Envoyez un message &agrave; Revolution Sound Records.
+              </div>
+            </div>
+          </div>
+
+  </div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_admin_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_admin_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_admin_artiste.php	(revision 1)
@@ -0,0 +1,15 @@
+<h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+
+<?php require $env->out_file("views/artiste_onglets.php") ?>
+
+<?php if($env->out["edit_ok"]) : ?>
+
+<div id="fiche_artiste">
+  <div id="fiche_artiste_content">
+
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+
+  </div>
+</div>
+
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_artistes.php	(revision 1)
@@ -0,0 +1,45 @@
+<div class="bloc">
+
+<?php
+
+  # --------------------------------------------------------------------------------------
+  # si un identifiant d'artiste est prÃ©cisÃ©, on affiche la fiche artiste
+  if(isset($_GET[$env->param("artiste")])) :
+
+?>
+
+  <h2><?= $env->out["artiste"]["nom"] ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <div id="artiste_left">
+
+<?php require $env->out_file("views/artiste_colonne.php"); ?>
+
+    </div>
+    <div id="artiste_right">
+
+<?php
+
+  if($env->page === "presentation") require $env->out_file("content/artistes/presentation.php");
+  elseif($env->page === "news") require $env->out_file("content/artistes/news.php");
+  elseif($env->page === "downloads") require $env->out_file("content/artistes/downloads.php");
+  elseif($env->page === "contact") require $env->out_file("content/artistes/contact.php");
+
+?>
+    </div>
+
+    <div class="clear"><!-- --></div>
+  </div>
+
+<?php
+
+  # --------------------------------------------------------------------------------------
+  # si aucun identifiant d'artiste n'est prÃ©cisÃ©, on affiche la liste des artistes
+  else : require $env->out_file("content/artistes/artistes.php");
+  endif;
+
+?>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_carte.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_carte.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_carte.php	(revision 1)
@@ -0,0 +1,40 @@
+<div class="bloc">
+<h2>La carte des tourneurs du libre</h2>
+  <div class="bloc_content">
+<?php if($env->out["VIEW_MAP"]) : ?>
+<br />
+<center>
+<div id="map_canvas" style="width: 768px; height: 640px;"></div>
+</center>
+<br />
+<script type="text/javascript">
+  var user_id = <?= $env->pun_user["id"] ?>;
+  var emplacement_types = {};
+  var EDIT_ON = <?= $env->out["EDIT_ON"] ? "true" : "false"; ?>;
+  var site_root = "<?= $env->path("web") ?>";
+<?php $DEFAULT_EMPLACEMENT_TYPE_SET = false; foreach($env->out["emplacement_types"] as $id_et => $values) : ?>
+<?php if(!$DEFAULT_EMPLACEMENT_TYPE_SET) : ?>
+  default_emplacement_type = <?= $id_et ?>;
+<?php $DEFAULT_EMPLACEMENT_TYPE_SET = true; endif; ?>
+  emplacement_types["" + <?= $id_et; ?>] = {};
+  emplacement_types["" + <?= $id_et; ?>]["intitule"] = "<?= $values["intitule"]; ?>";
+  emplacement_types["" + <?= $id_et; ?>]["icone"] = "<?= $values["icone"] ? $values["icone"] : "null"; ?>";
+<?php endforeach; ?>
+<?php if($env->out["EDIT_MAP"] && $env->out["EDIT_ON"]) : ?>
+  enable_save_map_button(false);
+  tmce_init();
+<?php endif; ?>
+  load_map();
+</script>
+
+<?php else: ?>
+
+<h3>Vous devez &ecirc;tre identifi&eacute;s pour voir la carte</h3>
+<p>
+Si vous n'&ecirc;tes pas inscrits, vous pouvez 
+<a href="<?= $env->path("punbb")."register.php?from=".urlencode($_SERVER["REQUEST_URI"]) ?>">cr&eacute;er un compte</a>.
+</p>
+
+<?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_contact.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_contact.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_contact.php	(revision 1)
@@ -0,0 +1,38 @@
+<?php if($env->config("email_contact")) : ?>
+<h2>Message pour <?= $env->config("site_name") ?></h2>
+<div class="bloc_content">
+<br /><br />
+<form name="contact_form" action="<?= $env->url(array("e" => "contact")) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>Votre email</th>
+    <td><input type="text" name="from" size="50" value="<?= $_POST["from"] ?>" /><br /><br /></td>
+  </tr>
+  <tr>
+    <th>Sujet</th>
+    <td><input type="text" name="sujet" size="50" value="<?= $_POST["sujet"] ?>" /><br /><br /></td>
+  </tr>
+  <tr>
+    <th>Message</th>
+    <td><textarea name="message" cols="70" rows="15"><?= $_POST["message"] ?></textarea></td>
+  </tr>
+  <tr>
+  </tr>
+  <tr>
+    <th>Anti-spam</th>
+    <td>
+      <p class="info">
+        <?=PtitCaptchaHelper::generateImgTags("./".$env->path("app")."plugins/")?>
+        Recopiez ce que vous voyez sur l'image (cliquez dessus pour la changer)
+      </p>
+      <?=PtitCaptchaHelper::generateHiddenTags()?>
+      <?=PtitCaptchaHelper::generateInputTags()?>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2" style="text-align: right"><input type="submit" value="Envoyer" /></td>
+  </tr>
+</table>
+</form>
+</div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_content.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_content.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_content.php	(revision 1)
@@ -0,0 +1,13 @@
+<?php if($env->out["content"]) : ?>
+
+<h2><?= $env->out["content"]["titre"] ?></h2>
+<div class="bloc_content">
+<p class="by">
+  par <?= $env->out["content"]["auteur"] ?> - <?= $env->out["content"]["date_creation"] ?>
+</p>
+<?= $env->data->html($env->out["content"]["contenu"]) ?>
+<div class="clear"><!-- --></div>
+</div>
+<?php else : ?>
+<p>Pas de contenu pour cette adresse</p>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_erreur.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_erreur.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_erreur.php	(revision 1)
@@ -0,0 +1,6 @@
+<h2>Erreur</h2>
+<div class="erreur">
+  <div>
+    <?= $env->erreur ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_forum.php	(revision 1)
@@ -0,0 +1,1 @@
+<?= $env->out["forum"]["body"] ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_links.php	(revision 1)
@@ -0,0 +1,18 @@
+<?php debug($env->out); ?>
+<h2>Les liens</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_links.php"); ?>
+  </h3>
+
+  <br />
+<?php if($env->out["links_categories"]["list"]) : ?>
+
+<?php foreach($env->out["links_categories"]["list"] as $id_links_categorie => $links_categorie) : ?>
+<h4><a href="<?= $env->url(array("e" => "links", "path" => $_GET[$env->param("path")]."/".$links_categorie["id"])) ?>"><?= $links_categorie["titre"] ?></a></h4>
+
+<?php endforeach; ?>
+<?php else : ?>
+  <p>Aucun lien dans cette cat&eacute;gorie.</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_login.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_login.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_login.php	(revision 1)
@@ -0,0 +1,4 @@
+<h2>Identification</h2>
+<div class="bloc_content">
+<p>Vous devez &ecirc;tre identifi&eacute; pour acc&eacute;der &agrave; cette page.</p>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_news.php	(revision 1)
@@ -0,0 +1,75 @@
+<div class="bloc">
+<h2>News</h2>
+  <div class="bloc_content">
+<?php if($env->out["news"]["list"] || $_GET[$env->param("categorie")]) : ?>
+
+<?php if($env->out["categories"]["list"]) : ?>
+  <div class="filtre">
+    Afficher les news pour la cat&eacute;gorie :
+    <select onchange="document.location=this.options[this.selectedIndex].value;">
+      <option value="<?= $env->url(array("e" => "news")) ?>">Toutes les cat&eacute;gories</option>
+      <option value="<?= $env->url(array("e" => "news", "categorie" => "")) ?>"
+              <?= isset($_GET[$env->param("categorie")]) && strlen($_GET[$env->param("categorie")]) == 0 ?
+                    "selected" : "" ?>>Sans cat&eacute;gorie</option>
+<?php foreach($env->out["categories"]["list"] as $id_categorie => $categorie) : ?>
+      <option value="<?= $env->url(array("e" => "news", "categorie" => $id_categorie)) ?>"
+              <?= $_GET[$env->param("categorie")] == $id_categorie ? "selected" : "" ?>>
+        <?= $categorie["titre"] ?>
+      </option>
+<?php endforeach; ?>
+    </select>
+  </div>
+<?php endif; ?>
+
+<?php endif; ?>
+
+<?php if($env->out["news"]["list"]) : ?>
+
+<?php foreach($env->out["news"]["list"] as $id_news => $news) : ?>
+<div class="news">
+  <div class="news_categorie">
+<?php if($news["categorie_icone"] || $news["categorie_titre"]) : ?>
+    <a href="<?= $env->url(array("e" => "accueil", "categorie" => $news["categorie"])) ?>">
+<?php if($news["categorie_icone"]) : ?>
+      <img src="<?= $news["categorie_icone"] ?>" alt="<?= $news["categorie_titre"] ?>" />
+<?php else : ?>
+      <?= $news["categorie_titre"] ?>
+<?php endif; ?>
+    </a>
+<?php else : ?>
+    &nbsp;
+<?php endif; ?>
+
+  </div>
+  <div class="news_main">
+    <h3><a href="<?= $env->url(array("e" => "content", "id" => $id_news)) ?>"><?= $news["titre"] ?></a></h3>
+    <p class="by">Par <?= $news["auteur"] ?> - <?= $news["date_publication"] ?></p>
+    <div class="news_contenu">
+    <?= $env->data->html($news["contenu"]) ?>
+    </div>
+  </div>
+  <div class="clear"><!-- --></div>
+</div>
+<?php endforeach; ?>
+
+<div class="navig">
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["news"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " news"
+  );
+
+?>
+</div>
+<?php else : ?>
+<?php if($_GET[$env->param("categorie")]) : ?>
+  <p>Aucune news dans cette cat&eacute;gorie</p>
+<?php endif; ?>
+<?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_page.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_page.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_page.php	(revision 1)
@@ -0,0 +1,21 @@
+<?php if($env->out["page"]) : ?>
+
+<?php
+
+  $page_content = "";
+  if($env->out["page"]["nom"])
+  { ob_start();
+    require $env->out_file("pages/".$env->out["page"]["nom"]);
+    $page_content = ob_get_contents();
+    ob_end_clean();
+  }
+  else $page_content = $env->out["page"]["contenu"];
+  if($page_content) :
+
+?>
+
+<h2><?= $env->out["page"]["titre"] ?></h2>
+<div class="bloc_content">
+<?= $env->data->html($page_content) ?>
+</div>
+<?php endif; endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_playlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_playlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_playlist.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/playlist/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/playlist/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.bak.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.bak.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.bak.php	(revision 1)
@@ -0,0 +1,77 @@
+
+  <h2>Rechercher</h2>
+<div class="bloc_content">
+  <br />
+  <form id="search" name="search_form" action="<?= $env->url(array("e" => "rechercher")) ?>" method="post">
+    <input type="text" name="match" value="<?= $_POST["match"]?>" />
+    <input type="submit" value="Rechercher" />
+  </form>
+
+<?php if($env->out["results"]) : ?>
+<div id="search_results">
+<p>R&eacute;sultats pour <strong><?= $env->out["results"]["match"] ?></strong> :</p>
+<?php if($env->out["results"]["has_results"]) : ?>
+<?php if($env->out["results"]["artistes"]) : ?>
+<h2>artistes</h2>
+
+<?php foreach($env->out["results"]["artistes"] as $id => $artiste) : ?>
+  <div class="artiste_list_link">
+    <a href="<?= $env->url(array("e" => "artistes", "artiste" => $id)) ?>">
+      <img src="<?php echo $artiste["image"]; ?>" style="float: left; width: 60px; margin: 0px 10px 10px 0px; border: none;">
+    </a>
+    <a href="<?= $env->url(array("e" => "artistes", "artiste" => $id)) ?>"><?= $artiste["nom"] ?></a><br>
+    <?= $artiste["style"] ?>
+    <div style="clear: both">&nbsp;</div>
+  </div>
+<?php endforeach; ?>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
+<?php if($env->out["results"]["downloads"]) : ?>
+<h2>downloads</h2>
+
+<?php foreach($env->out["results"]["downloads"] as $id_download => $download) : ?>
+
+<div class="download">
+
+<h3>
+  <?php echo $download["nom"]; ?>
+ (<a href="<?= $env->url(array("e" => "artistes", "artiste" => $download["id_artiste"])) ?>"><?= $download["auteur"] ?></a>)
+</h3>
+<div class="dleft">
+<?php echo $download["style"]; ?><br/>
+<table>
+  <tr>
+    <td>playlist :</td>
+    <td>
+<?php foreach($download["urls"] as $id_url => $url) : ?>
+<a href="<?= $env->url(array("e" => "m3u", "download" => $id_url), "download.php") ?>"><?= $url["format"]; ?></a>
+<?php endforeach; ?>
+    </td>
+  </tr>
+  <tr>
+    <td>download :</td>
+    <td>
+<?php foreach($download["urls"] as $id_url => $url) : ?>
+<a href="<?= $env->url(array("e" => "down", "download" => $id_url), "download.php") ?>"><?= $url["format"]; ?></a>
+<?php endforeach; ?>
+    </td>
+  </tr>
+</table>
+</div>
+<div class="dright">
+<?php echo $download["date_creation"]; ?><br/>
+<a href="<?php echo $download["licence_url"]; ?>"><?php echo $download["licence"]; ?></a>
+</div>
+<div style="clear: both">&nbsp;</div>
+</div>
+
+<?php endforeach; ?>
+<div style="clear: both">&nbsp;</div>
+
+<?php endif; ?>
+<?php else : ?>
+<p>Aucun r&eacute;sultat pour cette recherche</p>
+<?php endif; ?>
+</div>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_rechercher.php	(revision 1)
@@ -0,0 +1,41 @@
+
+  <h2>Rechercher</h2>
+<div class="bloc_content">
+  <br />
+  <form id="search" name="search_form" action="<?= $env->url(array("e" => "rechercher")) ?>" method="post">
+    <input type="text" name="match" value="<?= $_POST["match"]?>" />
+    <input type="submit" value="Rechercher" />
+  </form>
+
+<?php if($env->out["results"]) : ?>
+<div id="search_results">
+<p>R&eacute;sultats pour <strong><?= $env->out["results"]["match"] ?></strong> :</p>
+<?php if($env->out["results"]["has_results"]) : ?>
+<?php if($env->out["results"]["artistes"]) : ?>
+<h2>artistes</h2>
+<br/>
+
+<?php foreach($env->out["results"]["artistes"] as $id => $artiste) : ?>
+  <div class="artiste_list_link">
+    <a href="<?= $env->url(array("e" => "artistes", "artiste" => $id)) ?>">
+      <img src="<?php echo $artiste["image"]; ?>" style="float: left; width: 60px; margin: 0px 10px 10px 0px; border: none;">
+    </a>
+    <a href="<?= $env->url(array("e" => "artistes", "artiste" => $id)) ?>"><?= $artiste["nom"] ?></a><br>
+    <?= $artiste["style"] ?>
+    <div style="clear: both">&nbsp;</div>
+  </div>
+<?php endforeach; ?>
+<div class="clear"><!-- --></div>
+<?php endif; ?>
+<?php if($env->out["results"]["downloads"]) : $env->out["downloads"] = &$env->out["results"]["downloads"]; ?>
+<h2>downloads</h2>
+
+<?php require $env->out_file("views/downloads.php"); ?>
+
+<?php endif; ?>
+<?php else : ?>
+<p>Aucun r&eacute;sultat pour cette recherche</p>
+<?php endif; ?>
+</div>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_redirect.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_redirect.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_redirect.php	(revision 1)
@@ -0,0 +1,16 @@
+<div class="redirect_message">
+  <div>
+<?= $env->out["redirect"]["message"] ?>
+    <br><br><br>
+    ---------------------------------------------------<br>
+    Vous allez &ecirc;tre redirig&eacute; vers <a href="<?= $env->out["redirect"]["url"] ?>"><?= $env->out["redirect"]["url"] ?></a>
+    dans <?= $env->out["redirect"]["wait"] ?> secondes.<br>
+    (cliquez sur le lien si la redirection ne se fait pas)
+  </div>
+</div>
+<script type="text/javascript">
+
+  setTimeout("js_redirect('<?= $env->out["redirect"]["url"] ?>')", 1000 * <?= $env->out["redirect"]["wait"] ?>);
+  function js_redirect(redirect_url) { document.location = redirect_url; }
+
+</script>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_albums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_albums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_albums.php	(revision 1)
@@ -0,0 +1,26 @@
+<div class="bloc">
+  <h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <?php if($env->out["edit_ok"]) : ?>
+
+    <div id="artiste_left">
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+    </div>
+    <div id="artiste_right">
+
+<?php
+
+  if($env->out_file_exists("content/set_artiste_albums/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_artiste_albums/".$env->prefix.$env->a.".php");
+  }
+
+?>
+    </div>
+    <div class="clear"><!-- --></div>
+
+    <?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_downloads.php	(revision 1)
@@ -0,0 +1,26 @@
+<div class="bloc">
+  <h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <?php if($env->out["edit_ok"]) : ?>
+
+    <div id="artiste_left">
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+    </div>
+    <div id="artiste_right">
+
+<?php
+
+  if($env->out_file_exists("content/set_artiste_downloads/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_artiste_downloads/".$env->prefix.$env->a.".php");
+  }
+
+?>
+    </div>
+    <div class="clear"><!-- --></div>
+
+    <?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_infos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_infos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_infos.php	(revision 1)
@@ -0,0 +1,120 @@
+<div class="bloc">
+  <h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <?php if($env->out["edit_ok"]) : ?>
+
+    <div id="artiste_left">
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+    </div>
+    <div id="artiste_right">
+
+    <form name="infos"
+          action="<?= $env->url(array("e" => "set_artiste_infos", "artiste" => $env->out["artiste"]["id"])) ?>"
+          method="post"
+          enctype="multipart/form-data">
+      <h3>Informations g&eacute;n&eacute;rales</h3>
+      <br />
+      <table class="admin">
+        <tr>
+          <th>Nom</th>
+          <td><input type="text" name="nom" value="<?= $env->out["artiste"]["nom"] ?>" size="40"/></td>
+        </tr>
+
+
+        <tr>
+         <th><br />image</th>
+          <td>
+            <br />
+<?php if($env->out["artiste"]["image"]) : ?>
+            <input type="checkbox" name="del_image" /> effacer l'image
+<?php else : ?>
+            aucune image pour le moment
+<?php endif; ?>
+            <br />
+            <input type="file" name="image" style="width: 400px">
+            <br />
+          </td>
+        </tr>
+
+        <tr>
+          <th>Style</th>
+          <td><input type="text" name="style" value="<?= $env->out["artiste"]["style"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>Localisation</th>
+          <td><input type="text" name="pays" value="<?= $env->out["artiste"]["pays"] ?>" size="40"/></td>
+        </tr>
+      </table>
+      <br />
+      <h3>Contact et liens</h3>
+      <br />
+      <table class="admin">
+        <tr>
+          <th>Email contact</th>
+          <td>
+            <input type="text" name="email_contact" value="<?= $env->out["artiste"]["email_contact"] ?>" size="40"/><br />
+            <input type="checkbox" name="hide_email" <?= $env->out["artiste"]["hide_email"] ? "checked " : "" ?>/>
+            ne pas montrer l'adresse email<br />
+            <input type="checkbox" name="contact_form" <?= $env->out["artiste"]["contact_form"] ? "checked " : "" ?>/>
+            autoriser le formulaire de contact
+          </td>
+        </tr>
+        <tr>
+          <th>Site web</th>
+          <td><input type="text" name="site" value="<?= $env->out["artiste"]["site"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>Lien Facebook</th>
+          <td><input type="text" name="lien_facebook" value="<?= $env->out["artiste"]["lien_facebook"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>Lien Flickr</th>
+          <td><input type="text" name="lien_flickr" value="<?= $env->out["artiste"]["lien_flickr"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>Lien Twitter</th>
+          <td><input type="text" name="lien_twitter" value="<?= $env->out["artiste"]["lien_twitter"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>Lien Blip.Tv</th>
+          <td><input type="text" name="lien_youtube" value="<?= $env->out["artiste"]["lien_youtube"] ?>" size="40"/></td>
+        </tr>
+      </table>
+      <br />
+      <h3>Don Paypal et boutique en ligne</h3>
+      <table class="admin">
+        <tr>
+          <th>Identifiant de compte Paypal</th>
+          <td>
+            <p>Si vous avez un compte Paypal, indiquez ici votre identifiant de compte marchand s&eacute;curis&eacute; pour activer le bouton de dons.</p>
+            <input type="text" name="identifiant_paypal" value="<?= $env->out["artiste"]["identifiant_paypal"] ?>" size="40"/>
+          </td>
+        </tr>
+        <tr>
+          <th>Boutique en ligne</th>
+          <td>
+            <p>Si vous faites de la vente en ligne, indiquez ici un lien vers votre boutique.</p>
+            <input type="text" name="lien_boutique" value="<?= $env->out["artiste"]["lien_boutique"] ?>" size="40"/>
+          </td>
+        </tr>
+      </table>
+
+      <br />
+      <table class="admin">
+        <tr>
+          <td colspan="2" align="right"><input type="submit" value="Enregistrer" /></td>
+        </tr>
+      </table>
+
+
+
+    </form>
+    </div>
+    <div class="clear"><!-- --></div>
+
+    <?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_news.php	(revision 1)
@@ -0,0 +1,26 @@
+<div class="bloc">
+  <h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <?php if($env->out["edit_ok"]) : ?>
+
+    <div id="artiste_left">
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+    </div>
+    <div id="artiste_right">
+
+<?php
+
+  if($env->out_file_exists("content/set_artiste_news/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_artiste_news/".$env->prefix.$env->a.".php");
+  }
+
+?>
+    </div>
+    <div class="clear"><!-- --></div>
+
+    <?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_presentation.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_presentation.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artiste_presentation.php	(revision 1)
@@ -0,0 +1,51 @@
+<div class="bloc">
+  <h2><?php echo $env->out["artiste"]["nom"]; ?></h2>
+  <div class="bloc_content">
+
+    <?php require $env->out_file("views/artiste_onglets.php") ?>
+
+    <?php if($env->out["edit_ok"]) : ?>
+
+    <div id="artiste_left">
+<?php require $env->out_file("views/menu_admin_artiste.php") ?>
+    </div>
+    <div id="artiste_right">
+<h3>Pr&eacute;sentation</h3>
+<form name="edito_form"
+      action="<?= $env->url(array("e" => "set_artiste_presentation", "artiste" => $_GET[$env->param("artiste")])) ?>"
+      method="post">
+<table>
+  <tr>
+    <td>
+      <textarea name="presentation" id="presentation" style="width: 490px; height: 500px;"><?= $env->out["presentation"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "presentation",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+    </div>
+    <div class="clear"><!-- --></div>
+
+    <?php endif; ?>
+  </div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_artistes.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_artistes/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_artistes/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_boxes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_boxes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_boxes.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_boxes/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_boxes/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_config.php	(revision 1)
@@ -0,0 +1,29 @@
+<h2>Configuration g&eacute;n&eacute;rale</h2>
+<div class="bloc_content">
+<form name="news_form" action="<?= $env->url(array("e" => "set_config")) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>Nom du site</th>
+    <td><input type="text" name="site_name" style="width: 500px" value="<?= $env->out["config"]["site_name"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>Email contact</th>
+    <td><input type="text" name="email_contact" style="width: 500px" value="<?= $env->out["config"]["email_contact"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>Dossier des fichiers d'affichage</th>
+    <td><input type="text" name="out" style="width: 500px" value="<?= $env->out["config"]["out"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>Maximum des listes</th>
+    <td><input type="text" name="max_list"
+               style="width: 500px" value="<?= $env->out["config"]["max_list"] ?>" /></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_dons_achats.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_dons_achats.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_dons_achats.php	(revision 1)
@@ -0,0 +1,22 @@
+<h2>Dons et achats</h2>
+<div class="bloc_content">
+<form name="news_form" action="<?= $env->url(array("e" => "set_dons_achats")) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>Identifiant Paypal</th>
+    <td>
+      <input type="text" name="identifiant_paypal" style="width: 500px" value="<?= $env->out["config"]["identifiant_paypal"] ?>" />
+    </td>
+  </tr>
+  <tr>
+    <th>URL boutique en ligne</th>
+    <td><input type="text" name="lien_boutique" style="width: 500px" value="<?= $env->out["config"]["lien_boutique"] ?>" /></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_editos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_editos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_editos.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_editos/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_editos/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_links.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_links/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_links/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_map.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_map.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_map.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_map/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_map/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_menus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_menus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_menus.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_menus/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_menus/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_news/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_news/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news_categories.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news_categories.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_news_categories.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_news_categories/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_news_categories/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_pages.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_pages.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_pages.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_pages/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_pages/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_spotlights.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_spotlights.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_set_spotlights.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  if($env->out_file_exists("content/set_spotlights/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/set_spotlights/".$env->prefix.$env->a.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/e_spotlight.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/e_spotlight.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/e_spotlight.php	(revision 1)
@@ -0,0 +1,8 @@
+<div class="bloc">
+
+  <h2>Spotlight - <?= $env->out["spotlight"]["titre"] ?></h2>
+  <div class="bloc_content">
+   <?= $env->out["spotlight"]["contenu"] ?>
+  </div>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_downloads.php	(revision 1)
@@ -0,0 +1,25 @@
+<h3 class="first">Ecoute et t&eacute;l&eacute;chargement</h3>
+<p>
+  Chaque artiste propose sur ce site des fichiers au format <strong>flac</strong>, <strong>ogg</strong>,
+  <strong>wav</strong> ou <strong>mp3</strong>. Mais vous trouverez aussi des archives <strong>tar</strong>, <strong>rar</strong>, <strong>zip</strong>...
+</p>
+<p>
+  Chacun de ses fichiers sont t&eacute;l&eacute;chargeables, parfois dans plusieurs formats. Par exemple pour
+  un morceau propos&eacute; en <strong>ogg</strong> et en <strong>mp3</strong> :
+</p>
+<p><img src="<?= $env->out_file("images/player_off.png") ?>" ></p>
+<p>
+  Les diff&eacute;rents formats du morceau sont disponibles en t&eacute;l&eacute;chargement sous le titre, en face de
+  <strong>t&eacute;l&eacute;charger</strong>.
+</p>
+<p>
+  Le navigateur utilis&eacute; dans cet exemple prend en charge le format <strong>ogg</strong>, donc un petit player
+  est aussi disponible, &agrave; gauche du titre, pour &eacute;couter le morceau directement sur le site.
+</p>
+<p><img src="<?= $env->out_file("images/player_on.png") ?>" ></p>
+<p>
+  Les formats audio pris en charge d&eacute;pendent de votre navigateur. Certains navigateurs pourront lire
+  le <strong>ogg</strong>, d'autres le <strong>mp3</strong>, d'autres les deux. Si aucun format
+  n'est pris en charge, les fichiers seront toujours t&eacute;l&eacute;chargeables, mais le
+  player n'appara&icirc;tra pas.
+</p>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_artiste.php	(revision 1)
@@ -0,0 +1,3 @@
+<h3>Soutenir un artiste</h3>
+
+<p>modifier le fichier <strong>out/dist/content/infos/e_soutenir_artiste.php</strong> pour changer ce texte</p>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_site.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_site.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/infos/e_soutenir_site.php	(revision 1)
@@ -0,0 +1,3 @@
+<h3>Si vous souhaitez soutenir notre action</h3>
+
+<p>modifier le fichier <strong>out/dist/content/infos/e_soutenir.php</strong> pour changer ce texte</p>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_last_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_last_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_last_downloads.php	(revision 1)
@@ -0,0 +1,15 @@
+<h2>Les 10 derniers morceaux</h2>
+<div class="bloc_content">
+
+<?php if($env->out["downloads"]) : ?>
+
+
+<?php require $env->out_file("views/downloads.php"); ?>
+
+
+<?php else: ?>
+
+  <p>Aucun download pour le moment.</p>
+
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_rand_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_rand_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/playlist/e_rand_downloads.php	(revision 1)
@@ -0,0 +1,15 @@
+<h2>10 morceaux au hasard</h2>
+<div class="bloc_content">
+
+<?php if($env->out["downloads"]) : ?>
+
+
+<?php require $env->out_file("views/downloads.php"); ?>
+
+
+<?php else: ?>
+
+  <p>Aucun download pour le moment.</p>
+
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_add_album.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_add_album.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_add_album.php	(revision 1)
@@ -0,0 +1,90 @@
+<h3>Nouvel album</h3>
+
+<form name="album_form"
+      action="<?= $env->url(array("e" => "set_artiste_albums", "artiste" => $_GET[$env->param("artiste")], "action" => "add_album")) ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" value="<?= $env->out["album"]["titre"] ?>" size="40" /></td>
+  </tr>
+  <tr>
+    <th>image</th>
+    <td><input type="file" name="image" /></td>
+  </tr>
+  <tr>
+    <th style="vertical-align: bottom">date de cr&eacute;ation</th>
+    <td>
+      <br />
+<?php
+
+  $date_creation =
+  ( $env->out["album"]["date_creation"] ?
+      explode("-", $env->out["album"]["date_creation"])
+    : array(0 => date("Y"), 1 => date("m"), 2 => date("d"))
+  );
+
+?>
+      jour
+      <select name="jour_date_creation">
+<?php for($j = 1; $j <=31; $j++) : ?>
+        <option value="<?= $j ?>"<?= $date_creation[2] == $j ? " selected" : ""?>><?= $j ?></option>
+<?php endfor; ?>
+      </select>
+      mois
+      <select name="mois_date_creation">
+<?php for($m = 1; $m <=12; $m++) : ?>
+       <option value="<?= $m ?>"<?= $date_creation[1] == $m ? " selected" : ""?>><?= $m ?></option>
+<?php endfor; ?>
+      </select>
+      ann&eacute;e
+      <input type="text" size="4" name="annee_date_creation" value="<?= $date_creation[0] ?>">
+    </td>
+  </tr>
+  <tr>
+    <th style="vertical-align: middle">archive</th>
+    <td>
+      <br />
+      <p class="info">Vous pouvez pr&eacute;ciser une archive pour t&eacute;l&eacute;charger l'album en entier :</p>
+      url
+      <input type="text" name="url" value="<?= $env->out["album"]["url"] ?>" size="30">
+      format
+      <select name="format">
+<?php foreach($env->out["formats"] as $id => $values) : ?>
+        <option value="<?= $id ?>"<?= $url["id_format"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+</table>
+<table>
+  <tr><th style="text-align: left">description</th></tr>
+  <tr>
+    <td>
+      <textarea name="description" id="description" style="width: 490px; height: 400px;"><?= $env->out["album"]["description"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "description",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer l'album" /></td>
+  </tr>
+</table>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_albums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_albums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_albums.php	(revision 1)
@@ -0,0 +1,54 @@
+<h3>Les albums</h3>
+<ul>
+  <li><a href="<?= $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"], "action" => "add_album")) ?>">Nouvel album</a></li>
+</ul>
+
+<?php if($env->out["albums"]) : ?>
+
+<form name="albums"
+      action="<?= $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"], "action" => "set_albums")) ?>"
+      method="post">
+  <table class="admin">
+    <tr>
+      <th>titre</th>
+      <th>montrer</th>
+      <th>compteur</th>
+      <th>ordre</th>
+      <th colspan="2">actions</th>
+    </tr>
+<?php $compteur = 0; foreach($env->out["albums"] as $id => $album) : ?>
+    <tr class="hl">
+      <td><?= $album["titre"]?></td>
+      <td><input type="checkbox" name="actif_<?= $id ?>" <?= $album["actif"] ? "checked " : "" ?>/></td>
+      <td><?= $album["compteur"] ?></td>
+      <td><input type="text" size="4" name="ordre_<?= $id ?>" value="<?= $album["ordre"] ?>" /></td>
+      <td align="center">
+        <a href="<?= $env->url(array("e" => "set_artiste_albums", "action" => "set_album", "album" => $id, "artiste" => $env->out["artiste"]["id"])) ?>"
+           class="admin_link"
+           title="modifier cet album"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+      </td>
+      <td align="center">
+        <a href="<?= $env->url(array("e" => "set_artiste_albums", "action" => "del_album", "album" => $id, "artiste" => $env->out["artiste"]["id"])) ?>"
+           class="admin_link"
+           title="supprimer cet album"
+           onclick="return confirm('supprimer cet album ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+      </td>
+    </tr>
+<?php $compteur += $album["compteur"]; endforeach; ?>
+    <tr>
+      <th colspan="2" align="right">total</th>
+      <td colspan="3"><?= $compteur ?></td>
+    </tr>
+    <tr>
+      <td colspan="6" align="center"><input type="submit"value="Enregistrer" /></td>
+    </tr>
+  </table>
+</form>
+
+<?php else : ?>
+
+<p>Aucun album pour le moment.</p>
+
+<?php endif; ?>
+
+<div style="clear: both">&nbsp;</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_set_album.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_set_album.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_albums/e_set_album.php	(revision 1)
@@ -0,0 +1,98 @@
+<h3>Modifier un album</h3>
+
+<form name="album_form"
+      action="<?= $env->url(array("e" => "set_artiste_albums", "artiste" => $_GET[$env->param("artiste")], "action" => "set_album", "album" => $_GET[$env->param("album")])) ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" value="<?= $env->out["album"]["titre"] ?>" size="40" /></td>
+  </tr>
+  <tr>
+    <th>image</th>
+    <td>
+      <?php if($env->out["album"]["image"]) : ?>
+      <img src="<?= $env->out["album"]["image"] ?>" width="200" />
+      <br />
+      <input type="checkbox" name="del_image" /> effacer l'image
+      <br />
+      <?php endif; ?>
+      <input type="file" name="image" />
+    </td>
+  </tr>
+  <tr>
+    <th style="vertical-align: bottom">date de cr&eacute;ation</th>
+    <td>
+      <br />
+<?php
+
+  $date_creation =
+  ( $env->out["album"]["date_creation"] ?
+      explode("-", $env->out["album"]["date_creation"])
+    : array(0 => date("Y"), 1 => date("m"), 2 => date("d"))
+  );
+
+?>
+      jour
+      <select name="jour_date_creation">
+<?php for($j = 1; $j <=31; $j++) : ?>
+        <option value="<?= $j ?>"<?= $date_creation[2] == $j ? " selected" : ""?>><?= $j ?></option>
+<?php endfor; ?>
+      </select>
+      mois
+      <select name="mois_date_creation">
+<?php for($m = 1; $m <=12; $m++) : ?>
+       <option value="<?= $m ?>"<?= $date_creation[1] == $m ? " selected" : ""?>><?= $m ?></option>
+<?php endfor; ?>
+      </select>
+      ann&eacute;e
+      <input type="text" size="4" name="annee_date_creation" value="<?= $date_creation[0] ?>">
+    </td>
+  </tr>
+  <tr>
+    <th style="vertical-align: middle">archive</th>
+    <td>
+      <br />
+      <p class="info">Vous pouvez pr&eacute;ciser une archive pour t&eacute;l&eacute;charger l'album en entier :</p>
+      url
+      <input type="text" name="url" value="<?= $env->out["album"]["url"] ?>" size="30">
+      format
+      <select name="format">
+<?php foreach($env->out["formats"] as $id => $values) : ?>
+        <option value="<?= $id ?>"<?= $env->out["album"]["format"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+</table>
+<table>
+  <tr><th style="text-align: left">description</th></tr>
+  <tr>
+    <td>
+      <textarea name="description" id="description" style="width: 490px; height: 400px;"><?= $env->out["album"]["description"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "description",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer l'album" /></td>
+  </tr>
+</table>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_add_download.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_add_download.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_add_download.php	(revision 1)
@@ -0,0 +1,92 @@
+<?php /* --------------------------------- ajouter un download */ ?>
+
+<h3>Ajouter un download</h3>
+<form name="download_ordre"
+      action="<?= $env->url(array("e" => "set_artiste_downloads", "artiste" => $env->out["artiste"]["id"], "action" => "add_download")) ?>"
+      method="post">
+  <input type="hidden" name="action" value="add_download" />
+  <table class="admin">
+        <tr>
+          <th>nom du download</th>
+          <td><input type="text" name="nom" value="<?= isset($_POST["nom"]) ? $_POST["nom"] : "" ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>style</th>
+          <td><input type="text" name="style" value="<?= isset($_POST["style"]) ? $_POST["style"] : "" ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>licence</th>
+          <td>
+            <select name="licence">
+<?php foreach($env->out["licences"] as $id => $values) : ?>
+              <option value="<?= $id ?>"<?= isset($_POST["licence"]) && $_POST["licence"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+            </select><br />
+            <p class="info">Si vous utilisez une licence ouverte qui n'est pas dans la liste,
+            <a href="<?= $env->url(array("e" => "contact")) ?>">contactez-nous</a>.</p>
+          </td>
+        </tr>
+        <tr>
+          <th>date de cr&eacute;ation</th>
+          <td>
+<?php
+
+  $jour_creation = isset($_POST["jour_creation"]) ? $_POST["jour_creation"] : date("j");
+  $mois_creation = isset($_POST["mois_creation"]) ? $_POST["mois_creation"] : date("n");
+  $annee_creation = isset($_POST["annee_creation"]) ? $_POST["annee_creation"] : date("Y");
+
+?>
+            jour
+            <select name="jour_creation">
+<?php for($j = 1; $j <=31; $j++) : ?>
+              <option value="<?= strlen($j) == 1 ? "0".$j : $j ?>"<?= $jour_creation == $j ? " selected" : ""?>>
+                <?= strlen($j) == 1 ? "0".$j : $j ?>
+              </option>
+<?php endfor; ?>
+            </select>
+            mois
+            <select name="mois_creation">
+<?php for($m = 1; $m <=12; $m++) : ?>
+              <option value="<?= strlen($m) == 1 ? "0".$m : $m ?>"<?= $mois_creation == $m ? " selected" : ""?>>
+                <?= strlen($m) == 1 ? "0".$m : $m ?>
+              </option>
+<?php endfor; ?>
+            </select>
+            ann&eacute;e
+            <input type="text" size="4" name="annee_creation" value="<?= $annee_creation ?>">
+          </td>
+        </tr>
+        <tr>
+          <th>Album</th>
+          <td>
+<?php if($env->out["albums"]) : ?>
+            <select name="album">
+              <option value=""<?= $env->out["download"]["id_album"] ? "" : " selected" ?>>Aucun album</option>
+<?php foreach($env->out["albums"] as $id => $album) : ?>
+              <option value="<?= $id ?>"<?= $env->out["download"]["id_album"] == $id ? " selected" : ""?>><?= $album["titre"] ?></option>
+<?php endforeach; ?>
+            </select>
+<?php else : ?>
+            <p class="info">Vous n'avez inscrit aucun album pour le moment</p>
+<?php endif; ?>
+          </td>
+        </tr>
+        <tr>
+          <th>fichier</th>
+          <td>
+            format
+            <select name="format">
+<?php foreach($env->out["formats"] as $id => $values) : ?>
+              <option value="<?= $id ?>"<?= isset($_POST["format"]) && $_POST["format"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+            </select>
+            url
+            <input type="text" name="url" value="<?= isset($_POST["style"]) ? $_POST["style"] : "" ?>" size="30"><br />
+            <p class="info">Vous pourrez, par la suite, ajouter des fichiers dans d'autres formats pour ce download</p>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="2" align="right"><input type="submit" value="Ajouter le download" /></td>
+        </tr>
+  </table>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_download.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_download.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_download.php	(revision 1)
@@ -0,0 +1,175 @@
+    <h3><?= $env->out["download"]["nom"] ?></h3>
+    <br>
+    <a href="<?=
+         $env->url
+         ( array
+           ( "e" => "set_artiste_downloads",
+             "artiste" => $env->out["artiste"]["id"],
+             "action" => "del_download",
+             "download" => $_GET[$env->param("download")]
+           )
+         )
+       ?>"
+       class="admin_link"
+       title="supprimer ce download"
+       onclick="return confirm('supprimer ce download ?\nTous les fichiers associ&eacute;s seront aussi supprim&eacute;s')">
+      <img src="<?= $env->out_file("icons/del.gif") ?>" />
+    </a>
+    <form name="set_download"
+          action="<?=
+           $env->url
+           ( array
+             ( "e" => "set_artiste_downloads",
+               "artiste" => $env->out["artiste"]["id"],
+               "action" => "set_download",
+               "download" => $_GET[$env->param("download")]
+             )
+           )
+          ?>"
+          method="post">
+      <input type="hidden" name="action" value="set_download" />
+      <table class="admin">
+        <tr>
+          <th>nom du download</th>
+          <td><input type="text" name="nom" value="<?= $env->out["download"]["nom"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>style</th>
+          <td><input type="text" name="style" value="<?= $env->out["download"]["style"] ?>" size="40"/></td>
+        </tr>
+        <tr>
+          <th>licence</th>
+          <td>
+            <select name="licence">
+<?php foreach($env->out["licences"] as $id => $values) : ?>
+              <option value="<?= $id ?>"<?= $env->out["download"]["id_licence"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+            </select>
+            <p class="info">Si vous utilisez une licence ouverte qui n'est pas dans la liste,
+            <a href="<?= $env->url(array("e" => "contact")) ?>">contactez-nous</a>.</p>
+          </td>
+        </tr>
+        <tr>
+          <th>date de cr&eacute;ation</th>
+          <td>
+<?php $date_creation = explode("-", $env->out["download"]["date_creation"]); ?>
+            jour
+            <select name="jour_date_creation">
+<?php for($j = 1; $j <=31; $j++) : ?>
+              <option value="<?= $j ?>"<?= $date_creation[2] == $j ? " selected" : ""?>><?= $j ?></option>
+<?php endfor; ?>
+            </select>
+            mois
+            <select name="mois_date_creation">
+<?php for($m = 1; $m <=12; $m++) : ?>
+              <option value="<?= $m ?>"<?= $date_creation[1] == $m ? " selected" : ""?>><?= $m ?></option>
+<?php endfor; ?>
+            </select>
+            ann&eacute;e
+            <input type="text" size="4" name="annee_date_creation" value="<?= $date_creation[0] ?>">
+          </td>
+        </tr>
+        <tr>
+          <th>Album</th>
+          <td>
+<?php if($env->out["albums"]) : ?>
+            <select name="album">
+              <option value=""<?= $env->out["download"]["id_album"] ? "" : " selected" ?>>Aucun album</option>
+<?php foreach($env->out["albums"] as $id => $album) : ?>
+              <option value="<?= $id ?>"<?= $env->out["download"]["id_album"] == $id ? " selected" : ""?>><?= $album["titre"] ?></option>
+<?php endforeach; ?>
+            </select>
+<?php else : ?>
+            <p class="info">Vous n'avez inscrit aucun album pour le moment</p>
+<?php endif; ?>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="2" align="right"><input type="submit" value="Enregistrer" /></td>
+        </tr>
+      </table>
+    </form>
+
+    <h3>fichiers</h3>
+    <?php foreach($env->out["download"]["urls"] as $id_url => $url) : ?>
+    <form name="set_fichier_<?= $id_url ?>"
+          action="<?=
+            $env->url
+            ( array
+              ( "e" => "set_artiste_downloads",
+                "artiste" => $env->out["artiste"]["id"],
+                "action" => "set_download_url",
+                "download" => $_GET[$env->param("download")]
+              )
+            )
+          ?>"
+          method="post">
+      <input type="hidden" name="action" value="set_fichier" />
+      <input type="hidden" name="id_url" value="<?= $id_url ?>" />
+      <table class="admin">
+        <tr>
+          <td>
+            url
+            <input type="text" name="url" value="<?= $url["url"] ?>" size="25">
+            format
+            <select name="format">
+<?php foreach($env->out["formats"] as $id => $values) : ?>
+              <option value="<?= $id ?>"<?= $url["id_format"] == $id ? " selected" : ""?>><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+            </select>
+          </td>
+          <td align="right">
+            <input type="submit" value="Enregistrer" />
+            <a href="<?=
+                 $env->url
+                 ( array
+                   ( "e" => "set_artiste_downloads",
+                     "artiste" => $env->out["artiste"]["id"],
+                     "action" => "del_download_url",
+                     "download" => $_GET[$env->param("download")],
+                     "url" => $id_url
+                   )
+                 )
+               ?>"
+               class="admin_link"
+               title="supprimer ce fichier"
+               onclick="return confirm('supprimer ce fichier ?\nSi c\'est le seul fichier pour ce download, le download sera aussi supprim&eacute;')">
+              <img src="<?= $env->out_file("icons/del.gif") ?>" />
+            </a>
+          </td>
+      </table>
+    </form>
+    <?php endforeach; ?>
+
+    <h3>ajouter un fichier</h3>
+    <form name="add_fichier"
+          action="<?=
+            $env->url
+            ( array
+              ( "e" => "set_artiste_downloads",
+                "artiste" => $env->out["artiste"]["id"],
+                "action" => "add_download_url",
+                "download" => $_GET[$env->param("download")]
+              )
+            )
+          ?>"
+          method="post">
+      <input type="hidden" name="action" value="add_fichier" />
+      <table class="admin">
+        <tr>
+          <td>
+            url
+            <input type="text" name="url" value="" size="25">
+            format
+            <select name="format">
+<?php foreach($env->out["formats"] as $id => $values) : ?>
+              <option value="<?= $id ?>"><?= $values["nom"] ?></option>
+<?php endforeach; ?>
+            </select>
+          </td>
+          <td align="right">
+            <input type="submit" value="Ajouter" />
+          </td>
+      </table>
+    </form>
+    <div style="clear: both">&nbsp;</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_downloads/e_downloads.php	(revision 1)
@@ -0,0 +1,54 @@
+<h3>Les downloads</h3>
+<ul>
+  <li><a href="<?= $env->url(array("e" => "set_artiste_downloads", "artiste" => $env->out["artiste"]["id"], "action" => "add_download")) ?>">Nouveau download</a></li>
+</ul>
+
+<?php if($env->out["downloads"]) : ?>
+
+<form name="downloads"
+      action="<?= $env->url(array("e" => "set_artiste_downloads", "artiste" => $env->out["artiste"]["id"], "action" => "set_downloads")) ?>"
+      method="post">
+  <table class="admin">
+    <tr>
+      <th>titre</th>
+      <th>ordre</th>
+      <th>montrer</th>
+      <th>compteur</th>
+      <th colspan="2">actions</th>
+    </tr>
+<?php $compteur = 0; foreach($env->out["downloads"] as $id => $values) : ?>
+    <tr class="hl">
+      <td><?= $values["nom"]?></td>
+      <td><input type="text" size="4" name="ordre_<?= $id ?>" value="<?= $values["ordre"] ?>" /></td>
+      <td><input type="checkbox" name="actif_<?= $id ?>" <?= $values["actif"] ? "checked " : "" ?>/></td>
+      <td><?= $values["compteur"] ?></td>
+      <td align="center">
+        <a href="<?= $env->url(array("e" => "set_artiste_downloads", "action" => "download", "download" => $id, "artiste" => $env->out["artiste"]["id"])) ?>"
+           class="admin_link"
+           title="modifier ce download"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+      </td>
+      <td align="center">
+        <a href="<?= $env->url(array("e" => "set_artiste_downloads", "action" => "del_download", "download" => $id, "artiste" => $env->out["artiste"]["id"])) ?>"
+           class="admin_link"
+           title="supprimer ce download"
+           onclick="return confirm('supprimer ce download ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+      </td>
+    </tr>
+<?php $compteur += $values["compteur"]; endforeach; ?>
+    <tr>
+      <th colspan="3" align="right">total</th>
+      <td colspan="3"><?= $compteur ?></td>
+    </tr>
+    <tr>
+      <td colspan="6" align="center"><input type="submit"value="Enregistrer" /></td>
+    </tr>
+  </table>
+</form>
+
+<?php else : ?>
+
+<p>Aucun download pour le moment.</p>
+
+<?php endif; ?>
+
+<div style="clear: both">&nbsp;</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_add_artiste_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_add_artiste_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_add_artiste_news.php	(revision 1)
@@ -0,0 +1,81 @@
+<?php if($env->out["preview"]) : $env->out["news"] = $env->out["preview"]; ?>
+<div class="news">
+<h3><span><?= $env->out["news"]["titre"] ?></span></h3>
+<p class="by">
+  Par <?= $env->out["news"]["auteur"] ?> -
+  <?= $env->out["news"]["date_publication"] ? $env->out["news"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["news"]["contenu"]) ?>
+</div>
+<br /><br />
+<?php endif; ?>
+
+<h3>Nouvelle news</h3>
+<form name="news_form" action="<?= $env->url
+                                   ( array
+                                     ( "e" => "set_artiste_news",
+                                       "action" => "add_artiste_news",
+                                       "artiste" => $_GET[$env->param("artiste")]
+                                     )
+                                   ) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" size="40" value="<?= $env->out["news"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>publique</th>
+    <td>
+      <div class="info">cochez cette case pour rendre la news publique</div>
+      <input type="checkbox" name="public" <?=
+             isset($env->out["news"]["public"]) ? ($env->out["news"]["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["news"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="news" id="news" style="width: 490px; height: 400px;"><?= $env->out["news"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "news",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['news_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_artiste_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_artiste_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_artiste_news.php	(revision 1)
@@ -0,0 +1,66 @@
+<h3>News</h3>
+<ul>
+  <li><a href="<?= $env->url
+                   ( array
+                     ( "e" => "set_artiste_news",
+                       "action" => "add_artiste_news",
+                       "artiste" => $_GET[$env->param("artiste")]
+                     )
+                   ) ?>">Nouvelle news</a></li>
+</ul>
+<?php if($env->out["news"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["news"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " news"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <th>date de publication</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["news"]["list"] as $id_news => $news) : ?>
+  <tr class="hl">
+    <td><?= $news["titre"] ?></td>
+    <td><?= $news["date_publication"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url
+                 ( array
+                   ( "e" => "set_artiste_news",
+                     "action" => "set_one_artiste_news",
+                     "news" => $id_news,
+                     "artiste" => $_GET[$env->param("artiste")]
+                   )
+                 ) ?>"
+       class="admin_link"
+       title="modifier cette news"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url
+                 ( array
+                   ( "e" => "set_artiste_news",
+                     "action" => "del_artiste_news",
+                     "news" => $id_news,
+                     "artiste" => $_GET[$env->param("artiste")]
+                   )
+                 ) ?>"
+       class="admin_link"
+       title="supprimer cette news"
+       onclick="return confirm('supprimer cette news ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucune news pour le moment...</p>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_set_one_artiste_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_set_one_artiste_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artiste_news/e_set_one_artiste_news.php	(revision 1)
@@ -0,0 +1,82 @@
+<?php if($env->out["preview"]) : $env->out["news"] = $env->out["preview"]; ?>
+<div class="news">
+<h3><span><?= $env->out["news"]["titre"] ?></span></h3>
+<p class="by">
+  Par <?= $env->out["news"]["auteur"] ?> -
+  <?= $env->out["news"]["date_publication"] ? $env->out["news"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["news"]["contenu"]) ?>
+</div>
+<br /><br />
+<?php endif; ?>
+
+<h3>Modifier une news</h3>
+<form name="news_form" action="<?= $env->url
+                                   ( array
+                                     ( "e" => "set_artiste_news",
+                                       "action" => "set_one_artiste_news",
+                                       "news" => $_GET[$env->param("news")],
+                                       "artiste" => $_GET[$env->param("artiste")]
+                                     )
+                                   ) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" size="40" value="<?= $env->out["news"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>publique</th>
+    <td>
+      <div class="info">cochez cette case pour rendre la news publique</div>
+      <input type="checkbox" name="public" <?=
+             isset($env->out["news"]["public"]) ? ($env->out["news"]["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["news"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="news" id="news" style="width: 490px; height: 400px;"><?= $env->out["news"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "news",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['news_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_add_user_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_add_user_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_add_user_artiste.php	(revision 1)
@@ -0,0 +1,57 @@
+<h2>Nouvel artiste pour <?= $env->out["user"]["username"] ?></h2>
+<div class="bloc_content">
+
+<form name="artiste_form" action="<?=
+    $env->url
+    ( array
+      ( "e" => "set_artistes",
+        "action" => "add_user_artiste",
+        "user" => $_GET[$env->param("user")]
+      )
+    )
+  ?>" method="post">
+<table class="admin">
+  <tr>
+    <td>
+      <p><strong>Nom de l'artiste</p></strong>
+      <p>
+        L'artiste pourra changer ce nom dans son compte
+      </p>
+      <input type="text" name="nom" size="50" />
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <p><strong>Forum de l'artiste</strong></p>
+      <select name="forum">
+        <option value="0">pas de forum</option>
+      <?php if($env->out["forums"]) : foreach($env->out["forums"] as $id_forum => $forum) : ?>
+        <option value="<?= $id_forum ?>"><?= $forum["forum_name"] ?></option>
+      <?php endforeach; endif; ?>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <p><strong>dossier personnel</p></strong>
+      <p>laisser vide pour pas de dossier personnel</p>
+      <input type="text" name="dossier_personnel" size="50" value="" />
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2" align="right">
+      <input type="submit" value="ajouter" />
+      <a href="<?=
+          $env->url
+          ( array
+            ( "e" => "set_artistes",
+              "action" => "user_artistes",
+              "user" => $_GET[$env->param("user")]
+            )
+          )
+        ?>">annuler</a>
+    </td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_set_user_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_set_user_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_set_user_artiste.php	(revision 1)
@@ -0,0 +1,61 @@
+<h2>Modifier l'artiste <?= $env->out["artiste"]["nom"] ?></h2>
+<div class="bloc_content">
+<p>
+Pr&eacute;cisez le nom de l'artiste. L'artiste pourra ensuite le modifier dans ses pages priv&eacute;es :
+</p>
+
+<form name="artiste_form" action="<?=
+    $env->url
+    ( array
+      ( "e" => "set_artistes",
+        "action" => "set_user_artiste",
+        "user" => $_GET[$env->param("user")],
+        "artiste" => $_GET[$env->param("artiste")]
+      )
+    )
+  ?>" method="post">
+<table class="admin">
+  <tr>
+    <td>
+      <p><strong>Nom de l'artiste</p></strong>
+      <p>
+        L'artiste pourra changer ce nom dans son compte
+      </p>
+      <input type="text" name="nom" size="50" value="<?= $env->out["artiste"]["nom"] ?>" />
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <p><strong>Forum de l'artiste</strong></p>
+      <select name="forum">
+        <option value="0">pas de forum</option>
+      <?php if($env->out["forums"]) : foreach($env->out["forums"] as $id_forum => $forum) : ?>
+        <option value="<?= $id_forum ?>"<?= $env->out["artiste"]["pun_forum"] == $id_forum ? " selected" : "" ?>><?= $forum["forum_name"] ?></option>
+      <?php endforeach; endif; ?>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <p><strong>dossier personnel</p></strong>
+      <p>laisser vide pour pas de dossier personnel</p>
+      <input type="text" name="dossier_personnel" size="50" value="<?= $env->out["artiste"]["dossier_personnel"] ?>" />
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2" align="right">
+      <input type="submit" value="enregistrer" />
+      <a href="<?=
+          $env->url
+          ( array
+            ( "e" => "set_artistes",
+              "action" => "user_artistes",
+              "user" => $_GET[$env->param("user")]
+            )
+          )
+        ?>">annuler</a>
+    </td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_user_artistes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_user_artistes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_user_artistes.php	(revision 1)
@@ -0,0 +1,58 @@
+<h2>Les artistes g&eacute;r&eacute;s par <?= $env->out["user"]["username"] ?></h2>
+<div class="bloc_content">
+<ul>
+  <li><a href="<?=
+    $env->url
+    ( array
+      ( "e" => "set_artistes",
+        "action" => "add_user_artiste",
+        "user" => $_GET[$env->param("user")]
+      )
+    )
+    ?>">Cr&eacute;er un nouvel artiste pour cet utilisateur</a></li>
+</ul>
+
+<?php if($env->out["artistes"]) : ?>
+
+<table class="admin">
+  <tr>
+    <th>nom</th>
+    <th style="text-align: center" colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["artistes"] as $id_artiste => $artiste) : ?>
+  <tr class="hl">
+    <td><?= $artiste["nom"] ?></td>
+    <td align="center">
+    <a href="<?=
+      $env->url
+      ( array
+        ( "e" => "set_artistes",
+          "action" => "set_user_artiste",
+          "user" => $_GET[$env->param("user")],
+          "artiste" => $id_artiste
+        )
+      ) ?>"
+       class="admin_link"
+       title="modifier le compte artiste"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?=
+      $env->url
+      ( array
+        ( "e" => "set_artistes",
+          "action" => "del_user_artiste",
+          "user" => $_GET[$env->param("user")],
+          "artiste" => $id_artiste
+        )
+      ) ?>"
+       class="admin_link"
+       title="supprimer cet artiste"
+       onclick="return confirm('supprimer cet artiste ?\nsa pr&eacute;sentation, ses downloads, etc, seront aussi supprim&eacute;s')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucun artiste pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_users.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_users.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_artistes/e_users.php	(revision 1)
@@ -0,0 +1,81 @@
+<h2>Les comptes artiste</h2>
+<div class="bloc_content">
+afficher :
+<select onchange="document.location=this.options[this.selectedIndex].value;">
+  <option value="<?php
+      $url = array("e" => "set_artistes");
+      if($_GET[$env->param("alpha")]) $url["alpha"] = $_GET[$env->param("alpha")];
+      echo $env->url($url);
+    ?>"<?=
+      isset($_GET[$env->param("is_artiste")]) ? "" : " selected"
+    ?>>tous les utilisateurs</option>
+  <option value="<?php
+      $url = array("e" => "set_artistes", "is_artiste" => 1);
+      if($_GET[$env->param("alpha")]) $url["alpha"] = $_GET[$env->param("alpha")];
+      echo $env->url($url);
+    ?>"<?=
+      isset($_GET[$env->param("is_artiste")]) && $_GET[$env->param("is_artiste")] == 1 ? " selected" : ""
+    ?>>les utilisateurs qui ont un compte artiste</option>
+  <option value="<?php
+      $url = array("e" => "set_artistes", "is_artiste" => 0);
+      if($_GET[$env->param("alpha")]) $url["alpha"] = $_GET[$env->param("alpha")];
+      echo $env->url($url);
+   ?>"<?=
+      isset($_GET[$env->param("is_artiste")]) && $_GET[$env->param("is_artiste")] == 0 ? " selected" : ""
+    ?>>les utilisateurs sans compte artiste</option>
+</select>
+<br/><br/>
+
+<?php for($i = 65; $i <= 90; $i++) : ?>
+<?php
+  $url = array("e" => "set_artistes", "alpha" => chr($i));
+  if($_GET[$env->param("is_artiste")]) $url["is_artiste"] = $_GET[$env->param("is_artiste")];  
+?>
+<a href="<?= $env->url($url) ?>"><?= chr($i) ?></a>
+<?php endfor; ?>
+<?php
+  $url = array("e" => "set_artistes");
+  if($_GET[$env->param("is_artiste")]) $url["is_artiste"] = $_GET[$env->param("is_artiste")];  
+?>
+&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<?= $env->url($url) ?>">Tous les pseudos</a>
+<br/><br/>
+
+<?php if($env->out["users"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["users"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " utilisateurs"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>pseudo</th>
+    <th style="text-align: center">gerer les comptes artistes pour cet utilisateur</th>
+  </tr>
+<?php foreach($env->out["users"]["list"] as $id_user => $user) : ?>
+  <tr class="hl">
+    <td>
+      <a href="<?= $env->path("punbb")."profile.php?id=".$user["id"] ?>">
+        <?= $user["username"] ?>
+      </a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_artistes", "action" => "user_artistes", "user" => $id_user)) ?>"
+       class="admin_link"
+       title="gerer les comptes artistes pour cet utilisateur"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucun utilisateur pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_add_box.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_add_box.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_add_box.php	(revision 1)
@@ -0,0 +1,93 @@
+<h2>Nouveau bloc</h2>
+<div class="bloc_content">
+
+<form name="box_form" action="<?= $env->url(array("e" => "set_boxes", "action" => "add_box")) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>intitul&eacute;</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $_POST["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <div class="info">cochez cette case pour rendre le bloc public</div>
+      <input type="checkbox" name="public" <?=
+             isset($_POST["public"]) ? ($_POST["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>nom</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un nom pour le bloc.<br />
+        Ce nom pourra servir de r&eacute;f&eacute;rence dans un template.
+      </div>
+      <input type="text" name="nom" style="width: 500px" value="<?= $_POST["nom"] ?>">
+    </td>
+  </tr>
+<?php if($env->out["emplacements"]) : ?>
+  <tr>
+    <th>emplacement</th>
+    <td>
+      <select name="emplacement">
+        <option value="">Aucun</option>
+<?php foreach($env->out["emplacements"] as $id_emplacement => $emplacement) : ?>
+        <option value="<?= $id_emplacement ?>"<?= $_POST["emplacement"] == $id_emplacement ? " selected" : "" ?>>
+          <?= $emplacement["intitule"] ?>
+        </option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+<?php endif; ?>
+  <tr>
+    <th>fichier</th>
+    <td>
+      <select name="fichier">
+        <option value="">Aucun</option>
+<?php foreach($env->out["box_files"] as $box_file) : ?>
+        <option value="<?= $box_file ?>"
+                <?= $box_file == $_POST["fichier"] ? " selected" : ""
+                ?>><?= $box_file ?></option>
+<?php endforeach; ?>
+      </select>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un fichier pour le contenu du bloc.<br />
+        Vous pouvez ajouter des fichiers de bloc par FTP dans le dossier <strong>boxes</strong>
+        du template.<br /> 
+        <strong>note</strong> : si vous pr&eacute;cisez un fichier, le contenu ci-dessous ne sera pas affich&eacute;.
+      </div>
+    </td>
+  </tr>
+  <tr>
+    <th>contenu</th>
+    <td>
+      <textarea name="contenu" id="contenu" style="width: 500px; height: 300px;"><?= $_POST["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "contenu",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+  <tr>
+    <td align="center" colspan="2"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_boxes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_boxes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_boxes.php	(revision 1)
@@ -0,0 +1,76 @@
+<h2>Les blocs</h2>
+<div class="bloc_content">
+
+<?php if($env->out["emplacements"]) : ?>
+  <div class="filtre">
+    Afficher les blocs pour l'emplacement :
+    <select onchange="document.location=this.options[this.selectedIndex].value;">
+      <option value="<?= $env->url(array("e" => "set_boxes")) ?>">Tous</option>
+      <option value="<?= $env->url(array("e" => "set_boxes", "categorie" => "")) ?>"
+              <?= isset($_GET[$env->param("categorie")]) && strlen($_GET[$env->param("categorie")]) == 0 ?
+                    "selected" : "" ?>>Aucun</option>
+<?php foreach($env->out["emplacements"] as $id_emplacement => $emplacement) : ?>
+      <option value="<?= $env->url(array("e" => "set_boxes", "categorie" => $id_emplacement)) ?>"
+              <?= $_GET[$env->param("categorie")] == $id_emplacement ? "selected" : "" ?>>
+        <?= $emplacement["intitule"] ?>
+      </option>
+<?php endforeach; ?>
+    </select>
+  </div>
+<?php endif; ?>
+
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_boxes", "action" => "add_box")) ?>">Nouveau bloc</a></li>
+  </ul>
+
+<?php if($env->out["boxes"]["list"]) : ?>
+
+<br />
+<form name="blocs_form" action="<?= $env->url(array("e" => "set_boxes", "categorie" => $_GET[$env->param("categorie")])) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>id</th>
+    <th>intitul&eacute;</th>
+    <th>nom</th>
+    <th>fichier</th>
+    <th>ordre</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["boxes"]["list"] as $id_box => $box) : ?>
+  <tr class="hl">
+    <td><strong><?= $id_box ?></strong></td>
+    <td><?= $box["titre"] ?></td>
+    <td><?= $box["nom"] ?></td>
+    <td><?= $box["description"] ?></td>
+    <td align="center"><input type="text" size="3" name="ordre<?= $id_box ?>" value="<?= $box["ordre"] ?>" /></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_boxes", "action" => "set_box", "id" => $id_box)) ?>"
+       class="admin_link"
+       title="modifier ce bloc"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_boxes", "action" => "del_box", "id" => $id_box)) ?>"
+       class="admin_link"
+       title="supprimer ce bloc"
+       onclick="return confirm('supprimer ce bloc ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+  <tr>
+    <td colspan="4"><!-- --></td>
+    <td align="center">
+      <input type="submit" value="enregistrer l'ordre" />
+    </td>
+    <td colspan="2"><!-- --></td>
+  </tr>
+</table>
+</form>
+<?php else : ?>
+<br />
+<?php if($_GET[$env->param("categorie")]) : ?>
+  <p>Aucun bloc pour le moment pour cet emplacement...</p>
+<?php else : ?>
+  <p>Aucun bloc pour le moment...</p>
+<?php endif; ?>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_set_box.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_set_box.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_boxes/e_set_box.php	(revision 1)
@@ -0,0 +1,95 @@
+<h2>Modifier le bloc</h2>
+<div class="bloc_content">
+
+<form name="box_form" action="<?= $env->url(array("e" => "set_boxes", "action" => "set_box", "id" => $env->out["box"]["id"])) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>intitul&eacute;</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $_POST ? $_POST["titre"] : $env->out["box"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <input type="checkbox" name="public" <?=
+             $_POST ? ($_POST["public"] ? "checked" : "") : ($env->out["box"]["public"] ? "checked" : "") ?>>
+      <div class="info">cochez cette case pour rendre le bloc public</div>
+    </td>
+  </tr>
+  <tr>
+    <th>nom</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un nom pour le bloc.<br />
+        Ce nom pourra servir de r&eacute;f&eacute;rence dans un template.
+      </div>
+      <input type="text" name="nom" style="width: 500px" value="<?= $_POST ? $_POST["nom"] : $env->out["box"]["nom"] ?>">
+    </td>
+  </tr>
+<?php if($env->out["emplacements"]) : ?>
+  <tr>
+    <th>emplacement</th>
+    <td>
+      <select name="emplacement">
+        <option value="">Aucun</option>
+<?php foreach($env->out["emplacements"] as $id_emplacement => $emplacement) : ?>
+        <option value="<?= $id_emplacement ?>"<?=
+                $_POST ?
+                  ($_POST["emplacement"] == $id_emplacement ? " selected" : "")
+                : ($env->out["box"]["emplacement"] == $id_emplacement ? " selected" : "") ?>>
+          <?= $emplacement["intitule"] ?>
+        </option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+<?php endif; ?>
+  <tr>
+    <th>fichier</th>
+    <td>
+      <select name="fichier">
+        <option value="">Aucun</option>
+<?php foreach($env->out["box_files"] as $box_file) : ?>
+        <option value="<?= $box_file ?>"
+                <?= $box_file == ($_POST ? $_POST["fichier"] : $env->out["box"]["fichier"]) ? " selected" : ""
+                ?>><?= $box_file ?></option>
+<?php endforeach; ?>
+      </select>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un fichier pour le contenu du bloc.<br />
+        Vous pouvez ajouter des fichiers de bloc par FTP dans le dossier <strong>boxes</strong>
+        du template.<br /> 
+        <strong>note</strong> : si vous pr&eacute;cisez un fichier, le contenu ci-dessous ne sera pas affich&eacute;.
+      </div>
+    </td>
+  </tr>
+  <tr>
+    <th>contenu</th>
+    <td>
+      <textarea name="contenu" id="contenu" style="width: 500px; height: 300px;"><?= $_POST ? $_POST["contenu"] : $env->out["box"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "contenu",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+  <tr>
+    <td align="center" colspan="2"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_add_edito.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_add_edito.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_add_edito.php	(revision 1)
@@ -0,0 +1,79 @@
+<h2>Nouvel &eacute;dito</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["edito"] = $env->out["preview"]; ?>
+<h3><?= $env->out["edito"]["titre"] ?></h3>
+<p class="by">
+  par <?= $env->out["edito"]["auteur"] ?> -
+  <?= $env->out["edito"]["date_publication"] ? $env->out["edito"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["edito"]["contenu"]) ?>
+
+<br/><br/>
+<?php endif; ?>
+
+
+<form name="edito_form" action="<?= $env->url(array("e" => "set_editos", "action" => "add_edito")) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["edito"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <div class="info">cochez cette case pour rendre l'&eacute;dito public</div>
+      <input type="checkbox" name="public" <?=
+             isset($env->out["edito"]["public"]) ? ($env->out["edito"]["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        L'&eacute;dito qui s'affiche sur l'accueil du site est celui qui a la date de publication la plus r&eacutecente et qui est public.<br/>
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["edito"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="edito" id="edito" style="width: 765px; height: 400px;"><?= $env->out["edito"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "edito",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['edito_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_editos.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_editos.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_editos.php	(revision 1)
@@ -0,0 +1,50 @@
+<h2>Les &eacute;ditos</h2>
+<div class="bloc_content">
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_editos", "action" => "add_edito")) ?>">Nouvel &eacute;dito</a></li>
+  </ul>
+<?php if($env->out["editos"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["editos"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " &eacute;ditos"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <th>date de publication</th>
+    <th>auteur</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["editos"]["list"] as $id_edito => $edito) : ?>
+  <tr class="hl">
+    <td><?= $edito["titre"] ?></td>
+    <td><?= $edito["date_publication"] ?></td>
+    <td><?= $edito["auteur"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_editos", "action" => "set_edito", "edito" => $id_edito)) ?>"
+       class="admin_link"
+       title="modifier cet &eacute;dito"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_editos", "action" => "del_edito", "edito" => $id_edito)) ?>"
+       class="admin_link"
+       title="supprimer cet &eacute;dito"
+       onclick="return confirm('supprimer cet &eacute;dito ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucun &eacute;dito pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_set_edito.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_set_edito.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_editos/e_set_edito.php	(revision 1)
@@ -0,0 +1,79 @@
+<h2>Modifier l'&eacute;ditos</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["edito"] = $env->out["preview"]; ?>
+<h3><?= $env->out["edito"]["titre"] ?></h3>
+<p class="by">
+  par <?= $env->out["edito"]["auteur"] ?> -
+  <?= $env->out["edito"]["date_publication"] ? $env->out["edito"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["edito"]["contenu"]) ?>
+
+<br/><br/>
+<?php endif; ?>
+
+<form name="edito_form"
+      action="<?= $env->url(array("e" => "set_editos", "action" => "set_edito", "edito" => $_GET[$env->param("edito")])) ?>"
+      method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["edito"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <div class="info">cochez cette case pour rendre l'&eacute;dito public</div>
+      <input type="checkbox" name="public" <?= $env->out["edito"]["public"] ? "checked" : "" ?>/>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        L'&eacute;dito qui appara&icirc;t sur le site est celui dont la date de publication est la plus r&eacute;cente<br/>
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["edito"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="edito" id="edito" style="width: 765px; height: 400px;"><?= $env->out["edito"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "edito",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['edito_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_add_links_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_add_links_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_add_links_categorie.php	(revision 1)
@@ -0,0 +1,56 @@
+<h2>Nouveau lien</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_links.php"); ?>
+  </h3>
+
+<br /><br />
+<form name="link_form"
+      action="<?= $env->url(array("e" => "set_links", "action" => "add_links_categorie", "path" => $_GET[$env->param("path")])) ?>"
+      method="post">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="titre" style="width: 400px"></td>
+  </tr>
+  <tr>
+    <th>lien</th>
+    <td>
+      <input type="text" name="url" style="width: 400px">
+    </td>
+  </tr>
+</table>
+<br />
+<h3>Description</h3>
+<table>
+  <tr>
+    <td>
+      <textarea name="description" id="description" style="width: 656px; height: 400px;"></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "description",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_links.php	(revision 1)
@@ -0,0 +1,47 @@
+<h2>Les liens</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_links.php"); ?>
+  </h3>
+
+  <br />
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_links", "action" => "add_links_categorie", "path" => $_GET[$env->param("path")])) ?>">Nouveau lien / cat&eacute;gorie de liens</a></li>
+  </ul>
+<?php if($env->out["links_categories"]["list"]) : ?>
+
+<form name="links_form" action="<?= $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")])) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>intitul&eacute;</th>
+    <th>ordre</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["links_categories"]["list"] as $id_links_categorie => $links_categorie) : ?>
+  <tr class="hl">
+    <td><a href="<?= $env->url(array("e" => "set_links", "path" => $_GET[$env->param("path")]."/".$links_categorie["id"])) ?>"><?= $links_categorie["titre"] ?></a></td>
+    <td><input type="text" name="ordre_<?= $id_links_categorie ?>" value="<?= $links_categorie["ordre"] ?>" size="5" /></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_links", "action" => "set_links_categorie", "id" => $id_links_categorie, "path" => $_GET[$env->param("path")])) ?>"
+       class="admin_link"
+       title="modifier ce lien / cat&eacute;gorie de lien"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_links", "action" => "del_links_categorie", "id" => $id_links_categorie, "path" => $_GET[$env->param("path")])) ?>"
+       class="admin_link"
+       title="supprimer ce lien / cat&eacute;gorie de liens"
+       onclick="return confirm('supprimer ce lien ?\ntous ses sous-liens seront aussi supprim&eacute;s')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+  <tr>
+    <td colspan="2">&nbsp;</td>
+    <td><input type="submit" value="appliquer l'ordre" /></td>
+    <td colspan="2">&nbsp;</td>
+  </tr>
+</table>
+</form>
+<?php else : ?>
+  <p>Aucun lien dans cette cat&eacute;gorie.</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_set_links_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_set_links_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_links/e_set_links_categorie.php	(revision 1)
@@ -0,0 +1,56 @@
+<h2>Modifier un lien</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_links.php"); ?>
+  </h3>
+
+<br /><br />
+<form name="link_form"
+      action="<?= $env->url(array("e" => "set_links", "action" => "set_links_categorie", "path" => $_GET[$env->param("path")], "id" => $env->out["links_categorie"]["id"])) ?>"
+      method="post">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="titre" style="width: 400px" value="<?= $_POST["titre"] ? $_POST["titre"] : $env->out["links_categorie"]["titre"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>lien</th>
+    <td>
+      <input type="text" name="url" style="width: 400px" value="<?= $_POST["url"] ? $_POST["url"] : $env->out["links_categorie"]["contenu"] ?>" />
+    </td>
+  </tr>
+</table>
+<br />
+<h3>Description</h3>
+<table>
+  <tr>
+    <td>
+      <textarea name="description" id="description" style="width: 656px; height: 400px;"><?= $_POST["description"] ? $_POST["description"] : $env->out["links_categorie"]["description"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "description",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+    </td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_add_emplacement_type.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_add_emplacement_type.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_add_emplacement_type.php	(revision 1)
@@ -0,0 +1,29 @@
+<h2>Nouveau type d'emplacement</h2>
+<div class="bloc_content">
+<form name="news_form"
+      action="<?= $env->url(array("e" => "set_map", "action" => "add_emplacement_type")) ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="intitule" style="width: 500px" value="<?= $_POST["intitule"] ?>"></td>
+  </tr>
+  <tr>
+    <th>icone</th>
+    <td>
+      <input type="file" name="icone" style="width: 400px">
+    </td>
+  </tr>
+  <tr>
+    <th>description</th>
+    <td><textarea name="descriptif" cols="50" rows="3"><?= $_POST["descriptif"] ?></textarea></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_map_config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_map_config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_map_config.php	(revision 1)
@@ -0,0 +1,58 @@
+<h2>Configuration de la carte</h2>
+<div class="bloc_content">
+<form name="news_form" action="<?= $env->url(array("e" => "set_map")) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>Google key</th>
+    <td>
+      <input type="text" name="google_key"
+               style="width: 500px" value="<?= $env->out["config"]["google_key"] ?>" /></td>
+  </tr>
+
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+
+<h3>Les types d'emplacement</h3>
+
+<ul>
+  <li><a href="<?= $env->url(array("e" => "set_map", "action" => "add_emplacement_type")) ?>">Nouveau type d'emplacement</a></li>
+</ul>
+
+<?php if($env->out["emplacement_types"]) : ?>
+
+<table class="admin">
+  <tr>
+    <th>icone</th>
+    <th>intitule</th>
+    <th>descriptif</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["emplacement_types"] as $id_emplacement_type => $emplacement_type) : ?>
+  <tr class="hl">
+    <td><img src="<?= $emplacement_type["icone"] ?>" /></td>
+    <td><?= $emplacement_type["intitule"] ?></td>
+    <td><?= $emplacement_type["descriptif"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_map", "action" => "set_emplacement_type", "id" => $id_emplacement_type)) ?>"
+       class="admin_link"
+       title="modifier ce type d'emplacement"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_map", "action" => "del_emplacement_type", "id" => $id_emplacement_type)) ?>"
+       class="admin_link"
+       title="supprimer ce type d'emplacement"
+       onclick="return confirm('supprimer ce type d\'emplacement ?\n tous les emplacements de ce type seront aussi supprim&eacute;s')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+
+<?php else : ?>
+<p>Aucun type d'emplacement pour le moment</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_set_emplacement_type.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_set_emplacement_type.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_map/e_set_emplacement_type.php	(revision 1)
@@ -0,0 +1,38 @@
+<h2>Modifier un type d'emplacement</h2>
+<div class="bloc_content">
+<form name="news_form"
+      action="<?=
+        $env->url
+        ( array
+          ( "e" => "set_map",
+            "action" => "set_emplacement_type",
+            "id" => $_GET[$env->param("id")]
+          )
+        )
+      ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="intitule" value="<?= $_POST["intitule"] ? $_POST["intitule"] : $env->out["emplacement_type"]["intitule"] ?>" style="width: 500px"></td>
+  </tr>
+  <tr>
+    <th>icone</th>
+    <td>
+      <img src="<?= $env->out["emplacement_type"]["icone"] ?>" /><br />
+      changer d'icone : <input type="file" name="icone" style="width: 400px">
+    </td>
+  </tr>
+  <tr>
+    <th>description</th>
+    <td><textarea name="descriptif" cols="50" rows="3"><?= $_POST["descriptif"] ? $_POST["descriptif"] : $env->out["emplacement_type"]["descriptif"] ?></textarea></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_add_menus_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_add_menus_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_add_menus_categorie.php	(revision 1)
@@ -0,0 +1,36 @@
+<h2>Nouveau menu</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_menus.php"); ?>
+  </h3>
+
+<br /><br />
+<?php
+
+  $form_action = array
+  ( "e" => "set_menus",
+    "action" => "add_menus_categorie"
+  );
+  if($_GET[$env->param("path")]) $form_action["path"] = $_GET[$env->param("path")];
+
+?>
+<form name="news_form" action="<?= $env->url($form_action) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="titre" style="width: 400px"></td>
+  </tr>
+  <tr>
+    <th>lien</th>
+    <td>
+      <input type="text" name="url" style="width: 400px">
+    </td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_menus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_menus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_menus.php	(revision 1)
@@ -0,0 +1,52 @@
+<h2>Les menus</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_menus.php"); ?>
+  </h3>
+
+  <br />
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_menus", "action" => "add_menus_categorie", "path" => $_GET[$env->param("path")])) ?>">Nouveau menu</a></li>
+  </ul>
+<?php if($env->out["menus_categories"]["list"]) : ?>
+<?php
+
+  $form_action = array("e" => "set_menus");
+  if($_GET[$env->param("path")]) $form_action["path"] = $_GET[$env->param("path")];
+
+?>
+<form name="menus_form" action="<?= $env->url($form_action) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>intitul&eacute;</th>
+    <th>ordre</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["menus_categories"]["list"] as $id_menus_categorie => $menus_categorie) : ?>
+  <tr class="hl">
+    <td><a href="<?= $env->url(array("e" => "set_menus", "path" => $_GET[$env->param("path")]."/".$menus_categorie["id"])) ?>"><?= $menus_categorie["titre"] ?></a></td>
+    <td><input type="text" name="ordre_<?= $id_menus_categorie ?>" value="<?= $menus_categorie["ordre"] ?>" size="5" /></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_menus", "action" => "set_menus_categorie", "menus_categorie" => $id_menus_categorie, "path" => $_GET[$env->param("path")])) ?>"
+       class="admin_link"
+       title="modifier cette cat&eacute;gorie de menus"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_menus", "action" => "del_menus_categorie", "menus_categorie" => $id_menus_categorie, "path" => $_GET[$env->param("path")])) ?>"
+       class="admin_link"
+       title="supprimer cette cat&eacute;gorie de menus"
+       onclick="return confirm('supprimer cette cat&eacute;gorie ?\ntous les menus et sous-menus de cette cat&eacute;gorie seront aussi supprim&eacute;s')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+  <tr>
+    <td colspan="2">&nbsp;</td>
+    <td><input type="submit" value="appliquer l'ordre" /></td>
+    <td colspan="2">&nbsp;</td>
+  </tr>
+</table>
+</form>
+<?php else : ?>
+  <p>Aucun menu dans cette cat&eacute;gorie.</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_set_menus_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_set_menus_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_menus/e_set_menus_categorie.php	(revision 1)
@@ -0,0 +1,37 @@
+<h2>Modifier un menu</h2>
+<div class="bloc_content">
+  <h3>
+<?php require $env->out_file("views/ariane_menus.php"); ?>
+  </h3>
+
+<br /><br />
+<?php
+
+  $form_action = array
+  ( "e" => "set_menus",
+    "action" => "set_menus_categorie",
+    "menus_categorie" => $_GET[$env->param("menus_categorie")]
+  );
+  if($_GET[$env->param("path")]) $form_action["path"] = $_GET[$env->param("path")];
+
+?>
+<form name="news_form" action="<?= $env->url($form_action) ?>" method="post">
+<table class="admin">
+  <tr>
+    <th>intitule</th>
+    <td><input type="text" name="titre" style="width: 400px" value="<?= $_POST["titre"] ? $_POST["titre"] : $env->out["menus_categorie"]["titre"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>lien</th>
+    <td>
+      <input type="text" name="url" style="width: 400px" value="<?= $_POST["nom"] ? $_POST["url"] : $env->out["menus_categorie"]["contenu"] ?>" />
+    </td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_add_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_add_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_add_news.php	(revision 1)
@@ -0,0 +1,112 @@
+<h2>Nouvelle news</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["news"] = $env->out["preview"]; ?>
+
+<div class="news">
+  <div class="news_categorie">
+<?php if($env->out["news"]["categorie_icone"] || $env->out["news"]["categorie_titre"]) : ?>
+    <a href="<?= $env->url(array("e" => "accueil", "categorie" => $env->out["news"]["categorie"])) ?>">
+<?php if($env->out["news"]["categorie_icone"]) : ?>
+      <img src="<?= $env->out["news"]["categorie_icone"] ?>" alt="<?= $env->out["news"]["categorie_titre"] ?>" />
+<?php else : ?>
+      <?= $env->out["news"]["categorie_titre"] ?>
+<?php endif; ?>
+    </a>
+<?php else : ?>
+    &nbsp;
+<?php endif; ?>
+  </div>
+  <div class="news_main">
+    <h3><span><?= $env->out["news"]["titre"] ?></span></h3>
+    <p class="by">
+      Par <?= $env->out["news"]["auteur"] ?> -
+      <?= $env->out["news"]["date_publication"] ? $env->out["news"]["date_publication"] : date("Y-m-d H:i:s") ?>
+    </p>
+    <div class="news_contenu">
+    <?= $env->data->html($env->out["news"]["contenu"]) ?>
+    </div>
+  </div>
+  <div class="clear"><!-- --></div>
+</div>
+
+<br/><br/>
+<?php endif; ?>
+
+<form name="news_form" action="<?= $env->url(array("e" => "set_news", "action" => "add_news")) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["news"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>cat&eacute;gorie</th>
+    <td>
+      <select name="categorie">
+        <option value="<?= $env->out["news_root_categorie"] ?>"
+                <?= $env->out["news"]["categorie"] == $env->out["news_root_categorie"] ? " selected" : "" ?>>
+          Sans cat&eacute;gorie</option>
+<?php foreach($env->out["categories"]["list"] as $id_categorie => $categorie) : ?>
+        <option value="<?= $id_categorie ?>"<?= $env->out["news"]["categorie"] == $id_categorie ? " selected" : "" ?>>
+          <?= $categorie["titre"] ?>
+        </option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <th>publique</th>
+    <td>
+      <div class="info">cochez cette case pour rendre la news publique</div>
+      <input type="checkbox" name="public" <?=
+             isset($env->out["news"]["public"]) ? ($env->out["news"]["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["news"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="news" id="news" style="width: 765px; height: 400px;"><?= $env->out["news"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "news",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['news_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_news.php	(revision 1)
@@ -0,0 +1,75 @@
+<h2>Les news</h2>
+<div class="bloc_content">
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_news", "action" => "add_news")) ?>">Nouvelle news</a></li>
+  </ul>
+
+<?php if($env->out["categories"]["list"]) : ?>
+  <div class="filtre">
+    Afficher les news pour la cat&eacute;gorie :
+    <select onchange="document.location=this.options[this.selectedIndex].value;">
+      <option value="<?= $env->url(array("e" => "set_news")) ?>">Toutes les cat&eacute;gories</option>
+      <option value="<?= $env->url(array("e" => "set_news", "categorie" => "")) ?>"
+              <?= isset($_GET[$env->param("categorie")]) && strlen($_GET[$env->param("categorie")]) == 0 ?
+                    "selected" : "" ?>>Sans cat&eacute;gorie</option>
+<?php if($env->out["categories"]["total"] > 0) : foreach($env->out["categories"]["list"] as $id_categorie => $categorie) : ?>
+      <option value="<?= $env->url(array("e" => "set_news", "categorie" => $id_categorie)) ?>"
+              <?= $_GET[$env->param("categorie")] == $id_categorie ? "selected" : "" ?>>
+        <?= $categorie["titre"] ?>
+      </option>
+<?php endforeach; endif; ?>
+    </select>
+  </div>
+<?php endif; ?>
+
+<?php if($env->out["news"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["news"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " news"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <th>categorie</th>
+    <th>date de publication</th>
+    <th>auteur</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["news"]["list"] as $id_news => $news) : ?>
+  <tr class="hl">
+    <td><?= $news["titre"] ?></td>
+    <td><?= $env->out["categories"]["list"][$news["categorie"]]["titre"] ?></td>
+    <td><?= $news["date_publication"] ?></td>
+    <td><?= $news["auteur"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_news", "action" => "set_one_news", "news" => $id_news)) ?>"
+       class="admin_link"
+       title="modifier cette news"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_news", "action" => "del_news", "news" => $id_news)) ?>"
+       class="admin_link"
+       title="supprimer cette news"
+       onclick="return confirm('supprimer cette news ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+<?php if($_GET[$env->param("categorie")]) : ?>
+  <p>Aucune news dans cette cat&eacute;gorie pour le moment...</p>
+<?php else : ?>
+  <p>Aucune news pour le moment...</p>
+<?php endif; ?>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_set_one_news.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_set_one_news.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news/e_set_one_news.php	(revision 1)
@@ -0,0 +1,113 @@
+<h2>Modifier la news</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["news"] = $env->out["preview"]; ?>
+
+<div class="news">
+  <div class="news_categorie">
+<?php if($env->out["news"]["categorie_icone"] || $env->out["news"]["categorie_titre"]) : ?>
+    <a href="<?= $env->url(array("e" => "accueil", "categorie" => $env->out["news"]["categorie"])) ?>">
+<?php if($env->out["news"]["categorie_icone"]) : ?>
+      <img src="<?= $env->out["news"]["categorie_icone"] ?>" alt="<?= $env->out["news"]["categorie_titre"] ?>" />
+<?php else : ?>
+      <?= $env->out["news"]["categorie_titre"] ?>
+<?php endif; ?>
+    </a>
+<?php else : ?>
+    &nbsp;
+<?php endif; ?>
+  </div>
+  <div class="news_main">
+    <h3><span><?= $env->out["news"]["titre"] ?></span></h3>
+    <p class="by">
+      Par <?= $env->out["news"]["auteur"] ?> -
+      <?= $env->out["news"]["date_publication"] ? $env->out["news"]["date_publication"] : date("Y-m-d H:i:s") ?>
+    </p>
+    <div class="news_contenu">
+    <?= $env->data->html($env->out["news"]["contenu"]) ?>
+    </div>
+  </div>
+  <div class="clear"><!-- --></div>
+</div>
+
+<br/><br/>
+<?php endif; ?>
+
+<form name="news_form"
+      action="<?= $env->url(array("e" => "set_news", "action" => "set_one_news", "news" => $_GET[$env->param("news")])) ?>"
+      method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["news"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>cat&eacute;gorie</th>
+    <td>
+      <select name="categorie">
+        <option value="<?= $env->out["news_root_categorie"] ?>"
+                <?= $env->out["news"]["categorie"] == $env->out["news_root_categorie"] ? " selected" : "" ?>>
+          Sans cat&eacute;gorie</option>
+<?php foreach($env->out["categories"]["list"] as $id_categorie => $categorie) : ?>
+        <option value="<?= $id_categorie ?>"<?= $env->out["news"]["categorie"] == $id_categorie ? " selected" : "" ?>>
+          <?= $categorie["titre"] ?>
+        </option>
+<?php endforeach; ?>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <th>publique</th>
+    <td>
+      <div class="info">cochez cette case pour rendre la news publique</div>
+      <input type="checkbox" name="public" <?= $env->out["news"]["public"] ? "checked" : "" ?>/>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["news"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="news" id="news" style="width: 765px; height: 400px;"><?= $env->out["news"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "news",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",
+          theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['news_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_add_news_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_add_news_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_add_news_categorie.php	(revision 1)
@@ -0,0 +1,29 @@
+<h2>Nouvelle cat&eacute;gorie de news</h2>
+<div class="bloc_content">
+<form name="news_form"
+      action="<?= $env->url(array("e" => "set_news_categories", "action" => "add_news_categorie")) ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px"></td>
+  </tr>
+  <tr>
+    <th>icone</th>
+    <td>
+      <input type="file" name="icone" style="width: 400px">
+    </td>
+  </tr>
+  <tr>
+    <th>description</th>
+    <td><textarea name="description" cols="50" rows="3"></textarea></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_news_categories.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_news_categories.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_news_categories.php	(revision 1)
@@ -0,0 +1,54 @@
+<h2>Les cat&eacute;gories de news</h2>
+<div class="bloc_content">
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_news_categories", "action" => "add_news_categorie")) ?>">Nouvelle cat&eacute;gorie</a></li>
+  </ul>
+<?php if($env->out["news_categories"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["news_categories"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " cat&eacute;gories de news"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>icone</th>
+    <th>titre</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["news_categories"]["list"] as $id_news_categorie => $news_categorie) : ?>
+  <tr class="hl">
+    <td>
+<?php if($news_categorie["icone"]) : ?>
+      <img src="<?= $news_categorie["icone"] ?>" />
+<?php else : ?>
+      &nbsp;
+<?php endif; ?>
+    </td>
+    <td><?= $news_categorie["titre"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_news_categories", "action" => "set_news_categorie", "categorie" => $id_news_categorie)) ?>"
+       class="admin_link"
+       title="modifier cette cat&eacute;gorie"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_news_categories", "action" => "del_news_categorie", "categorie" => $id_news_categorie)) ?>"
+       class="admin_link"
+       title="supprimer cette cat&eacute;gorie"
+       onclick="return confirm('supprimer cette cat&eacute;gorie ? Si la cat&eacute;gorie a une icone, elle sera aussi supprim&eacute;e.')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucune cat&eacute;gorie pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_set_news_categorie.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_set_news_categorie.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_news_categories/e_set_news_categorie.php	(revision 1)
@@ -0,0 +1,43 @@
+<h2>Editer une cat&eacute;gorie de news</h2>
+<div class="bloc_content">
+<form name="news_form"
+      action="<?=
+        $env->url
+        ( array
+          ( "e" => "set_news_categories",
+            "action" => "set_news_categorie",
+            "categorie" => $env->out["news_categorie"]["id"]
+          )
+        ) ?>"
+      method="post"
+      enctype="multipart/form-data">
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["news_categorie"]["titre"] ?>" /></td>
+  </tr>
+  <tr>
+    <th>icone</th>
+    <td>
+<?php if($env->out["news_categorie"]["icone"]) : ?>
+<img src="<?= $env->out["news_categorie"]["icone"] ?>" /><br />
+<input type="checkbox" name="del_icone" />effacer l'icone
+<?php else : ?>
+aucune icone pour le moment
+<?php endif; ?>
+      <br />
+      <input type="file" name="icone" style="width: 400px">
+    </td>
+  </tr>
+  <tr>
+    <th>description</th>
+    <td><textarea name="description" cols="50" rows="3"><?= $env->out["news_categorie"]["description"] ?></textarea></td>
+  </tr>
+</table>
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_add_page.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_add_page.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_add_page.php	(revision 1)
@@ -0,0 +1,50 @@
+<h2>Nouvelle page</h2>
+<div class="bloc_content">
+<form name="page_form" action="<?= $env->url(array("e" => "set_pages", "action" => "add_page")) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<input type="hidden" name="public"  value="1" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["page"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>fichier</th>
+    <td>
+      <input type="text" name="fichier" style="width: 500px" value="<?= $env->out["page"]["fichier"] ?>">
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un fichier pour le contenu de la page.<br />
+        Le fichier doit se trouver dans le dossier <strong>pages</strong> du repertoire du template.<br />
+        <strong>note</strong> : si vous pr&eacute;cisez un fichier, le contenu ci-dessous ne sera pas affich&eacute;.
+      </div>
+    </td>
+  </tr>
+</table>
+<br />
+      <textarea name="contenu" id="contenu" style="width: 765px; height: 400px;"><?= $env->out["page"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "contenu",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center" colspan="2"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_pages.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_pages.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_pages.php	(revision 1)
@@ -0,0 +1,52 @@
+<h2>Les pages</h2>
+<div class="bloc_content">
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_pages", "action" => "add_page")) ?>">Nouvelle page</a></li>
+  </ul>
+<?php if($env->out["pages"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["pages"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " pages"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <th>url</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["pages"]["list"] as $id_page => $page) : ?>
+  <tr class="hl">
+    <td><?= $page["titre"] ?></td>
+    <td>
+      <a href="<?= "http://".$_SERVER["SERVER_NAME"].$env->url(array("e" => "page", "id" => $id_page)) ?>">
+        <?= "http://".$_SERVER["SERVER_NAME"].$env->url(array("e" => "page", "id" => $id_page)) ?>
+      </a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_pages", "action" => "set_page", "id" => $id_page)) ?>"
+       class="admin_link"
+       title="modifier cette page"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_pages", "action" => "del_page", "id" => $id_page)) ?>"
+       class="admin_link"
+       title="supprimer cette page"
+       onclick="return confirm('supprimer cette page ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucune page pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_set_page.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_set_page.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_pages/e_set_page.php	(revision 1)
@@ -0,0 +1,50 @@
+<h2>Modifier une page</h2>
+<div class="bloc_content">
+<form name="page_form" action="<?= $env->url(array("e" => "set_pages", "action" => "set_page", "id" => $env->out["page"]["id"])) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<input type="hidden" name="public"  value="1" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["page"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>fichier</th>
+    <td>
+      <input type="text" name="fichier" style="width: 500px" value="<?= $env->out["page"]["nom"] ?>">
+      <div class="info">
+        Vous pouvez pr&eacute;ciser un fichier pour le contenu de la page.<br />
+        Le fichier doit se trouver dans le dossier <strong>pages</strong> du repertoire du template.<br />
+        <strong>note</strong> : si vous pr&eacute;cisez un fichier, le contenu ci-dessous ne sera pas affich&eacute;.
+      </div>
+    </td>
+  </tr>
+</table>
+<br />
+      <textarea name="contenu" id="contenu" style="width: 765px; height: 400px;"><?= $env->out["page"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "contenu",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center" colspan="2"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_add_spotlight.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_add_spotlight.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_add_spotlight.php	(revision 1)
@@ -0,0 +1,79 @@
+<h2>Nouveau spotlight</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["_spotlight"] = $env->out["preview"]; ?>
+
+<h3><?= $env->out["_spotlight"]["titre"] ?></h3>
+<p class="by">
+  par <?= $env->out["_spotlight"]["auteur"] ?> -
+  <?= $env->out["_spotlight"]["date_publication"] ? $env->out["_spotlight"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["_spotlight"]["contenu"]) ?>
+
+<br/><br/>
+<?php endif; ?>
+
+<form name="spotlight_form" action="<?= $env->url(array("e" => "set_spotlights", "action" => "add_spotlight")) ?>" method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["_spotlight"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <div class="info">cochez cette case pour rendre le spotlight public</div>
+      <input type="checkbox" name="public" <?=
+             isset($env->out["_spotlight"]["public"]) ? ($env->out["_spotlight"]["public"] ? "checked" : "") : "checked" ?>>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Le spotlight qui appara&icirc;t sur le site est celui dont la date de publication est la plus r&eacute;cente<br/>
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["_spotlight"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="spotlight" id="spotlight" style="width: 765px; height: 400px;"><?= $env->out["_spotlight"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "spotlight",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['spotlight_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_set_spotlight.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_set_spotlight.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_set_spotlight.php	(revision 1)
@@ -0,0 +1,80 @@
+<h2>Modifier le spotlight</h2>
+<div class="bloc_content">
+
+<?php if($env->out["preview"]) : $env->out["_spotlight"] = $env->out["preview"]; ?>
+
+<h3><?= $env->out["_spotlight"]["titre"] ?></h3>
+<p class="by">
+  par <?= $env->out["_spotlight"]["auteur"] ?> -
+  <?= $env->out["_spotlight"]["date_publication"] ? $env->out["_spotlight"]["date_publication"] : date("Y-m-d H:i:s") ?>
+</p>
+<?= $env->data->html($env->out["_spotlight"]["contenu"]) ?>
+
+<br/><br/>
+<?php endif; ?>
+
+<form name="spotlight_form"
+      action="<?= $env->url(array("e" => "set_spotlights", "action" => "set_spotlight", "spotlight" => $_GET[$env->param("spotlight")])) ?>"
+      method="post">
+<input type="hidden" name="preview" value="0" />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <td><input type="text" name="titre" style="width: 500px" value="<?= $env->out["_spotlight"]["titre"] ?>"></td>
+  </tr>
+  <tr>
+    <th>public</th>
+    <td>
+      <div class="info">cochez cette case pour rendre le spotlight public</div>
+      <input type="checkbox" name="public" <?= $env->out["_spotlight"]["public"] ? "checked" : "" ?>/>
+    </td>
+  </tr>
+  <tr>
+    <th>date de publication</th>
+    <td>
+      <div class="info">
+        Le spotlight qui appara&icirc;t sur le site est celui dont la date de publication est la plus r&eacute;cente<br/>
+        Vous pouvez pr&eacute;ciser une date dans le future pour un affichage &agrave; la date voulue<br/>
+        Laissez vide pour que la date de publication soit la date actuelle.<br/><br/>
+        format : aaaa-mm-jj<br/>
+        ou : aaaa-mm-jj hh-mm-ss
+      </div>
+      <link href="<?= $env->out_file("css/ds.css") ?>" rel="stylesheet" type="text/css" />
+      <input type="text" name="date_publication" value="<?= $env->out["_spotlight"]["date_publication"] ?>" onclick="ds_sh(this, ' 00:00:00');">
+    </td>
+  </tr>
+  <tr class="ds_box" id="ds_conclass" style="display: none;">
+    <th>calendrier</th>
+    <td id="ds_calclass"></td>
+  </tr>
+</table>
+<br />
+      <textarea name="spotlight" id="spotlight" style="width: 765px; height: 400px;"><?= $env->out["_spotlight"]["contenu"] ?></textarea>
+      <script type="text/javascript" src="<?= $env->path("tinymce") ?>jscripts/tiny_mce/tiny_mce.js"></script>
+      <script type="text/javascript">
+      tinyMCE.init
+      ( { mode: "exact",
+          elements : "spotlight",
+          theme : "advanced",
+          plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
+          theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,image",
+          theme_advanced_buttons2 : null,
+          theme_advanced_buttons3 : null,
+          theme_advanced_toolbar_location : "top",
+          theme_advanced_toolbar_align : "left",
+          theme_advanced_statusbar_location : "bottom",
+          theme_advanced_resizing : true,
+          content_css : "<?= $env->out_file("css/tiny_mce.css") ?>"
+        }
+      );
+      </script>
+<br />
+<table class="admin">
+  <tr>
+    <td align="center"><input type="submit" value="Pr&eacute;visualiser" onclick="document.forms['spotlight_form'].preview.value='1'" /></td>
+    <td align="center"><input type="submit" value="Enregistrer" /></td>
+  </tr>
+</table>
+      <script type="text/javascript" src="<?= $env->out_file("js/ds.js") ?>"></script>
+</form>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_spotlights.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_spotlights.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/content/set_spotlights/e_spotlights.php	(revision 1)
@@ -0,0 +1,50 @@
+<h2>Les spotlights</h2>
+<div class="bloc_content">
+  <ul>
+    <li><a href="<?= $env->url(array("e" => "set_spotlights", "action" => "add_spotlight")) ?>">Nouveau spotlight</a></li>
+  </ul>
+<?php if($env->out["spotlights"]["list"]) : ?>
+
+<?php
+
+  echo navig
+  ( $env->start,
+    $env->out["spotlights"]["total"],
+    $env->config("max_list"),
+    $_SERVER["REQUEST_URI"],
+    $env->param("start"),
+	 " spotlights"
+  );
+
+?>
+<br /><br />
+<table class="admin">
+  <tr>
+    <th>titre</th>
+    <th>date de publication</th>
+    <th>auteur</th>
+    <th colspan="2">actions</th>
+  </tr>
+<?php foreach($env->out["spotlights"]["list"] as $id_spotlight => $spotlight) : ?>
+  <tr class="hl">
+    <td><?= $spotlight["titre"] ?></td>
+    <td><?= $spotlight["date_publication"] ?></td>
+    <td><?= $spotlight["auteur"] ?></td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_spotlights", "action" => "set_spotlight", "spotlight" => $id_spotlight)) ?>"
+       class="admin_link"
+       title="modifier ce spotlight"><img src="<?= $env->out_file("icons/edit.gif") ?>" /></a>
+    </td>
+    <td align="center">
+    <a href="<?= $env->url(array("e" => "set_spotlights", "action" => "del_spotlight", "spotlight" => $id_spotlight)) ?>"
+       class="admin_link"
+       title="supprimer ce spotlight"
+       onclick="return confirm('supprimer ce spotlight ?')"><img src="<?= $env->out_file("icons/del.gif") ?>" /></a>
+    </td>
+  </tr>
+<?php endforeach; ?>
+</table>
+<?php else : ?>
+  <p>Aucun spotlight pour le moment...</p>
+<?php endif; ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes.css	(revision 1)
@@ -0,0 +1,441 @@
+/* ------------------------ blocs dans le listing des artistes */
+
+ul.artiste_mini_blocs li
+{ float: left;
+  width: 230px;
+  margin: 15px 5px 5px 15px;
+/*  margin: 20px 5px 5px 60px;*/
+}
+
+ul.artiste_mini_blocs li a
+{ text-decoration: none;
+  display: block;
+  width: 220px;
+  height: 110px;
+  padding: 5px;
+  background-color: #202020;
+  border: solid 1px #303030;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul.artiste_mini_blocs li a span.image
+{ display: block;
+  float: left;
+  width: 104px;
+  height: 110px;
+  text-align: center;
+  background-color: #151515;
+  border: solid 1px #303030;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul.artiste_mini_blocs li a span
+{ display: block;
+  float: right;
+  width: 111px;
+  text-align: right;
+}
+
+ul.artiste_mini_blocs li a span.nom
+{ font-weight: bold;
+}
+
+ul.artiste_mini_blocs li a:hover span.nom
+{ text-decoration: underline;
+}
+
+ul.artiste_mini_blocs li a span.style
+{ margin-top: 20px;
+  font-size: 0.9em;
+}
+
+/* ------------------------ onglets des pages artistes */
+
+#artiste_onglets
+{ margin: 10px 20px 10px 20px;
+}
+
+.artiste_edit_onglet
+{ float: right;
+}
+
+.artiste_onglet
+{ float: left;
+}
+
+/* ------------------------ entete des pages artistes */
+
+#artiste_left
+{ float: left;
+  width: 250px;
+}
+
+#artiste_right
+{ float: left;
+  width: 488px;
+  padding: 0 10px 0 20px;
+}
+
+#artiste_player
+{
+}
+
+#last_albums_bloc a
+{ display: block;
+  text-align: center;
+  float: none;
+  width: auto;
+  padding: 5px 5px 15px 5px;
+  margin: 5px 0px 0px 0px;
+}
+
+#last_albums_bloc a:hover
+{ text-decoration: none;
+}
+
+#last_albums_bloc a span
+{ display: block;
+  text-align: center;
+  padding: 3px 0px 10px 0px;
+}
+
+#last_albums_bloc a img
+{
+}
+
+#last_albums_bloc a strong
+{ display: block;
+  text-align: center;
+  padding: 3px 0px 10px 0px;
+}
+
+
+.last_album_link
+{ display: block;
+  text-align: center;
+}
+
+.last_album_link:hover
+{ text-decoration: none;
+}
+
+#artiste_logo
+{ width: 240px;
+  height: 190px;
+  overflow: hidden;
+  text-align: center;
+  background-color: #131313;
+  border: solid 1px #333333;
+  padding: 5px;
+}
+
+#artiste_logo a
+{ display: block;
+  width: 238px;
+  height: 190px;
+}
+
+#reseaux_sociaux
+{ text-align: center;
+  padding: 10px 0px 10px 0px;
+  background-color: #131313;
+  border: solid 1px #333333;
+}
+
+#reseaux_sociaux img
+{ margin: 0px 10px 0px 10px;
+}
+
+
+
+
+ul#download_list
+{ list-style-type: none;
+  margin: 0px;
+  padding: 0px;
+
+}
+
+ul#download_list li
+{ margin: 0px;
+  padding: 0px;
+}
+
+ul#download_list li a.all
+{ display: block;
+  padding: 5px;
+  margin: 0px 0px 10px 0px;
+  background-color: #202020;
+  font-weight: bold;
+}
+
+ul#download_list li span.titre
+{ display: block;
+  padding: 5px;
+  margin: 0px 0px 10px 0px;
+  background-color: #202020;
+  font-weight: bold;
+}
+
+ul#download_list li a.artiste_album_link
+{ display: block;
+  padding: 5px;
+  border: solid 1px #202020;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+  margin: 0px 0px 5px 0px;
+}
+
+ul#download_list li a.artiste_album_link:hover
+{ /*text-decoration: none;*/
+}
+
+ul#download_list li a.artiste_album_link img
+{ /*width: 90px;*/
+}
+
+ul#download_list li .artiste_album_link span
+{ display: block;
+  float: right;
+  text-align: right;
+  padding-top: 5px;
+  font-size: 1.1em;
+  width: 105px;
+}
+
+
+
+
+
+
+
+#soutenir_artiste
+{ padding: 10px 0px 10px 0px;
+  background-color: #131313;
+  border: solid 1px #333333;
+}
+
+#soutenir_artiste h3
+{ text-align: center;
+  font-weight: normal;
+  color: #dad3bc;
+  border-bottom: dashed 1px #333333;
+  padding-bottom: 5px;
+}
+
+#soutenir_artiste span
+{ display: block;
+  text-align: center;
+  padding: 5px;
+}
+
+#don_artiste
+{ float: left;
+  width: 50%;
+  text-align: center;
+}
+
+#lien_boutique_artiste
+{ float: left;
+  width: 50%;
+  text-align: center;
+}
+
+#artiste_infos
+{
+}
+
+#artiste_right img
+{ max-width: 450px;
+}
+
+/* ------------------------ listing des downloads */
+
+.download
+{ padding: 5px;
+  border: solid 1px #191919;
+  margin-top: 5px;
+}
+
+.playing_download
+{ padding: 5px;
+  border: solid 1px #232323;
+  background-color: #151515;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+  margin-top: 5px;
+}
+
+.download h3, .playing_download h3
+{ float: left;
+  width: 430px;
+}
+
+#album_date
+{ font-weight: normal;
+  font-size: 0.8em;
+}
+
+.dright
+{ float: right;
+  width: 216px;
+  text-align: right;
+}
+
+.dleft
+{ float: left;
+  width: 260px;
+}
+
+a.file_format
+{ display: block;
+  width: 30px;
+  height: 12px;
+  line-height: 9px;
+  font-size: 9px;
+  text-align: center;
+  background-image: url("../icons/ext.png");
+  float: left;
+  margin-left: 3px;
+}
+
+a.file_format:hover
+{ text-decoration: none;
+}
+
+.download_licence
+{ display: block;
+  float: right;
+  margin-top: 3px;
+}
+
+/* ------------------------ players */
+
+.player_progress
+{ width: 100%;
+  height: 2px;
+  font-size: 2px;
+  line-height: 2px;
+  background-color: #333333;
+  overflow: hidden;
+  margin: 4px 0 3px 0;
+}
+
+.player_progress .loaded
+{ width: 0;
+  height: 2px;
+  background-color: #3a3a3a;
+}
+
+.player_progress .position
+{ width: 0;
+  height: 2px;
+//  background-color: #706c61;
+  background-color: #555555;
+  position: relative;
+  top: -2px;
+}
+
+.player_controls
+{ margin: 1px 1px 0 0;
+  float: left;
+}
+
+.player_controls a
+{ text-decoration: none;
+  display: block;
+  float: left;
+  width: 16px;
+  height: 16px;
+  margin-right: 5px;
+}
+
+.player_controls a span
+{ display: none;
+}
+
+.player_controls a.play
+{ background-image: url("../icons/player/play.png");
+}
+
+.player_controls a.play:hover
+{ background-image: url("../icons/player/play_over.png");
+}
+
+.player_controls a.pause
+{ background-image: url("../icons/player/pause.png");
+  display: none;
+}
+
+.player_controls a.pause:hover
+{ background-image: url("../icons/player/pause_over.png");
+}
+
+.player_controls a.stop
+{ background-image: url("../icons/player/stop.png");
+  display: none;
+}
+
+.player_controls a.stop:hover
+{ background-image: url("../icons/player/stop_over.png");
+}
+
+/* ------------------------ entete admin artiste */
+
+#artiste_admin_infos
+{ float: left;
+  width: 500px;
+}
+
+/* ------------------------ bloc playlists */
+
+#playlists h4
+{ padding: 0px 0px 0px 0px;
+  margin: 0px 0px 0px 0px;
+  font-weight: bold;
+  color: #dad3bc;
+}
+
+#playlists ul
+{ margin: 0px;
+  padding: 0px 0px 0px 0px;
+}
+
+#playlists ul li
+{ margin: 3px;
+  float: right;
+}
+
+#playlists ul li a
+{ display: block;
+  padding: 5px 10px 5px 10px;
+  border: solid 1px #333333;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+  line-height: 12px;
+}
+
+#playlists ul li a:hover
+{ text-decoration: none;
+  background-color: #202020;
+}
+
+#playlists ul li a img
+{ height: 12px;
+}
+
+/*
+#playlists ul li.sep
+{ border-left: solid 1px #333333;
+}
+
+#playlists ul li.last
+{ border-right: solid 1px #333333;
+}
+*/
+
+#playlists .clear
+{ margin-bottom: 13px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes_au_hasard.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes_au_hasard.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/artistes_au_hasard.css	(revision 1)
@@ -0,0 +1,17 @@
+#artistes_au_hasard
+{ padding-left: 5px;
+}
+
+#artistes_au_hasard a
+{ display: block;
+  width: 60px;
+  height: 60px;
+  float: left;
+  overflow: hidden;
+  margin: 4px;
+}
+
+#artistes_au_hasard a img
+{ width: 60px;
+  height: 60px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/bloc.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/bloc.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/bloc.css	(revision 1)
@@ -0,0 +1,49 @@
+#main_content .bloc
+{ margin: 5px 0 10px 0;
+}
+
+#main_content .bloc_content
+{ margin: 0px;
+  padding: 10px;
+  font-size: 0.9em;
+  background-color: #191919;
+  border-left: solid 1px #2c2c2c;
+  border-right: solid 1px #2c2c2c;
+  border-bottom: solid 1px #2c2c2c;
+  border-radius: 0 0 3px 3px;
+  -moz-border-radius: 0 0 3px 3px;
+}
+
+#main_content .bloc ul
+{ list-style-type: none;
+}
+
+#main_content .bloc h2
+{ color: #dad3bc;
+  line-height: 25px;
+  padding-left: 30px;
+  margin: 0;
+  font-size: 1.3em;
+  font-weight: normal;
+  line-height: 1.7em;
+  background-color: #0f0f0f;
+  border: solid 1px #2c2c2c;
+  border-radius: 3px 3px 0 0;
+  border-radius: 3px 3px 0 0;
+  -moz-border-radius: 3px 3px 0 0;    
+
+}
+
+#main_content .bloc h2 a:hover
+{ text-decoration: none;
+  color: #dfdfdf;
+}
+
+#main_content .bloc h3
+{
+}
+
+#main_content .bloc p
+{ margin: 10px 0 5px 0;
+  text-align: justify;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/footer.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/footer.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/footer.css	(revision 1)
@@ -0,0 +1,31 @@
+#footer
+{
+}
+
+#footer .content
+{ /*border-top: solid 1px #252525;*/
+  padding: 10px 0 20px 0;
+}
+
+#footer_content
+{ color: #555555;
+  font-size: 0.8em;
+  background-image: url("../images/footer_bkg.png");
+}
+
+#footer_navig
+{ float: left;
+  width: 480px;
+  padding: 0 10px 0 10px;
+}
+
+.footer_menu_part
+{ float: right;
+  margin: 0 0 10px 10px;
+}
+
+#footer_infos
+{ float: left;
+  width: 480px;
+  padding: 0 10px 0 10px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/general.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/general.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/general.css	(revision 1)
@@ -0,0 +1,172 @@
+@import url("bloc.css");
+@import url("news.css");
+@import url("pages.css");
+
+body
+{ font: normal 80% Verdana, Helvetica, Arial, sans-serif;
+  background-color: #1f1f1f;
+  color: #c0c0c0;
+  font-size: 12px;
+}
+
+a
+{ text-decoration: none;
+  color: #dad3bc;
+}
+
+a:hover
+{ text-decoration: underline;
+}
+
+a img
+{ border: none;
+}
+
+table.admin
+{ width: 100%;
+}
+
+table.admin th, table.admin td
+{ vertical-align: top;
+}
+
+table.admin th
+{ border: solid 1px #999999;
+}
+
+table.admin tr.hl:hover
+{ background-color: #3a3a3a;
+}
+
+table.admin input, table.admin textarea, table.admin select
+{ border: solid 1px #666666;
+  background-color: #444444;
+  color: #c0c0c0;
+}
+
+ul
+{ padding-left: 15px;
+}
+
+h1
+{ color: #c0c0c0;
+}
+
+h2
+{ margin-top: 5px;
+  border-bottom: solid 1px #c0c0c0;
+  margin-bottom: 10px;
+}
+
+p
+{ text-align: justify;
+}
+
+p.by
+{ text-align: right;
+  font-size: 0.9em;
+  font-style: italic;
+  margin-bottom: 10px;
+}
+
+.filtre
+{ text-align: right;
+  margin: 10px 5px 10px 5px;
+}
+
+.navig
+{ text-align: right;
+}
+
+#search_results h2
+{ border-bottom: dashed 1px #c0c0c0;
+}
+
+select
+{ border: solid 1px #555555;
+  background-color: #1f1f1f;
+  color: #c0c0c0;
+/*  padding: 3px;
+  border-radius: 3px;
+  -moz-border-radius: 3px;
+  -webkit-border-radius: 3px;*/
+}
+
+.info_mini_right
+{ float: right;
+  padding-right: 10px;
+  margin-top: -5px;
+}
+
+.info_mini_right img
+{ width: 20px;
+}
+
+#soutenir_site
+{ padding: 0px 0px 10px 0px;
+}
+
+#soutenir_site h3
+{ text-align: center;
+  font-weight: normal;
+  color: #dad3bc;
+  border-bottom: dashed 1px #333333;
+  padding-bottom: 5px;
+}
+
+#soutenir_site span
+{ display: block;
+  text-align: center;
+  padding: 5px;
+}
+
+
+
+
+#flickr_bloc
+{ float: right;
+}
+
+#flickr_bloc a
+{ display: block;
+  float: left;
+  margin: 0px 15px 0px 0px;
+  padding: 0px;
+  background-color: #0f0f0f;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+  height: 110px;
+  width: 110px;
+  text-align: center;
+}
+
+#flickr_bloc a:hover
+{ background-color: #252525;
+}
+
+#don_site
+{ float: left;
+  width: 50%;
+  text-align: center;
+}
+
+#lien_boutique_site
+{ float: left;
+  width: 50%;
+  text-align: center;
+}
+
+#soutenir_site .info_mini_right
+{ margin-top: 10px;
+  float: left;
+  line-height: 20px;
+}
+
+#soutenir_site .info_mini_right img
+{ float: left;
+  margin-right: 10px;
+}
+
+#soutenir_site a.info_mini_right:hover
+{ text-decoration: none;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/header.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/header.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/header.css	(revision 1)
@@ -0,0 +1,20 @@
+@import url("artistes_au_hasard.css");
+@import url("menu_top.css");
+@import url("login.css");
+
+#header
+{ background-image: url("../images/header_bkg.png");
+}
+
+#header .content
+{ height: 165px;
+}
+
+#header #accueil_link
+{ padding: 25px 0 0 135px;
+}
+
+#header #accueil_link a
+{ display: block;
+  width: 590px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/login.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/login.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/login.css	(revision 1)
@@ -0,0 +1,63 @@
+#identification
+{ float: right;
+  margin: 7px 10px 0 0;
+  color: #999999;
+  font-size: 0.9em;
+  height: 91px;
+  overflow: hidden;
+}
+
+#identification input
+{ border: solid 1px #777777;
+  background-color: #333333;
+  color: #c0c0c0;
+}
+
+#identification th
+{ padding: 0 10px 0 10px;
+}
+
+#identification table
+{ float: right;
+}
+
+#identification .bloc_content
+{ text-align: right;
+}
+
+#identification .bloc_content p
+{ text-align: right;
+  margin-top: 5px;
+}
+
+#identification ul
+{ list-style-type: none;
+}
+
+/* ----------------------- login box -------------------- */
+
+#pun_login_form
+{ font-size: 0.9em;
+  margin-top: 10px;
+}
+
+#pun_login_form input.txt
+{ width: 100px;
+  padding: 1px;
+  font-size: 1em;
+}
+
+#pun_login_form input.submit
+{ padding: 0px;
+  font-size: 1em;
+}
+
+#pun_login_menu
+{ text-align: right;
+  font-size: 0.9em;
+  margin-top: 62px;
+}
+
+#pun_login_menu ul li
+{ display: inline;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/main.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/main.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/main.css	(revision 1)
@@ -0,0 +1,3 @@
+#main_content
+{
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/menu_top.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/menu_top.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/menu_top.css	(revision 1)
@@ -0,0 +1,75 @@
+#navigation
+{ float: left;
+  position: relative;
+  top: 2px;
+  left: 120px;
+  font-size: 1.1em;
+  font-weight: bold;
+}
+
+ul#Nav, ul#Nav li, ul#Nav ul, ul#Nav ul li
+{ padding: 0;
+  margin: 0;
+  list-style: none;
+}
+
+ul#Nav
+{ margin-left: 0px;
+}
+
+#Nav li
+{ float: left;
+}
+
+#Nav li ul
+{ background-color: #191919;
+  position: absolute;
+  z-index: 1;
+}
+
+#Nav li ul li
+{ float: none;
+}
+
+#Nav li a
+{ display: block;
+/*  color: #c0c0c0;*/
+  font-weight: normal;
+  text-decoration: none;
+  line-height: 25px;
+  padding: 0 20px 0 20px;
+}
+
+#Nav li a:hover
+{ color: #ffffff;
+}
+
+#Nav li.menu_name a
+{ line-height: 30px;
+}
+
+.Menu
+{ display: none;
+}
+
+.Menu li
+{ border-left: solid 1px #2c2c2c;
+  border-right: solid 1px #2c2c2c;
+}
+
+#Nav .Menu li a
+{ color: #c0c0c0;
+  line-height: 25px;
+}
+
+#Nav .Menu li a:hover
+{ color: #ffffff;
+}
+
+.Menu li.last
+{ border-bottom: solid 1px #2c2c2c;
+}
+
+.Menu li a span
+{ font-weight: normal;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/messages.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/messages.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/messages.css	(revision 1)
@@ -0,0 +1,26 @@
+.message, .redirect_message .erreur
+{
+}
+
+.message div
+{ margin: 5px 100px 0px 100px;
+  border: solid 1px #555555;
+  padding: 10px;
+  text-align: center; 
+  background-color: #333333;
+  color: #777777;
+}
+
+.erreur div
+{ margin: 50px 100px 50px 100px;
+  border: solid 1px #790000;
+  padding: 20px;
+  color: #777777;
+}
+
+.redirect_message div
+{ margin: 50px 100px 50px 100px;
+  border: solid 1px #777777;
+  padding: 20px;
+  color: #777777;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/news.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/news.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/news.css	(revision 1)
@@ -0,0 +1,119 @@
+.news
+{ margin: 0px 0px 0px 0px;
+  padding-top: 10px;
+}
+
+#main_content .bloc .news h3
+{ border-bottom: solid 1px #555555;
+}
+
+#main_content .bloc .news.accueil
+{ padding-top: 0px;
+}
+
+#main_content .bloc .news.accueil h3
+{ border-bottom: none;
+  font-weight: normal;
+}
+
+.news h3 a
+{ color: #dad3bc;
+  display: block;
+  padding: 5px;
+}
+
+.news h3 span
+{ color: #333333;
+  display: block;
+  padding: 5px;
+}
+
+.news h3 a:hover
+{ text-decoration: none;
+}
+
+.news_categorie
+{ float: left;
+  width: 100px;
+}
+
+.news_main
+{ float: left;
+  width: 560px;
+}
+
+/* ---------------------------- news bloc */
+
+#news_box
+{
+}
+
+ul.last_news
+{ margin: 10px 0px 0px 0px;
+  padding: 0px;
+}
+
+ul.last_news li
+{ margin: 0px;
+  padding: 0px 0px 0px 0px;
+}
+
+ul.last_news li a
+{ display: block;
+  font-size: 1.2em;
+  background-color: #111111;
+  border: solid 1px #1f1f1f;
+  padding: 5px;
+  margin: 0px 0px 5px 0px;
+  border-radius: 3px 3px 3px 3px;
+  -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul.last_news li a:hover
+{ text-decoration: none;
+  background-color: #151515;
+}
+
+.news_actegories_menu
+{ float: right;
+  position: relative;
+}
+
+.news_actegories_menu h3
+{ background-color: #0f0f0f;
+  border: solid 1px #303030;
+  padding: 0px 30px 0px 7px;
+  line-height: 2em;
+  background-image: url("../icons/select.png");
+  background-repeat: no-repeat;
+  background-position: right 10px;
+}
+
+.news_actegories_menu ul
+{ position: absolute;
+  top: 2.5em;
+  right: 0px;
+  border: solid 1px #303030;
+  margin: 0px;
+  padding: 0px;
+  display: none;
+}
+
+.news_actegories_menu ul li
+{ margin: 0px;
+  padding: 0px;
+}
+
+.news_actegories_menu li a
+{ display: block;
+  background-color: #0f0f0f;
+  white-space: nowrap;
+  padding: 5px 15px 5px 15px;
+  background-repeat: no-repeat;
+  background-position: right 10px;
+}
+
+.news_actegories_menu li a:hover
+{ text-decoration: none;
+  background-color: #202020;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages.css	(revision 1)
@@ -0,0 +1,43 @@
+#main_content .bloc #cgus h1,
+#main_content .bloc #cgus h2,
+#main_content .bloc #cgus h3,
+#main_content .bloc #cgus h4
+{ background-color: transparent;
+  background-image: none;
+  border: none;
+  color: #c0c0c0;
+}
+
+#main_content .bloc #cgus h2
+{ font-size: 1.6em;
+  margin: 10px 0px 10px 0px;
+}
+
+#main_content .bloc #cgus p,
+#main_content .bloc #cgus ul
+{ font-size: 1.1em;
+}
+
+#main_content .bloc #cgus p
+{ margin: 5px 10px 5px 10px;
+}
+
+#main_content .bloc #cgus ul
+{ list-style-type: circle;
+  margin: 10px 10px 10px 30px;
+}
+
+#main_content .bloc #cgus h3
+{ font-size: 1.3em;
+  margin: 10px 0px 10px 30px;
+}
+
+#main_content .bloc #cgus h4
+{ font-size: 1.2em;
+  margin: 10px 0px 10px 30px;
+}
+
+#main_content .bloc #cgus strong
+{ color: #c1bba6;
+  border-bottom: dashed 1px #59564d;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/1_colonne.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/1_colonne.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/1_colonne.css	(revision 1)
@@ -0,0 +1,5 @@
+@import url("../style.css");
+
+#center
+{ padding: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/2_colonnes.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/2_colonnes.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/2_colonnes.css	(revision 1)
@@ -0,0 +1,13 @@
+@import url("../style.css");
+
+#left
+{ float: left;
+  width: 190px;
+  padding: 5px;
+}
+
+#center
+{ float: left;
+  width: 790px;
+  padding: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/accueil.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/accueil.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/accueil.css	(revision 1)
@@ -0,0 +1,172 @@
+@import url("../style.css");
+
+#left
+{ float: left;
+  width: 190px;
+  padding: 5px;
+}
+
+#center
+{ float: left;
+  width: 790px;
+  padding: 5px;
+}
+
+#accueil_header .content
+{ height: 100px;
+}
+
+#accueil
+{ position: relative;
+  height: 400px;
+}
+
+#accueil_intro
+{ background-color: #252525;
+  border: solid 1px #333333;
+  border-radius: 3px;
+  -moz-border-radius: 3px;
+  padding: 10px;
+/*  width: 690px;*/
+  text-align: justify;
+/*  margin: 0 0 0 145px;*/
+}
+
+#etoile
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+}
+
+#etoile_news
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+  display: none;
+}
+
+#etoile_contact
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+  display: none;
+}
+
+#etoile_forum
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+  display: none;
+}
+
+#etoile_son
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+  display: none;
+}
+
+#etoile_association
+{ position: absolute;
+  left: 265px;
+  top: 55px;
+  display: none;
+}
+
+#accueil_news
+{ position: absolute;
+  left: 60px;
+  top: 80px;
+}
+
+#accueil_contact
+{ position: absolute;
+  left: 430px;
+  top: 300px;
+}
+
+#accueil_forum
+{ position: absolute;
+  left: 525px;
+  top: 170px;
+}
+
+#accueil_son
+{ position: absolute;
+  left: 442px;
+  top: 37px;
+}
+
+#accueil_association
+{ position: absolute;
+  left: 53px;
+  top: 240px;
+}
+
+a.accueil_link
+{ font-size: 1.3em;
+  display: block;
+  width: 200px;
+  border-bottom: solid 1px #333333;
+}
+
+a.accueil_link:hover
+{ text-decoration: none;
+}
+
+#accueil_son a.accueil_link, #accueil_forum a.accueil_link, #accueil_contact a.accueil_link
+{ text-align: right;
+}
+
+.accueil_info
+{ background-color: #191919;
+  border: solid 1px #2c2c2c;
+  border-radius: 3px;
+  -moz-border-radius: 3px;
+  padding: 10px;
+  width: 300px;
+  position: relative;
+  left: -10px;
+  top: 5px;
+  filter: Alpha(opacity=80);
+  -moz-opacity: .80;
+  -khtml-opacity: 0.80;
+  opacity: .80;
+  display: none;
+/*  text-align: justify;*/
+}
+
+#accueil_news .accueil_info
+{ width: 160px;
+  position: relative;
+  left: 0px;
+  top: 5px;
+}
+
+#accueil_son .accueil_info
+{ width: 160px;
+  position: relative;
+  left: 18px;
+  top: 5px;
+}
+
+#accueil_forum .accueil_info
+{ width: 160px;
+  position: relative;
+  left: 18px;
+  top: 5px;
+}
+
+#accueil_contact .accueil_info
+{ width: 160px;
+  position: relative;
+  left: 18px;
+  top: 5px;
+}
+
+#accueil_association .accueil_info
+{ width: 160px;
+  position: relative;
+  left: 0px;
+  top: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/admin.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/admin.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/admin.css	(revision 1)
@@ -0,0 +1,13 @@
+@import url("../style.css");
+
+#left
+{ float: left;
+  width: 190px;
+  padding: 5px;
+}
+
+#center
+{ float: left;
+  width: 790px;
+  padding: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/carte.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/carte.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/carte.css	(revision 1)
@@ -0,0 +1,13 @@
+@import url("../style.css");
+
+#left
+{ float: left;
+  width: 190px;
+  padding: 5px;
+}
+
+#center
+{ float: left;
+  width: 790px;
+  padding: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/edito.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/edito.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/edito.css	(revision 1)
@@ -0,0 +1,25 @@
+@import url("../style.css");
+
+#left
+{ float: left;
+  width: 540px;
+  padding: 5px;
+}
+
+#right
+{ float: left;
+  width: 440px;
+  padding: 5px;
+}
+
+#bottom_left
+{ float: left;
+  width: 163px;
+  padding: 0 5px 0 0;
+}
+
+#bottom_right
+{ float: left;
+  width: 265px;
+  padding: 0 0 0 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/forum.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/forum.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/forum.css	(revision 1)
@@ -0,0 +1,27 @@
+@import url("../style.css");
+
+#body_forum
+{
+}
+
+#center
+{
+}
+
+#main_content.forum
+{
+}
+
+.forum .content
+{
+}
+
+#forum_footer
+{
+}
+
+#forum_footer .content
+{ border-top: solid 1px #555555;
+  padding: 10px 0 60px 0px;
+  color: #999999;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/popup.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/popup.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/pages/popup.css	(revision 1)
@@ -0,0 +1,75 @@
+*
+{ margin: 0;
+  padding: 0;
+}
+
+html
+{ height: 100%;
+}
+
+body
+{ text-align: center;
+  height: 100%;
+}
+
+pre, div { text-align: left; }
+
+.content
+{ margin: 10px auto 10px auto;
+  width: 500px;
+}
+
+.clear
+{ clear: both;
+  font-size: 0px;
+  line-height: 0px;
+  height: 0px;
+}
+
+body
+{ font: normal 80% Verdana, Helvetica, Arial, sans-serif;
+  background-color: #1f1f1f;
+  color: #c0c0c0;
+  font-size: 12px;
+}
+
+a
+{ text-decoration: none;
+  color: #dad3bc;
+}
+
+a:hover
+{ text-decoration: underline;
+}
+
+a img
+{ border: none;
+}
+
+ul
+{ padding-left: 30px;
+}
+
+h1
+{ color: #c0c0c0;
+}
+
+h2
+{ margin-top: 5px;
+  border-bottom: solid 1px #666666;
+  margin-bottom: 10px;
+}
+
+h3
+{ margin: 40px 0 5px 0;
+  border-bottom: solid 1px #333333;
+}
+
+h3.first
+{ margin: 5px 0 5px 0;
+}
+
+p
+{ text-align: justify;
+  margin: 10px 0 5px 0;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/style.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/style.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/style.css	(revision 1)
@@ -0,0 +1,35 @@
+@import url("general.css");
+@import url("header.css");
+@import url("main.css");
+@import url("footer.css");
+@import url("messages.css");
+@import url("artistes.css");
+
+*
+{ margin: 0;
+  padding: 0;
+}
+
+html
+{ height: 100%;
+}
+
+body
+{ text-align: center;
+  height: 100%;
+}
+
+pre, div { text-align: left; }
+
+.content
+{ margin-left: auto;
+  margin-right: auto;
+  width: 1000px;
+}
+
+.clear
+{ clear: both;
+  font-size: 0px;
+  line-height: 0px;
+  height: 0px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/thickbox.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/thickbox.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/thickbox.css	(revision 1)
@@ -0,0 +1,171 @@
+/* ----------------------------------------------------------------------------------------------------------------*/
+/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
+/* ----------------------------------------------------------------------------------------------------------------*/
+*{padding: 0; margin: 0;}
+
+/* ----------------------------------------------------------------------------------------------------------------*/
+/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
+/* ----------------------------------------------------------------------------------------------------------------*/
+#TB_window {
+	font: 12px Arial, Helvetica, sans-serif;
+	color: #333333;
+}
+
+#TB_secondLine {
+	font: 10px Arial, Helvetica, sans-serif;
+	color:#666666;
+}
+
+#TB_window a:link {color: #666666;}
+#TB_window a:visited {color: #666666;}
+#TB_window a:hover {color: #000;}
+#TB_window a:active {color: #666666;}
+#TB_window a:focus{color: #666666;}
+
+/* ----------------------------------------------------------------------------------------------------------------*/
+/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
+/* ----------------------------------------------------------------------------------------------------------------*/
+#TB_overlay {
+	position: fixed;
+	z-index:100;
+	top: 0px;
+	left: 0px;
+	height:100%;
+	width:100%;
+}
+
+.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;}
+.TB_overlayBG {
+	background-color:#000;
+	filter:alpha(opacity=75);
+	-moz-opacity: 0.75;
+	opacity: 0.75;
+}
+
+* html #TB_overlay { /* ie6 hack */
+     position: absolute;
+     height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+}
+
+#TB_window {
+	position: fixed;
+	background: #ffffff;
+	z-index: 102;
+	color:#000000;
+	display:none;
+	border: 4px solid #525252;
+	text-align:left;
+	top:50%;
+	left:50%;
+}
+
+* html #TB_window { /* ie6 hack */
+position: absolute;
+margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+}
+
+#TB_window img#TB_Image {
+	display:block;
+	margin: 15px 0 0 15px;
+	border-right: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
+	border-top: 1px solid #666;
+	border-left: 1px solid #666;
+}
+
+#TB_caption{
+	height:25px;
+	padding:7px 30px 10px 25px;
+	float:left;
+}
+
+#TB_closeWindow{
+	height:25px;
+	padding:11px 25px 10px 0;
+	float:right;
+}
+
+#TB_closeAjaxWindow{
+	padding:7px 10px 5px 0;
+	margin-bottom:1px;
+	text-align:right;
+	float:right;
+}
+
+#TB_closeAjaxWindow a
+{ text-decoration: none;
+  background-image: url("../icons/del.gif");
+  background-repeat: no-repeat;
+  line-height: 11px;
+  padding: 0 13px 0 0;
+}
+
+#TB_ajaxWindowTitle{
+	float:left;
+	padding:7px 0 5px 10px;
+	margin-bottom:1px;
+}
+
+#TB_title{
+	background-color:#e8e8e8;
+	height:27px;
+}
+
+#TB_ajaxContent{
+	clear:both;
+	padding:2px 15px 15px 15px;
+	overflow:auto;
+	text-align:left;
+	line-height:1.4em;
+}
+
+#TB_ajaxContent.TB_modal{
+	padding:15px;
+}
+
+#TB_ajaxContent p{
+	padding:5px 0px 5px 0px;
+}
+
+#TB_load{
+	position: fixed;
+	display:none;
+	height:13px;
+	width:208px;
+	z-index:103;
+	top: 50%;
+	left: 50%;
+	margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
+}
+
+* html #TB_load { /* ie6 hack */
+position: absolute;
+margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
+}
+
+#TB_HideSelect{
+	z-index:99;
+	position:fixed;
+	top: 0;
+	left: 0;
+	background-color:#fff;
+	border:none;
+	filter:alpha(opacity=0);
+	-moz-opacity: 0;
+	opacity: 0;
+	height:100%;
+	width:100%;
+}
+
+* html #TB_HideSelect { /* ie6 hack */
+     position: absolute;
+     height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+}
+
+#TB_iframeContent{
+	clear:both;
+	border:none;
+	margin-bottom:-1px;
+	margin-top:1px;
+	_margin-bottom:1px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/css/tiny_mce.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/css/tiny_mce.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/css/tiny_mce.css	(revision 1)
@@ -0,0 +1,6 @@
+body
+{ font: normal 80% Verdana, Helvetica, Arial, sans-serif;
+  background-color: #333333;
+  color: #c0c0c0;
+  font-size: 12px;
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/emplacements.xml
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/emplacements.xml	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/emplacements.xml	(revision 1)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<emplacements>
+  <emplacement>
+    <id>accueil_gauche</id>
+    <intitule>Accueil: colonne de gauche</intitule>
+  </emplacement>
+  <emplacement>
+    <id>accueil_droite_haut</id>
+    <intitule>Accueil: colonne de droite, en haut</intitule>
+  </emplacement>
+  <emplacement>
+    <id>accueil_droite_bas</id>
+    <intitule>Accueil: colonne de droite, en bas</intitule>
+  </emplacement>
+  <emplacement>
+    <id>accueil_petite_gauche</id>
+    <intitule>Accueil: petite colonne, partie gauche</intitule>
+  </emplacement>
+  <emplacement>
+    <id>accueil_petite_droite</id>
+    <intitule>Accueil: petite colonne, partie droite</intitule>
+  </emplacement>
+  <emplacement>
+    <id>accueil_footer</id>
+    <intitule>Accueil: footer</intitule>
+  </emplacement>
+  <emplacement>
+    <id>interne_gauche</id>
+    <intitule>Page interne: colonne de gauche</intitule>
+  </emplacement>
+</emplacements>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/head/content/default.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/head/content/default.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/head/content/default.php	(revision 1)
@@ -0,0 +1,1 @@
+<title><?= $env->config("site_name") ?></title>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_forum.php	(revision 1)
@@ -0,0 +1,5 @@
+<?php
+
+  echo $env->out["forum"]["head"];
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_playlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_playlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_playlist.php	(revision 1)
@@ -0,0 +1,2 @@
+<title><?= $env->config("site_name") ?></title>
+<script type="text/javascript" src="<?= $env->out_file("js/content/e_artistes.js") ?>"></script>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_rechercher.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_rechercher.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/head/content/e_rechercher.php	(revision 1)
@@ -0,0 +1,2 @@
+<title><?= $env->config("site_name") ?></title>
+<script type="text/javascript" src="<?= $env->out_file("js/content/e_artistes.js") ?>"></script>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/head/head.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/head/head.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/head/head.php	(revision 1)
@@ -0,0 +1,42 @@
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <link rel="shortcut icon" href="<?= $env->out_file("icons/favicon.ico") ?>" type="image/x-icon" />
+    <script type="text/javascript" src="<?= $env->out_file("js/jquery.js") ?>"></script>
+    <script type="text/javascript" src="<?= $env->out_file("js/thickbox.js") ?>"></script>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/thickbox.css") ?>" />
+<?php if($env->out_file_exists("css/pages/".$env->current_page.".css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/pages/".$env->current_page.".css") ?>" />
+<?php endif; ?>
+<?php if($env->out_file_exists("css/content/".$env->prefix.$env->e.".css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/content/".$env->prefix.$env->e.".css") ?>" />
+<?php elseif($env->out_file_exists("css/content/default.css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/content/default.css") ?>" />
+<?php endif; ?>
+<?php if($env->out_file_exists("js/script.js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/script.js") ?>"></script>
+<?php endif; ?>
+<?php if($env->out_file_exists("js/content/".$env->prefix.$env->e.".js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/content/".$env->prefix.$env->e.".js") ?>"></script>
+<?php elseif($env->out_file_exists("js/content/default.js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/content/default.js") ?>"></script>
+<?php endif; ?>
+<?php
+
+  if($env->out_file_exists("head/content/".$env->prefix.$env->e.".php"))
+  { require $env->out_file("head/content/".$env->prefix.$env->e.".php");
+  }
+  elseif($env->out_file_exists("head/content/default.php")) require $env->out_file("head/content/default.php");
+
+?>
+<script type="text/javascript">
+
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-26977912-1']);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+
+</script>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/index.php	(revision 1)
@@ -0,0 +1,20 @@
+<?php
+
+  $env->default_page = "2_colonnes";
+  $env->current_page = "";
+
+  $env->pages = array
+  ( "accueil" => "accueil",
+    "edito" => "edito",
+    "forum" => "forum",
+    "redirect" => "1_colonne",
+    "carte" => "carte",
+    "popup_info" => "popup"
+  );
+
+  $env->current_page = substr($env->e, 0, 4) == "set_" ? (substr($env->e, 0, 12) == "set_artiste_" ? "2_colonnes" : "admin") : $env->current_page;
+  $env->current_page = $env->pages[$env->e] ? $env->pages[$env->e] : ($env->current_page ? $env->current_page : $env->default_page);
+
+  require $env->out_file("layouts/".$env->current_page.".php");
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_accueil.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_accueil.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_accueil.js	(revision 1)
@@ -0,0 +1,33 @@
+var parts = ["son", "news", "association", "contact", "forum"];
+var current_part = 0;
+var RUNNING = true;
+
+$(document).ready
+( function()
+  { $(".accueil_block").hover
+    ( function()
+      { RUNNING = false;
+        $("#etoile_" + parts[current_part]).fadeOut(300);
+        $(this).find(".accueil_info").fadeIn(300);
+        var id = $(this).get(0).id.substr(7);
+        $("#etoile" + id).fadeIn(300);
+      },
+      function()
+      { $(this).find(".accueil_info").fadeOut(300);
+        var id = $(this).get(0).id.substr(7);
+        $("#etoile" + id).fadeOut(300);
+      }
+    );
+    //setTimeout("next_part()", 300);
+  }
+);
+
+function next_part()
+{ if(RUNNING)
+  { $("#etoile_" + parts[current_part]).fadeOut(450);
+    current_part++;
+    if(current_part > 4) current_part = 0;
+    $("#etoile_" + parts[current_part]).fadeIn(300);
+    setTimeout("next_part()", 200);
+  }
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_artistes.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_artistes.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/content/e_artistes.js	(revision 1)
@@ -0,0 +1,125 @@
+
+  $(document).ready
+  ( function()
+    { init_players();
+      init_player_listener();
+    }
+  );
+
+  var current_track = false;
+
+  function init_players()
+  { $("audio").each
+    ( function()
+      { var audio_elt = $(this).get(0);
+        var CAN_PLAY = false;
+        var id_track = $(this).attr("id").substring(6);
+        $(this).find("source").each
+        ( function()
+          { if(audio_elt.canPlayType($(this).attr("type"))) CAN_PLAY = true;
+          }
+        );
+        if(!CAN_PLAY) $("#track_" + id_track + " .player_controls").remove();
+        else
+        { audio_elt.addEventListener("ended", track_ended, false);
+          $("#player_controls_" + id_track + " .play").click(function() { play(id_track); return false; });
+          $("#player_controls_" + id_track + " .play").css("display: block");
+          $("#player_controls_" + id_track + " .pause").click(function() { pause(); return false; });
+          $("#player_controls_" + id_track + " .stop").click(function() { stop(); return false; });
+        }
+      }
+    );
+  }
+
+  function track_ended()
+  { gui_state("stoped");
+    var current_audio = $("#audio_" + current_track).get(0);
+    if(current_audio.currentTime) current_audio.currentTime = 0;
+    current_audio.pause();
+  }
+
+  function track_progress()
+  { if(current_track != false)
+    { var current_audio = $("#audio_" + current_track).get(0);
+      var position = Math.round((100 * current_audio.currentTime) / current_audio.duration);
+      $("#track_" + current_track).find(".position").get(0).style.width = position + "%";
+    }
+  }
+
+  function init_player_listener()
+  { setInterval("player_listener_update()", 300);
+  }
+
+  function player_listener_update()
+  { if(current_track != false)
+    { var current_audio = $("#audio_" + current_track).get(0);
+      var position = Math.round((100 * current_audio.currentTime) / current_audio.duration);
+      $("#track_" + current_track).find(".position").get(0).style.width = position + "%";
+    }
+  };
+
+  function play(track)
+  { if(current_track == track)
+    { if($("#audio_" + current_track).get(0).paused)
+      { $("#audio_" + current_track).get(0).play();
+      }
+    }
+    else
+    { if(current_track != false) stop();
+      current_track = track;
+      setTimeout("_play()", 1000);
+    }
+    gui_state("playing");
+  }
+
+  function _play()
+  { if(current_track != false)
+    { $("#audio_" + current_track).get(0).play();
+    }
+  }
+
+  function pause()
+  { if(current_track != false)
+    { $("#audio_" + current_track).get(0).pause();
+      gui_state("paused");
+    }
+  }
+
+  function stop()
+  { if(current_track != false)
+    { $("#audio_" + current_track).get(0).pause();
+      if($("#audio_" + current_track).get(0).currentTime) $("#audio_" + current_track).get(0).currentTime = 0;
+      gui_state("stoped");
+      current_track = false;
+    }
+  }
+
+  function gui_state(state)
+  { gui_blur();
+    if(state == "playing")
+    { $("#track_" + current_track).find(".play").get(0).style.display = "none";
+      $("#track_" + current_track).find(".pause").get(0).style.display = "inline";
+      $("#track_" + current_track).find(".stop").get(0).style.display = "inline";
+      $("#track_" + current_track).get(0).className = "playing_download";
+
+    }
+    else if(state == "paused")
+    { $("#track_" + current_track).find(".play").get(0).style.display = "inline";
+      $("#track_" + current_track).find(".pause").get(0).style.display = "none";
+      $("#track_" + current_track).find(".stop").get(0).style.display = "inline";
+      $("#track_" + current_track).get(0).className = "playing_download";
+    }
+    else if(state == "stoped")
+    { $("#track_" + current_track).find(".play").get(0).style.display = "inline";
+      $("#track_" + current_track).find(".pause").get(0).style.display = "none";
+      $("#track_" + current_track).find(".stop").get(0).style.display = "none";
+      $("#track_" + current_track).get(0).className = "download";
+      $("#track_" + current_track).find(".position").get(0).style.width = "0%";
+    }
+  }
+
+  function gui_blur()
+  { $("#track_" + current_track).find(".play").get(0).blur();
+    $("#track_" + current_track).find(".pause").get(0).blur();
+    $("#track_" + current_track).find(".stop").get(0).blur();
+  }
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/ds.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/ds.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/ds.js	(revision 1)
@@ -0,0 +1,276 @@
+// JavaScript Document
+// <!-- <![CDATA[
+
+// Project: Dynamic Date Selector (DtTvB) - 2006-03-16
+// Script featured on JavaScript Kit- http://www.javascriptkit.com
+// Code begin...
+// Set the initial date.
+var ds_i_date = new Date();
+ds_c_month = ds_i_date.getMonth() + 1;
+ds_c_year = ds_i_date.getFullYear();
+
+var sufixe = "";
+
+// Get Element By Id
+function ds_getel(id) {
+    return document.getElementById(id);
+}
+
+// Get the left and the top of the element.
+function ds_getleft(el) {
+    var tmp = el.offsetLeft;
+    el = el.offsetParent
+    while(el) {
+        tmp += el.offsetLeft;
+        el = el.offsetParent;
+    }
+    return tmp;
+}
+function ds_gettop(el) {
+    var tmp = el.offsetTop;
+    el = el.offsetParent
+    while(el) {
+        tmp += el.offsetTop;
+        el = el.offsetParent;
+    }
+    return tmp;
+}
+
+// Output Element
+var ds_oe = ds_getel('ds_calclass');
+// Container
+var ds_ce = ds_getel('ds_conclass');
+
+// Output Buffering
+var ds_ob = ''; 
+function ds_ob_clean() {
+    ds_ob = '';
+}
+function ds_ob_flush() {
+    ds_oe.innerHTML = ds_ob;
+    ds_ob_clean();
+}
+function ds_echo(t) {
+    ds_ob += t;
+}
+
+var ds_element; // Text Element...
+
+var ds_monthnames = [
+'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin',
+'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Décembre'
+]; // You can translate it for your language.
+
+var ds_daynames = [
+'Dim', 'Lun', 'Mar', 'Me', 'Jeu', 'Ven', 'Sam'
+]; // You can translate it for your language.
+
+// Calendar template
+function ds_template_main_above(t) {
+    return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'
+         + '<tr>'
+         + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();">&lt;&lt;</td>'
+         + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();">&lt;</td>'
+         + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Fermer]</td>'
+         + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">&gt;</td>'
+         + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">&gt;&gt;</td>'
+         + '</tr>'
+         + '<tr>'
+         + '<td colspan="7" class="ds_head">' + t + '</td>'
+         + '</tr>'
+         + '<tr>';
+}
+
+function ds_template_day_row(t) {
+    return '<td class="ds_subhead">' + t + '</td>';
+    // Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.
+}
+
+function ds_template_new_week() {
+    return '</tr><tr>';
+}
+
+function ds_template_blank_cell(colspan) {
+    return '<td colspan="' + colspan + '"></td>'
+}
+
+function ds_template_day(d, m, y) {
+    return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';
+    // Define width the day row.
+}
+
+function ds_template_main_below() {
+    return '</tr>'
+         + '</table>';
+}
+
+// This one draws calendar...
+function ds_draw_calendar(m, y) {
+    // First clean the output buffer.
+    ds_ob_clean();
+    // Here we go, do the header
+    ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));
+    for (i = 0; i < 7; i ++) {
+        ds_echo (ds_template_day_row(ds_daynames[i]));
+    }
+    // Make a date object.
+    var ds_dc_date = new Date();
+    ds_dc_date.setMonth(m - 1);
+    ds_dc_date.setFullYear(y);
+    ds_dc_date.setDate(1);
+    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
+        days = 31;
+    } else if (m == 4 || m == 6 || m == 9 || m == 11) {
+        days = 30;
+    } else {
+        days = (y % 4 == 0) ? 29 : 28;
+    }
+    var first_day = ds_dc_date.getDay();
+    var first_loop = 1;
+    // Start the first week
+    ds_echo (ds_template_new_week());
+    // If sunday is not the first day of the month, make a blank cell...
+    if (first_day != 0) {
+        ds_echo (ds_template_blank_cell(first_day));
+    }
+    var j = first_day;
+    for (i = 0; i < days; i ++) {
+        // Today is sunday, make a new week.
+        // If this sunday is the first day of the month,
+        // we've made a new row for you already.
+        if (j == 0 && !first_loop) {
+            // New week!!
+            ds_echo (ds_template_new_week());
+        }
+        // Make a row of that day!
+        ds_echo (ds_template_day(i + 1, m, y));
+        // This is not first loop anymore...
+        first_loop = 0;
+        // What is the next day?
+        j ++;
+        j %= 7;
+    }
+    // Do the footer
+    ds_echo (ds_template_main_below());
+    // And let's display..
+    ds_ob_flush();
+    // Scroll it into view.
+//    ds_ce.scrollIntoView();
+}
+
+// A function to show the calendar.
+// When user click on the date, it will set the content of t.
+function ds_sh(t, _sufixe) {
+    sufixe = _sufixe;
+   // Set the element to set...
+    ds_element = t;
+    // Make a new date, and set the current month and year.
+    var ds_sh_date = new Date();
+    ds_c_month = ds_sh_date.getMonth() + 1;
+    ds_c_year = ds_sh_date.getFullYear();
+    // Draw the calendar
+    ds_draw_calendar(ds_c_month, ds_c_year);
+    // To change the position properly, we must show it first.
+    ds_ce.style.display = '';
+    // Move the calendar container!
+    the_left = ds_getleft(t);
+    the_top = ds_gettop(t) + t.offsetHeight;
+    ds_ce.style.left = the_left + 'px';
+    ds_ce.style.top = the_top + 'px';
+    // Scroll it into view.
+//    ds_ce.scrollIntoView();
+}
+
+// Hide the calendar.
+function ds_hi() {
+    ds_ce.style.display = 'none';
+}
+
+// Moves to the next month...
+function ds_nm() {
+    // Increase the current month.
+    ds_c_month ++;
+    // We have passed December, let's go to the next year.
+    // Increase the current year, and set the current month to January.
+    if (ds_c_month > 12) {
+        ds_c_month = 1; 
+        ds_c_year++;
+    }
+    // Redraw the calendar.
+    ds_draw_calendar(ds_c_month, ds_c_year);
+}
+
+// Moves to the previous month...
+function ds_pm() {
+    ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.
+    // We have passed January, let's go back to the previous year.
+    // Decrease the current year, and set the current month to December.
+    if (ds_c_month < 1) {
+        ds_c_month = 12; 
+        ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
+    }
+    // Redraw the calendar.
+    ds_draw_calendar(ds_c_month, ds_c_year);
+}
+
+// Moves to the next year...
+function ds_ny() {
+    // Increase the current year.
+    ds_c_year++;
+    // Redraw the calendar.
+    ds_draw_calendar(ds_c_month, ds_c_year);
+}
+
+// Moves to the previous year...
+function ds_py() {
+    // Decrease the current year.
+    ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
+    // Redraw the calendar.
+    ds_draw_calendar(ds_c_month, ds_c_year);
+}
+
+// Format the date to output.
+function __ds_format_date(d, m, y) {
+    // 2 digits month.
+    m2 = '00' + m;
+    m2 = m2.substr(m2.length - 2);
+    // 2 digits day.
+    d2 = '00' + d;
+    d2 = d2.substr(d2.length - 2);
+    // YYYY-MM-DD
+    return y + '-' + m2 + '-' + d2 + sufixe;
+//    return d2 + '-' + m2 + '-' + y;
+}
+
+
+function ds_format_date(d, m, y) {
+    // 2 digits month.
+    m2 = '00' + m;
+    m2 = m2.substr(m2.length - 2);
+    // 2 digits day.
+    d2 = '00' + d;
+    d2 = d2.substr(d2.length - 2);
+    // YYYY-MM-DD
+//    return y + '-' + m2 + '-' + d2 + sufixe;
+    return y + '-' + m2 + '-' + d2 + sufixe;
+}
+
+// When the user clicks the day.
+function ds_onclick(d, m, y) {
+    // Hide the calendar.
+    ds_hi();
+    // Set the value of it, if we can.
+
+    if (typeof(ds_element.value) != 'undefined') {
+        ds_element.value = ds_format_date(d, m, y);
+    // Maybe we want to set the HTML in it.
+    } else if (typeof(ds_element.innerHTML) != 'undefined') {
+        ds_element.innerHTML = ds_format_date(d, m, y);
+    // I don't know how should we display it, just alert it to user.
+    } else {
+        alert (ds_format_date(d, m, y));
+    }
+}
+// And here is the end.
+
+// ]]> -->
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/iepngfix.htc
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/iepngfix.htc	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/iepngfix.htc	(revision 1)
@@ -0,0 +1,103 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="iePNGFix(0)" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0
+// (c) 2004-2008 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+
+// This must be a path to a blank image, relative to the HTML document(s).
+// In production use I suggest '/images/blank.gif' or similar. That's all!
+if (typeof blankImg == 'undefined') var blankImg = 'v.5/out/dist/images/blank.gif';
+
+
+
+function filt(s, b)
+{
+ var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+ var sM = (currentStyle.backgroundRepeat == 'no-repeat') ? 'crop' : 'scale';
+ s = (s || '').replace(/\(/g, '%28').replace(/\)/g, '%29');
+
+ if (s && !(/IMG|INPUT/.test(nodeName) && !b) &&
+  currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ {
+  style.width = offsetWidth + 'px';
+  style.height = clientHeight + 'px';
+  if (currentStyle.display == 'inline') style.display = 'inline-block';
+ }
+
+ if (filters[f])
+ {
+  filters[f].enabled = s ? true : false;
+  if (s) with (filters[f]) { src = s }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="' + sM + '")';
+}
+
+function iePNGFix(init)
+{
+ if (!/MSIE (5\.5|6)/.test(navigator.userAgent) || typeof filters == 'unknown') return;
+ var evt = init ? { propertyName: 'src,background' } : event;
+ var isSrc = /src/.test(evt.propertyName);
+ var isBg = /background/.test(evt.propertyName);
+ var isClass = !init &&
+  ((this.className != this._png_class) && (this.className || this._png_class));
+ if (!(isSrc || isBg || isClass)) return;
+ this._png_class = this.className;
+ var blank = blankImg.match(/([^\/]+)$/)[1];
+
+ // Required for Whatever:hover support - erase any set BG if className changes.
+ if (isClass && ((style.backgroundImage.indexOf('url(') == -1) ||
+     (style.backgroundImage.indexOf(blank) > -1)))
+ {
+  setTimeout(function() { this.style.backgroundImage = '' }, 0);
+  return;
+ }
+
+ if (isSrc && this.src && /IMG|INPUT/.test(nodeName))
+ {
+  if ((/\.png/i).test(src))
+  {
+   filt(src, 1);
+   src = blankImg;
+  }
+  else if (src.indexOf(blank) == -1) filt();
+ }
+
+ var bgSrc = currentStyle.backgroundImage || style.backgroundImage;
+ if ((bgSrc + this.src).indexOf(blank) == -1)
+ {
+  var bgPNG = bgSrc.match(/^url[("']+(.*\.png[^\)"']*)[\)"']+[^\)]*$/i);
+
+  if (bgPNG)
+  {
+   style.backgroundImage = 'url("' + blankImg + '")';
+   filt(bgPNG[1], 0);
+   // Unclickable elements inside PNG backgrounds.
+   var tags = ['a', 'input', 'select', 'textarea', 'iframe', 'object'],
+    t = tags.length, tFix = [];
+   while (t--)
+   {
+    var elms = all.tags(tags[t]), e = elms.length;
+    while (e--) tFix.push(elms[e]);
+   }
+   var t = tFix.length;
+   if (t && (/relative|absolute/i).test(currentStyle.position))
+    alert('IEPNGFix: Children of positioned element are unclickable:\n\n<' +
+     nodeName + (id && ' id=' + id) + '>');
+    while (t--)
+     if (!(/relative|absolute/i).test(tFix[t].currentStyle.position))
+      tFix[t].style.position = 'relative';
+  }
+  else filt();
+ }
+}
+
+iePNGFix(1);
+
+</script>
+</public:component>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/jquery.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/jquery.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/jquery.js	(revision 1)
@@ -0,0 +1,19 @@
+/*
+ * jQuery JavaScript Library v1.3.1
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
+ * Revision: 6158
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/script.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/script.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/script.js	(revision 1)
@@ -0,0 +1,138 @@
+$(document).ready
+( function ()
+  { init_menu_slide();
+    init_thickbox();
+    init_news_box();
+    //init_defil();
+  }
+);
+
+// ---------------------------------------- menus defilants
+
+var obj = null;
+
+function checkHover()
+{ if(obj) obj.find('ul').fadeOut('fast');
+}
+
+function init_menu_slide()
+{ $('.menu_name').hover
+  ( function()
+    { if(obj)
+      { obj.find('ul').fadeOut('fast');
+        obj = null;
+      }
+      $(this).find('ul').fadeIn('fast');
+    },
+    function()
+    { obj = $(this);
+      setTimeout("checkHover()", 80);
+    }
+  );
+}
+
+
+// ---------------------------------------- artistes au hasard
+
+var current_left = 0;
+var dx           = 15;
+var vitesse      = 1;
+var move_delay   = 50;
+
+var sens         = 0;
+var dv_width     = 671;
+var dv_height    = 60;
+var dvc_width    = 0;
+
+var MOVING       = false;
+
+function init_defil()
+{ set_dvc_width();
+  setInterval("move()", move_delay);
+  if(document.addEventListener) document.addEventListener("mousemove", check_defil, false);
+  else if(document.attachEvent) document.attachEvent("onmousemove", check_defil);
+  else document.onmousemove = check_defil;
+  _defil_view();
+}
+
+function set_dvc_width()
+{ dvc_width = document.getElementById("defil_viewer_content").offsetWidth;
+  document.getElementById("defil_viewer").style.width="" + dv_width + "px";
+  document.getElementById("defil_viewer").style.margin="0px 7px 0px 7px";
+  document.getElementById("defil_viewer").style.clip="rect(0px 0px 0px 0px)";
+  document.getElementById("defil_viewer").style.overflow="hidden";
+}
+
+function defil_view(_sens) { sens = _sens; }
+
+function get_obj(id)
+{ if(document.getElementById) return document.getElementById(id);
+  else if(document.all) return document.all[id];
+  return -1;
+}
+
+function _defil_view()
+{ move();
+  setTimeout("_defil_view()", move_delay);
+}
+
+function move()
+{ if(sens != 0)
+  { var next_left = current_left + (dx * vitesse * sens);
+    if(dvc_width > dv_width && next_left < 30  && next_left > (dv_width - dvc_width))
+    { current_left = next_left;
+      $("#defil_viewer_content").animate({left: "" + current_left + "px"}, move_delay);
+    }
+  }
+}
+
+function check_defil(e)
+{ var mx = 0;
+  var my = 0;
+  if (!e) var e = window.event;
+  if (e.pageX || e.pageY)
+  { mx = e.pageX;
+    my = e.pageY;
+  }
+  else if (e.clientX || e.clientY)
+  { mx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
+    my = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
+  }
+  elt = document.getElementById("defil_viewer");
+  divx = 0;
+  divy = 0;
+  while(elt != null && elt.tagName != 'BODY' && elt.tagName != 'body')
+  { divx += elt.offsetLeft;
+    divy += elt.offsetTop;
+    elt = elt.offsetParent;
+  }
+  posx = mx - divx;
+  posy = my - divy;
+  if(posx > 0 && posy > 0 && posx < dv_width && posy < dv_height)
+  { if(posx > 6 * (dv_width / 8))
+    { sens = -1;
+      if(posx < 7 * (dv_width / 8)) vitesse = 1;
+      else vitesse = 2;
+    }
+    else if(posx < 2 * (dv_width / 8))
+    { sens = 1;
+      if(posx > (dv_width / 8)) vitesse = 1;
+      else vitesse = 2;
+    }
+    else sens = 0;
+  }
+  else sens = 0;
+}
+
+// ---------------------------------------- news box
+
+function init_news_box()
+{ $(".news_actegories_menu").hover
+  ( function()
+    { $(".news_actegories_menu ul").slideDown(200);
+    },
+    function()
+    { $(".news_actegories_menu ul").slideUp(200);
+    }
+  );
+}
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/str_tab.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/str_tab.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/str_tab.js	(revision 1)
@@ -0,0 +1,108 @@
+var DEBUG = false;
+
+function str_tab()
+{
+  this.response = null;
+
+  this.tab_to_str = function(TAB)
+  { return this._tab_to_str("", TAB);
+  }
+
+  this._tab_to_str = function(pre, TAB)
+  { var content = "";
+    var HAS_VALUES = false;
+    for(var key in TAB)
+    { HAS_VALUES = true;
+      if(typeof(TAB[key]) == "object") content += this._tab_to_str(pre + key.length + ":"  + key, TAB[key]);
+      else content += pre + key.length + ":" + key + ("" + TAB[key]).length + ":" + TAB[key] + "\n";
+    }
+    if(HAS_VALUES) return content;
+    return pre + "a:\n";
+  }
+
+  this.str_to_tab = function(content)
+  { var TAB = {};
+    var n = 0;
+    while(n < content.length)
+    { var LINE_FOUND = false;
+      var words = new Array();
+      while(n < content.length && !LINE_FOUND)
+      { var length = "";
+        var word = "";
+        var ENDS_WITH_EMPTY_TAB = false;
+        while(n < content.length && content.charAt(n) != ':') { length += content.charAt(n); n++; } n++;
+        if(length == "a") ENDS_WITH_EMPTY_TAB = true;
+        else
+        { for(var k = 0; k < parseInt(length); k++) { word += content.charAt(n); n++; }
+          words.push(word);
+        }
+        LINE_FOUND = ENDS_WITH_EMPTY_TAB || n == content.length || content.charAt(n) == '\n';
+      }
+      n++;
+      if(words.length > 0) TAB = this.affect(TAB, words, ENDS_WITH_EMPTY_TAB);
+    }
+    return TAB;
+  }
+
+  this.affect = function(TAB, words, ENDS_WITH_EMPTY_TAB)
+  { if(words.length > (ENDS_WITH_EMPTY_TAB ? 1 : 2))
+      { if(typeof(TAB[words[0]]) != "object") TAB[words[0]] = {};
+      var _words = new Array();
+      var FIRST = true;
+      for(var k = 0; k < words.length; k++)
+      { if(FIRST) FIRST = false;
+        else _words.push(words[k]);
+      }
+      TAB[words[0]] = this.affect(TAB[words[0]], _words, ENDS_WITH_EMPTY_TAB);
+    }
+    else TAB[words[0]] = (ENDS_WITH_EMPTY_TAB ? {} : words[1]);
+    return TAB;
+  }
+
+  this.str_to_hex = function(str)
+  { var hex = "";
+    for(var n = 0; n < str.length; n++)
+    { var hex_char = str.charCodeAt(n).toString(16);
+      if(hex_char.length == 1) hex_char = "0" + hex_char;
+      hex += hex_char;
+    }
+    return hex;
+  }
+
+  this.hex_to_str = function(hex)
+  { var n = 0;
+    var str = "";
+    while(n + 2 <= hex.length) { str += unescape("%" + hex.substr(n, 2)); n += 2; }
+    return str;
+  }
+
+  this.request = function(file, req_tab, callback, str_tab_inst)
+  { if(window.XMLHttpRequest && !(window.ActiveXObject))
+    { try { req = new XMLHttpRequest(); }
+      catch(e) { req = false; }
+    }
+    else if(window.ActiveXObject)
+    { try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
+      catch(e)
+      { try { req = new ActiveXObject("Microsoft.XMLHTTP");    }
+        catch(e) { req = false; }
+      }
+    }
+    if(req)
+    { req.open("POST", file, true);
+      req.onreadystatechange = function()
+      { if(req.readyState == 4)
+        { if(DEBUG) alert(str_tab_inst.hex_to_str(req.responseText));
+		  str_tab_inst.response = str_tab_inst.str_to_tab(str_tab_inst.hex_to_str(req.responseText));
+          if(typeof(str_tab_inst.response["erreur"]) != "undefined") alert(str_tab_inst.response["erreur"]);
+          eval(callback);
+        }
+      }
+      req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+      req.send("post_request=" + this.str_to_hex(this.tab_to_str(req_tab)));
+    }
+  }
+
+}
+
+var str_tab = new str_tab();
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/swfobject.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/swfobject.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/swfobject.js	(revision 1)
@@ -0,0 +1,8 @@
+/**
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
Index: /branches/rsr.v5.1.dev/web/app/out/dist/js/thickbox.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/js/thickbox.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/js/thickbox.js	(revision 1)
@@ -0,0 +1,319 @@
+/*
+ * Thickbox 3.1 - One Box To Rule Them All.
+ * By Cody Lindley (http://www.codylindley.com)
+ * Copyright (c) 2007 cody lindley
+ * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
+*/
+		  
+var tb_pathToImage = "app/out/dist/images/loadingAnimation.gif";
+
+/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
+
+function init_thickbox()
+{ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
+  imgLoader = new Image();// preload image
+  imgLoader.src = tb_pathToImage;
+}
+
+//add thickbox to href & area elements that have a class of .thickbox
+function tb_init(domChunk){
+	$(domChunk).click(function(){
+	var t = this.title || this.name || null;
+	var a = this.href || this.alt;
+	var g = this.rel || false;
+	tb_show(t,a,g);
+	this.blur();
+	return false;
+	});
+}
+
+function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
+
+	try {
+		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
+			$("body","html").css({height: "100%", width: "100%"});
+			$("html").css("overflow","hidden");
+			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
+				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
+				$("#TB_overlay").click(tb_remove);
+			}
+		}else{//all others
+			if(document.getElementById("TB_overlay") === null){
+				$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
+				$("#TB_overlay").click(tb_remove);
+			}
+		}
+		
+		if(tb_detectMacXFF()){
+			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
+		}else{
+			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
+		}
+		
+		if(caption===null){caption="";}
+		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
+		$('#TB_load').show();//show loader
+		
+		var baseURL;
+	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
+			baseURL = url.substr(0, url.indexOf("?"));
+	   }else{ 
+	   		baseURL = url;
+	   }
+	   
+	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
+	   var urlType = baseURL.toLowerCase().match(urlString);
+
+		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
+				
+			TB_PrevCaption = "";
+			TB_PrevURL = "";
+			TB_PrevHTML = "";
+			TB_NextCaption = "";
+			TB_NextURL = "";
+			TB_NextHTML = "";
+			TB_imageCount = "";
+			TB_FoundURL = false;
+			if(imageGroup){
+				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
+				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
+					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
+						if (!(TB_TempArray[TB_Counter].href == url)) {						
+							if (TB_FoundURL) {
+								TB_NextCaption = TB_TempArray[TB_Counter].title;
+								TB_NextURL = TB_TempArray[TB_Counter].href;
+								TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
+							} else {
+								TB_PrevCaption = TB_TempArray[TB_Counter].title;
+								TB_PrevURL = TB_TempArray[TB_Counter].href;
+								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
+							}
+						} else {
+							TB_FoundURL = true;
+							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);											
+						}
+				}
+			}
+
+			imgPreloader = new Image();
+			imgPreloader.onload = function(){		
+			imgPreloader.onload = null;
+				
+			// Resizing large images - orginal by Christian Montoya edited by me.
+			var pagesize = tb_getPageSize();
+			var x = pagesize[0] - 150;
+			var y = pagesize[1] - 150;
+			var imageWidth = imgPreloader.width;
+			var imageHeight = imgPreloader.height;
+			if (imageWidth > x) {
+				imageHeight = imageHeight * (x / imageWidth); 
+				imageWidth = x; 
+				if (imageHeight > y) { 
+					imageWidth = imageWidth * (y / imageHeight); 
+					imageHeight = y; 
+				}
+			} else if (imageHeight > y) { 
+				imageWidth = imageWidth * (y / imageHeight); 
+				imageHeight = y; 
+				if (imageWidth > x) { 
+					imageHeight = imageHeight * (x / imageWidth); 
+					imageWidth = x;
+				}
+			}
+			// End Resizing
+			
+			TB_WIDTH = imageWidth + 30;
+			TB_HEIGHT = imageHeight + 60;
+			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>&nbsp;</a></div>"); 		
+			
+			$("#TB_closeWindowButton").click(tb_remove);
+			
+			if (!(TB_PrevHTML === "")) {
+				function goPrev(){
+					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
+					$("#TB_window").remove();
+					$("body").append("<div id='TB_window'></div>");
+					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
+					return false;	
+				}
+				$("#TB_prev").click(goPrev);
+			}
+			
+			if (!(TB_NextHTML === "")) {		
+				function goNext(){
+					$("#TB_window").remove();
+					$("body").append("<div id='TB_window'></div>");
+					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
+					return false;	
+				}
+				$("#TB_next").click(goNext);
+				
+			}
+
+			document.onkeydown = function(e){ 	
+				if (e == null) { // ie
+					keycode = event.keyCode;
+				} else { // mozilla
+					keycode = e.which;
+				}
+				if(keycode == 27){ // close
+					tb_remove();
+				} else if(keycode == 190){ // display previous image
+					if(!(TB_NextHTML == "")){
+						document.onkeydown = "";
+						goNext();
+					}
+				} else if(keycode == 188){ // display next image
+					if(!(TB_PrevHTML == "")){
+						document.onkeydown = "";
+						goPrev();
+					}
+				}	
+			};
+			
+			tb_position();
+			$("#TB_load").remove();
+			$("#TB_ImageOff").click(tb_remove);
+			$("#TB_window").css({display:"block"}); //for safari using css instead of show
+			};
+			
+			imgPreloader.src = url;
+		}else{//code to show html
+			
+			var queryString = url.replace(/^[^\?]+\??/,'');
+			var params = tb_parseQuery( queryString );
+
+			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
+			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
+			ajaxContentW = TB_WIDTH - 30;
+			ajaxContentH = TB_HEIGHT - 45;
+			
+			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window		
+					urlNoQuery = url.split('TB_');
+					$("#TB_iframeContent").remove();
+					if(params['modal'] != "true"){//iframe no modal
+						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>&nbsp;</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
+					}else{//iframe modal
+					$("#TB_overlay").unbind();
+						$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
+					}
+			}else{// not an iframe, ajax
+					if($("#TB_window").css("display") != "block"){
+						if(params['modal'] != "true"){//ajax no modal
+						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>&nbsp;</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
+						}else{//ajax modal
+						$("#TB_overlay").unbind();
+						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
+						}
+					}else{//this means the window is already up, we are just loading new content via ajax
+						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
+						$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
+						$("#TB_ajaxContent")[0].scrollTop = 0;
+						$("#TB_ajaxWindowTitle").html(caption);
+					}
+			}
+					
+			$("#TB_closeWindowButton").click(tb_remove);
+			
+				if(url.indexOf('TB_inline') != -1){	
+					$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
+					$("#TB_window").unload(function () {
+						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
+					});
+					tb_position();
+					$("#TB_load").remove();
+					$("#TB_window").css({display:"block"}); 
+				}else if(url.indexOf('TB_iframe') != -1){
+					tb_position();
+					if($.browser.safari){//safari needs help because it will not fire iframe onload
+						$("#TB_load").remove();
+						$("#TB_window").css({display:"block"});
+					}
+				}else{
+					$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
+						tb_position();
+						$("#TB_load").remove();
+						tb_init("#TB_ajaxContent a.thickbox");
+						$("#TB_window").css({display:"block"});
+					});
+				}
+			
+		}
+
+		if(!params['modal']){
+			document.onkeyup = function(e){ 	
+				if (e == null) { // ie
+					keycode = event.keyCode;
+				} else { // mozilla
+					keycode = e.which;
+				}
+				if(keycode == 27){ // close
+					tb_remove();
+				}	
+			};
+		}
+		
+	} catch(e) {
+		//nothing here
+	}
+}
+
+//helper functions below
+function tb_showIframe(){
+	$("#TB_load").remove();
+	$("#TB_window").css({display:"block"});
+}
+
+function tb_remove() {
+ 	$("#TB_imageOff").unbind("click");
+	$("#TB_closeWindowButton").unbind("click");
+	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
+	$("#TB_load").remove();
+	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
+		$("body","html").css({height: "auto", width: "auto"});
+		$("html").css("overflow","");
+	}
+	document.onkeydown = "";
+	document.onkeyup = "";
+	return false;
+}
+
+function tb_position() {
+$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
+	if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
+		$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
+	}
+}
+
+function tb_parseQuery ( query ) {
+   var Params = {};
+   if ( ! query ) {return Params;}// return empty object
+   var Pairs = query.split(/[;&]/);
+   for ( var i = 0; i < Pairs.length; i++ ) {
+      var KeyVal = Pairs[i].split('=');
+      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
+      var key = unescape( KeyVal[0] );
+      var val = unescape( KeyVal[1] );
+      val = val.replace(/\+/g, ' ');
+      Params[key] = val;
+   }
+   return Params;
+}
+
+function tb_getPageSize(){
+	var de = document.documentElement;
+	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
+	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
+	arrayPageSize = [w,h];
+	return arrayPageSize;
+}
+
+function tb_detectMacXFF() {
+  var userAgent = navigator.userAgent.toLowerCase();
+  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
+    return true;
+  }
+}
+
+
+
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/1_colonne.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/1_colonne.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/1_colonne.php	(revision 1)
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="center">
+<?php $env->aff_content() ?>
+          </div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/2_colonnes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/2_colonnes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/2_colonnes.php	(revision 1)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="left">
+<?php require $env->out_file("views/interne_gauche.php"); ?>
+          </div>
+
+          <div id="center">
+<div class="bloc">
+<?php $env->aff_content() ?>
+</div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.bak.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.bak.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.bak.php	(revision 1)
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+          <div id="left">
+<?php $env->aff_emplacement("accueil_gauche") ?>
+          </div>
+
+          <div id="right">
+<?php $env->aff_emplacement("accueil_droite") ?>
+            <div id="bottom">
+              <div id="bottom_left">
+<?php $env->aff_emplacement("accueil_petite_gauche") ?>
+              </div>
+              <div id="bottom_right">
+<?php $env->aff_emplacement("accueil_petite_droite") ?>
+              </div>
+              <div class="clear"><!-- --></div>
+            </div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+          <div id="accueil_footer">
+<?php $env->aff_emplacement("accueil_footer") ?>
+          </div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.php	(revision 1)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="left">
+<?php require $env->out_file("views/interne_gauche.php"); ?>
+          </div>
+
+          <div id="center">
+<div class="bloc">
+<?php $env->aff_content() ?>
+</div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.test.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.test.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/accueil.test.php	(revision 1)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+          <div id="left">
+<?php $env->aff_emplacement("accueil_gauche") ?>
+          </div>
+
+          <div id="right">
+<?php //$env->aff_bloc("artistes_au_hasard"); ?>
+            <div id="menu_accueil">
+              <center><img src="<?= $env->out_file("images/menu_accueil.png") ?>" /></center>
+            </div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+          <div id="accueil_footer">
+<?php $env->aff_emplacement("accueil_footer") ?>
+          </div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/admin.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/admin.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/admin.php	(revision 1)
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="left">
+<?php $env->aff_bloc("administration") ?>
+          </div>
+
+          <div id="center">
+<div class="bloc">
+<?php $env->aff_content() ?>
+</div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/carte.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/carte.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/carte.php	(revision 1)
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="left">
+<?php if($env->out["VIEW_MAP"]) : ?>
+<?php require $env->out_file("views/map_commands.php"); ?>
+<?php else : ?>
+<div class="bloc">
+<?php $env->aff_emplacement("interne_gauche") ?>
+</div>
+<?php endif; ?>
+          </div>
+
+          <div id="center">
+<div class="bloc">
+<?php $env->aff_content() ?>
+</div>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/edito.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/edito.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/edito.php	(revision 1)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+          <div id="left">
+<?php $env->aff_emplacement("accueil_gauche") ?>
+          </div>
+
+          <div id="right">
+<?php $env->aff_emplacement("accueil_droite_haut") ?>
+            <div id="bottom">
+              <div id="bottom_left">
+<?php $env->aff_emplacement("accueil_petite_gauche") ?>
+              </div>
+              <div id="bottom_right">
+<?php $env->aff_emplacement("accueil_petite_droite") ?>
+              </div>
+              <div class="clear"><!-- --></div>
+            </div>
+<?php $env->aff_emplacement("accueil_droite_bas") ?>
+          </div>
+
+          <div class="clear"><!-- --></div>
+
+          <div id="accueil_footer">
+<?php $env->aff_emplacement("accueil_footer") ?>
+          </div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/forum.php	(revision 1)
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body id="body_forum">
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content" class="forum">
+        <div class="content">
+
+          <div id="center">
+<?php $env->aff_content() ?>
+          </div>
+
+        </div>
+      </div>
+
+      <div id="forum_footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/layouts/popup.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/layouts/popup.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/layouts/popup.php	(revision 1)
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="main_content">
+        <div class="content">
+<?php
+
+  if($env->out_file_exists("content/infos/".$env->prefix.$env->a.".php"))
+  { require $env->out_file("content/infos/".$env->prefix.$env->a.".php");
+  }
+
+?>
+        </div>
+      </div>
+
+    </div>
+
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/utils.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/utils.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/utils.php	(revision 1)
@@ -0,0 +1,188 @@
+<?php
+
+  function url_amps($url)
+  { return str_replace("&", "&amp;", $url);
+  }
+
+  function navig($current, $total, $max, $base_url, $start_param, $legende = null)
+  { $navig = "";
+    if($total > $max)
+    { if(isset($legende))
+	  { $navig .=
+	     $legende." ".($current + 1)." &agrave; "
+	    .(($current + $max) > $total ? $total : $current + $max)
+		." sur ".$total." - aller &agrave; la ";
+	  }
+	  $get_params = array();
+      if(($q = strpos($base_url, "?")) !== false)
+	  { $v_query = explode("&", substr($base_url, $q + 1));
+        $base_url = substr($base_url, 0, $q);
+        foreach($v_query as $query)
+        { if($query)
+		  { $v = explode("=", $query);
+            $get_params[$v[0]] = $v[1];
+          }
+        }
+  	  }
+      if(isset($get_params[$start_param])) unset($get_params[$start_param]);
+      $base_url .= "?";
+      foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
+	  $nb_pages = ceil($total / $max);
+	  $navig .=
+	   "page : "
+	  ."<select onchange=\"document.location=this.options[this.selectedIndex].value;\">\n";
+      $np = 1;
+      $ni = 0;
+      while($ni < $total)
+	  { $navig .=
+         "  <option value=\"".$base_url.$start_param."=".$ni."\"".($current >= $ni && $current <= $ni ? " SELECTED" : "").">"
+		.$np
+		."</option>\n";
+        $np++;
+        $ni += $max;
+	  }
+      $navig .=
+	   "</select>\n";
+      if($current >= $max)
+	  { $navig .=
+          "&nbsp;&nbsp;<a href=\"".$base_url.$start_param."=".($current - $max)."\">&lt;&lt;</a>\n";
+	  }
+      if($current < $total - $max)
+	  { $navig .=
+          "&nbsp;&nbsp;<a href=\"".$base_url.$start_param."=".($current + $max)."\">&gt;&gt;</a>\n";
+	  }
+	}
+    return $navig;
+  }
+
+  function order_link($env, $text, $order_by, $base_url)
+  { $get_params = array();
+    if(($q = strpos($base_url, "?")) !== false)
+	{ $v_query = explode("&", substr($base_url, $q + 1));
+      $base_url = substr($base_url, 0, $q);
+      foreach($v_query as $query)
+      { if($query)
+	    { $v = explode("=", $query);
+          $get_params[$v[0]] = $v[1];
+        }
+      }
+    }
+    if(isset($get_params[$env->param("order_by")])) unset($get_params[$env->param("order_by")]);
+    if(isset($get_params[$env->param("order")])) unset($get_params[$env->param("order")]);
+    $base_url .= "?";
+    foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
+    if(substr($base_url, -1) === "&") $base_url = substr($base_url, 0, -1);
+    $order_params = "";
+    $order_img = "";
+	if($order_by === $env->order_by)
+    { if($env->order === "ASC")
+      { $order_params = $env->param("order_by")."=".$order_by."&".$env->param("order")."=DESC";
+        $order_img = "<img src=\"icons/asc.gif\" >";
+	  }
+      elseif($env->order === "DESC")
+	  { $order_img = "<img src=\"icons/desc.gif\" >";
+	  }
+	}
+	else
+	{ $order_params = $env->param("order_by")."=".$order_by."&".$env->param("order")."=ASC";
+	}
+    return "<a href=\"".$base_url.($order_params ? "&".$order_params : "")."\">".$text."</a>&nbsp;".$order_img;
+  }
+
+  function is_date($date)
+  { return ereg("^[0-9][0-9][0-9][0-9]-[0-9]{1,2}-[0-9]{1,2}$", $date);
+  }
+
+  function is_num($num)
+  { $num = str_replace(array(",", " "), array(".", ""), $num);
+    $v_num = explode(".", $num);
+    if(count($v_num) > 2) return false;
+    $OK = true;
+	for($n = 0; $n < count($v_num) && $OK; $n++) $OK = ereg("^[0-9]+$", $v_num[$n]);
+    return $OK ? $num : false;
+  }
+
+  function date_texte($moment)
+  { $moment = explode("-", $moment);
+    return jour_semaine($moment[0], $moment[1], $moment[2])." ".(0 + $moment[0])." ".mois(0 + $moment[1])." ".$moment[2];
+  }
+
+  function jour_semaine($jour, $mois, $annee)
+  { switch(date("N", mktime(1, 0, 0, 0 + $mois, 0 + $jour, 0 + $annee)))
+    { case 1: return "lundi";
+      case 2: return "mardi";
+      case 3: return "mercredi";
+      case 4: return "jeudi";
+      case 5: return "vendredi";
+      case 6: return "samedi";
+      case 7: return "dimanche";
+	}
+  }
+
+  function mois($mois)
+  { switch($mois)
+    { case 1:  return "janvier";
+      case 2:  return "fevrier";
+      case 3:  return "mars";
+      case 4:  return "avril";
+      case 5:  return "mai";
+      case 6:  return "juin";
+      case 7:  return "juillet";
+      case 8:  return "ao&ucirc;t";
+      case 9:  return "septembre";
+      case 10: return "octobre";
+      case 11: return "novembre";
+      case 12: return "decembre";
+	}
+	return "?";
+  }
+
+  function resume($content, $n)
+  { if($n)
+    { $v_content = explode(" ", $content);
+      if(count($v_content) > $n)
+      { $_content = "";
+        for($i = 0; $i <= $n; $i++) $_content .= $v_content[$i]." ";
+		return $_content." (...)";
+	  }
+    }
+    return $content;
+  }
+
+  function js_str($content)
+  { return str_replace
+    ( array("\"", "\r", "\n"),
+      array("\\\"", "\\r", "\\n"),
+      $content
+	);
+  }
+
+  function js_str_nocrlf($content)
+  { return str_replace
+    ( array("\"", "\r", "\n"),
+      array("\\\"", " ", " "),
+      $content
+	);
+  }
+
+  function img_size($file, $max_width, $max_height)
+  { $img_infos = @getimagesize($file);
+    $img_size = array();
+    if($img_infos)
+    { if($img_infos[0] > $max_width || $img_infos[1] > $max_height)
+      { $r = $max_width / $img_infos[0];
+        if($r * $img_infos[1] > $max_height) $r = $max_height / $img_infos[1];
+        return array
+        ( "width" => floor($r * $img_infos[0]),
+          "height" => floor($r * $img_infos[1]) 
+        );
+      }
+      return array
+      ( "width" => $img_infos[0],
+        "height" => $img_infos[1] 
+      );
+    }
+    return false;
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_links.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_links.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_links.php	(revision 1)
@@ -0,0 +1,19 @@
+<a href="<?=
+     $env->url
+     ( array
+       ( "e" => $env->e,
+         "path" => ""
+       )
+     )
+   ?>">liens</a>
+<?php $path = ""; foreach($env->out["ariane"] as $id => $link_categorie) : $path .= "/".$id ?>
+&gt;
+<a href="<?=
+     $env->url
+     ( array
+       ( "e" => $env->e,
+         "path" => $path
+       )
+     )
+   ?>"><?= $link_categorie["titre"] ?></a>
+<?php endforeach; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_menus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_menus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/ariane_menus.php	(revision 1)
@@ -0,0 +1,19 @@
+<a href="<?=
+     $env->url
+     ( array
+       ( "e" => "set_menus",
+         "path" => ""
+       )
+     )
+   ?>">menus</a>
+<?php $path = ""; foreach($env->out["ariane"] as $id => $menu_categorie) : $path .= "/".$id ?>
+&gt;
+<a href="<?=
+     $env->url
+     ( array
+       ( "e" => "set_menus",
+         "path" => $path
+       )
+     )
+   ?>"><?= $menu_categorie["titre"] ?></a>
+<?php endforeach; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_colonne.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_colonne.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_colonne.php	(revision 1)
@@ -0,0 +1,233 @@
+      <div id="artiste_logo">
+      <a href="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"], "page" => "presentation")) ?>">
+
+
+
+      <?php if($env->out["artiste"]["image"]) : ?>
+
+      <?php
+
+        $img_src = $env->out["artiste"]["image"];
+        if(($thumb = $env->data->img_thumb($img_src, 240, 190, $env->path("uploads")."thumbs/")) !== false)
+        { $thumb["thumb_file"] = $env->path("uploads")."thumbs/".$thumb["thumb_file"];
+          $margin_top = floor((190 - $thumb["thumb_height"]) / 2);
+        }
+        else
+        { $thumb = array
+          ( "thumb_file" => $img_src,
+            "thumb_width" => 240,
+            "thumb_height" => 190
+          );
+          $margin_top = 0;
+        }
+
+      ?>
+
+        <img src="<?= $thumb["thumb_file"] ?>"
+             width="<?= $thumb["thumb_width"] ?>"
+             height="<?= $thumb["thumb_height"] ?>"
+             style="margin-top:<?= $margin_top ?>px"
+             alt="<?= str_replace("\"", "\\\"", $env->out["artiste"]["nom"]) ?>" />
+
+      <?php else : ?>
+        <span><?= $env->out["artiste"]["nom"] ?></span>
+      <?php endif; ?>
+
+
+
+      </a>
+      </div>
+
+      <div id="artiste_infos">
+        <br />
+        <?php $PRE = false; if($env->out["artiste"]["style"]) : ?>
+          <?= $env->out["artiste"]["style"] ?>
+        <?php $PRE = true; endif; ?>
+        <?php if($env->out["artiste"]["pays"]) : ?>
+          <?php if($PRE) : ?> - <?php endif; ?>
+          <?= $env->out["artiste"]["pays"] ?>
+        <?php $PRE = true; endif; ?>
+          <?php if($PRE) : ?> <br /> <?php endif; ?>
+        <?php if($env->out["artiste"]["site"]) : ?>
+          <a href="<?= $env->out["artiste"]["site"] ?>">site web</a>
+        <?php $PRE = true; endif; ?>
+        <?php if(!$env->out["artiste"]["hide_email"]) : ?>
+          <?php if($PRE) : ?> - <?php endif; ?>
+          <?= $env->data->encode_email($env->out["artiste"]["email_contact"]) ?>
+        <?php elseif($env->out["artiste"]["contact_form"] && $env->out["artiste"]["email_contact"]) : ?>
+          <?php if($PRE) : ?> - <?php endif; ?>
+          <a href="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"], "page" => "contact")) ?>">contact</a>
+        <?php endif; ?>
+      </div>
+
+<?php
+
+  if
+  (    $env->out["artiste"]["lien_facebook"]
+    || $env->out["artiste"]["lien_flickr"]
+    || $env->out["artiste"]["lien_twitter"]
+    || $env->out["artiste"]["lien_youtube"]
+  ) :
+
+?>
+      <br />
+      <div id="reseaux_sociaux">
+      <?php if($env->out["artiste"]["lien_facebook"]) : ?>
+        <a href="<?= $env->out["artiste"]["lien_facebook"] ?>"
+           title="<?= $env->out["artiste"]["nom"] ?> sur Facebook"><img src="<?= $this->out_file("icons/social/facebook_32.png") ?>"
+           alt="<?= $env->out["artiste"]["nom"] ?> sur Facebook" /></a>
+      <?php endif; ?>
+      <?php if($env->out["artiste"]["lien_flickr"]) : ?>
+        <a href="<?= $env->out["artiste"]["lien_flickr"] ?>"
+           title="<?= $env->out["artiste"]["nom"] ?> sur Flickr"><img src="<?= $this->out_file("icons/social/flickr_32.png") ?>"
+           alt="<?= $env->out["artiste"]["nom"] ?> sur Flickr" /></a>
+      <?php endif; ?>
+      <?php if($env->out["artiste"]["lien_twitter"]) : ?>
+        <a href="<?= $env->out["artiste"]["lien_twitter"] ?>"
+           title="<?= $env->out["artiste"]["nom"] ?> sur Twitter"><img src="<?= $this->out_file("icons/social/twitter_32.png") ?>"
+           alt="<?= $env->out["artiste"]["nom"] ?> sur Twitter" /></a>
+      <?php endif; ?>
+      <?php if($env->out["artiste"]["lien_youtube"]) : ?>
+        <a href="<?= $env->out["artiste"]["lien_youtube"] ?>"
+           title="<?= $env->out["artiste"]["nom"] ?> sur Blip.Tv"><img src="<?= $this->out_file("icons/social/blip_32.png") ?>"
+           alt="<?= $env->out["artiste"]["nom"] ?> sur Blip.Tv" /></a>
+      <?php endif; ?>
+      </div>
+<?php endif;?>
+
+      <br />
+      <div class="bloc">
+        <h2>Ecoutes - T&eacute;l&eacute;chargements</h2>
+        <div class="bloc_content">
+          <ul id="download_list">
+            <li>
+              <a class="all"
+                 href="<?= $env->url
+                           ( array
+                             ( "e" => "artistes",
+                               "artiste" => $_GET[$env->param("artiste")],
+                               "page" => "downloads"
+                             )
+                           ) ?>">
+                Voir tous les titres
+              </a>
+            </li>
+            <?php if($env->out["albums"]) : ?>
+            <li>
+              <span class="titre">Albums :</span>
+
+      <div class="artiste_albums">
+        <?php
+
+          $nba = 0;
+          foreach($env->out["albums"] as $id_album => $album) : $nba++;
+          $date_creation = explode("-", $album["date_creation"]);
+          $date_creation = $date_creation[0];
+
+        ?>
+        <a class="artiste_album_link"
+           title="<?= str_replace("\"", "\\\"", $album["titre"]." (".$date_creation.")") ?>"
+           href="<?= $env->url
+                     ( array
+                       ( "e" => "artistes",
+                         "artiste" => $_GET[$env->param("artiste")],
+                         "page" => "downloads",
+                         "album" => $id_album
+                       )
+                     ) ?>">
+
+
+
+          <?php if($album["image"]) : ?>
+
+          <?php
+
+            $img_src = $album["image"];
+            if(($thumb = $env->data->img_thumb($img_src, 90, 100, $env->path("uploads")."thumbs/")) !== false)
+            { $thumb["thumb_file"] = $env->path("uploads")."thumbs/".$thumb["thumb_file"];
+              $margin_top = floor((100 - $thumb["thumb_height"]) / 2);
+            }
+            else
+            { $thumb = array
+              ( "thumb_file" => $img_src,
+                "thumb_width" => 90,
+                "thumb_height" => 100
+              );
+              $margin_top = 0;
+            }
+
+          ?>
+
+          <img src="<?= $thumb["thumb_file"] ?>"
+               width="<?= $thumb["thumb_width"] ?>"
+               height="<?= $thumb["thumb_height"] ?>"
+               style="margin: <?= $margin_top ?>px 0px <?= $margin_top ?>px 0px;"
+               alt="<?= str_replace("\"", "\\\"", $album["titre"]) ?>" />
+
+          <!-- img src="<?= $album["image"] ?>" alt="<?= str_replace("\"", "\\\"", $album["titre"]) ?>" / -->
+
+          <?php endif; ?>
+
+          <span><?= $album["titre"] ?> (<?= $date_creation ?>)</span>
+          <span class="clear"><!-- --></span>
+
+        </a>
+        <?php if($nba % 2 == 0) : ?>
+        <div class="clear"><!-- --></div>
+        <?php endif; ?>
+        <?php endforeach; ?>
+        <div class="clear"><!-- --></div>
+      </div>
+
+            </li>
+            <?php endif; ?>
+          </ul>
+        </div>
+      </div>
+
+<?php
+
+  if
+  (    $env->out["artiste"]["identifiant_paypal"]
+    || $env->out["artiste"]["lien_boutique"]
+  ) :
+
+?>
+      <br />
+      <div id="soutenir_artiste">
+  <a class="thickbox info_mini_right" href="<?= $env->url(array("e" => "popup_info", "action" => "soutenir_artiste")) ?>&amp;KeepThis=true&amp;TB_iframe=true&amp;height=400&amp;width=600" title="Soutenir un artiste">
+    <img src="<?= $env->out_file("icons/aide.png") ?>" alt="Soutenir un artiste" />
+  </a>
+        <h3>Soutenir l'artiste</h3>
+
+<?php if($env->out["artiste"]["identifiant_paypal"]) : ?>
+        <div id="don_artiste">
+
+<span>Don</span>
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+  <input type="hidden" name="cmd" value="_donations" />
+  <input type="hidden" name="business" value="<?= $env->out["artiste"]["identifiant_paypal"] ?>" />
+  <input type="hidden" name="lc" value="FR" />
+  <input type="hidden" name="no_note" value="0" />
+  <input type="hidden" name="no_shipping" value="2" />
+  <input type="hidden" name="currency_code" value="EUR" />
+  <input type="hidden" name="return" value="http://<?= $_SERVER["HTTP_HOST"].$env->url(array()) ?>" />
+  <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted" />
+  <input type="image" src="<?= $env->out_file("icons/paypal.png") ?>" name="submit" alt="Faire un don avec PayPal" />
+  <img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1" />
+</form>
+
+        </div>
+<?php endif; ?>
+<?php if($env->out["artiste"]["lien_boutique"]) : ?>
+        <div id="lien_boutique_artiste">
+
+<span>Achat</span>
+<a href="<?= $env->out["artiste"]["lien_boutique"] ?>"><img src="<?= $env->out_file("icons/cart.png") ?>" /></a>
+
+        </div>
+<?php endif; ?>
+        <div class="clear"><!-- --></div>
+
+      </div>
+<?php endif;?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_onglets.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_onglets.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/artiste_onglets.php	(revision 1)
@@ -0,0 +1,27 @@
+<div id="artiste_onglets">
+<?php if($env->out["edit_ok"]) : ?>
+  <div class="artiste_edit_onglet">
+    <a href="<?= $env->url(array("e" => "set_artiste_infos", "artiste" => $env->out["artiste"]["id"])) ?>"><img src="<?= $env->out_file("icons/edit.gif") ?>" alt="edit" /></a>
+  </div>
+<?php endif; ?>
+
+
+  <div class="artiste_ariane">
+         <a href="<?= $env->url(array("e" => "artistes")) ?>">Artistes</a>
+    &gt; <a href="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"])) ?>"><?= $env->out["artiste"]["nom"] ?></a>
+<?php if($env->page && $env->page !== "presentation") : ?>
+    &gt; <!-- a href="<?= $_SERVER["REQUEST_URI"] ?>"><?= $env->page ?></a -->
+         <a href="<?=
+              $env->url
+              ( array
+                ( "e" => "artistes",
+                  "artiste" => $env->out["artiste"]["id"],
+                  "page" => $env->page
+                )
+              )
+            ?>"><?= $env->page ?></a>
+<?php endif; ?>
+  </div>
+
+  <div class="clear"><!-- --></div>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/bloc.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/bloc.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/bloc.php	(revision 1)
@@ -0,0 +1,25 @@
+<?php
+
+  $has_content = false;
+  $bloc_file = null;
+  if($env->out["bloc"]["fichier"])
+  { $bloc_file = $env->out_file("boxes/".$env->out["bloc"]["fichier"]);
+    if(file_exists($bloc_file) && !is_dir($bloc_file)) $has_content = filesize($bloc_file) > 0;
+  }
+  else $has_content = strlen($env->out["bloc"]["contenu"]) > 0;
+  if($has_content) :
+
+?>
+<div class="bloc">
+<?php if($env->out["bloc"]["titre"]) : ?>
+  <h2><?= $env->out["bloc"]["titre"] ?></h2>
+<?php endif; ?>
+  <div class="bloc_content">
+<?php if($env->out["bloc"]["fichier"]) : ?>
+<?php require $bloc_file; ?>
+<?php else : ?>
+<?= $env->out["bloc"]["contenu"] ?>
+<?php endif; ?>
+  </div>
+</div>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/downloads.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/downloads.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/downloads.php	(revision 1)
@@ -0,0 +1,79 @@
+<?php
+
+  foreach($env->out["downloads"] as $id_download => $download) :
+
+  $audio_files = array();
+  foreach($download["urls"] as $id_url => $url)
+  { if
+    (    $url["format"] == "ogg"
+      || $url["format"] == "mp3"
+//      || $url["format"] == "wav"
+    )
+    { $audio_files[$url["format"]] = $url["url"];
+    }
+  }
+
+?>
+<div class="download" id="track_<?= $id_download  ?>">
+
+<?php if($audio_files) : ?>
+  <div class="player_controls" id="player_controls_<?= $id_download ?>">
+    <a class="play" href="#"><span>play</span></a>
+    <a class="pause" href="#"><span>pause</span></a>
+    <a class="stop" href="#"><span>stop</span></a>
+  </div>
+<?php endif; ?>
+
+<h3>
+<?php if($download["nom"]) : ?>
+  <?php echo $download["nom"]; ?>
+<?php else : ?>
+  <a href="<?= $env->url(array("e" => "artistes", "artiste" => $download["id_auteur"])) ?>"><?= $download["auteur"] ?></a> - <?= $download["titre"] ?>
+<?php endif; ?>
+</h3>
+<div class="clear"><!-- --></div>
+  <div class="player_progress">
+    <div class="loaded"><!-- --></div>
+    <div class="position"><!-- --></div>
+  </div>
+
+<div class="dleft">
+<?php if($download["style"]) : ?>
+<?= $download["style"] ?><br />
+<?php endif; ?>
+<table>
+  <tr>
+    <td>t&eacute;l&eacute;charger :</td>
+    <td>
+<?php foreach($download["urls"] as $id_url => $url) : ?>
+<a class="file_format" href="<?= $env->url(array("e" => "down", "download" => $id_url), "download.php") ?>"><?= $url["format"]; ?></a>
+<?php endforeach; ?>
+<?php if($audio_files) : ?>
+<audio id="audio_<?= $id_download ?>">
+<?php foreach($audio_files as $ext => $url) : ?>
+  <source src="<?= $url ?>" type="audio/<?= $ext ?>">
+<?php endforeach; ?>
+<!-- contenu alternatif si aucun format n'est supporte par le navigateur -->
+</audio>
+<?php endif; ?>
+      <div class="clear"><!-- --></div>
+    </td>
+  </tr>
+</table>
+</div>
+
+<div class="dright">
+<a class="download_licence" href="<?php echo $download["licence_url"]; ?>" title="<?= $download["licence"] ?>">
+<?php if($env->out["licences"][$download["id_licence"]]["icone"]) : ?>
+  <img src="<?= $env->out_file($env->out["licences"][$download["id_licence"]]["icone"]) ?>" alt="<?= $download["licence"] ?>" />
+<?php else : ?>
+  <?php echo $download["licence"]; ?>
+<?php endif; ?>
+</a>
+<div class="clear"><!-- --></div>
+<?php echo $download["date_creation"]; ?>
+</div>
+
+<div class="clear"><!-- --></div>
+</div>
+<?php endforeach; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/flickr_bloc.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/flickr_bloc.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/flickr_bloc.php	(revision 1)
@@ -0,0 +1,33 @@
+            <div class="bloc" id="flickr_bloc">
+              <h2>
+                <a id="flickr_bloc_link" href="http://www.flickr.com/photos/revolutionsoundrecords/">
+                  En images <img src="<?= $env->out_file("icons/social/flickr_mini.png") ?>" />
+                </a>
+              </h2>
+              <div class="bloc_content">
+<?php
+
+
+if($flux = simplexml_load_file('http://api.flickr.com/services/feeds/photos_public.gne?id=43300075@N07&lang=fr-fr&format=rss_200'))
+{
+   $donnee = $flux->channel;
+   $n = 0;
+   foreach($donnee->item as $valeur)
+   { $n++;
+     $description = utf8_decode($valeur->description);
+     $description = substr($description, strpos($description, "<img"));
+     $description = substr($description, strpos($description, "src=") + 5);
+     $description = substr($description, 0, strpos($description, "\""));
+?>
+     <a href="<?= utf8_decode($valeur->link) ?>"><img src="<?= $description ?>" /></a>
+<?php
+     if($n == 4) break;
+   }
+}else echo 'Erreur de lecture du flux RSS';
+
+
+
+?>
+                <div class="clear"><!-- --></div>
+              </div>
+            </div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/footer.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/footer.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/footer.php	(revision 1)
@@ -0,0 +1,49 @@
+<?php
+
+  function get_ul_menu($env, $menu)
+  { $content = "<ul>";
+    foreach($menu["subs"] as $sub)
+    { $content .=
+       "<li>"
+      .($sub["contenu"] ? "<a href=\"".$env->url(null, null, url_amps($sub["contenu"]))."\">" : "")
+      .$sub["titre"]
+      .($sub["contenu"] ? "</a>" : "");
+      if($sub["subs"]) $content .= get_ul_menu($env, $sub);
+      $content .=
+       "</li>";
+    }
+    $content .= "</ul>";
+    return $content;
+  }
+
+?>
+<div id="footer_content">
+
+  <div id="footer_navig">
+<?php if(isset($env->out["menu_top"]["subs"])) : foreach($env->out["menu_top"]["subs"] as $menu) : ?>
+    <div class="footer_menu_part">
+      <ul>
+        <li>
+<?php if($menu["contenu"]) : ?>
+          <a href="<?= $env->url(null, null, url_amps($menu["contenu"])) ?>">
+<?php //endif; ?>
+<?= $menu["titre"] ?>
+<?php //if($menu["contenu"]) : ?>
+          </a>
+<?php endif; ?>
+<?php if($menu["subs"]) echo get_ul_menu($env, $menu) ?>
+        </li>
+      </ul>
+    </div>
+<?php endforeach; endif; ?>
+    <div class="clear"><!-- --></div>
+  </div>
+  <div id="footer_infos">
+    <ul>
+      <li><a href="<?= $env->url(array("e" => "contact")) ?>">Contactez-nous</a></li>
+      <li><a href="http://wiki.rsr.free.fr/wiki">rsr - v.5</a></li>
+    </ul>
+  </div>
+  <div class="clear"><!-- --></div>
+
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/header.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/header.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/header.php	(revision 1)
@@ -0,0 +1,13 @@
+<div id="identification">
+<?php $env->aff_bloc("identification"); ?>
+</div>
+
+<h1 id="accueil_link"><a href="<?= $env->url(array("e" => "")) ?>" title="Accueil">
+  <span><?= $env->config("site_name") ?></span>
+</a></h1>
+
+<div class="clear"><!-- --></div>
+
+<div id="navigation">
+<?php $env->aff_bloc("navigation"); ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/interne_gauche.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/interne_gauche.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/interne_gauche.php	(revision 1)
@@ -0,0 +1,27 @@
+<?php $env->aff_emplacement("interne_gauche") ?>
+
+<?php if(false && $env->out["last_albums"]) : ?>
+
+<?php foreach($env->out["last_albums"] as $id_album => $album) : ?>
+
+<br />
+        <a class="last_album_link"
+           title="<?= $album["artiste"] ?> : <?= str_replace("\"", "\\\"", $album["titre"]) ?>"
+           href="<?= $env->url
+                     ( array
+                       ( "e" => "artistes",
+                         "artiste" => $album["id_artiste"],
+                         "page" => "downloads",
+                         "album" => $id_album
+                       )
+                     ) ?>">
+          <?php if($album["image"]) : ?>
+          <img src="<?= $album["image"] ?>" width="150" alt="<?= str_replace("\"", "\\\"", $album["titre"]) ?>" />
+          <?php endif; ?>
+          <br/>
+          <?= $album["artiste"] ?> : <?= $album["titre"] ?>
+        </a>
+
+<?php endforeach; ?>
+
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/map_commands.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/map_commands.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/map_commands.php	(revision 1)
@@ -0,0 +1,42 @@
+<?php if($env->out["emplacement_types"]) : ?>
+<?php if($env->out["VIEW_MAP"]) : ?>
+<div class="bloc">
+<h2>Afficher</h2>
+  <div class="bloc_content">
+    <div class="map_commands">
+      <ul id="legende">
+<?php foreach($env->out["emplacement_types"] as $id_et => $values) : ?>
+        <li>
+          <img src="<?php echo isset($values["icone"]) && $values["icone"] ? $values["icone"] : "http://www.google.com/intl/fr_ALL/mapfiles/ms/micons/red-dot.png" ?>" alt="" />
+          <input type="checkbox"
+                 id="et_check_<?php echo $id_et; ?>"
+                 onclick="update_map()" checked>
+          <label><?php echo $values["intitule"]; ?></label>
+        </li>
+<?php endforeach; ?>
+      </ul>
+    </div>
+<?php if($env->out["EDIT_MAP"]) : ?>
+    <br>
+  </div>
+</div>
+<div class="bloc">
+<h2>Editer</h2>
+  <div class="bloc_content">
+    <div class="map_commands">
+<?php if($env->out["EDIT_ON"]) : ?>
+      <a href="javascript:add_map_emplacement()"><img src="<?= $env->out_file("icons/add.gif") ?>" alt="ajouter un emplacement"> ajouter un emplacement</a>
+      <br />
+      <br />
+      <input disabled class="button" id="save_map_button" type="submit" onclick="javascript:save_map()" value="enregistrer">
+      <input class="button" type="submit" onclick="javascript:location.href='<?= $env->url(array("e" => "carte")) ?>'" value="terminer">
+<?php else : ?>
+      <input class="button" type="submit" onclick="javascript:location.href='<?= $env->url(array("e" => "carte", "edit" => "on")) ?>'" value="modifier">
+      <font>&nbsp;</font>
+<?php endif; ?>
+    </div>
+  </div>
+</div>
+<?php endif; ?>
+<?php endif; ?>
+<?php endif; ?>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/menu_admin_artiste.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/menu_admin_artiste.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/menu_admin_artiste.php	(revision 1)
@@ -0,0 +1,49 @@
+      <div id="artiste_logo">
+
+      <a href="<?= $env->url(array("e" => "artistes", "artiste" => $env->out["artiste"]["id"], "page" => "presentation")) ?>">
+      <?php
+
+        if($env->out["artiste"]["image"] && ($img_size = img_size($env->out["artiste"]["image"], 240, 190)) !== false) :
+        $margin_top = floor((190 - $img_size["height"]) / 2);
+
+      ?>
+
+        <img src="<?php echo $env->out["artiste"]["image"]; ?>" alt="<?= $env->out["artiste"]["nom"] ?>"
+             width="<?= $img_size["width"] ?>"
+             height="<?= $img_size["height"] ?>"
+             style="margin-top:<?= $margin_top ?>px" />
+
+      <?php else : ?>
+        <?= $env->out["artiste"]["nom"] ?><br />
+        (pas d'image pour le moment)
+      <?php endif; ?>
+      </a>
+
+      </div>
+
+
+
+
+<div id="artiste_admin_infos">
+  <br />
+  <h3>Administration de votre compte</h3>
+  <br />
+  <ul class="menu_admin">
+    <li><a href="<?= $env->url(array("e" => "set_artiste_infos", "artiste" => $env->out["artiste"]["id"])) ?>">
+      Informations g&eacute;n&eacute;rales
+    </a></li>
+    <li><a href="<?= $env->url(array("e" => "set_artiste_presentation", "artiste" => $env->out["artiste"]["id"])) ?>">
+      Pr&eacute;sentation
+    </a></li>
+    <li><a href="<?= $env->url(array("e" => "set_artiste_news", "artiste" => $env->out["artiste"]["id"])) ?>">
+      News
+    </a></li>
+    <li><a href="<?= $env->url(array("e" => "set_artiste_downloads", "artiste" => $env->out["artiste"]["id"])) ?>">
+      Downloads
+    </a></li>
+    <li><a href="<?= $env->url(array("e" => "set_artiste_albums", "artiste" => $env->out["artiste"]["id"])) ?>">
+      Albums
+    </a></li>
+  </ul>
+</div>
+<div style="clear: both">&nbsp;</div>
Index: /branches/rsr.v5.1.dev/web/app/out/dist/views/message.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/out/dist/views/message.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/out/dist/views/message.php	(revision 1)
@@ -0,0 +1,4 @@
+<div class="message">
+  <div><?= $env->message ?></div>
+  <br />
+</div>
Index: /branches/rsr.v5.1.dev/web/app/plugins/ptitcaptcha.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/ptitcaptcha.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/ptitcaptcha.php	(revision 1)
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Ptitcaptcha : simple php captcha system
+ * 
+ * @author Jean-Pierre Morfin
+ * @license Creative Commons By
+ * @license http://creativecommons.org/licenses/by/2.0/fr/
+ */
+ 
+/* Change it to have a specific encoding ! */
+define("PTITCAPTCHA_ENTROPY","what-ever-you-want");
+ 
+/* Choose length (max 32) */
+define("PTITCAPTCHA_LENGTH",5);
+ 
+$GLOBALS["ptitcaptcha_akey"] = md5(uniqid(rand(), true));
+ 
+/**
+ * Helper to generate html form tags
+ *
+ */
+class PtitCaptchaHelper
+{
+	/**
+	 * Generate IMG Tag
+	 *
+	 * @param string $baseuri : relative or absolute path to folder containing this file on web
+	 * @return IMG Tag
+	 */
+	function generateImgTags($baseuri)
+	{
+		return "<a href=\"#\"><img alt=\"???\" title=\"?\"".
+			" src=\"".$baseuri."ptitcaptcha.php?pck=".$GLOBALS['ptitcaptcha_akey']."\"".
+			" id=\"ptitcaptcha\"".
+			" onclick=\"javascript:this.src='".$baseuri."ptitcaptcha.php?pck=".
+			$GLOBALS['ptitcaptcha_akey'].
+			"&amp;z='+Math.random();return false;\" /></a>\n";
+	}
+ 
+	/**
+	 * Generate hidden tag (must be in a form)
+	 *
+	 * @return input hidden tag
+	 */
+	function generateHiddenTags()
+	{
+		return "<input type=\"hidden\" name=\"ptitcaptcha_key\" value=\"".$GLOBALS['ptitcaptcha_akey']."\"/>";
+	}
+ 
+	/**
+	 * Generate input tag (must be in a form)
+	 *
+	 * @return input tag
+	 */
+	function generateInputTags()
+	{
+		return "<input type=\"text\" name=\"ptitcaptcha_entry\" value=\"\"/>";
+	}
+ 
+	/**
+	 * Check if user input is correct
+	 *
+	 * @return boolean (true=correct, false=incorrect)
+	 */
+	function checkCaptcha()
+	{
+		if(	isset($_POST['ptitcaptcha_entry']) && 
+			$_POST['ptitcaptcha_entry'] == PtitCaptchaHelper::_getDisplayText($_POST['ptitcaptcha_key']))
+		{
+			return true;
+		}
+		return false;
+	}
+ 
+	/**
+	 * Internal function
+	 *
+	 * @param string $pck
+	 * @return string
+	 */
+	function _getDisplayText($pck)	// internal function
+	{
+		$src=md5(PTITCAPTCHA_ENTROPY.$pck);
+		$txt="";
+		for($i=0;$i<PTITCAPTCHA_LENGTH;$i++)
+			$txt.=substr($src,$i*32/PTITCAPTCHA_LENGTH,1);
+		return $txt;
+	}
+}	
+ 
+ 
+// If script called directly : generate image
+if(basename($_SERVER["SCRIPT_NAME"])=="ptitcaptcha.php" && isset($_GET["pck"]))
+{
+	$width = PTITCAPTCHA_LENGTH*10+10;
+	$height = 30;
+ 
+	$image = imagecreatetruecolor($width, $height);
+	$bgCol = imagecolorallocate($image, rand(128,255), rand(128,255), rand(128,255));
+	imagefilledrectangle($image,0,0,$width,$height,$bgCol);
+ 
+	$txt = PtitCaptchaHelper::_getDisplayText($_GET["pck"]);
+ 
+	for($c=0;$c<PTITCAPTCHA_LENGTH*2;$c++)
+	{
+		$bgCol = imagecolorallocate($image, rand(100,255), rand(100,255), rand(100,255));
+		$x=rand(0,$width);
+		$y=rand(0,$height);
+		$w=rand(5,$width/2);
+		$h=rand(5,$height/2);
+		imagefilledrectangle($image,$x,$y,$x+$w,$y+$h,$bgCol);
+		imagecolordeallocate($image,$bgCol);
+	}
+	for($c=0;$c<PTITCAPTCHA_LENGTH;$c++)
+	{
+		$txtCol = imagecolorallocate($image, rand(0,128) , rand(0,128), rand(0,128));
+		imagestring($image,5,5+10*$c,rand(0,10),substr($txt,$c,1),$txtCol);
+		imagecolordeallocate($image,$txtCol);
+	}
+ 
+	header("Content-type: image/png");
+	imagepng($image);
+	imagedestroy($image);
+}
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/plugins/str_tab.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/str_tab.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/str_tab.php	(revision 1)
@@ -0,0 +1,88 @@
+<?php
+
+#
+# quelques fonctions pour convertir un Array php en chaine de caractères et vis-versa.
+#
+# l'idée, à la base, c'était de trouver un format pour pouvoir sauver un Array php
+# dans un fichier texte. ça permet de sauvegarder des données structurées, sans avoir
+# à passer par une base de données.
+#
+#
+# SYNTAXE:
+#
+#   ----------------------------------------------------------------------------------
+#   tab_to_str($TAB)
+#
+#   retourne une chaine de caractères qui représente $TAB. $TAB doit être du type Array.
+#
+#   NOTE: la convertion en chaine de caractères marche si les valeurs du tableau
+#         sont des chaines de caractères, des nombres ou des tableaux, mais c'est
+#         pas dit que ça marche pour d'autre types de variables.
+#
+#         Autrement dit, le tableau $TAB peut lui-même contenir des tableaux, qui
+#         peuvent eux-même contenir des tableaux (...), tant que les valeurs restent
+#         des chaines de caractères, des nombres ou des tableaux.
+#
+#
+#   ----------------------------------------------------------------------------------
+#   str_to_tab($str)
+#
+#   retourne un Array qui correspond à la chaine de caractère $str. $str doit avoir
+#   été crée avec la fonction tab_to_str.
+#
+
+
+  function tab_to_str($TAB) { return _tab_to_str("", $TAB); }
+
+  function _tab_to_str($pre, $TAB)
+  { $content = "";
+    if($TAB)
+    { foreach($TAB as $key => $value)
+      { if(is_array($value)) $content .= _tab_to_str($pre.strlen($key).":".$key, $TAB[$key]);
+        else $content .= $pre.strlen($key).":".$key.strlen($value).":".$value."\n"; 
+      }
+    }
+    else return $pre."a:\n";
+    return $content;
+  }
+
+  function str_to_tab($content)
+  { $TAB = array();
+    $n = 0;
+    while($n < strlen($content))
+    { $LINE_FOUND = 0;
+      $ENDS_WITH_EMPTY_TAB = 0;
+      $words = array();
+      while($n < strlen($content) && !$LINE_FOUND)
+      { $length = "";
+        $word = "";
+        while($n < strlen($content) && strcmp(substr($content, $n, 1), ":") != 0) { $length .= $content[$n]; $n++; } $n++;
+        if(strcmp($length, "a") == 0) $ENDS_WITH_EMPTY_TAB = 1;
+        else
+        { for($k = 0; $k < $length; $k++) { $word .= $content[$n]; $n++; }
+          $words[] = $word;
+        }
+        $LINE_FOUND = $ENDS_WITH_EMPTY_TAB || $n == strlen($content) || strcmp(substr($content, $n, 1), "\n") == 0;
+      }
+      $n++;
+      if($words) $TAB = affect($TAB, $words, $ENDS_WITH_EMPTY_TAB);
+    }
+    return $TAB; 
+  }
+
+  function affect($TAB, $words, $ENDS_WITH_EMPTY_TAB)
+  { if(count($words) > ($ENDS_WITH_EMPTY_TAB ? 1 : 2))
+    { if(!is_array($TAB[$words[0]])) $TAB[$words[0]] = array();
+      $_words = array();
+      $FIRST = 1;  
+      foreach($words as $word)
+      { if($FIRST) $FIRST = 0;
+        else $_words[] = $word;
+      }
+      $TAB[$words[0]] = affect($TAB[$words[0]], $_words, $ENDS_WITH_EMPTY_TAB);
+    }
+    else $TAB[$words[0]] = ($ENDS_WITH_EMPTY_TAB ? array() : $words[1]);
+    return $TAB;
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/changelog.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/changelog.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/changelog.txt	(revision 1)
@@ -0,0 +1,303 @@
+Version 3.0 (2008-01-30)
+	Added map and area elements to the default valid_elements list and also some indentation rules.
+	Fixed bug where empty paragraphs wasn't padded when loading contents.
+	Fixed bug where the RowLayout manager didn't work at all.
+	Fixed bug where style attribute data would get messed up in advimage dialog.
+	Fixed bug where the table dialogs class select wasn't updated correctly.
+	Fixed bug where elements would get extra whitespace around on insert when body was present in valid_elements.
+	Fixed bug where coords attribute of the area element wasn't handled properly in IE.
+	Fixed bug where Safari didn't produce BR elements on shift+return.
+	Fixed bug where force blocks would cast odd invalid attribute exception in IE.
+	Fixed bug where media plugin would produce extra whitespace before and after objects.
+	Fixed bug where cleanup_callback could break the contents of the editor. But use the new event system instead of this option.
+	Fixed bug where the tab_focus option didn't work between editor instanced. You can now tab between editors.
+	Fixed bug where the load function of the ScriptLoader class didn't load single files without the load que as it was supposed to.
+	Fixed bug where the execcommand_callback parameter order was incorrect. Recommendation use the new addCommand method.
+	Fixed bug where range.select calls sometimes failed on some IE versions.
+	Fixed bug where Safari was scrolling to top of document when enter/returned was pressed.
+	Fixed bug where fullscreen_new_window option didn't work correctly.
+	Fixed bug where the nonbreaking plugin inserted an space instead of an non breaking space the first time.
+	Fixed bug where the visualization of non breaking spaces where visual in element path.
+	Fixed so the focus is restored to the editor after inserting an custom character.
+	Fixed so the isNotDirty state is set to false if a new undo level is added.
+	Fixed so pointless style information for borders gets removed in IE.
+	Fixed so the resize button has a se-resize cursor css value.
+Version 3.0rc2 (2008-01-18)
+	Added new fix_nesting option to fix bug #1867292, this is disabled by default.
+	Added new indentation option enables you to specify how much each indent/outdent call will add/remove.
+	Added easier support for enabling/disabling icon columns on drop menues.
+	Added new menu button control class. This control is very similar to the splitbutton but without any onclick action.
+	Added support for previous tab focus (shift+tab). The tab_focus setting now takes two items next and previous element.
+	Fixed bug where iframes inside the editor got removed in Firefox on initial load.
+	Fixed bug where the CSS for abbr elements wasn't applied correctly in IE.
+	Fixed bug where mceAddControl on element inside a hidden container produced errors.
+	Fixed bug where closed anchors like <a /> produced strange results.
+	Fixed bug where caret would jump to the top of the editor if enter was pressed a the end of a list.
+	Fixed bug where remove editor failed if the editor wasn't properly initialized.
+	Fixed bug where render call on for a non existing element produced exception.
+	Fixed bug where parent window was hidden when the color picker was used in a non inlinepopups setup.
+	Fixed bug where onchange event wasn't fired correctly on IE when color picker was used in dialogs.
+	Fixed bug where save plugin could not save contents if the converted element wasn't an textarea.
+	Fixed bug where events might be fired even after an editor instance was removed such as blur events.
+	Fixed bug where an exception about undefined undo levels could be throwed sometimes.
+	Fixed bug where the plugin_preview_pageurl option didn't work.
+	Fixed bug where adding/removing an editor instance very fast could produce problems.
+	Fixed bug where the link button was highlighted when an anchor element was selected.
+	Fixed bug where the selected contents where removed if a new anchor element was added.
+	Fixed bug where splitbuttons where rendered one pixel down in the default theme.
+	Fixed bug where some buttons where placed at incorrect positions in the o2k7 theme.
+	Fixed bug that made it impossible to visually disable a custom button that used an image instead of CSS sprites.
+	Fixed bug where it wasn't possible to press delete/backspace if the editor was added+removed and re-added due to a FF bug.
+	Fixed bug where an entities option with only 38,amp,60,lt,62,gt would fail in IE.
+	Fixed bug where innerHTML sometimes generated unknown runtime error on IE.
+	Fixed bug where content_css files wasn't loaded in the template preview iframe.
+	Fixed bug where scroll position was incorrect when toggling fullscreen mode.
+	Fixed bug where restoration of overflow didn't work correctly when disabling fullscreen mode in Opera.
+	Fixed bug where drop menus where places at incorrect locations if the editor was placed in a scrollable container element.
+	Fixed bug where hideMenu didn't hide sub menus correctly. It will now hide all menus recursively.
+	Fixed so theme_advanced_path_location can be used in init options for compatibility reasons.
+	Fixed so the drop menu colors matches the rest of o2k7 theme.
+	Fixed so the preview example.html file is updated to the new 3.x API.
+	Fixed so the margins are the same by default inside the editable area between IE and other browsers.
+	Fixed so editor contents gets stored before it the onSubmit event is fired.
+Version 3.0rc1 (2008-01-08)
+	Added new classes for toolbar rows in advanced theme mceToolbarRow1..n enabled you to change appearance of individual rows.
+	Added auto detection for the strict_loading_mode option when running in application/xhtml+xml mode on Gecko.
+	Optimized the HTML serializer by bundling some post process methods together.
+	Fixed so that the toolbars have unique IDs, enables you to alter the toolbars using the ControlManager and the DOM.
+	Fixed bug where delta values for dialog sizes in language packs didn't work correctly due to missing string to number casting.
+	Fixed bug where paragraph generation logic didn't handle hr or table elements correctly if they where the only element.
+	Fixed bug where some elements got extra linebreaks added after or before it in HTML output.
+	Fixed bug where it was hard to modify existing style data on table rows and table cells.
+	Fixed bug where the dom.getRect method didn't handle non pixel values correctly.
+	Fixed bug where strikethrough and underline couldn't be toggled on existing span elements.
+	Fixed bug where the postprocessor searched for nsbp instead of nbsp entities.
+	Fixed bug where it was impossible to edit links that had child elements within them.
+	Fixed bug where it was possible to click on the parent item of a submenu.
+	Fixed bug where mouseover/mouseout images couldn't be removed in advimage dialog.
+	Fixed bug where drop menus didn't work when running in application/xhtml+xml mode.
+	Fixed bug where Opera added doctype to output in application/xhtml+xml mode.
+	Fixed bug where some DOM methods didn't work correctly in the application/xhtml+xml mode.
+	Fixed bug where the inlinepopups didn't work correctly in the application/xhtml+xml mode.
+	Fixed bug where the ColorSplitButton didn't display correctly in the application/xhtml+xml mode.
+	Fixed bug where the UI layout was incorrect on Gecko browsers when running in application/xhtml+xml mode.
+	Fixed bug where the word paste plugin produced exception while running in application/xhtml+xml mode.
+	Fixed bug where there wasn't any hidden input element generated for divs while running in application/xhtml+xml mode.
+	Fixed bug where indentation of script/style/pre elements where incorrect.
+	Fixed bug where script element contents was removed in IE.
+	Fixed bug where script element contents got entity encoded.
+	Fixed bug where you couldn't edit existing element styles using the styles plugin.
+	Fixed bug where styles wasn't updated properly sometimes due to an performance enhancement.
+	Fixed bug where font sizes couldn't be changed using the style plugin.
+	Fixed bug where an error was produced in Gecko browsers when switching back from fullscreen mode.
+	Fixed bug where Opera was producing br elements after elements like h3.
+	Fixed bug where TinyMCE couldn't be loaded on a page using - characters in it's URL.
+	Fixed bug where the editor container element was forced to have a specific name.
+	Fixed bug with force_br_newlines option on Firefox, even though it should never be used (Read FAQ).
+	Fixed bug where onclick event had an return true; prefix added when creating an popup.
+	Fixed bug where the theme_advanced_statusbar_location option couldn't handle the value "none".
+	Fixed issue with URLs with multiple at characters for example an Zope URI.
+	Fixed so simple and advanced themes doesn't collide.
+	Fixed so a elements gets removed when the href field is left empty, the href attribute is required in a link after all.
+	Fixed so img elements gets removed when the src field is left empty, the src attribute is required for all images after all.
+	Removed the indent and encode methods from the tinymce.dom.Serializer class due to performance enhancement and reduction of the API size.
+Version 3.0b3 (2007-12-14)
+	Added new getElement method to Editor class, returns the element that was replaced with the editor instance.
+	Added new unavailable prefix for disabled controls for accessibility reasons.
+	Fixed bug where regexp patterns couldn't be used for the editor_selector/editor_deselector options.
+	Fixed bug where the DOM wasn't properly initialized before the onInit event was executed in popups.
+	Fixed bug where font sizes where reduced by font size actions on previous spans in Safari.
+	Fixed bug where HR elements got places at the wrong location in IE.
+	Fixed bug where align/justify didn't work correctly on multiple paragraphs.
+	Fixed bug with missing translation for cell scope settings.
+	Fixed bug where selection/caret position was lost on some table actions.
+	Fixed bug where editor instances couldn't be added to hidden div elements.
+	Fixed bug where list elements in Safari would get an odd ID attribute.
+	Fixed bug where IE would return <html/> when the editor was completely empty.
+	Fixed bug where accessibility title attribute for access keys wasn't setup properly.
+	Fixed bug where forecolorpicker and backcolorpicker control names wasn't working.
+	Fixed bug where inserting template content didn't work in Safari due to selection exception.
+	Fixed bug where absolute URLs to remote hosts couldn't be used for background images.
+	Fixed bug where mysterious span elements where produced in Safari when injecting HTML contents.
+	Fixed bug where the media plugin didn't work correctly on the latest Opera 9.24.
+	Fixed bug where indentation of HTML output wasn't applied to all block elements.
+	Fixed bug where Safari was production DOM exception if you pressed enter in an empty editor.
+	Fixed bug where media plugin didn't parse script tags correctly patch contributed by Mathieu Campagna.
+	Fixed bug where the drop menus of list boxes like blockformat could produce scrolling of the page.
+	Fixed bug where the drop menus where placed at an incorrect location if TinyMCE was placed in a scrollable div.
+	Fixed bug where submit buttons couldn't be named submit, it's not recommended to name submit buttons submit anyway.
+	Fixed bug where the stylelistbox produced an exception if there was only one class in the list box.
+	Fixed bug where the stylelistbox wasn't updated correctly when the current class was removed.
+	Fixed bug where the formatblock command sometimes removed the body element.
+	Fixed bug where fullscreen switching in IE sometimes produced an exception when the spellchecker plugin was enabled.
+	Fixed issue where FF produced an empty paragraph when the editor was completely empty.
+	Fixed issue with size of image dialog in the advanced theme.
+	Fixed issues with the bbcode plugin it now also handles spans and the [font] rule.
+	Fixed so the style compression feature is a bit smarter to resolve issues with Opera.
+	Reintroduced the remove_linebreaks option, this is enabled by default.
+Version 3.0b2 (2007-11-29)
+	Added type and compact attributes to the default valid_elements list for the ul and ol elements.
+	Added missing accessibility support to native list boxes in both the toolbar and dialogs.
+	Added missing access key for the element path for accessibility reasons.
+	Fixed support for loading themes from external URLs.
+	Fixed bug where setOuterHTML didn't work correctly when multiple elements where passed to it.
+	Fixed bug with visualchars plugin was moving elements around in the DOM.
+	Fixed bug with DIV elements that got converted into editors on IE.
+	Fixed bug with paste plugin using the old event API.
+	Fixed bug where the spellchecker was removing the word when it was ignored.
+	Fixed bug where fullscreen wasn't working properly.
+	Fixed bug where the base href element and attribute was ignored.
+	Fixed bug where redo function didn't work in IE.
+	Fixed bug where content_css didn't work as previous 2.x branch.
+	Fixed bug where preview dialog was throwing errors if the content_css wasn't defined.
+	Fixed bug where the theme_advanced_path option didn't work like the 2.x branch.
+	Fixed bug where the theme_advanced_statusbar_location was called theme_advanced_status_location.
+	Fixed bug where the strict_loading_mode option didn't work if you created editors dynamically without using the EditorManager.
+	Fixed bug where some language values wasn't translated such as insert and update in dialogs.
+	Fixed bug where some image attributes wasn't stored correctly when inserting an image.
+	Fixed bug where fullscreen mode didn't restore scrollbars when disabled.
+	Fixed bug where there was no visual representation for tab focus in toolbars on IE.
+	Fixed bug where HR elements wasn't treated as block elements so forced_root_block would fail on these.
+	Fixed bug where autosave presented warning message even when the form was submitted normally.
+	Fixed typo of openBrower it's now openBrowser in form_utils.js.
+	Fixed various HTML problems like missing TD elements and duplicated doctypes.
+	Fixed default values for theme_advanced_resize_horizontal, theme_advanced_resizing_use_cookie to be 2.x compatible.
+	Moved spellchecker JS files into the development package.
+	Removed support for theme_advanced_path_location since the theme_advanced_statusbar_location is the correct option name.
+Version 3.0b1 (2007-11-21)
+	Added new tab_focus option, that enables you to specify a element id or that the next element to be focused on tab key down.
+	Added new addQueryValueHandler method to the tinymce.Editor class.
+	Added new class_filter option, this enables you to specify a function that can filter out CSS classes for the styles list box.
+	Added support form [url=url]title[/url] to the bbcode plugin.
+	Renamed the addCommandQueryState method in the tinymce.Editor class to addQueryStateHandler.
+	Renamed loadQue to loadQueue, to correct spelling.
+	Removed the createDOM method from the window manager and replace it with a createInstance method.
+	Removed the add to beginning of class attribute parameter of the DOMUtils.addClass method.
+	Fixed bug with the forced_root_block option, didn't work correctly with multiple inline elements.
+	Fixed bug where image dialogs replaced the current image element with a new one even when it was updated.
+	Fixed bug where the submit trigger wasn't executed when divs where converted into editor instances.
+	Fixed bug where div elements that got converted into editors didn't get a hidden input element generated for them.
+	Fixed bug where the the media_use_script option for the media plugin wasn't working correctly.
+	Fixed bug where the font size and font family listboxes wasn't updated correctly on Safari.
+	Fixed bug where the height of the fieldset in default image dialog for the advanced theme was to small.
+	Fixed bug where the font sizes behaved incorrectly after a cleanup on Safari.
+	Fixed bug where formatblock didn't work correctly in Safari on some elements.
+	Fixed bug where template plugin didn't insert content correctly unless some options where specified.
+	Fixed bug where charmap on Safari produced scrollbars.
+	Fixed bug where there was white artifacts in some dialogs due to missing background color.
+	Fixed bug where port was added to all external URLs if the editor was loaded from a custom port.
+	Fixed bug where the context menus got duplicated on Safari 3.0.4 on Mac OS X.
+	Fixed bug where dialogs like paste from word was huge on Firefox.
+	Fixed bug with media plugin not working with windows media objects.
+	Fixed bug where a forever loop was created if multiple instances where submitted using form.submit.
+	Fixed bug with editing a table produce error in IE when inlinepopups where used.
+	Fixed bug where the style plugin generated ugly looking style information in IE.
+	Fixed bug where the inline dialogs that got opened while in fullscreen mode wasn't visible.
+	Fixed bug where it was difficult to place the caret inside the word paste dialog.
+	Fixed bug where Opera produced strange border in the word paste dialog.
+	Fixed bug where viewport constraints could move a inlinepopup to a negative x, y position if the viewport was to small.
+	Fixed bug where template plugin was producing an error due to a deprecated API call.
+	Fixed bug where drag drop of images failed in Gecko if a document_base_url was specified.
+	Fixed bug where Firefox 3 failed to apply block formats like H1-H6 it still breaks on DIVs this has been reported to bugzilla.
+	Fixed bug where IE was producing a warning dialog about non secure items when running TinyMCE over HTTPS.
+	Fixed bug where the onbeforeunload event was triggered when menus or dialogs where opened.
+	Fixed bug where the fullscreen mode of the HTML view source box threw an error.
+	Fixed bug where the mceFocus command didn't work correctly.
+	Fixed bug where the selection could get lost in IE using inlinepopups.
+	Fixed so the body of the editor area has the mceContentBody class just like the 2.x branch. 
+	Fixed so the media icon gets active when a media element is selected.
+Version 3.0a3 (2007-11-13)
+	Added new experimental jQuery and Prototype framework adapters to the development package.
+	Added new translation.html file for the development package. Helps with the internationalization of TinyMCE.
+	Added new setup callback option, use this callback to add events to TinyMCE. This method is recommended over the old callbacks.
+	Added new API documetation to all classes, functions, events, properties to the Wiki with examples etc.
+	Added new init method to all plugins and themes, since it's shorter to write and it mimics interface capable languages better.
+	Fixed various CSS issues in the default skin such as alignment of split buttons and separators.
+	Fixed issues with mod_security. It didn't like that a content type of text/javascript was forced in a XHR.
+	Fixed all events so that they now pass the sender object as it's first argument.
+	Fixed some DOM methods so they now can take an array as input.
+	Fixed so addButton and the methods of the ControlManager uses less arguments and it now uses a settings object instead.
+	Fixed various issues with the tinymce.util.URI class.
+	Fixed bug in IE and Safari and the on demand gzip loading feature.
+	Fixed bug with moving inline windows sometimes failed in IE6.
+	Fixed bug where save_callback function wasn't executed at all.
+	Fixed bug where inlinepopups produces scrollbars if windows where moved to the corners of the browser.
+	Fixed bug where view HTML source failed when inserting a embedded media object.
+	Fixed bug where the listbox menus didn't display correctly on IE6.
+	Fixed bug where undo level wasn't added when editor was blurred.
+	Fixed bug where spellchecker wasn't disabled when fullscreen mode was enabled.
+	Fixed bug where Firefox could crash some times when the user switched to fullscreen mode.
+	Fixed bug where tinymce.ui.DropMenu didn't remove all item data when an item was removed from the menu.
+	Fixed bug where anchor list in advlink dialog wasn't populated correctly in Safari.
+	Fixed bug where it wasn't possible to edit tables in IE when inlinepopups was enabled.
+	Fixed bug where it wasn't possible to change the table width of an existing table.
+	Fixed bug where xhtmlxtras like abbr didn't work correctly on IE.
+	Fixed bug where IE6 had some graphics rendering issues with the inlinepopups.
+	Fixed bug where inlinepopup windows where moved incorrectly when they were boundary checked for min width.
+	Fixed bug where textareas without id or name couldn't be converted into editor instances.
+	Fixed bug where TinyMCE was stealing element focus on IE.
+	Fixed bug where the getParam method didn't handle false values correctly.
+	Fixed bug where inlinepopups was clipped by other TinyMCE instances or relative elements in IE.
+	Fixed bug where the contextmenu was clipped by other TinyMCE instances or relative elements in IE.
+	Fixed bug where listbox menus was clipped by other TinyMCE instances or relative elements in IE.
+	Fixed bug where listboxes wasn't updated correctly when the a value wasn't found by select.
+	Fixed various CSS issues that produced odd rendering bugs in IE.
+	Fixed issues with tinymce.ui.DropMenu class, it required some optional settings to be specified.
+	Fixed so multiple blockquotes can be removed with a easier method than before.
+	Optimized some of the core API to boost performance.
+	Removed some functions from the core API that wasn't needed.
+Version 3.0a2 (2007-11-02)
+	Fixed critical bug where IE generaded an error on a hasAttribute call in the serialization engine.
+	Fixed critical bug where some dialogs didn't open in the non dev package.
+	Fixed bug when using the theme_advanced_styles option. Error was thrown in some dialogs.
+	Fixed bug where the close buttons produced an error when native windows where used.
+	Fixed bug in default skin so that split buttons gets activated correctly.
+	Fixed so plugins can be loaded from external urls outsite the plugins directory.
+Version 3.0a1 (2007-11-01)
+	Rewrote the core and most of the plugins and themes from scratch.
+	Added new and improved serialization engine, faster and more powerful.
+	Added new internal event system, things like editor.onClick.add(func).
+	Added new inlinepopups plugin, the dialogs are now skinnable and uses clearlooks2 as default.
+	Added new contextmenu plugin, context menus can now have submenus and plugins can add items on the fly.
+	Added new skin support for the simple and advanced themes you can alter the whole UI using CSS.
+	Added new o2k7 skin for the simple and advanced themes.
+	Added new custom list boxes for font size/format/style etc with preview support.
+	Added new UI management, enabled plugins to create controls like splitbuttons or menus easier.
+	Added new JSON parser/serializer and JSON-RPC class to the core API.
+	Added new cookie utility class to the core API.
+	Added new Unit testing class to the core API only available in dev mode.
+	Added new firebug lite integration when loading the dev version of TinyMCE.
+	Added new Safari plugin, fixes lots compatibility of issues with Safari 3.x.
+	Added new URI/URL parsing it now handles the hole RFC and even some exceptions.
+	Added new pagebreak plugin, enables you to insert pagebreak comments like <!-- pagebreak -->
+	Added new on demand loading of plugins and themes. Enables you to load and init TinyMCE at any time.
+	Added new throbber/progress visualization a plugin can show/hide this when it's needed.
+	Added new blockquote button. Enables you to wrap paragraphs in blockquotes.
+	Added new compat2x plugin. Will provide a TinyMCE 2.x API for older plugins.
+	Added new theme_advanced_resizing_min_width, theme_advanced_resizing_min_height options.
+	Added new theme_advanced_resizing_max_height, theme_advanced_resizing_max_height options.
+	Added new use_native_selects option. Enables you to toggle native listboxes on and off.
+	Added new docs_url option enables you to specify where the TinyMCE user documentation is located.
+	Added new frame and rules options for the table dialog.
+	Added new global rule for valid_elements/extended_valid_elements enables you to specify global attributes for all elements.
+	Added new deny attribute rule characher so it's possible to deny global attribute rules on specific elements.
+	Added new unit tests in the dev package of TinyMCE. Runs tests on the core API, commands and settings of the editor.
+	Readded the inline_styles option and enabled it by default so deprecated attributes are no longer used.
+	Removed all button images and replaced them with CSS sprite images. Reduces the number of requests needed.
+	Removed lots of language files and merged them into the base language files. Reduces the number of requests needed.
+	Removed lots of unnecessary files and merged many of them together to reduce requests and improve loading speed.
+	Reduced the over all script size by 33% and the number of files/requests by 75% so it loads a lot faster.
+	Fixed so convert_fonts_to_spans are enabled by default. So no more font tags.
+	Fixed so underline and strikethrough uses spans instread of deprecated U and STRIKE elements.
+	Fixed so indent/outdent adds/removed margin-left instead of blockquotes.
+	Fixed so alignment of paragraphs results in a text-align style value instead of the deprecated align attribute.
+	Fixed so alignment of images uses float or vertical-align style values instead of the deprecated align attribute.
+	Fixed so all classes from @import stylesheets gets imported into the editor.
+	Fixed so the directionality can toggle the dir attribute on and off.
+	Fixed so the fullscreen_settings can be used for all types of fullscreen modes.
+	Fixed so the advanced HR dialog gets displayed when inserting a HR not only on edit.
+	Fixed bug where word wrap didn't work in the source editor on Safari.
+	Fixed so non HTML elements can be used within the editor such as <myns:tag>
+	Fixed various memory leaks in IE and reduced the unload cleanups needed.
+	Fixed so the preformatted option adds an invisible container pre tag inside the editor.
+	Renamed the _template plugin to example and updated it to use the new 3.x API.
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/langs/en.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/langs/en.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/langs/en.js	(revision 1)
@@ -0,0 +1,154 @@
+tinyMCE.addI18n({en:{
+common:{
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
+apply:"Apply",
+insert:"Insert",
+update:"Update",
+cancel:"Cancel",
+close:"Close",
+browse:"Browse",
+class_name:"Class",
+not_set:"-- Not set --",
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
+popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
+invalid_data:"Error: Invalid values entered, these are marked in red.",
+more_colors:"More colors"
+},
+contextmenu:{
+align:"Alignment",
+left:"Left",
+center:"Center",
+right:"Right",
+full:"Full"
+},
+insertdatetime:{
+date_fmt:"%Y-%m-%d",
+time_fmt:"%H:%M:%S",
+insertdate_desc:"Insert date",
+inserttime_desc:"Insert time",
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
+},
+print:{
+print_desc:"Print"
+},
+preview:{
+preview_desc:"Preview"
+},
+directionality:{
+ltr_desc:"Direction left to right",
+rtl_desc:"Direction right to left"
+},
+layer:{
+insertlayer_desc:"Insert new layer",
+forward_desc:"Move forward",
+backward_desc:"Move backward",
+absolute_desc:"Toggle absolute positioning",
+content:"New layer..."
+},
+save:{
+save_desc:"Save",
+cancel_desc:"Cancel all changes"
+},
+nonbreaking:{
+nonbreaking_desc:"Insert non-breaking space character"
+},
+iespell:{
+iespell_desc:"Run spell checking",
+download:"ieSpell not detected. Do you want to install it now?"
+},
+advhr:{
+advhr_desc:"Horizontale rule"
+},
+emotions:{
+emotions_desc:"Emotions"
+},
+searchreplace:{
+search_desc:"Find",
+replace_desc:"Find/Replace"
+},
+advimage:{
+image_desc:"Insert/edit image"
+},
+advlink:{
+link_desc:"Insert/edit link"
+},
+xhtmlxtras:{
+cite_desc:"Citation",
+abbr_desc:"Abbreviation",
+acronym_desc:"Acronym",
+del_desc:"Deletion",
+ins_desc:"Insertion",
+attribs_desc:"Insert/Edit Attributes"
+},
+style:{
+desc:"Edit CSS Style"
+},
+paste:{
+paste_text_desc:"Paste as Plain Text",
+paste_word_desc:"Paste from Word",
+selectall_desc:"Select All"
+},
+paste_dlg:{
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
+text_linebreaks:"Keep linebreaks",
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."
+},
+table:{
+desc:"Inserts a new table",
+row_before_desc:"Insert row before",
+row_after_desc:"Insert row after",
+delete_row_desc:"Delete row",
+col_before_desc:"Insert column before",
+col_after_desc:"Insert column after",
+delete_col_desc:"Remove column",
+split_cells_desc:"Split merged table cells",
+merge_cells_desc:"Merge table cells",
+row_desc:"Table row properties",
+cell_desc:"Table cell properties",
+props_desc:"Table properties",
+paste_row_before_desc:"Paste table row before",
+paste_row_after_desc:"Paste table row after",
+cut_row_desc:"Cut table row",
+copy_row_desc:"Copy table row",
+del:"Delete table",
+row:"Row",
+col:"Column",
+cell:"Cell"
+},
+autosave:{
+unload_msg:"The changes you made will be lost if you navigate away from this page."
+},
+fullscreen:{
+desc:"Toggle fullscreen mode"
+},
+media:{
+desc:"Insert / edit embedded media",
+edit:"Edit embedded media"
+},
+fullpage:{
+desc:"Document properties"
+},
+template:{
+desc:"Insert predefined template content"
+},
+visualchars:{
+desc:"Visual control characters on/off."
+},
+spellchecker:{
+desc:"Toggle spellchecker",
+menu:"Spellchecker settings",
+ignore_word:"Ignore word",
+ignore_words:"Ignore all",
+langs:"Languages",
+wait:"Please wait...",
+sug:"Suggestions",
+no_sug:"No suggestions",
+no_mpell:"No misspellings found."
+},
+pagebreak:{
+desc:"Insert page break."
+}}});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/license.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/license.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/license.txt	(revision 1)
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+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 this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+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
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css	(revision 1)
@@ -0,0 +1,5 @@
+input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
+.panel_wrapper div.current {height:80px;}
+#width {width:50px; vertical-align:middle;}
+#width2 {width:50px; vertical-align:middle;}
+#size {width:100px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.AdvancedHRPlugin',{init:function(ed,url){ed.addCommand('mceAdvancedHr',function(){ed.windowManager.open({file:url+'/rule.htm',width:250+parseInt(ed.getLang('advhr.delta_width',0)),height:160+parseInt(ed.getLang('advhr.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('advhr',{title:'advhr.advhr_desc',cmd:'mceAdvancedHr'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('advhr',n.nodeName=='HR');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='HR')ed.selection.select(e);});},getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advhr',tinymce.plugins.AdvancedHRPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,54 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
+		init : function(ed, url) {
+			// Register commands
+			ed.addCommand('mceAdvancedHr', function() {
+				ed.windowManager.open({
+					file : url + '/rule.htm',
+					width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
+					height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('advhr', {
+				title : 'advhr.advhr_desc',
+				cmd : 'mceAdvancedHr'
+			});
+
+			ed.onNodeChange.add(function(ed, cm, n) {
+				cm.setActive('advhr', n.nodeName == 'HR');
+			});
+
+			ed.onClick.add(function(ed, e) {
+				e = e.target;
+
+				if (e.nodeName === 'HR')
+					ed.selection.select(e);
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Advanced HR',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/js/rule.js	(revision 1)
@@ -0,0 +1,34 @@
+var AdvHRDialog = {
+	init : function(ed) {
+		var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
+
+		w = dom.getAttrib(n, 'width');
+		f.width.value = w ? parseInt(w) : '';
+		f.size.value = dom.getAttrib(n, 'size');
+		f.noshade.checked = !!dom.getAttrib(n, 'noshade');
+		selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
+	},
+
+	update : function() {
+		var ed = tinyMCEPopup.editor, h, f = document.forms[0];
+
+		h = '<hr';
+
+		if (f.size.value)
+			h += ' size="' + f.size.value + '"';
+
+		if (f.width.value)
+			h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
+
+		if (f.noshade.checked)
+			h += ' noshade="noshade"';
+
+		h += ' />';
+
+		ed.execCommand("mceInsertContent", false, h);
+		tinyMCEPopup.close();
+	}
+};
+
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.advhr_dlg',{
+width:"Width",
+size:"Height",
+noshade:"No shadow"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm	(revision 1)
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advhr.advhr_desc}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/rule.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<link href="css/advhr.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body>
+<form onsubmit="AdvHRDialog.update();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<table border="0" cellpadding="4" cellspacing="0">
+                    <tr>
+                        <td><label for="width">{#advhr_dlg.width}</label></td>
+                        <td nowrap="nowrap">
+                            <input id="width" name="width" type="text" value="" />
+                            <select name="width2" id="width2">
+                                <option value="">px</option>
+                                <option value="%">%</option>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td><label for="size">{#advhr_dlg.size}</label></td>
+                        <td><select id="size" name="size">
+                            <option value="">Normal</option>
+                            <option value="1">1</option>
+                            <option value="2">2</option>
+                            <option value="3">3</option>
+                            <option value="4">4</option>
+                            <option value="5">5</option>
+                        </select></td>
+                    </tr>
+                    <tr>
+                        <td><label for="noshade">{#advhr_dlg.noshade}</label></td>
+                        <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
+                    </tr>
+            </table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#insert}" onclick="AdvHRDialog.update();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css	(revision 1)
@@ -0,0 +1,13 @@
+#src_list, #over_list, #out_list {width:280px;}
+.mceActionPanel {margin-top:7px;}
+.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
+.checkbox {border:0;}
+.panel_wrapper div.current {height:305px;}
+#prev {margin:0; border:1px solid #000; width:99%; height:150px; overflow:auto;}
+#align, #classlist {width:150px;}
+#width, #height {vertical-align:middle; width:50px; text-align:center;}
+#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
+#class_list {width:180px;}
+input {width: 280px;}
+#constrain, #onmousemovecheck {width:auto;}
+#id, #dir, #lang, #usemap, #longdesc {width:200px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.AdvancedImagePlugin',{init:function(ed,url){ed.addCommand('mceAdvImage',function(){var e=ed.selection.getNode();if(ed.dom.getAttrib(e,'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({file:url+'/image.htm',width:480+parseInt(ed.getLang('advimage.delta_width',0)),height:385+parseInt(ed.getLang('advimage.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('image',{title:'advimage.image_desc',cmd:'mceAdvImage'});},getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advimage',tinymce.plugins.AdvancedImagePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,49 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
+		init : function(ed, url) {
+			// Register commands
+			ed.addCommand('mceAdvImage', function() {
+				var e = ed.selection.getNode();
+
+				// Internal image object like a flash placeholder
+				if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
+					return;
+
+				ed.windowManager.open({
+					file : url + '/image.htm',
+					width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
+					height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('image', {
+				title : 'advimage.image_desc',
+				cmd : 'mceAdvImage'
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Advanced image',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/image.htm	(revision 1)
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advimage_dlg.dialog_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/image.js"></script>
+	<link href="css/advimage.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="advimage" style="display: none">
+    <form onsubmit="ImageDialog.insert();return false;" action="#"> 
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
+				<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+						<legend>{#advimage_dlg.general}</legend>
+
+						<table class="properties">
+							<tr>
+								<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
+								<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
+									<tr> 
+									  <td><input name="src" type="text" id="src" value="" onchange="ImageDialog.showPreviewImage(this.value);" /></td> 
+									  <td id="srcbrowsercontainer">&nbsp;</td>
+									</tr>
+								  </table></td>
+							</tr>
+							<tr>
+								<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
+								<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"></select></td>
+							</tr>
+							<tr> 
+								<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> 
+								<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> 
+							</tr> 
+							<tr> 
+								<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> 
+								<td colspan="2"><input id="title" name="title" type="text" value="" /></td> 
+							</tr>
+						</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#advimage_dlg.preview}</legend>
+					<div id="prev"></div>
+				</fieldset>
+			</div>
+
+			<div id="appearance_panel" class="panel">
+				<fieldset>
+					<legend>{#advimage_dlg.tab_appearance}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr> 
+							<td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> 
+							<td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> 
+									<option value="">{#not_set}</option> 
+									<option value="baseline">{#advimage_dlg.align_baseline}</option>
+									<option value="top">{#advimage_dlg.align_top}</option>
+									<option value="middle">{#advimage_dlg.align_middle}</option>
+									<option value="bottom">{#advimage_dlg.align_bottom}</option>
+									<option value="text-top">{#advimage_dlg.align_texttop}</option>
+									<option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
+									<option value="left">{#advimage_dlg.align_left}</option>
+									<option value="right">{#advimage_dlg.align_right}</option>
+								</select> 
+							</td>
+							<td rowspan="6" valign="top">
+								<div class="alignPreview">
+									<img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
+									Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
+									nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
+									edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
+									erat volutpat.
+								</div>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
+							<td nowrap="nowrap">
+								<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x 
+								<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px
+							</td>
+						</tr>
+
+						<tr>
+							<td>&nbsp;</td>
+							<td><table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
+										<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
+									</tr>
+								</table></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> 
+							<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
+							</td>
+						</tr>
+
+						<tr> 
+							<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> 
+							<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> 
+							<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="class_list">{#class_name}</label></td>
+							<td><select id="class_list" name="class_list"></select></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> 
+							<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> 
+						</tr>
+
+						<!-- <tr>
+							<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> 
+							<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> 
+						</tr> -->
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{#advimage_dlg.swap_image}</legend>
+
+					<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />
+					<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
+
+					<table border="0" cellpadding="4" cellspacing="0" width="100%">
+							<tr>
+								<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> 
+								<td><table border="0" cellspacing="0" cellpadding="0"> 
+									<tr> 
+									  <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> 
+									  <td id="onmouseoversrccontainer">&nbsp;</td>
+									</tr>
+								  </table></td>
+							</tr>
+							<tr>
+								<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
+								<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"></select></td>
+							</tr>
+							<tr> 
+								<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> 
+								<td class="column2"><table border="0" cellspacing="0" cellpadding="0"> 
+									<tr> 
+									  <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> 
+									  <td id="onmouseoutsrccontainer">&nbsp;</td>
+									</tr> 
+								  </table></td> 
+							</tr>
+							<tr>
+								<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
+								<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"></select></td>
+							</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#advimage_dlg.misc}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#advimage_dlg.ltr}</option> 
+										<option value="rtl">{#advimage_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> 
+							<td>
+								<input id="usemap" name="usemap" type="text" value="" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
+							<td><table border="0" cellspacing="0" cellpadding="0">
+									<tr>
+									  <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
+									  <td id="longdesccontainer">&nbsp;</td>
+									</tr>
+								</table></td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.insert();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+    </form>
+</body> 
+</html> 
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/js/image.js	(revision 1)
@@ -0,0 +1,434 @@
+var ImageDialog = {
+	preInit : function() {
+		var url;
+
+		tinyMCEPopup.requireLangPack();
+
+		if (url = tinyMCEPopup.getParam("external_image_list_url"))
+			document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+	},
+
+	init : function(ed) {
+		var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
+
+		tinyMCEPopup.resizeToInnerSize();
+		this.fillClassList('class_list');
+		this.fillFileList('src_list', 'tinyMCEImageList');
+		this.fillFileList('over_list', 'tinyMCEImageList');
+		this.fillFileList('out_list', 'tinyMCEImageList');
+
+		if (n.nodeName == 'IMG') {
+			nl.src.value = dom.getAttrib(n, 'src');
+			nl.width.value = dom.getAttrib(n, 'width');
+			nl.height.value = dom.getAttrib(n, 'height');
+			nl.alt.value = dom.getAttrib(n, 'alt');
+			nl.title.value = dom.getAttrib(n, 'title');
+			nl.vspace.value = this.getAttrib(n, 'vspace');
+			nl.hspace.value = this.getAttrib(n, 'hspace');
+			nl.border.value = this.getAttrib(n, 'border');
+			selectByValue(f, 'align', this.getAttrib(n, 'align'));
+			selectByValue(f, 'class_list', dom.getAttrib(n, 'class'));
+			nl.style.value = dom.getAttrib(n, 'style');
+			nl.id.value = dom.getAttrib(n, 'id');
+			nl.dir.value = dom.getAttrib(n, 'dir');
+			nl.lang.value = dom.getAttrib(n, 'lang');
+			nl.usemap.value = dom.getAttrib(n, 'usemap');
+			nl.longdesc.value = dom.getAttrib(n, 'longdesc');
+			nl.insert.value = ed.getLang('update');
+
+			if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
+				nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
+
+			if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
+				nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
+
+			if (ed.settings.inline_styles) {
+				// Move attribs to styles
+				if (dom.getAttrib(n, 'align'))
+					this.updateStyle('align');
+
+				if (dom.getAttrib(n, 'hspace'))
+					this.updateStyle('hspace');
+
+				if (dom.getAttrib(n, 'border'))
+					this.updateStyle('border');
+
+				if (dom.getAttrib(n, 'vspace'))
+					this.updateStyle('vspace');
+			}
+		}
+
+		// Setup browse button
+		document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+		if (isVisible('srcbrowser'))
+			document.getElementById('src').style.width = '260px';
+
+		// Setup browse button
+		document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
+		if (isVisible('overbrowser'))
+			document.getElementById('onmouseoversrc').style.width = '260px';
+
+		// Setup browse button
+		document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
+		if (isVisible('outbrowser'))
+			document.getElementById('onmouseoutsrc').style.width = '260px';
+
+		// If option enabled default contrain proportions to checked
+		if (ed.getParam("advimage_constrain_proportions", true))
+			f.constrain.checked = true;
+
+		// Check swap image if valid data
+		if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
+			this.setSwapImage(true);
+		else
+			this.setSwapImage(false);
+
+		this.changeAppearance();
+		this.showPreviewImage(nl.src.value, 1);
+	},
+
+	insert : function(file, title) {
+		var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
+
+		if (f.src.value === '') {
+			ed.dom.remove(ed.selection.getNode());
+			ed.execCommand('mceRepaint');
+			tinyMCEPopup.close();
+			return;
+		}
+
+		if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
+			if (!f.alt.value) {
+				tinyMCEPopup.editor.windowManager.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
+					if (s)
+						t.insertAndClose();
+				});
+
+				return;
+			}
+		}
+
+		t.insertAndClose();
+	},
+
+	insertAndClose : function() {
+		var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
+
+		// Fixes crash in Safari
+		if (tinymce.isWebKit)
+			ed.getWin().focus();
+
+		if (!ed.settings.inline_styles) {
+			args = {
+				vspace : nl.vspace.value,
+				hspace : nl.hspace.value,
+				border : nl.border.value,
+				align : getSelectValue(f, 'align')
+			};
+		} else {
+			// Remove deprecated values
+			args = {
+				vspace : '',
+				hspace : '',
+				border : '',
+				align : ''
+			};
+		}
+
+		tinymce.extend(args, {
+			src : nl.src.value,
+			width : nl.width.value,
+			height : nl.height.value,
+			alt : nl.alt.value,
+			title : nl.title.value,
+			'class' : getSelectValue(f, 'class_list'),
+			style : nl.style.value,
+			id : nl.id.value,
+			dir : nl.dir.value,
+			lang : nl.lang.value,
+			usemap : nl.usemap.value,
+			longdesc : nl.longdesc.value
+		});
+
+		args.onmouseover = args.onmouseout = '';
+
+		if (f.onmousemovecheck.checked) {
+			if (nl.onmouseoversrc.value)
+				args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
+
+			if (nl.onmouseoutsrc.value)
+				args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
+		}
+
+		el = ed.selection.getNode();
+
+		if (el && el.nodeName == 'IMG') {
+			ed.dom.setAttribs(el, args);
+		} else {
+			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />');
+			ed.dom.setAttribs('__mce_tmp', args);
+			ed.dom.setAttrib('__mce_tmp', 'id', '');
+		}
+
+		tinyMCEPopup.close();
+	},
+
+	getAttrib : function(e, at) {
+		var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
+
+		if (ed.settings.inline_styles) {
+			switch (at) {
+				case 'align':
+					if (v = dom.getStyle(e, 'float'))
+						return v;
+
+					if (v = dom.getStyle(e, 'vertical-align'))
+						return v;
+
+					break;
+
+				case 'hspace':
+					v = dom.getStyle(e, 'margin-left')
+					v2 = dom.getStyle(e, 'margin-right');
+
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'vspace':
+					v = dom.getStyle(e, 'margin-top')
+					v2 = dom.getStyle(e, 'margin-bottom');
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'border':
+					v = 0;
+
+					tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
+						sv = dom.getStyle(e, 'border-' + sv + '-width');
+
+						// False or not the same as prev
+						if (!sv || (sv != v && v !== 0)) {
+							v = 0;
+							return false;
+						}
+
+						if (sv)
+							v = sv;
+					});
+
+					if (v)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+			}
+		}
+
+		if (v = dom.getAttrib(e, at))
+			return v;
+
+		return '';
+	},
+
+	setSwapImage : function(st) {
+		var f = document.forms[0];
+
+		f.onmousemovecheck.checked = st;
+		setBrowserDisabled('overbrowser', !st);
+		setBrowserDisabled('outbrowser', !st);
+
+		if (f.over_list)
+			f.over_list.disabled = !st;
+
+		if (f.out_list)
+			f.out_list.disabled = !st;
+
+		f.onmouseoversrc.disabled = !st;
+		f.onmouseoutsrc.disabled  = !st;
+	},
+
+	fillClassList : function(id) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
+			cl = [];
+
+			tinymce.each(v.split(';'), function(v) {
+				var p = v.split('=');
+
+				cl.push({'title' : p[0], 'class' : p[1]});
+			});
+		} else
+			cl = tinyMCEPopup.editor.dom.getClasses();
+
+		if (cl.length > 0) {
+			lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+
+			tinymce.each(cl, function(o) {
+				lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	fillFileList : function(id, l) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		l = window[l];
+
+		if (l && l.length > 0) {
+			lst.options[lst.options.length] = new Option('', '');
+
+			tinymce.each(l, function(o) {
+				lst.options[lst.options.length] = new Option(o[0], o[1]);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	resetImageData : function() {
+		var f = document.forms[0];
+
+		f.elements.width.value = f.elements.height.value = '';
+	},
+
+	updateImageData : function(img, st) {
+		var f = document.forms[0];
+
+		if (!st) {
+			f.elements.width.value = img.width;
+			f.elements.height.value = img.height;
+		}
+
+		this.preloadImg = img;
+	},
+
+	changeAppearance : function() {
+		var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
+
+		if (img) {
+			if (ed.getParam('inline_styles')) {
+				ed.dom.setAttrib(img, 'style', f.style.value);
+			} else {
+				img.align = f.align.value;
+				img.border = f.border.value;
+				img.hspace = f.hspace.value;
+				img.vspace = f.vspace.value;
+			}
+		}
+	},
+
+	changeHeight : function() {
+		var f = document.forms[0], tp, t = this;
+
+		if (!f.constrain.checked || !t.preloadImg) {
+			return;
+		}
+
+		if (f.width.value == "" || f.height.value == "")
+			return;
+
+		tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
+		f.height.value = tp.toFixed(0);
+	},
+
+	changeWidth : function() {
+		var f = document.forms[0], tp, t = this;
+
+		if (!f.constrain.checked || !t.preloadImg) {
+			return;
+		}
+
+		if (f.width.value == "" || f.height.value == "")
+			return;
+
+		tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
+		f.width.value = tp.toFixed(0);
+	},
+
+	updateStyle : function(ty) {
+		var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
+
+		if (tinyMCEPopup.editor.settings.inline_styles) {
+			// Handle align
+			if (ty == 'align') {
+				dom.setStyle(img, 'float', '');
+				dom.setStyle(img, 'vertical-align', '');
+
+				v = getSelectValue(f, 'align');
+				if (v) {
+					if (v == 'left' || v == 'right')
+						dom.setStyle(img, 'float', v);
+					else
+						img.style.verticalAlign = v;
+				}
+			}
+
+			// Handle border
+			if (ty == 'border') {
+				dom.setStyle(img, 'border', '');
+
+				v = f.border.value;
+				if (v || v == '0') {
+					if (v == '0')
+						img.style.border = '';
+					else
+						img.style.border = v + 'px solid black';
+				}
+			}
+
+			// Handle hspace
+			if (ty == 'hspace') {
+				dom.setStyle(img, 'marginLeft', '');
+				dom.setStyle(img, 'marginRight', '');
+
+				v = f.hspace.value;
+				if (v) {
+					img.style.marginLeft = v + 'px';
+					img.style.marginRight = v + 'px';
+				}
+			}
+
+			// Handle vspace
+			if (ty == 'vspace') {
+				dom.setStyle(img, 'marginTop', '');
+				dom.setStyle(img, 'marginBottom', '');
+
+				v = f.vspace.value;
+				if (v) {
+					img.style.marginTop = v + 'px';
+					img.style.marginBottom = v + 'px';
+				}
+			}
+
+			// Merge
+			dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
+		}
+	},
+
+	changeMouseMove : function() {
+	},
+
+	showPreviewImage : function(u, st) {
+		if (!u) {
+			tinyMCEPopup.dom.setHTML('prev', '');
+			return;
+		}
+
+		if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
+			this.resetImageData();
+
+		u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
+
+		if (!st)
+			tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
+		else
+			tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
+	}
+};
+
+ImageDialog.preInit();
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advimage/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,43 @@
+tinyMCE.addI18n('en.advimage_dlg',{
+tab_general:"General",
+tab_appearance:"Appearance",
+tab_advanced:"Advanced",
+general:"General",
+title:"Title",
+preview:"Preview",
+constrain_proportions:"Constrain proportions",
+langdir:"Language direction",
+langcode:"Language code",
+long_desc:"Long description link",
+style:"Style",
+classes:"Classes",
+ltr:"Left to right",
+rtl:"Right to left",
+id:"Id",
+map:"Image map",
+swap_image:"Swap image",
+alt_image:"Alternative image",
+mouseover:"for mouse over",
+mouseout:"for mouse out",
+misc:"Miscellaneous",
+example_img:"Appearance preview image",
+missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
+dialog_title:"Insert/edit image",
+src:"Image URL",
+alt:"Image description",
+list:"Image list",
+border:"Border",
+dimensions:"Dimensions",
+vspace:"Vertical space",
+hspace:"Horizontal space",
+align:"Alignment",
+align_baseline:"Baseline",
+align_top:"Top",
+align_middle:"Middle",
+align_bottom:"Bottom",
+align_texttop:"Text top",
+align_textbottom:"Text bottom",
+align_left:"Left",
+align_right:"Right",
+image_list:"Image list"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/css/advlink.css	(revision 1)
@@ -0,0 +1,8 @@
+.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
+.mceActionPanel {margin-top:7px;}
+.panel_wrapper div.current {height:320px;}
+#classlist, #title, #href {width:280px;}
+#popupurl, #popupname {width:200px;}
+#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
+#events_panel input {width:200px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.AdvancedLinkPlugin',{init:function(ed,url){this.editor=ed;ed.addCommand('mceAdvLink',function(){var se=ed.selection;if(se.isCollapsed()&&!ed.dom.getParent(se.getNode(),'A'))return;ed.windowManager.open({file:url+'/link.htm',width:480+parseInt(ed.getLang('advlink.delta_width',0)),height:400+parseInt(ed.getLang('advlink.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('link',{title:'advlink.link_desc',cmd:'mceAdvLink'});ed.addShortcut('ctrl+k','advlink.advlink_desc','mceAdvLink');ed.onNodeChange.add(function(ed,cm,n,co){cm.setDisabled('link',co&&n.nodeName!='A');cm.setActive('link',n.nodeName=='A'&&!n.name);});},getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('advlink',tinymce.plugins.AdvancedLinkPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,58 @@
+/**
+ * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
+		init : function(ed, url) {
+			this.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceAdvLink', function() {
+				var se = ed.selection;
+
+				// No selection and not in link
+				if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
+					return;
+
+				ed.windowManager.open({
+					file : url + '/link.htm',
+					width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
+					height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('link', {
+				title : 'advlink.link_desc',
+				cmd : 'mceAdvLink'
+			});
+
+			ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
+
+			ed.onNodeChange.add(function(ed, cm, n, co) {
+				cm.setDisabled('link', co && n.nodeName != 'A');
+				cm.setActive('link', n.nodeName == 'A' && !n.name);
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Advanced link',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/js/advlink.js	(revision 1)
@@ -0,0 +1,563 @@
+/* Functions for the advlink plugin popup */
+
+tinyMCEPopup.requireLangPack();
+
+var templates = {
+	"window.open" : "window.open('${url}','${target}','${options}')"
+};
+
+function preinit() {
+	var url;
+
+	if (url = tinyMCEPopup.getParam("external_link_list_url"))
+		document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+}
+
+function changeClass() {
+	var formObj = document.forms[0];
+	formObj.classes.value = getSelectValue(formObj, 'classlist');
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var formObj = document.forms[0];
+	var inst = tinyMCEPopup.editor;
+	var elm = inst.selection.getNode();
+	var action = "insert";
+	var html;
+
+	document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
+	document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
+	document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
+	document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
+	document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
+
+	// Link list
+	html = getLinkListHTML('linklisthref','href');
+	if (html == "")
+		document.getElementById("linklisthrefrow").style.display = 'none';
+	else
+		document.getElementById("linklisthrefcontainer").innerHTML = html;
+
+	// Resize some elements
+	if (isVisible('hrefbrowser'))
+		document.getElementById('href').style.width = '260px';
+
+	if (isVisible('popupurlbrowser'))
+		document.getElementById('popupurl').style.width = '180px';
+
+	elm = inst.dom.getParent(elm, "A");
+	if (elm != null && elm.nodeName == "A")
+		action = "update";
+
+	formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); 
+
+	setPopupControlsDisabled(true);
+
+	if (action == "update") {
+		var href = inst.dom.getAttrib(elm, 'href');
+		var onclick = inst.dom.getAttrib(elm, 'onclick');
+
+		// Setup form data
+		setFormValue('href', href);
+		setFormValue('title', inst.dom.getAttrib(elm, 'title'));
+		setFormValue('id', inst.dom.getAttrib(elm, 'id'));
+		setFormValue('style', inst.dom.getAttrib(elm, "style"));
+		setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
+		setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
+		setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
+		setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
+		setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
+		setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
+		setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
+		setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
+		setFormValue('type', inst.dom.getAttrib(elm, 'type'));
+		setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
+		setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
+		setFormValue('onclick', onclick);
+		setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
+		setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
+		setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
+		setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
+		setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
+		setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
+		setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
+		setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
+		setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
+		setFormValue('target', inst.dom.getAttrib(elm, 'target'));
+		setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
+
+		// Parse onclick data
+		if (onclick != null && onclick.indexOf('window.open') != -1)
+			parseWindowOpen(onclick);
+		else
+			parseFunction(onclick);
+
+		// Select by the values
+		selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
+		selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
+		selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
+		selectByValue(formObj, 'linklisthref', href);
+
+		if (href.charAt(0) == '#')
+			selectByValue(formObj, 'anchorlist', href);
+
+		addClassesToList('classlist', 'advlink_styles');
+
+		selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
+		selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
+	} else
+		addClassesToList('classlist', 'advlink_styles');
+
+	window.focus();
+}
+
+function checkPrefix(n) {
+	if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
+		n.value = 'mailto:' + n.value;
+
+	if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
+		n.value = 'http://' + n.value;
+}
+
+function setFormValue(name, value) {
+	document.forms[0].elements[name].value = value;
+}
+
+function parseWindowOpen(onclick) {
+	var formObj = document.forms[0];
+
+	// Preprocess center code
+	if (onclick.indexOf('return false;') != -1) {
+		formObj.popupreturn.checked = true;
+		onclick = onclick.replace('return false;', '');
+	} else
+		formObj.popupreturn.checked = false;
+
+	var onClickData = parseLink(onclick);
+
+	if (onClickData != null) {
+		formObj.ispopup.checked = true;
+		setPopupControlsDisabled(false);
+
+		var onClickWindowOptions = parseOptions(onClickData['options']);
+		var url = onClickData['url'];
+
+		formObj.popupname.value = onClickData['target'];
+		formObj.popupurl.value = url;
+		formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
+		formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
+
+		formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
+		formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
+
+		if (formObj.popupleft.value.indexOf('screen') != -1)
+			formObj.popupleft.value = "c";
+
+		if (formObj.popuptop.value.indexOf('screen') != -1)
+			formObj.popuptop.value = "c";
+
+		formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
+		formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
+		formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
+		formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
+		formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
+		formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
+		formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
+
+		buildOnClick();
+	}
+}
+
+function parseFunction(onclick) {
+	var formObj = document.forms[0];
+	var onClickData = parseLink(onclick);
+
+	// TODO: Add stuff here
+}
+
+function getOption(opts, name) {
+	return typeof(opts[name]) == "undefined" ? "" : opts[name];
+}
+
+function setPopupControlsDisabled(state) {
+	var formObj = document.forms[0];
+
+	formObj.popupname.disabled = state;
+	formObj.popupurl.disabled = state;
+	formObj.popupwidth.disabled = state;
+	formObj.popupheight.disabled = state;
+	formObj.popupleft.disabled = state;
+	formObj.popuptop.disabled = state;
+	formObj.popuplocation.disabled = state;
+	formObj.popupscrollbars.disabled = state;
+	formObj.popupmenubar.disabled = state;
+	formObj.popupresizable.disabled = state;
+	formObj.popuptoolbar.disabled = state;
+	formObj.popupstatus.disabled = state;
+	formObj.popupreturn.disabled = state;
+	formObj.popupdependent.disabled = state;
+
+	setBrowserDisabled('popupurlbrowser', state);
+}
+
+function parseLink(link) {
+	link = link.replace(new RegExp('&#39;', 'g'), "'");
+
+	var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
+
+	// Is function name a template function
+	var template = templates[fnName];
+	if (template) {
+		// Build regexp
+		var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
+		var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
+		var replaceStr = "";
+		for (var i=0; i<variableNames.length; i++) {
+			// Is string value
+			if (variableNames[i].indexOf("'${") != -1)
+				regExp += "'(.*)'";
+			else // Number value
+				regExp += "([0-9]*)";
+
+			replaceStr += "$" + (i+1);
+
+			// Cleanup variable name
+			variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
+
+			if (i != variableNames.length-1) {
+				regExp += "\\s*,\\s*";
+				replaceStr += "<delim>";
+			} else
+				regExp += ".*";
+		}
+
+		regExp += "\\);?";
+
+		// Build variable array
+		var variables = new Array();
+		variables["_function"] = fnName;
+		var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
+		for (var i=0; i<variableNames.length; i++)
+			variables[variableNames[i]] = variableValues[i];
+
+		return variables;
+	}
+
+	return null;
+}
+
+function parseOptions(opts) {
+	if (opts == null || opts == "")
+		return new Array();
+
+	// Cleanup the options
+	opts = opts.toLowerCase();
+	opts = opts.replace(/;/g, ",");
+	opts = opts.replace(/[^0-9a-z=,]/g, "");
+
+	var optionChunks = opts.split(',');
+	var options = new Array();
+
+	for (var i=0; i<optionChunks.length; i++) {
+		var parts = optionChunks[i].split('=');
+
+		if (parts.length == 2)
+			options[parts[0]] = parts[1];
+	}
+
+	return options;
+}
+
+function buildOnClick() {
+	var formObj = document.forms[0];
+
+	if (!formObj.ispopup.checked) {
+		formObj.onclick.value = "";
+		return;
+	}
+
+	var onclick = "window.open('";
+	var url = formObj.popupurl.value;
+
+	onclick += url + "','";
+	onclick += formObj.popupname.value + "','";
+
+	if (formObj.popuplocation.checked)
+		onclick += "location=yes,";
+
+	if (formObj.popupscrollbars.checked)
+		onclick += "scrollbars=yes,";
+
+	if (formObj.popupmenubar.checked)
+		onclick += "menubar=yes,";
+
+	if (formObj.popupresizable.checked)
+		onclick += "resizable=yes,";
+
+	if (formObj.popuptoolbar.checked)
+		onclick += "toolbar=yes,";
+
+	if (formObj.popupstatus.checked)
+		onclick += "status=yes,";
+
+	if (formObj.popupdependent.checked)
+		onclick += "dependent=yes,";
+
+	if (formObj.popupwidth.value != "")
+		onclick += "width=" + formObj.popupwidth.value + ",";
+
+	if (formObj.popupheight.value != "")
+		onclick += "height=" + formObj.popupheight.value + ",";
+
+	if (formObj.popupleft.value != "") {
+		if (formObj.popupleft.value != "c")
+			onclick += "left=" + formObj.popupleft.value + ",";
+		else
+			onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
+	}
+
+	if (formObj.popuptop.value != "") {
+		if (formObj.popuptop.value != "c")
+			onclick += "top=" + formObj.popuptop.value + ",";
+		else
+			onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
+	}
+
+	if (onclick.charAt(onclick.length-1) == ',')
+		onclick = onclick.substring(0, onclick.length-1);
+
+	onclick += "');";
+
+	if (formObj.popupreturn.checked)
+		onclick += "return false;";
+
+	// tinyMCE.debug(onclick);
+
+	formObj.onclick.value = onclick;
+
+	if (formObj.href.value == "")
+		formObj.href.value = url;
+}
+
+function setAttrib(elm, attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib.toLowerCase()];
+
+	if (typeof(value) == "undefined" || value == null) {
+		value = "";
+
+		if (valueElm)
+			value = valueElm.value;
+	}
+
+	if (value != "") {
+		elm.setAttribute(attrib.toLowerCase(), value);
+
+		if (attrib == "style")
+			attrib = "style.cssText";
+
+//		if (attrib.substring(0, 2) == 'on')
+//			value = 'return true;' + value;
+
+		if (attrib == "class")
+			attrib = "className";
+
+		elm[attrib] = value;
+	} else
+		elm.removeAttribute(attrib);
+}
+
+function getAnchorListHTML(id, target) {
+	var inst = tinyMCEPopup.editor;
+	var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;
+	var html = "";
+
+	html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
+	html += 'this.options[this.selectedIndex].value;">';
+	html += '<option value="">---</option>';
+
+	for (i=0; i<nodes.length; i++) {
+		if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")
+			html += '<option value="#' + name + '">' + name + '</option>';
+	}
+
+	html += '</select>';
+
+	return html;
+}
+
+function insertAction() {
+	var inst = tinyMCEPopup.editor;
+	var elm, elementArray, i;
+
+	elm = inst.selection.getNode();
+	checkPrefix(document.forms[0].href);
+
+	elm = inst.dom.getParent(elm, "A");
+
+	// Remove element if there is no href
+	if (!document.forms[0].href.value) {
+		tinyMCEPopup.execCommand("mceBeginUndoLevel");
+		i = inst.selection.getBookmark();
+		inst.dom.remove(elm, 1);
+		inst.selection.moveToBookmark(i);
+		tinyMCEPopup.execCommand("mceEndUndoLevel");
+		tinyMCEPopup.close();
+		return;
+	}
+
+	tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+	// Create new anchor elements
+	if (elm == null) {
+		tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#");
+
+		elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
+		for (i=0; i<elementArray.length; i++) {
+			elm = elementArray[i];
+
+			// Move cursor to end
+			try {
+				tinyMCEPopup.editor.selection.collapse(false);
+			} catch (ex) {
+				// Ignore
+			}
+
+			// Move cursor behind the new anchor
+			// Don't remember why this was needed so it's now removed
+			/*
+			if (tinyMCE.isGecko) {
+				var sp = inst.getDoc().createTextNode(" ");
+
+				if (elm.nextSibling)
+					elm.parentNode.insertBefore(sp, elm.nextSibling);
+				else
+					elm.parentNode.appendChild(sp);
+
+				// Set range after link
+				var rng = inst.getDoc().createRange();
+				rng.setStartAfter(elm);
+				rng.setEndAfter(elm);
+
+				// Update selection
+				var sel = inst.getSel();
+				sel.removeAllRanges();
+				sel.addRange(rng);
+			}
+			*/
+
+			setAllAttribs(elm);
+		}
+	} else
+		setAllAttribs(elm);
+
+	tinyMCEPopup.execCommand("mceEndUndoLevel");
+	tinyMCEPopup.close();
+}
+
+function setAllAttribs(elm) {
+	var formObj = document.forms[0];
+	var href = formObj.href.value;
+	var target = getSelectValue(formObj, 'targetlist');
+
+	setAttrib(elm, 'href', href);
+	setAttrib(elm, 'mce_href', href);
+	setAttrib(elm, 'title');
+	setAttrib(elm, 'target', target == '_self' ? '' : target);
+	setAttrib(elm, 'id');
+	setAttrib(elm, 'style');
+	setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
+	setAttrib(elm, 'rel');
+	setAttrib(elm, 'rev');
+	setAttrib(elm, 'charset');
+	setAttrib(elm, 'hreflang');
+	setAttrib(elm, 'dir');
+	setAttrib(elm, 'lang');
+	setAttrib(elm, 'tabindex');
+	setAttrib(elm, 'accesskey');
+	setAttrib(elm, 'type');
+	setAttrib(elm, 'onfocus');
+	setAttrib(elm, 'onblur');
+	setAttrib(elm, 'onclick');
+	setAttrib(elm, 'ondblclick');
+	setAttrib(elm, 'onmousedown');
+	setAttrib(elm, 'onmouseup');
+	setAttrib(elm, 'onmouseover');
+	setAttrib(elm, 'onmousemove');
+	setAttrib(elm, 'onmouseout');
+	setAttrib(elm, 'onkeypress');
+	setAttrib(elm, 'onkeydown');
+	setAttrib(elm, 'onkeyup');
+
+	// Refresh in old MSIE
+	if (tinyMCE.isMSIE5)
+		elm.outerHTML = elm.outerHTML;
+}
+
+function getSelectValue(form_obj, field_name) {
+	var elm = form_obj.elements[field_name];
+
+	if (elm == null || elm.options == null)
+		return "";
+
+	return elm.options[elm.selectedIndex].value;
+}
+
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {
+	if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
+		return "";
+
+	var html = "";
+
+	html += '<select id="' + elm_id + '" name="' + elm_id + '"';
+	html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
+	html += 'this.options[this.selectedIndex].value;';
+
+	if (typeof(onchange_func) != "undefined")
+		html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
+
+	html += '"><option value="">---</option>';
+
+	for (var i=0; i<tinyMCELinkList.length; i++)
+		html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
+
+	html += '</select>';
+
+	return html;
+
+	// tinyMCE.debug('-- image list start --', html, '-- image list end --');
+}
+
+function getTargetListHTML(elm_id, target_form_element) {
+	var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
+	var html = '';
+
+	html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
+	html += 'this.options[this.selectedIndex].value;">';
+	html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
+	html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
+	html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
+	html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
+
+	for (var i=0; i<targets.length; i++) {
+		var key, value;
+
+		if (targets[i] == "")
+			continue;
+
+		key = targets[i].split('=')[0];
+		value = targets[i].split('=')[1];
+
+		html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
+	}
+
+	html += '</select>';
+
+	return html;
+}
+
+// While loading
+preinit();
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,52 @@
+tinyMCE.addI18n('en.advlink_dlg',{
+title:"Insert/edit link",
+url:"Link URL",
+target:"Target",
+titlefield:"Title",
+is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
+is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
+list:"Link list",
+general_tab:"General",
+popup_tab:"Popup",
+events_tab:"Events",
+advanced_tab:"Advanced",
+general_props:"General properties",
+popup_props:"Popup properties",
+event_props:"Events",
+advanced_props:"Advanced properties",
+popup_opts:"Options",
+anchor_names:"Anchors",
+target_same:"Open in this window / frame",
+target_parent:"Open in parent window / frame",
+target_top:"Open in top frame (replaces all frames)",
+target_blank:"Open in new window",
+popup:"Javascript popup",
+popup_url:"Popup URL",
+popup_name:"Window name",
+popup_return:"Insert 'return false'",
+popup_scrollbars:"Show scrollbars",
+popup_statusbar:"Show status bar",
+popup_toolbar:"Show toolbars",
+popup_menubar:"Show menu bar",
+popup_location:"Show location bar",
+popup_resizable:"Make window resizable",
+popup_dependent:"Dependent (Mozilla/Firefox only)",
+popup_size:"Size",
+popup_position:"Position (X/Y)",
+id:"Id",
+style:"Style",
+classes:"Classes",
+target_name:"Target name",
+langdir:"Language direction",
+target_langcode:"Target language",
+langcode:"Language code",
+encoding:"Target character encoding",
+mime:"Target MIME type",
+rel:"Relationship page to target",
+rev:"Relationship target to page",
+tabindex:"Tabindex",
+accesskey:"Accesskey",
+ltr:"Left to right",
+rtl:"Right to left",
+link_list:"Link list"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm	(revision 1)
@@ -0,0 +1,339 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advlink_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/advlink.js"></script>
+	<link href="css/advlink.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="advlink" style="display: none">
+    <form onsubmit="insertAction();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
+				<li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
+				<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{#advlink_dlg.general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+						  <td nowrap="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
+						  <td><table border="0" cellspacing="0" cellpadding="0">
+								<tr>
+								  <td><input id="href" name="href" type="text" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
+								  <td id="hrefbrowsercontainer">&nbsp;</td>
+								</tr>
+							  </table></td>
+						</tr>
+						<tr id="linklisthrefrow">
+							<td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
+							<td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
+							<td colspan="2" id="anchorlistcontainer">&nbsp;</td>
+						</tr>
+						<tr>
+							<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
+							<td id="targetlistcontainer">&nbsp;</td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
+							<td><input id="title" name="title" type="text" value="" /></td>
+						</tr>
+						<tr>
+							<td><label id="classlabel" for="classlist">{#class_name}</label></td>
+							<td>
+								 <select id="classlist" name="classlist" onchange="changeClass();">
+									<option value="" selected>{#not_set}</option>
+								 </select>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="popup_panel" class="panel">
+				<fieldset>
+					<legend>{#advlink_dlg.popup_props}</legend>
+
+					<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
+					<label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td nowrap="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label>&nbsp;</td>
+							<td>
+								<table border="0" cellspacing="0" cellpadding="0">
+									<tr>
+										<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
+										<td id="popupurlbrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label>&nbsp;</td>
+							<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label>{#advlink_dlg.popup_size}</label>&nbsp;</td>
+							<td nowrap="nowrap">
+								<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
+								<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
+							</td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label>&nbsp;</td>
+							<td nowrap="nowrap">
+								<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /                                
+								<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
+							</td>
+						</tr>
+					</table>
+
+					<fieldset>
+						<legend>{#advlink_dlg.popup_opts}</legend>
+
+						<table border="0" cellpadding="0" cellspacing="4">
+							<tr>
+								<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
+								<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
+							</tr>
+							<tr>
+								<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
+								<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
+							</tr>
+							<tr>
+								<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
+								<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
+							</tr>
+							<tr>
+								<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
+								<td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
+								<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
+								<td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
+							</tr>
+						</table>
+					</fieldset>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+			<fieldset>
+					<legend>{#advlink_dlg.advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
+							<td><input type="text" id="style" name="style" value="" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
+							<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
+							<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#advlink_dlg.ltr}</option> 
+										<option value="rtl">{#advlink_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
+							<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
+							<td><input type="text" id="charset" name="charset" value="" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
+							<td><input type="text" id="type" name="type" value="" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
+							<td><select id="rel" name="rel"> 
+									<option value="">{#not_set}</option> 
+									<option value="lightbox">Lightbox</option> 
+									<option value="alternate">Alternate</option> 
+									<option value="designates">Designates</option> 
+									<option value="stylesheet">Stylesheet</option> 
+									<option value="start">Start</option> 
+									<option value="next">Next</option> 
+									<option value="prev">Prev</option> 
+									<option value="contents">Contents</option> 
+									<option value="index">Index</option> 
+									<option value="glossary">Glossary</option> 
+									<option value="copyright">Copyright</option> 
+									<option value="chapter">Chapter</option> 
+									<option value="subsection">Subsection</option> 
+									<option value="appendix">Appendix</option> 
+									<option value="help">Help</option> 
+									<option value="bookmark">Bookmark</option>
+									<option value="nofollow">No Follow</option>
+									<option value="tag">Tag</option>
+								</select> 
+							</td>
+						</tr>
+
+						<tr>
+							<td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
+							<td><select id="rev" name="rev"> 
+									<option value="">{#not_set}</option> 
+									<option value="alternate">Alternate</option> 
+									<option value="designates">Designates</option> 
+									<option value="stylesheet">Stylesheet</option> 
+									<option value="start">Start</option> 
+									<option value="next">Next</option> 
+									<option value="prev">Prev</option> 
+									<option value="contents">Contents</option> 
+									<option value="index">Index</option> 
+									<option value="glossary">Glossary</option> 
+									<option value="copyright">Copyright</option> 
+									<option value="chapter">Chapter</option> 
+									<option value="subsection">Subsection</option> 
+									<option value="appendix">Appendix</option> 
+									<option value="help">Help</option> 
+									<option value="bookmark">Bookmark</option> 
+								</select> 
+							</td>
+						</tr>
+
+						<tr>
+							<td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
+							<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
+							<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="events_panel" class="panel">
+			<fieldset>
+					<legend>{#advlink_dlg.event_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="onfocus">onfocus</label></td> 
+							<td><input id="onfocus" name="onfocus" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onblur">onblur</label></td> 
+							<td><input id="onblur" name="onblur" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onclick">onclick</label></td> 
+							<td><input id="onclick" name="onclick" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="ondblclick">ondblclick</label></td> 
+							<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onmousedown">onmousedown</label></td> 
+							<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onmouseup">onmouseup</label></td> 
+							<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onmouseover">onmouseover</label></td> 
+							<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onmousemove">onmousemove</label></td> 
+							<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onmouseout">onmouseout</label></td> 
+							<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onkeypress">onkeypress</label></td> 
+							<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onkeydown">onkeydown</label></td> 
+							<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="onkeyup">onkeyup</label></td> 
+							<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="insertAction();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+    </form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,51 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.AutoSavePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Auto save',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private plugin internal methods
+
+		'static' : {
+			_beforeUnloadHandler : function() {
+				var msg;
+
+				tinymce.each(tinyMCE.editors, function(ed) {
+					if (ed.getParam("fullscreen_is_enabled"))
+						return;
+
+					if (ed.isDirty()) {
+						msg = ed.getLang("autosave.unload_msg");
+						return false;
+					}
+				});
+
+				return msg;
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.BBCodePlugin',{init:function(ed,url){var t=this,dialect=ed.getParam('bbcode_dialect','punbb').toLowerCase();ed.onBeforeSetContent.add(function(ed,o){o.content=t['_'+dialect+'_bbcode2html'](o.content);});ed.onPostProcess.add(function(ed,o){if(o.set)o.content=t['_'+dialect+'_bbcode2html'](o.content);if(o.get)o.content=t['_'+dialect+'_html2bbcode'](o.content);});},getInfo:function(){return{longname:'BBCode Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_punbb_html2bbcode:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");rep(/<u>/gi,"[u]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/&nbsp;/gi," ");rep(/&quot;/gi,"\"");rep(/&lt;/gi,"<");rep(/&gt;/gi,">");rep(/&amp;/gi,"&");return s;},_punbb_bbcode2html:function(s){s=tinymce.trim(s);function rep(re,str){s=s.replace(re,str);};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");return s;}});tinymce.PluginManager.add('bbcode',tinymce.plugins.BBCodePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,115 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.BBCodePlugin', {
+		init : function(ed, url) {
+			var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
+
+			ed.onBeforeSetContent.add(function(ed, o) {
+				o.content = t['_' + dialect + '_bbcode2html'](o.content);
+			});
+
+			ed.onPostProcess.add(function(ed, o) {
+				if (o.set)
+					o.content = t['_' + dialect + '_bbcode2html'](o.content);
+
+				if (o.get)
+					o.content = t['_' + dialect + '_html2bbcode'](o.content);
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'BBCode Plugin',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		// HTML -> BBCode in PunBB dialect
+		_punbb_html2bbcode : function(s) {
+			s = tinymce.trim(s);
+
+			function rep(re, str) {
+				s = s.replace(re, str);
+			};
+
+			// example: <strong> to [b]
+			rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
+			rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
+			rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
+			rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
+			rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
+			rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
+			rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
+			rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
+			rep(/<font>(.*?)<\/font>/gi,"$1");
+			rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
+			rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
+			rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
+			rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
+			rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
+			rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
+			rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
+			rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
+			rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
+			rep(/<\/(strong|b)>/gi,"[/b]");
+			rep(/<(strong|b)>/gi,"[b]");
+			rep(/<\/(em|i)>/gi,"[/i]");
+			rep(/<(em|i)>/gi,"[i]");
+			rep(/<\/u>/gi,"[/u]");
+			rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
+			rep(/<u>/gi,"[u]");
+			rep(/<br \/>/gi,"\n");
+			rep(/<br\/>/gi,"\n");
+			rep(/<br>/gi,"\n");
+			rep(/<p>/gi,"");
+			rep(/<\/p>/gi,"\n");
+			rep(/&nbsp;/gi," ");
+			rep(/&quot;/gi,"\"");
+			rep(/&lt;/gi,"<");
+			rep(/&gt;/gi,">");
+			rep(/&amp;/gi,"&");
+
+			return s; 
+		},
+
+		// BBCode -> HTML from PunBB dialect
+		_punbb_bbcode2html : function(s) {
+			s = tinymce.trim(s);
+
+			function rep(re, str) {
+				s = s.replace(re, str);
+			};
+
+			// example: [b] to <strong>
+			rep(/\n/gi,"<br />");
+			rep(/\[b\]/gi,"<strong>");
+			rep(/\[\/b\]/gi,"</strong>");
+			rep(/\[i\]/gi,"<em>");
+			rep(/\[\/i\]/gi,"</em>");
+			rep(/\[u\]/gi,"<u>");
+			rep(/\[\/u\]/gi,"</u>");
+			rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
+			rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
+			rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
+			rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
+			rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
+			rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");
+
+			return s; 
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.Compat2x',{getInfo:function(){return{longname:'Compat2x',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};}});(function(){tinymce.extend(tinyMCE,{addToLang:function(p,l){each(l,function(v,k){tinyMCE.i18n[(tinyMCE.settings.language||'en')+'.'+(p?p+'_':'')+k]=v;});},getInstanceById:function(n){return this.get(n);}});})();(function(){var EditorManager=tinymce.EditorManager;tinyMCE.instances={};tinyMCE.plugins={};tinymce.PluginManager.onAdd.add(function(pm,n,p){tinyMCE.plugins[n]=p;});tinyMCE.majorVersion=tinymce.majorVersion;tinyMCE.minorVersion=tinymce.minorVersion;tinyMCE.releaseDate=tinymce.releaseDate;tinyMCE.baseURL=tinymce.baseURL;tinyMCE.isIE=tinyMCE.isMSIE=tinymce.isIE||tinymce.isOpera;tinyMCE.isMSIE5=tinymce.isIE;tinyMCE.isMSIE5_0=tinymce.isIE;tinyMCE.isMSIE7=tinymce.isIE;tinyMCE.isGecko=tinymce.isGecko;tinyMCE.isSafari=tinymce.isWebKit;tinyMCE.isOpera=tinymce.isOpera;tinyMCE.isMac=false;tinyMCE.isNS7=false;tinyMCE.isNS71=false;tinyMCE.compat=true;TinyMCE_Engine=tinyMCE;tinymce.extend(tinyMCE,{getParam:function(n,dv){return this.activeEditor.getParam(n,dv);},addEvent:function(e,na,f,sc){tinymce.dom.Event.add(e,na,f,sc||this);},getControlHTML:function(n){return EditorManager.activeEditor.controlManager.createControl(n);},loadCSS:function(u){tinymce.DOM.loadCSS(u);},importCSS:function(doc,u){if(doc==document)this.loadCSS(u);else new tinymce.dom.DOMUtils(doc).loadCSS(u);},log:function(){console.debug.apply(console,arguments);},getLang:function(n,dv){var v=EditorManager.activeEditor.getLang(n.replace(/^lang_/g,''),dv);if(/^[0-9\-.]+$/g.test(v))return parseInt(v);return v;},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.execCommand;},triggerNodeChange:function(){EditorManager.activeEditor.nodeChanged();},regexpReplace:function(in_str,reg_exp,replace_str,opts){var re;if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);},trim:function(s){return tinymce.trim(s);},xmlEncode:function(s){return tinymce.DOM.encode(s);},explode:function(s,d){var o=[];tinymce.each(s.split(d),function(v){if(v!='')o.push(v);});return o;},switchClass:function(id,cls){var b;if(/^mceButton/.test(cls)){b=EditorManager.activeEditor.controlManager.get(id);if(!b)return;switch(cls){case"mceButtonNormal":b.setDisabled(false);b.setActive(false);return;case"mceButtonDisabled":b.setDisabled(true);return;case"mceButtonSelected":b.setActive(true);b.setDisabled(false);return;}}},addCSSClass:function(e,n,b){return tinymce.DOM.addClass(e,n,b);},hasCSSClass:function(e,n){return tinymce.DOM.hasClass(e,n);},removeCSSClass:function(e,n){return tinymce.DOM.removeClass(e,n);},getCSSClasses:function(){var cl=EditorManager.activeEditor.dom.getClasses(),o=[];each(cl,function(c){o.push(c['class']);});return o;},setWindowArg:function(n,v){EditorManager.activeEditor.windowManager.params[n]=v;},getWindowArg:function(n,dv){var wm=EditorManager.activeEditor.windowManager,v;v=wm.getParam(n);if(v==='')return'';return v||wm.getFeature(n)||dv;},getParentNode:function(n,f){return this._getDOM().getParent(n,f);},selectElements:function(n,na,f){var i,a=[],nl,x;for(x=0,na=na.split(',');x<na.length;x++)for(i=0,nl=n.getElementsByTagName(na[x]);i<nl.length;i++)(!f||f(nl[i]))&&a.push(nl[i]);return a;},getNodeTree:function(n,na,t,nn){return this.selectNodes(n,function(n){return(!t||n.nodeType==t)&&(!nn||n.nodeName==nn);},na?na:[]);},getAttrib:function(e,n,dv){return this._getDOM().getAttrib(e,n,dv);},setAttrib:function(e,n,v){return this._getDOM().setAttrib(e,n,v);},getElementsByAttributeValue:function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=[];for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i];}return o;},selectNodes:function(n,f,a){var i;if(!a)a=[];if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a);}return a;},getContent:function(){return EditorManager.activeEditor.getContent();},getParentElement:function(n,na,f){if(na)na=new RegExp('^('+na.toUpperCase().replace(/,/g,'|')+')$','g');return this._getDOM().getParent(n,function(n){return n.nodeType==1&&(!na||na.test(n.nodeName))&&(!f||f(n));},this.activeEditor.getBody());},importPluginLanguagePack:function(n){tinymce.PluginManager.requireLangPack(n);},getButtonHTML:function(cn,lang,img,c,u,v){var ed=EditorManager.activeEditor;img=img.replace(/\{\$pluginurl\}/g,tinyMCE.pluginURL);img=img.replace(/\{\$themeurl\}/g,tinyMCE.themeURL);lang=lang.replace(/^lang_/g,'');return ed.controlManager.createButton(cn,{title:lang,command:c,ui:u,value:v,scope:this,'class':'compat',image:img});},addSelectAccessibility:function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w;}return false;},accessibleEventHandler:function(e){var elm,win=this._win;e=tinymce.isIE?win.event:e;elm=tinymce.isIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange=elm.oldonchange;elm.oldonchange=null;}return true;}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null;}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false;}return true;},cancelEvent:function(e){return tinymce.dom.Event.cancel(e);},handleVisualAid:function(e){EditorManager.activeEditor.addVisual(e);},getAbsPosition:function(n,r){return tinymce.DOM.getPos(n,r);},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s;},getVisualAidClass:function(s){return s;},parseStyle:function(s){return this._getDOM().parseStyle(s);},serializeStyle:function(s){return this._getDOM().serializeStyle(s);},openWindow:function(tpl,args){var ed=EditorManager.activeEditor,o={},n;for(n in tpl)o[n]=tpl[n];tpl=o;args=args||{};tpl.url=new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);tpl.inline=tpl.inline||args.inline;ed.windowManager.open(tpl,args);},closeWindow:function(win){EditorManager.activeEditor.windowManager.close(win);},getOuterHTML:function(e){return tinymce.DOM.getOuterHTML(e);},setOuterHTML:function(e,h,d){return tinymce.DOM.setOuterHTML(e,h,d);},hasPlugin:function(n){return tinymce.PluginManager.get(n)!=null;},_setEventsEnabled:function(){},addPlugin:function(pn,f){var t=this;function PluginWrapper(ed){tinyMCE.selectedInstance=ed;ed.onInit.add(function(){t.settings=ed.settings;t.settings['base_href']=tinyMCE.documentBasePath;tinyMCE.settings=t.settings;tinyMCE.documentBasePath=ed.documentBasePath;if(f.initInstance)f.initInstance(ed);ed.contentDocument=ed.getDoc();ed.contentWindow=ed.getWin();ed.undoRedo=ed.undoManager;ed.startContent=ed.getContent({format:'raw'});tinyMCE.instances[ed.id]=ed;tinyMCE.loadedFiles=[];});ed.onActivate.add(function(){tinyMCE.settings=ed.settings;tinyMCE.selectedInstance=ed;});if(f.handleNodeChange){ed.onNodeChange.add(function(ed,cm,n){f.handleNodeChange(ed.id,n,0,0,false,!ed.selection.isCollapsed());});}if(f.onChange){ed.onChange.add(function(ed,n){return f.onChange(ed);});}if(f.cleanup){ed.onGetContent.add(function(){});}this.getInfo=function(){return f.getInfo();};this.createControl=function(n){tinyMCE.pluginURL=tinymce.baseURL+'/plugins/'+pn;tinyMCE.themeURL=tinymce.baseURL+'/themes/'+tinyMCE.activeEditor.settings.theme;if(f.getControlHTML)return f.getControlHTML(n);return null;};this.execCommand=function(cmd,ui,val){if(f.execCommand)return f.execCommand(ed.id,ed.getBody(),cmd,ui,val);return false;};};tinymce.PluginManager.add(pn,PluginWrapper);},_getDOM:function(){return tinyMCE.activeEditor?tinyMCE.activeEditor.dom:tinymce.DOM;},convertRelativeToAbsoluteURL:function(b,u){return new tinymce.util.URI(b).toAbsolute(u);},convertAbsoluteURLToRelativeURL:function(b,u){return new tinymce.util.URI(b).toRelative(u);}});tinymce.extend(tinymce.Editor.prototype,{getFocusElement:function(){return this.selection.getNode();},getData:function(n){if(!this.data)this.data=[];if(!this.data[n])this.data[n]=[];return this.data[n];},hasPlugin:function(n){return this.plugins[n]!=null;},getContainerWin:function(){return window;},getHTML:function(raw){return this.getContent({format:raw?'raw':'html'});},setHTML:function(h){this.setContent(h);},getSel:function(){return this.selection.getSel();},getRng:function(){return this.selection.getRng();},isHidden:function(){var s;if(!tinymce.isGecko)return false;s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},translate:function(s){var c=this.settings.language,o;o=tinymce.EditorManager.i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{#'+b+'}';});o=o.replace(/{\$lang_([^}]+)\}/g,function(a,b){return tinymce.EditorManager.i18n[c+'.'+b]||'{$lang_'+b+'}';});return o;},repaint:function(){this.execCommand('mceRepaint');}});tinymce.extend(tinymce.dom.Selection.prototype,{getSelectedText:function(){return this.getContent({format:'text'});},getSelectedHTML:function(){return this.getContent({format:'html'});},getFocusElement:function(){return this.getNode();},selectNode:function(node,collapse,select_text_node,to_start){var t=this;t.select(node,select_text_node||0);if(!is(collapse))collapse=true;if(collapse){if(!is(to_start))to_start=true;t.collapse(to_start);}}});}).call(this);tinymce.PluginManager.add('compat2x',tinymce.plugins.Compat2x);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/compat2x/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,613 @@
+/**
+ * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
+
+	tinymce.create('tinymce.plugins.Compat2x', {
+		getInfo : function() {
+			return {
+				longname : 'Compat2x',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/compat2x',
+				version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+			};
+		}
+	});
+
+	(function() {
+		// Extend tinyMCE/EditorManager
+		tinymce.extend(tinyMCE, {
+			addToLang : function(p, l) {
+				each(l, function(v, k) {
+					tinyMCE.i18n[(tinyMCE.settings.language || 'en') + '.' + (p ? p + '_' : '') + k] = v;
+				});
+			},
+
+			getInstanceById : function(n) {
+				return this.get(n);
+			}
+		});
+	})();
+
+	(function() {
+		var EditorManager = tinymce.EditorManager;
+
+		tinyMCE.instances = {};
+		tinyMCE.plugins = {};
+		tinymce.PluginManager.onAdd.add(function(pm, n, p) {
+			tinyMCE.plugins[n] = p;
+		});
+
+		tinyMCE.majorVersion = tinymce.majorVersion;
+		tinyMCE.minorVersion = tinymce.minorVersion;
+		tinyMCE.releaseDate = tinymce.releaseDate;
+		tinyMCE.baseURL = tinymce.baseURL;
+		tinyMCE.isIE = tinyMCE.isMSIE = tinymce.isIE || tinymce.isOpera;
+		tinyMCE.isMSIE5 = tinymce.isIE;
+		tinyMCE.isMSIE5_0 = tinymce.isIE;
+		tinyMCE.isMSIE7 = tinymce.isIE;
+		tinyMCE.isGecko = tinymce.isGecko;
+		tinyMCE.isSafari = tinymce.isWebKit;
+		tinyMCE.isOpera = tinymce.isOpera;
+		tinyMCE.isMac = false;
+		tinyMCE.isNS7 = false;
+		tinyMCE.isNS71 = false;
+		tinyMCE.compat = true;
+
+		// Extend tinyMCE class
+		TinyMCE_Engine = tinyMCE;
+		tinymce.extend(tinyMCE, {
+			getParam : function(n, dv) {
+				return this.activeEditor.getParam(n, dv);
+			},
+
+			addEvent : function(e, na, f, sc) {
+				tinymce.dom.Event.add(e, na, f, sc || this);
+			},
+
+			getControlHTML : function(n) {
+				return EditorManager.activeEditor.controlManager.createControl(n);
+			},
+
+			loadCSS : function(u) {
+				tinymce.DOM.loadCSS(u);
+			},
+
+			importCSS : function(doc, u) {
+				if (doc == document)
+					this.loadCSS(u);
+				else
+					new tinymce.dom.DOMUtils(doc).loadCSS(u);
+			},
+
+			log : function() {
+				console.debug.apply(console, arguments);
+			},
+
+			getLang : function(n, dv) {
+				var v = EditorManager.activeEditor.getLang(n.replace(/^lang_/g, ''), dv);
+
+				// Is number
+				if (/^[0-9\-.]+$/g.test(v))
+					return parseInt(v);
+
+				return v;
+			},
+
+			isInstance : function(o) {
+				return o != null && typeof(o) == "object" && o.execCommand;
+			},
+
+			triggerNodeChange : function() {
+				EditorManager.activeEditor.nodeChanged();
+			},
+
+			regexpReplace : function(in_str, reg_exp, replace_str, opts) {
+				var re;
+
+				if (in_str == null)
+					return in_str;
+
+				if (typeof(opts) == "undefined")
+					opts = 'g';
+
+				re = new RegExp(reg_exp, opts);
+
+				return in_str.replace(re, replace_str);
+			},
+
+			trim : function(s) {
+				return tinymce.trim(s);
+			},
+
+			xmlEncode : function(s) {
+				return tinymce.DOM.encode(s);
+			},
+
+			explode : function(s, d) {
+				var o = [];
+
+				tinymce.each(s.split(d), function(v) {
+					if (v != '')
+						o.push(v);
+				});
+
+				return o;
+			},
+
+			switchClass : function(id, cls) {
+				var b;
+
+				if (/^mceButton/.test(cls)) {
+					b = EditorManager.activeEditor.controlManager.get(id);
+
+					if (!b)
+						return;
+
+					switch (cls) {
+						case "mceButtonNormal":
+							b.setDisabled(false);
+							b.setActive(false);
+							return;
+
+						case "mceButtonDisabled":
+							b.setDisabled(true);
+							return;
+
+						case "mceButtonSelected":
+							b.setActive(true);
+							b.setDisabled(false);
+							return;
+					}
+				}
+			},
+
+			addCSSClass : function(e, n, b) {
+				return tinymce.DOM.addClass(e, n, b);
+			},
+
+			hasCSSClass : function(e, n) {
+				return tinymce.DOM.hasClass(e, n);
+			},
+
+			removeCSSClass : function(e, n) {
+				return tinymce.DOM.removeClass(e, n);
+			},
+
+			getCSSClasses : function() {
+				var cl = EditorManager.activeEditor.dom.getClasses(), o = [];
+
+				each(cl, function(c) {
+					o.push(c['class']);
+				});
+
+				return o;
+			},
+
+			setWindowArg : function(n, v) {
+				EditorManager.activeEditor.windowManager.params[n] = v;
+			},
+
+			getWindowArg : function(n, dv) {
+				var wm = EditorManager.activeEditor.windowManager, v;
+
+				v = wm.getParam(n);
+				if (v === '')
+					return '';
+
+				return v || wm.getFeature(n) || dv;
+			},
+
+			getParentNode : function(n, f) {
+				return this._getDOM().getParent(n, f);
+			},
+
+			selectElements : function(n, na, f) {
+				var i, a = [], nl, x;
+
+				for (x=0, na = na.split(','); x<na.length; x++)
+					for (i=0, nl = n.getElementsByTagName(na[x]); i<nl.length; i++)
+						(!f || f(nl[i])) && a.push(nl[i]);
+
+				return a;
+			},
+
+			getNodeTree : function(n, na, t, nn) {
+				return this.selectNodes(n, function(n) {
+					return (!t || n.nodeType == t) && (!nn || n.nodeName == nn);
+				}, na ? na : []);
+			},
+
+			getAttrib : function(e, n, dv) {
+				return this._getDOM().getAttrib(e, n, dv);
+			},
+
+			setAttrib : function(e, n, v) {
+				return this._getDOM().setAttrib(e, n, v);
+			},
+
+			getElementsByAttributeValue : function(n, e, a, v) {
+				var i, nl = n.getElementsByTagName(e), o = [];
+
+				for (i=0; i<nl.length; i++) {
+					if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
+						o[o.length] = nl[i];
+				}
+
+				return o;
+			},
+
+			selectNodes : function(n, f, a) {
+				var i;
+
+				if (!a)
+					a = [];
+
+				if (f(n))
+					a[a.length] = n;
+
+				if (n.hasChildNodes()) {
+					for (i=0; i<n.childNodes.length; i++)
+						tinyMCE.selectNodes(n.childNodes[i], f, a);
+				}
+
+				return a;
+			},
+
+			getContent : function() {
+				return EditorManager.activeEditor.getContent();
+			},
+
+			getParentElement : function(n, na, f) {
+				if (na)
+					na = new RegExp('^(' + na.toUpperCase().replace(/,/g, '|') + ')$', 'g');
+
+				return this._getDOM().getParent(n, function(n) {
+					return n.nodeType == 1 && (!na || na.test(n.nodeName)) && (!f || f(n));
+				}, this.activeEditor.getBody());
+			},
+
+			importPluginLanguagePack : function(n) {
+				tinymce.PluginManager.requireLangPack(n);
+			},
+
+			getButtonHTML : function(cn, lang, img, c, u, v) {
+				var ed = EditorManager.activeEditor;
+
+				img = img.replace(/\{\$pluginurl\}/g, tinyMCE.pluginURL);
+				img = img.replace(/\{\$themeurl\}/g, tinyMCE.themeURL);
+				lang = lang.replace(/^lang_/g, '');
+
+				return ed.controlManager.createButton(cn, {
+					title : lang,
+					command : c,
+					ui : u,
+					value : v,
+					scope : this,
+					'class' : 'compat',
+					image : img
+				});
+			},
+
+			addSelectAccessibility : function(e, s, w) {
+				// Add event handlers 
+				if (!s._isAccessible) {
+					s.onkeydown = tinyMCE.accessibleEventHandler;
+					s.onblur = tinyMCE.accessibleEventHandler;
+					s._isAccessible = true;
+					s._win = w;
+				}
+
+				return false;
+			},
+
+			accessibleEventHandler : function(e) {
+				var elm, win = this._win;
+
+				e = tinymce.isIE ? win.event : e;
+				elm = tinymce.isIE ? e.srcElement : e.target;
+
+				// Unpiggyback onchange on blur
+				if (e.type == "blur") {
+					if (elm.oldonchange) {
+						elm.onchange = elm.oldonchange;
+						elm.oldonchange = null;
+					}
+
+					return true;
+				}
+
+				// Piggyback onchange
+				if (elm.nodeName == "SELECT" && !elm.oldonchange) {
+					elm.oldonchange = elm.onchange;
+					elm.onchange = null;
+				}
+
+				// Execute onchange and remove piggyback
+				if (e.keyCode == 13 || e.keyCode == 32) {
+					elm.onchange = elm.oldonchange;
+					elm.onchange();
+					elm.oldonchange = null;
+
+					tinyMCE.cancelEvent(e);
+					return false;
+				}
+
+				return true;
+			},
+
+			cancelEvent : function(e) {
+				return tinymce.dom.Event.cancel(e);
+			},
+
+			handleVisualAid : function(e) {
+				EditorManager.activeEditor.addVisual(e);
+			},
+
+			getAbsPosition : function(n, r) {
+				return tinymce.DOM.getPos(n, r);
+			},
+
+			cleanupEventStr : function(s) {
+				s = "" + s;
+				s = s.replace('function anonymous()\n{\n', '');
+				s = s.replace('\n}', '');
+				s = s.replace(/^return true;/gi, ''); // Remove event blocker
+
+				return s;
+			},
+
+			getVisualAidClass : function(s) {
+				// TODO: Implement
+				return s;
+			},
+
+			parseStyle : function(s) {
+				return this._getDOM().parseStyle(s);
+			},
+
+			serializeStyle : function(s) {
+				return this._getDOM().serializeStyle(s);
+			},
+
+			openWindow : function(tpl, args) {
+				var ed = EditorManager.activeEditor, o = {}, n;
+
+				// Convert name/value array to object
+				for (n in tpl)
+					o[n] = tpl[n];
+
+				tpl = o;
+
+				args = args || {};
+				tpl.url = new tinymce.util.URI(tinymce.ThemeManager.themeURLs[ed.settings.theme]).toAbsolute(tpl.file);
+				tpl.inline = tpl.inline || args.inline;
+
+				ed.windowManager.open(tpl, args);
+			},
+
+			closeWindow : function(win) {
+				EditorManager.activeEditor.windowManager.close(win);
+			},
+
+			getOuterHTML : function(e) {
+				return tinymce.DOM.getOuterHTML(e);
+			},
+
+			setOuterHTML : function(e, h, d) {
+				return tinymce.DOM.setOuterHTML(e, h, d);
+			},
+
+			hasPlugin : function(n) {
+				return tinymce.PluginManager.get(n) != null;
+			},
+
+			_setEventsEnabled : function() {
+				// Ignore it!!
+			},
+
+			addPlugin : function(pn, f) {
+				var t = this;
+
+				function PluginWrapper(ed) {
+					tinyMCE.selectedInstance = ed;
+
+					ed.onInit.add(function() {
+						t.settings = ed.settings;
+						t.settings['base_href'] = tinyMCE.documentBasePath;
+						tinyMCE.settings = t.settings;
+						tinyMCE.documentBasePath = ed.documentBasePath;
+						//ed.formElement = DOM.get(ed.id);
+
+						if (f.initInstance)
+							f.initInstance(ed);
+
+						ed.contentDocument = ed.getDoc();
+						ed.contentWindow = ed.getWin();
+						ed.undoRedo = ed.undoManager;
+						ed.startContent = ed.getContent({format : 'raw'});
+
+						tinyMCE.instances[ed.id] = ed;
+						tinyMCE.loadedFiles = [];
+					});
+
+					ed.onActivate.add(function() {
+						tinyMCE.settings = ed.settings;
+						tinyMCE.selectedInstance = ed;
+					});
+
+				/*	if (f.removeInstance) {
+						ed.onDestroy.add(function() {
+							return f.removeInstance(ed.id);
+						});
+					}*/
+
+					if (f.handleNodeChange) {
+						ed.onNodeChange.add(function(ed, cm, n) {
+							f.handleNodeChange(ed.id, n, 0, 0, false, !ed.selection.isCollapsed());
+						});
+					}
+
+					if (f.onChange) {
+						ed.onChange.add(function(ed, n) {
+							return f.onChange(ed);
+						});
+					}
+
+					if (f.cleanup) {
+						ed.onGetContent.add(function() {
+							//f.cleanup(type, content, inst);
+						});
+					}
+
+					this.getInfo = function() {
+						return f.getInfo();
+					};
+
+					this.createControl = function(n) {
+						tinyMCE.pluginURL = tinymce.baseURL + '/plugins/' + pn;
+						tinyMCE.themeURL = tinymce.baseURL + '/themes/' + tinyMCE.activeEditor.settings.theme;
+
+						if (f.getControlHTML)
+							return f.getControlHTML(n);
+
+						return null;
+					};
+
+					this.execCommand = function(cmd, ui, val) {
+						if (f.execCommand)
+							return f.execCommand(ed.id, ed.getBody(), cmd, ui, val);
+
+						return false;
+					};
+				};
+
+				tinymce.PluginManager.add(pn, PluginWrapper);
+			},
+
+			_getDOM : function() {
+				return tinyMCE.activeEditor ? tinyMCE.activeEditor.dom : tinymce.DOM;
+			},
+
+			convertRelativeToAbsoluteURL : function(b, u) {
+				return new tinymce.util.URI(b).toAbsolute(u);
+			},
+
+			convertAbsoluteURLToRelativeURL : function(b, u) {
+				return new tinymce.util.URI(b).toRelative(u);
+			}
+		});
+
+		// Extend Editor class
+		tinymce.extend(tinymce.Editor.prototype, {
+			getFocusElement : function() {
+				return this.selection.getNode();
+			},
+
+			getData : function(n) {
+				if (!this.data)
+					this.data = [];
+
+				if (!this.data[n])
+					this.data[n] = [];
+
+				return this.data[n];
+			},
+
+			hasPlugin : function(n) {
+				return this.plugins[n] != null;
+			},
+
+			getContainerWin : function() {
+				return window;
+			},
+
+			getHTML : function(raw) {
+				return this.getContent({ format : raw ? 'raw' : 'html'});
+			},
+
+			setHTML : function(h) {
+				this.setContent(h);
+			},
+
+			getSel : function() {
+				return this.selection.getSel();
+			},
+
+			getRng : function() {
+				return this.selection.getRng();
+			},
+
+			isHidden : function() {
+				var s;
+
+				if (!tinymce.isGecko)
+					return false;
+
+				s = this.getSel();
+
+				// Weird, wheres that cursor selection?
+				return (!s || !s.rangeCount || s.rangeCount == 0);
+			},
+
+			translate : function(s) {
+				var c = this.settings.language, o;
+
+				o = tinymce.EditorManager.i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
+					return tinymce.EditorManager.i18n[c + '.' + b] || '{#' + b + '}';
+				});
+
+				o = o.replace(/{\$lang_([^}]+)\}/g, function(a, b) {
+					return tinymce.EditorManager.i18n[c + '.' + b] || '{$lang_' + b + '}';
+				});
+
+				return o;
+			},
+
+			repaint : function() {
+				this.execCommand('mceRepaint');
+			}
+		});
+
+		// Extend selection
+		tinymce.extend(tinymce.dom.Selection.prototype, {
+			getSelectedText : function() {
+				return this.getContent({format : 'text'});
+			},
+
+			getSelectedHTML : function() {
+				return this.getContent({format : 'html'});
+			},
+
+			getFocusElement : function() {
+				return this.getNode();
+			},
+
+			selectNode : function(node, collapse, select_text_node, to_start) {
+				var t = this;
+
+				t.select(node, select_text_node || 0);
+
+				if (!is(collapse))
+					collapse = true;
+
+				if (collapse) {
+					if (!is(to_start))
+						to_start = true;
+
+					t.collapse(to_start);
+				}
+			}
+		});
+	}).call(this);
+
+	// Register plugin
+	tinymce.PluginManager.add('compat2x', tinymce.plugins.Compat2x);
+})();
+
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var Event=tinymce.dom.Event,each=tinymce.each,DOM=tinymce.DOM;tinymce.create('tinymce.plugins.ContextMenu',{init:function(ed){var t=this;t.editor=ed;t.onContextMenu=new tinymce.util.Dispatcher(this);ed.onContextMenu.add(function(ed,e){t._getMenu(ed).showMenu(e.clientX,e.clientY);Event.cancel(e);});function hide(){if(t._menu){t._menu.removeAll();t._menu.destroy();}};ed.onMouseDown.add(hide);ed.onKeyDown.add(hide);Event.add(document,'click',hide);},_getMenu:function(ed){var t=this,m=t._menu,se=ed.selection,col=se.isCollapsed(),el=se.getNode()||ed.getBody(),am;if(m){m.removeAll();m.destroy();}p1=DOM.getPos(ed.getContentAreaContainer());p2=DOM.getPos(ed.getContainer());m=ed.controlManager.createDropMenu('contextmenu',{offset_x:p1.x,offset_y:p1.y,constrain:1});t._menu=m;m.add({title:'advanced.cut_desc',icon:'cut',cmd:'Cut'}).setDisabled(col);m.add({title:'advanced.copy_desc',icon:'copy',cmd:'Copy'}).setDisabled(col);m.add({title:'advanced.paste_desc',icon:'paste',cmd:'Paste'});if((el.nodeName=='A'&&!ed.dom.getAttrib(el,'name'))||!col){m.addSeparator();m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});}m.addSeparator();m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();am=m.addMenu({title:'contextmenu.align'});am.add({title:'contextmenu.left',icon:'justifyleft',cmd:'JustifyLeft'});am.add({title:'contextmenu.center',icon:'justifycenter',cmd:'JustifyCenter'});am.add({title:'contextmenu.right',icon:'justifyright',cmd:'JustifyRight'});am.add({title:'contextmenu.full',icon:'justifyfull',cmd:'JustifyFull'});t.onContextMenu.dispatch(t,m,el,col);return m;}});tinymce.PluginManager.add('contextmenu',tinymce.plugins.ContextMenu);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,84 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
+
+	tinymce.create('tinymce.plugins.ContextMenu', {
+		init : function(ed) {
+			var t = this;
+
+			t.editor = ed;
+			t.onContextMenu = new tinymce.util.Dispatcher(this);
+
+			ed.onContextMenu.add(function(ed, e) {
+				t._getMenu(ed).showMenu(e.clientX, e.clientY);
+				Event.cancel(e);
+			});
+
+			function hide() {
+				if (t._menu) {
+					t._menu.removeAll();
+					t._menu.destroy();
+				}
+			};
+
+			ed.onMouseDown.add(hide);
+			ed.onKeyDown.add(hide);
+			Event.add(document, 'click', hide);
+		},
+
+		_getMenu : function(ed) {
+			var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am;
+
+			if (m) {
+				m.removeAll();
+				m.destroy();
+			}
+
+			p1 = DOM.getPos(ed.getContentAreaContainer());
+			p2 = DOM.getPos(ed.getContainer());
+
+			m = ed.controlManager.createDropMenu('contextmenu', {
+				offset_x : p1.x,
+				offset_y : p1.y,
+/*				vp_offset_x : p2.x,
+				vp_offset_y : p2.y,*/
+				constrain : 1
+			});
+
+			t._menu = m;
+
+			m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
+			m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
+			m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
+
+			if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
+				m.addSeparator();
+				m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
+				m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
+			}
+
+			m.addSeparator();
+			m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
+
+			m.addSeparator();
+			am = m.addMenu({title : 'contextmenu.align'});
+			am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
+			am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
+			am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
+			am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
+
+			t.onContextMenu.dispatch(t, m, el, col);
+
+			return m;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,79 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Directionality', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			ed.addCommand('mceDirectionLTR', function() {
+				var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
+
+				if (e) {
+					if (ed.dom.getAttrib(e, "dir") != "ltr")
+						ed.dom.setAttrib(e, "dir", "ltr");
+					else
+						ed.dom.setAttrib(e, "dir", "");
+				}
+
+				ed.nodeChanged();
+			});
+
+			ed.addCommand('mceDirectionRTL', function() {
+				var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
+
+				if (e) {
+					if (ed.dom.getAttrib(e, "dir") != "rtl")
+						ed.dom.setAttrib(e, "dir", "rtl");
+					else
+						ed.dom.setAttrib(e, "dir", "");
+				}
+
+				ed.nodeChanged();
+			});
+
+			ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
+			ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
+
+			ed.onNodeChange.add(t._nodeChange, t);
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Directionality',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_nodeChange : function(ed, cm, n) {
+			var dom = ed.dom, dir;
+
+			n = dom.getParent(n, dom.isBlock);
+			if (!n) {
+				cm.setDisabled('ltr', 1);
+				cm.setDisabled('rtl', 1);
+				return;
+			}
+
+			dir = dom.getAttrib(n, 'dir');
+			cm.setActive('ltr', dir == "ltr");
+			cm.setDisabled('ltr', 0);
+			cm.setActive('rtl', dir == "rtl");
+			cm.setDisabled('rtl', 0);
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.EmotionsPlugin',{init:function(ed,url){ed.addCommand('mceEmotion',function(){ed.windowManager.open({file:url+'/emotions.htm',width:250+parseInt(ed.getLang('emotions.delta_width',0)),height:160+parseInt(ed.getLang('emotions.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('emotions',{title:'emotions.emotions_desc',cmd:'mceEmotion'});},getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('emotions',tinymce.plugins.EmotionsPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,40 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.EmotionsPlugin', {
+		init : function(ed, url) {
+			// Register commands
+			ed.addCommand('mceEmotion', function() {
+				ed.windowManager.open({
+					file : url + '/emotions.htm',
+					width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
+					height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Emotions',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/emotions.htm	(revision 1)
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#emotions_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/emotions.js"></script>
+	<base target="_self" />
+</head>
+<body style="display: none">
+	<div align="center">
+		<div class="title">{#emotions_dlg.title}:<br /><br /></div>
+
+		<table border="0" cellspacing="0" cellpadding="4">
+		  <tr>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td>
+		  </tr>
+		  <tr>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td>
+			<td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td>
+		  </tr>
+		</table>
+	</div>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/js/emotions.js	(revision 1)
@@ -0,0 +1,22 @@
+tinyMCEPopup.requireLangPack();
+
+var EmotionsDialog = {
+	init : function(ed) {
+		tinyMCEPopup.resizeToInnerSize();
+	},
+
+	insert : function(file, title) {
+		var ed = tinyMCEPopup.editor, dom = ed.dom;
+
+		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
+			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
+			alt : ed.getLang(title),
+			title : ed.getLang(title),
+			border : 0
+		}));
+
+		tinyMCEPopup.close();
+	}
+};
+
+tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/emotions/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,20 @@
+tinyMCE.addI18n('en.emotions_dlg',{
+title:"Insert emotion",
+desc:"Emotions",
+cool:"Cool",
+cry:"Cry",
+embarassed:"Embarassed",
+foot_in_mouth:"Foot in mouth",
+frown:"Frown",
+innocent:"Innocent",
+kiss:"Kiss",
+laughing:"Laughing",
+money_mouth:"Money mouth",
+sealed:"Sealed",
+smile:"Smile",
+surprised:"Surprised",
+tongue_out:"Tongue out",
+undecided:"Undecided",
+wink:"Wink",
+yell:"Yell"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/dialog.htm	(revision 1)
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#example_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/dialog.js"></script>
+</head>
+<body>
+
+<form onsubmit="ExampleDialog.insert();return false;" action="#">
+	<p>Here is a example dialog.</p>
+	<p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>
+	<p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.PluginManager.requireLangPack('example');tinymce.create('tinymce.plugins.ExamplePlugin',{init:function(ed,url){ed.addCommand('mceExample',function(){ed.windowManager.open({file:url+'/dialog.htm',width:320+parseInt(ed.getLang('example.delta_width',0)),height:120+parseInt(ed.getLang('example.delta_height',0)),inline:1},{plugin_url:url,some_custom_arg:'custom arg'});});ed.addButton('example',{title:'example.desc',cmd:'mceExample',image:url+'/img/example.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('example',n.nodeName=='IMG');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'Example plugin',author:'Some author',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',version:"1.0"};}});tinymce.PluginManager.add('example',tinymce.plugins.ExamplePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,81 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	// Load plugin specific language pack
+	tinymce.PluginManager.requireLangPack('example');
+
+	tinymce.create('tinymce.plugins.ExamplePlugin', {
+		/**
+		 * Initializes the plugin, this will be executed after the plugin has been created.
+		 * This call is done before the editor instance has finished it's initialization so use the onInit event
+		 * of the editor instance to intercept that event.
+		 *
+		 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+		 * @param {string} url Absolute URL to where the plugin is located.
+		 */
+		init : function(ed, url) {
+			// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+			ed.addCommand('mceExample', function() {
+				ed.windowManager.open({
+					file : url + '/dialog.htm',
+					width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
+					height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url, // Plugin absolute URL
+					some_custom_arg : 'custom arg' // Custom argument
+				});
+			});
+
+			// Register example button
+			ed.addButton('example', {
+				title : 'example.desc',
+				cmd : 'mceExample',
+				image : url + '/img/example.gif'
+			});
+
+			// Add a node change handler, selects the button in the UI when a image is selected
+			ed.onNodeChange.add(function(ed, cm, n) {
+				cm.setActive('example', n.nodeName == 'IMG');
+			});
+		},
+
+		/**
+		 * Creates control instances based in the incomming name. This method is normally not
+		 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
+		 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
+		 * method can be used to create those.
+		 *
+		 * @param {String} n Name of the control to create.
+		 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
+		 * @return {tinymce.ui.Control} New control instance or null if no control was created.
+		 */
+		createControl : function(n, cm) {
+			return null;
+		},
+
+		/**
+		 * Returns information about the plugin as a name/value array.
+		 * The current keys are longname, author, authorurl, infourl and version.
+		 *
+		 * @return {Object} Name/value array containing information about the plugin.
+		 */
+		getInfo : function() {
+			return {
+				longname : 'Example plugin',
+				author : 'Some author',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
+				version : "1.0"
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/js/dialog.js	(revision 1)
@@ -0,0 +1,19 @@
+tinyMCEPopup.requireLangPack();
+
+var ExampleDialog = {
+	init : function() {
+		var f = document.forms[0];
+
+		// Get the selected contents as text and place it in the input
+		f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
+		f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
+	},
+
+	insert : function() {
+		// Insert the contents from the input into the document
+		tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
+		tinyMCEPopup.close();
+	}
+};
+
+tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en.js	(revision 1)
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.example',{
+	desc : 'This is just a template button'
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/example/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,3 @@
+tinyMCE.addI18n('en.example_dlg',{
+	title : 'This is just a example title'
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/css/fullpage.css	(revision 1)
@@ -0,0 +1,178 @@
+/* Hide the advanced tab */
+#advanced_tab {
+	display: none;
+}
+
+#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {
+	width: 280px;
+}
+
+#doctype, #docencoding {
+	width: 200px;
+}
+
+#langcode {
+	width: 30px;
+}
+
+#bgimage {
+	width: 220px;	
+}
+
+#fontface {
+	width: 240px;
+}
+
+#leftmargin, #rightmargin, #topmargin, #bottommargin {
+	width: 50px;
+}
+
+.panel_wrapper div.current {
+	height: 400px;
+}
+
+#stylesheet, #style {
+	width: 240px;
+}
+
+/* Head list classes */
+
+.headlistwrapper {
+	width: 100%;
+}
+
+.addbutton, .removebutton, .moveupbutton, .movedownbutton {
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: default;
+	display: block;
+	width: 20px;
+	height: 20px;
+}
+
+.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
+	border: 1px solid #0A246A;
+	background-color: #B6BDD2;
+}
+
+.addbutton {
+	background-image: url('../images/add.gif');
+	float: left;
+	margin-right: 3px;
+}
+
+.removebutton {
+	background-image: url('../images/remove.gif');
+	float: left;
+}
+
+.moveupbutton {
+	background-image: url('../images/move_up.gif');
+	float: left;
+	margin-right: 3px;
+}
+
+.movedownbutton {
+	background-image: url('../images/move_down.gif');
+	float: left;
+}
+
+.selected {
+	border: 1px solid #0A246A;
+	background-color: #B6BDD2;
+}
+
+.toolbar {
+	width: 100%;
+}
+
+#headlist {
+	width: 100%;
+	margin-top: 3px;
+	font-size: 11px;
+}
+
+#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
+	display: none;
+}
+
+#addmenu {
+	position: absolute;
+	border: 1px solid gray;
+	display: none;
+	z-index: 100;
+	background-color: white;
+}
+
+#addmenu a {
+	display: block;
+	width: 100%;
+	line-height: 20px;
+	text-decoration: none;
+	background-color: white;
+}
+
+#addmenu a:hover {
+	background-color: #B6BDD2;
+	color: black;
+}
+
+#addmenu span {
+	padding-left: 10px;
+	padding-right: 10px;
+}
+
+#updateElementPanel {
+	display: none;
+}
+
+#script_element .panel_wrapper div.current {
+	height: 108px;
+}
+
+#style_element .panel_wrapper div.current {
+	height: 108px;
+}
+
+#link_element  .panel_wrapper div.current {
+	height: 140px;
+}
+
+#element_script_value {
+	width: 100%;
+	height: 100px;
+}
+
+#element_comment_value {
+	width: 100%;
+	height: 120px;
+}
+
+#element_style_value {
+	width: 100%;
+	height: 100px;
+}
+
+#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
+	width: 250px;
+}
+
+.updateElementButton {
+	margin-top: 3px;
+}
+
+/* MSIE specific styles */
+
+* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
+	width: 22px;
+	height: 22px;
+}
+
+textarea {
+	height: 55px;
+}
+
+.panel_wrapper div.current {height:420px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onGetContent.add(t._getContent,t);},getInfo:function(){return{longname:'Fullpage',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content;sp=c.indexOf('<body');if(sp==-1)sp=c.indexOf('<BODY');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);}else{t.head='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';t.head+='\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,88 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.FullPagePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceFullPageProperties', function() {
+				ed.windowManager.open({
+					file : url + '/fullpage.htm',
+					width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
+					height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url,
+					head_html : t.head
+				});
+			});
+
+			// Register buttons
+			ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
+
+			ed.onBeforeSetContent.add(t._setContent, t);
+			ed.onGetContent.add(t._getContent, t);
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Fullpage',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private plugin internal methods
+
+		_createSerializer : function() {
+			return new tinymce.dom.Serializer({
+				dom : this.editor.dom,
+				apply_source_formatting : true
+			});
+		},
+
+		_setContent : function(ed, o) {
+			var t = this, sp, ep, c = o.content;
+
+			// Parse out head, body and footer
+			sp = c.indexOf('<body');
+			if (sp == -1)
+				sp = c.indexOf('<BODY');
+
+			if (sp != -1) {
+				sp = c.indexOf('>', sp);
+				t.head = c.substring(0, sp + 1);
+
+				ep = c.indexOf('</body', sp);
+				if (ep == -1)
+					ep = c.indexOf('</body', ep);
+
+				o.content = c.substring(sp + 1, ep);
+				t.foot = c.substring(ep);
+			} else {
+				t.head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+				t.head += '\n<html>\n<head>\n<title>Untitled document</title>\n</head>\n<body>\n';
+				t.foot = '\n</body>\n</html>';
+			}
+		},
+
+		_getContent : function(ed, o) {
+			var t = this;
+
+			o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/fullpage.htm	(revision 1)
@@ -0,0 +1,577 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#fullpage_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/fullpage.js"></script>
+	<link href="css/fullpage.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="advlink" style="display: none">
+    <form onsubmit="updateAction();return false;" name="fullpage" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>
+				<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="meta_panel" class="panel current">
+				<fieldset>
+					<legend>{#fullpage_dlg.meta_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td nowrap="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>
+							<td><input type="text" id="metatitle" name="metatitle" value="" /></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>
+							<td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>
+							<td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>
+							<td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>
+							<td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>
+							<td>
+								<select id="metarobots" name="metarobots">
+											<option value="">{#not_set}</option> 
+											<option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
+											<option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
+											<option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
+											<option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
+								</select>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.langprops}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> 
+							<td>
+								<select id="docencoding" name="docencoding"> 
+										<option value="">{#not_set}</option>
+								</select>
+							</td> 
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
+							<td>
+								<select id="doctypes" name="doctypes">
+										<option value="">{#not_set}</option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>
+							<td><input type="text" id="langcode" name="langcode" value="" /></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> 
+							<td>
+								<select id="langdir" name="langdir"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#fullpage_dlg.ltr}</option> 
+										<option value="rtl">{#fullpage_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+						<tr>
+							<td nowrap="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>
+							<td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="appearance_panel" class="panel">
+				<fieldset>
+					<legend>{#fullpage_dlg.appearance_textprops}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> 
+							<td>
+								<select id="fontface" name="fontface" onchange="changedStyleField(this);">
+										<option value="">{#not_set}</option>
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> 
+							<td>
+								<select id="fontsize" name="fontsize" onchange="changedStyleField(this);">
+										<option value="">{#not_set}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>
+										<td id="textcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.appearance_bgprops}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>
+										<td id="bgimage_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.appearance_marginprops}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> 
+							<td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
+							<td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> 
+							<td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> 
+							<td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
+							<td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> 
+							<td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.appearance_linkprops}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>
+										<td id="link_color_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+
+							<td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>
+										<td id="visited_color_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>
+										<td id="active_color_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+
+							<td>&nbsp;</td>
+							<td>&nbsp;</td>
+
+<!--							<td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>
+										<td id="hover_color_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> -->
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.appearance_style}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> 
+							<td><table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
+										<td id="stylesheet_browsercontainer">&nbsp;</td>
+									</tr>
+								</table></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> 
+							<td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<div id="addmenu">
+					<table border="0" cellpadding="0" cellspacing="0">
+						<tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>
+						<tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>
+					</table>
+				</div>
+
+				<fieldset>
+					<legend>{#fullpage_dlg.head_elements}</legend>
+
+					<div class="headlistwrapper">
+						<div class="toolbar">
+							<div style="float: left">
+								<a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>
+								<a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>
+							</div>
+							<div style="float: right">
+								<a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>
+								<a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>
+							</div>
+							<br style="clear: both" />
+						</div>
+						<select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">
+							<option value="title_0">&lt;title&gt;Some title bla bla bla&lt;/title&gt;</option>
+							<option value="meta_1">&lt;meta name="keywords"&gt;Some bla bla bla&lt;/meta&gt;</option>
+							<option value="meta_2">&lt;meta name="description"&gt;Some bla bla bla bla bla bla bla bla bla&lt;/meta&gt;</option>
+							<option value="script_3">&lt;script language=&quot;javascript&quot;&gt;...&lt;/script&gt;</option>
+							<option value="style_4">&lt;style&gt;...&lt;/style&gt;</option>
+							<option value="base_5">&lt;base href="." /&gt;</option>
+							<option value="comment_6">&lt;!-- ... --&gt;</option>
+							<option value="link_7">&lt;link href="." /&gt;</option>
+						</select>
+					</div>
+				</fieldset>
+
+				<fieldset id="meta_element">
+					<legend>{#fullpage_dlg.meta_element}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td> 
+							<td><select id="element_meta_type">
+										<option value="name">name</option>
+										<option value="http-equiv">http-equiv</option>
+								</select></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td> 
+							<td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td> 
+							<td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>
+						</tr>
+					</table>
+
+					<input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="title_element">
+					<legend>{#fullpage_dlg.title_element}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td> 
+							<td><input id="element_title" name="element_title" type="text" value="" /></td>
+						</tr>
+					</table>
+
+					<input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="script_element">
+					<legend>{#fullpage_dlg.script_element}</legend>
+
+					<div class="tabs">
+						<ul>
+							<li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
+							<li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
+						</ul>
+					</div>
+
+					<br style="clear: both" />
+
+					<div class="panel_wrapper">
+						<div id="script_props_panel" class="panel current">
+							<table border="0" cellpadding="4" cellspacing="0">
+								<tr>
+									<td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td> 
+									<td><select id="element_script_type">
+										<option value="text/javascript">text/javascript</option>
+										<option value="text/jscript">text/jscript</option>
+										<option value="text/vbscript">text/vbscript</option>
+										<option value="text/vbs">text/vbs</option>
+										<option value="text/ecmascript">text/ecmascript</option>
+										<option value="text/xml">text/xml</option>
+									</select></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td> 
+									<td><table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>
+										<td id="script_src_pickcontainer">&nbsp;</td>
+									</tr>
+								</table></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td> 
+									<td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td> 
+									<td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>
+								</tr>
+							</table>
+						</div>
+
+						<div id="script_value_panel" class="panel">
+							<textarea id="element_script_value"></textarea>
+						</div>
+					</div>
+
+					<input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="style_element">
+					<legend>{#fullpage_dlg.style_element}</legend>
+
+					<div class="tabs">
+						<ul>
+							<li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
+							<li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
+						</ul>
+					</div>
+
+					<br style="clear: both" />
+
+					<div class="panel_wrapper">
+						<div id="style_props_panel" class="panel current">
+							<table border="0" cellpadding="4" cellspacing="0">
+								<tr>
+									<td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td> 
+									<td><select id="element_style_type">
+										<option value="text/css">text/css</option>
+									</select></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td> 
+									<td><select id="element_style_media"></select></td>
+								</tr>
+							</table>
+						</div>
+
+						<div id="style_value_panel" class="panel">
+							<textarea id="element_style_value"></textarea>
+						</div>
+					</div>
+
+					<input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="base_element">
+					<legend>{#fullpage_dlg.base_element}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td> 
+							<td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>
+						</tr>
+						<tr>
+							<td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td> 
+							<td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>
+						</tr>
+					</table>
+
+					<input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="link_element">
+					<legend>{#fullpage_dlg.link_element}</legend>
+
+					<div class="tabs">
+						<ul>
+							<li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>
+							<li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>
+						</ul>
+					</div>
+
+					<br style="clear: both" />
+
+					<div class="panel_wrapper">
+						<div id="link_general_panel" class="panel current">
+							<table border="0" cellpadding="4" cellspacing="0">
+								<tr>
+									<td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td> 
+									<td><table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>
+										<td id="link_href_pickcontainer">&nbsp;</td>
+									</tr>
+								</table></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td> 
+									<td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td> 
+									<td><select id="element_link_type" name="element_link_type">
+										<option value="text/css">text/css</option>
+										<option value="text/javascript">text/javascript</option>
+									</select></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td> 
+									<td><select id="element_link_media" name="element_link_media"></select></td>
+								</tr>
+								<tr>
+									<td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>
+									<td><select id="element_style_rel" name="element_style_rel"> 
+											<option value="">{#not_set}</option> 
+											<option value="stylesheet">Stylesheet</option>
+											<option value="alternate">Alternate</option>
+											<option value="designates">Designates</option>
+											<option value="start">Start</option>
+											<option value="next">Next</option>
+											<option value="prev">Prev</option>
+											<option value="contents">Contents</option>
+											<option value="index">Index</option>
+											<option value="glossary">Glossary</option>
+											<option value="copyright">Copyright</option>
+											<option value="chapter">Chapter</option>
+											<option value="subsection">Subsection</option>
+											<option value="appendix">Appendix</option>
+											<option value="help">Help</option>
+											<option value="bookmark">Bookmark</option>
+										</select> 
+									</td>
+								</tr>
+							</table>
+						</div>
+
+						<div id="link_advanced_panel" class="panel">
+							<table border="0" cellpadding="4" cellspacing="0">
+								<tr>
+									<td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td> 
+									<td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td> 
+									<td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>
+								</tr>
+								<tr>
+									<td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td> 
+									<td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>
+								</tr>
+								<tr>
+									<td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>
+									<td><select id="element_style_rev" name="element_style_rev"> 
+											<option value="">{#not_set}</option> 
+											<option value="alternate">Alternate</option> 
+											<option value="designates">Designates</option> 
+											<option value="stylesheet">Stylesheet</option> 
+											<option value="start">Start</option> 
+											<option value="next">Next</option> 
+											<option value="prev">Prev</option> 
+											<option value="contents">Contents</option> 
+											<option value="index">Index</option> 
+											<option value="glossary">Glossary</option> 
+											<option value="copyright">Copyright</option> 
+											<option value="chapter">Chapter</option> 
+											<option value="subsection">Subsection</option> 
+											<option value="appendix">Appendix</option> 
+											<option value="help">Help</option> 
+											<option value="bookmark">Bookmark</option> 
+										</select> 
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+
+					<input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+
+				<fieldset id="comment_element">
+					<legend>{#fullpage_dlg.comment_element}</legend>
+
+					<textarea id="element_comment_value"></textarea>
+
+					<input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="update" value="{#update}" onclick="updateAction();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+    </form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/js/fullpage.js	(revision 1)
@@ -0,0 +1,461 @@
+tinyMCEPopup.requireLangPack();
+
+var doc;
+
+var defaultDocTypes = 
+	'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
+	'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
+	'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
+	'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
+	'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
+	'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
+	'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
+
+var defaultEncodings = 
+	'Western european (iso-8859-1)=iso-8859-1,' +
+	'Central European (iso-8859-2)=iso-8859-2,' +
+	'Unicode (UTF-8)=utf-8,' +
+	'Chinese traditional (Big5)=big5,' +
+	'Cyrillic (iso-8859-5)=iso-8859-5,' +
+	'Japanese (iso-2022-jp)=iso-2022-jp,' +
+	'Greek (iso-8859-7)=iso-8859-7,' +
+	'Korean (iso-2022-kr)=iso-2022-kr,' +
+	'ASCII (us-ascii)=us-ascii';
+
+var defaultMediaTypes = 
+	'all=all,' +
+	'screen=screen,' +
+	'print=print,' +
+	'tty=tty,' +
+	'tv=tv,' +
+	'projection=projection,' +
+	'handheld=handheld,' +
+	'braille=braille,' +
+	'aural=aural';
+
+var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
+var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
+
+function init() {
+	var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;
+
+	// Setup doctype select box
+	doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');
+	for (i=0; i<doctypes.length; i++) {
+		p = doctypes[i].split('=');
+
+		if (p.length > 1)
+			addSelectValue(f, 'doctypes', p[0], p[1]);
+	}
+
+	// Setup fonts select box
+	fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');
+	for (i=0; i<fonts.length; i++) {
+		p = fonts[i].split('=');
+
+		if (p.length > 1)
+			addSelectValue(f, 'fontface', p[0], p[1]);
+	}
+
+	// Setup fontsize select box
+	fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
+	for (i=0; i<fonts.length; i++)
+		addSelectValue(f, 'fontsize', fonts[i], fonts[i]);
+
+	// Setup mediatype select boxs
+	mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');
+	for (i=0; i<mediaTypes.length; i++) {
+		p = mediaTypes[i].split('=');
+
+		if (p.length > 1) {
+			addSelectValue(f, 'element_style_media', p[0], p[1]);
+			addSelectValue(f, 'element_link_media', p[0], p[1]);
+		}
+	}
+
+	// Setup encodings select box
+	encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');
+	for (i=0; i<encodings.length; i++) {
+		p = encodings[i].split('=');
+
+		if (p.length > 1) {
+			addSelectValue(f, 'docencoding', p[0], p[1]);
+			addSelectValue(f, 'element_script_charset', p[0], p[1]);
+			addSelectValue(f, 'element_link_charset', p[0], p[1]);
+		}
+	}
+
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+	document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
+	//document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');
+	document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
+	document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
+	document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
+	document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
+	document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');
+	document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');
+	document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
+
+	// Resize some elements
+	if (isVisible('stylesheetbrowser'))
+		document.getElementById('stylesheet').style.width = '220px';
+
+	if (isVisible('link_href_browser'))
+		document.getElementById('element_link_href').style.width = '230px';
+
+	if (isVisible('bgimage_browser'))
+		document.getElementById('bgimage').style.width = '210px';
+
+	// Add iframe
+	dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});
+	doc = dom.get('documentIframe').contentWindow.document;
+	h = tinyMCEPopup.getWindowArg('head_html');
+
+	// Preprocess the HTML disable scripts and urls
+	h = h.replace(/<script>/gi, '<script type="text/javascript">');
+	h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
+	h = h.replace(/(src=|href=)/g, 'mce_$1');
+
+	// Write in the content in the iframe
+	doc.write(h + '</body></html>');
+	doc.close();
+
+	// Parse xml and doctype
+	xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
+	xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
+	docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
+	f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
+
+	// Parse title
+	if (e = doc.getElementsByTagName('title')[0])
+		el.metatitle.value = e.textContent || e.text;
+
+	// Parse meta
+	tinymce.each(doc.getElementsByTagName('meta'), function(n) {
+		var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';
+
+		e = el['meta' + na];
+
+		if (na == 'robots') {
+			selectByValue(f, 'metarobots', tinymce.trim(va), true, true);
+			return;
+		}
+
+		switch (eq.toLowerCase()) {
+			case "content-type":
+				tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, value, 1);
+
+				// Override XML encoding
+				if (tmp != "")
+					xmlEnc = tmp;
+
+				return;
+		}
+
+		if (e)
+			e.value = va;
+	});
+
+	selectByValue(f, 'doctypes', docType, true, true);
+	selectByValue(f, 'docencoding', xmlEnc, true, true);
+	selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);
+
+	if (xmlVer != '')
+		el.xml_pi.checked = true;
+
+	// Parse appearance
+
+	// Parse primary stylesheet
+	tinymce.each(doc.getElementsByTagName("link"), function(l) {
+		var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
+
+		if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
+			f.stylesheet.value = l.getAttribute('mce_href', 2) || '';
+			return false;
+		}
+	});
+
+	// Get from style elements
+	tinymce.each(doc.getElementsByTagName("style"), function(st) {
+		var tmp = parseStyleElement(st);
+
+		for (x=0; x<tmp.length; x++) {
+			if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])
+				f.visited_color.value = tmp[x].data['color'];
+
+			if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])
+				f.link_color.value = tmp[x].data['color'];
+
+			if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])
+				f.active_color.value = tmp[x].data['color'];
+		}
+	});
+
+	f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");
+	f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");
+	f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");
+	f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");
+	f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");
+	f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");
+
+	// Get from style info
+	style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));
+
+	if (style['font-family'])
+		selectByValue(f, 'fontface', style['font-family'], true, true);
+	else
+		selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);
+
+	if (style['font-size'])
+		selectByValue(f, 'fontsize', style['font-size'], true, true);
+	else
+		selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);
+
+	if (style['color'])
+		f.textcolor.value = convertRGBToHex(style['color']);
+
+	if (style['background-image'])
+		f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+	if (style['background-color'])
+		f.bgcolor.value = style['background-color'];
+
+	if (style['margin']) {
+		tmp = style['margin'].replace(/[^0-9 ]/g, '');
+		tmp = tmp.split(/ +/);
+		f.topmargin.value = tmp.length > 0 ? tmp[0] : '';
+		f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];
+		f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];
+		f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];
+	}
+
+	if (style['margin-left'])
+		f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');
+
+	if (style['margin-right'])
+		f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');
+
+	if (style['margin-top'])
+		f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');
+
+	if (style['margin-bottom'])
+		f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');
+
+	f.style.value = tinyMCEPopup.dom.serializeStyle(style);
+
+	// Update colors
+	updateColor('textcolor_pick', 'textcolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+	updateColor('visited_color_pick', 'visited_color');
+	updateColor('active_color_pick', 'active_color');
+	updateColor('link_color_pick', 'link_color');
+}
+
+function getReItem(r, s, i) {
+	var c = r.exec(s);
+
+	if (c && c.length > i)
+		return c[i];
+
+	return '';
+}
+
+function updateAction() {
+	var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;
+
+	head = doc.getElementsByTagName('head')[0];
+
+	// Fix scripts without a type
+	nl = doc.getElementsByTagName('script');
+	for (i=0; i<nl.length; i++) {
+		if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')
+			nl[i].setAttribute('mce_type', 'text/javascript');
+	}
+
+	// Get primary stylesheet
+	nl = doc.getElementsByTagName("link");
+	for (i=0; i<nl.length; i++) {
+		l = nl[i];
+
+		tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
+
+		if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
+			addlink = false;
+
+			if (f.stylesheet.value == '')
+				l.parentNode.removeChild(l);
+			else
+				l.setAttribute('mce_href', f.stylesheet.value);
+
+			break;
+		}
+	}
+
+	// Add new link
+	if (f.stylesheet.value != '') {
+		l = doc.createElement('link');
+
+		l.setAttribute('type', 'text/css');
+		l.setAttribute('mce_href', f.stylesheet.value);
+		l.setAttribute('rel', 'stylesheet');
+
+		head.appendChild(l);
+	}
+
+	setMeta(head, 'keywords', f.metakeywords.value);
+	setMeta(head, 'description', f.metadescription.value);
+	setMeta(head, 'author', f.metaauthor.value);
+	setMeta(head, 'copyright', f.metacopyright.value);
+	setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
+	setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
+
+	doc.body.dir = getSelectValue(f, 'langdir');
+	doc.body.style.cssText = f.style.value;
+
+	doc.body.setAttribute('vLink', f.visited_color.value);
+	doc.body.setAttribute('link', f.link_color.value);
+	doc.body.setAttribute('text', f.textcolor.value);
+	doc.body.setAttribute('aLink', f.active_color.value);
+
+	doc.body.style.fontFamily = getSelectValue(f, 'fontface');
+	doc.body.style.fontSize = getSelectValue(f, 'fontsize');
+	doc.body.style.backgroundColor = f.bgcolor.value;
+
+	if (f.leftmargin.value != '')
+		doc.body.style.marginLeft = f.leftmargin.value + 'px';
+
+	if (f.rightmargin.value != '')
+		doc.body.style.marginRight = f.rightmargin.value + 'px';
+
+	if (f.bottommargin.value != '')
+		doc.body.style.marginBottom = f.bottommargin.value + 'px';
+
+	if (f.topmargin.value != '')
+		doc.body.style.marginTop = f.topmargin.value + 'px';
+
+	html = doc.getElementsByTagName('html')[0];
+	html.setAttribute('lang', f.langcode.value);
+	html.setAttribute('xml:lang', f.langcode.value);
+
+	if (f.bgimage.value != '')
+		doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
+	else
+		doc.body.style.backgroundImage = '';
+
+	ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();
+	ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');
+
+	h = ser.serialize(doc.documentElement);
+	h = h.substring(0, h.lastIndexOf('</body>'));
+
+	if (h.indexOf('<title>') == -1)
+		h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
+	else
+		h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
+
+	if ((v = getSelectValue(f, 'doctypes')) != '')
+		h = v + '\n' + h;
+
+	if (f.xml_pi.checked) {
+		s = '<?xml version="1.0"';
+
+		if ((v = getSelectValue(f, 'docencoding')) != '')
+			s += ' encoding="' + v + '"';
+
+		s += '?>\n';
+		h = s + h;
+	}
+
+	h = h.replace(/type=\"\-mce\-/gi, 'type="');
+
+	tinyMCEPopup.editor.plugins.fullpage.head = h;
+	tinyMCEPopup.close();
+}
+
+function changedStyleField(field) {
+	//alert(field.id);
+}
+
+function setMeta(he, k, v) {
+	var nl, i, m;
+
+	nl = he.getElementsByTagName('meta');
+	for (i=0; i<nl.length; i++) {
+		if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {
+			if (v == '')
+				nl[i].parentNode.removeChild(nl[i]);
+			else
+				nl[i].setAttribute('content', "text/html; charset=" + v);
+
+			return;
+		}
+
+		if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {
+			if (v == '')
+				nl[i].parentNode.removeChild(nl[i]);
+			else
+				nl[i].setAttribute('content', v);
+			return;
+		}
+	}
+
+	if (v == '')
+		return;
+
+	m = doc.createElement('meta');
+
+	if (k == 'Content-Type')
+		m.httpEquiv = k;
+	else
+		m.setAttribute('name', k);
+
+	m.setAttribute('content', v);
+	he.appendChild(m);
+}
+
+function parseStyleElement(e) {
+	var v = e.innerHTML;
+	var p, i, r;
+
+	v = v.replace(/<!--/gi, '');
+	v = v.replace(/-->/gi, '');
+	v = v.replace(/[\n\r]/gi, '');
+	v = v.replace(/\s+/gi, ' ');
+
+	r = [];
+	p = v.split(/{|}/);
+
+	for (i=0; i<p.length; i+=2) {
+		if (p[i] != "")
+			r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};
+	}
+
+	return r;
+}
+
+function serializeStyleElement(d) {
+	var i, s, st;
+
+	s = '<!--\n';
+
+	for (i=0; i<d.length; i++) {
+		s += d[i].rule + ' {\n';
+
+		st = tinyMCE.serializeStyle(d[i].data);
+
+		if (st != '')
+			st += ';';
+
+		s += st.replace(/;/g, ';\n');
+		s += '}\n';
+
+		if (i != d.length - 1)
+			s += '\n';
+	}
+
+	s += '\n-->';
+
+	return s;
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullpage/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,85 @@
+tinyMCE.addI18n('en.fullpage_dlg',{
+title:"Document properties",
+meta_tab:"General",
+appearance_tab:"Appearance",
+advanced_tab:"Advanced",
+meta_props:"Meta information",
+langprops:"Language and encoding",
+meta_title:"Title",
+meta_keywords:"Keywords",
+meta_description:"Description",
+meta_robots:"Robots",
+doctypes:"Doctype",
+langcode:"Language code",
+langdir:"Language direction",
+ltr:"Left to right",
+rtl:"Right to left",
+xml_pi:"XML declaration",
+encoding:"Character encoding",
+appearance_bgprops:"Background properties",
+appearance_marginprops:"Body margins",
+appearance_linkprops:"Link colors",
+appearance_textprops:"Text properties",
+bgcolor:"Background color",
+bgimage:"Background image",
+left_margin:"Left margin",
+right_margin:"Right margin",
+top_margin:"Top margin",
+bottom_margin:"Bottom margin",
+text_color:"Text color",
+font_size:"Font size",
+font_face:"Font face",
+link_color:"Link color",
+hover_color:"Hover color",
+visited_color:"Visited color",
+active_color:"Active color",
+textcolor:"Color",
+fontsize:"Font size",
+fontface:"Font family",
+meta_index_follow:"Index and follow the links",
+meta_index_nofollow:"Index and don't follow the links",
+meta_noindex_follow:"Do not index but follow the links",
+meta_noindex_nofollow:"Do not index and don\'t follow the links",
+appearance_style:"Stylesheet and style properties",
+stylesheet:"Stylesheet",
+style:"Style",
+author:"Author",
+copyright:"Copyright",
+add:"Add new element",
+remove:"Remove selected element",
+moveup:"Move selected element up",
+movedown:"Move selected element down",
+head_elements:"Head elements",
+info:"Information",
+add_title:"Title element",
+add_meta:"Meta element",
+add_script:"Script element",
+add_style:"Style element",
+add_link:"Link element",
+add_base:"Base element",
+add_comment:"Comment node",
+title_element:"Title element",
+script_element:"Script element",
+style_element:"Style element",
+base_element:"Base element",
+link_element:"Link element",
+meta_element:"Meta element",
+comment_element:"Comment",
+src:"Src",
+language:"Language",
+href:"Href",
+target:"Target",
+type:"Type",
+charset:"Charset",
+defer:"Defer",
+media:"Media",
+properties:"Properties",
+name:"Name",
+value:"Value",
+content:"Content",
+rel:"Rel",
+rev:"Rev",
+hreflang:"Href lang",
+general_props:"General",
+advanced_props:"Advanced"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent({format:'raw',no_events:1}),{format:'raw',no_events:1});});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,127 @@
+/**
+ * $Id: editor_plugin_src.js 544 2008-01-17 13:07:00Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var DOM = tinymce.DOM;
+
+	tinymce.create('tinymce.plugins.FullScreenPlugin', {
+		init : function(ed, url) {
+			var t = this, s = {}, vp;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceFullScreen', function() {
+				var win, de = document.documentElement;
+
+				if (ed.getParam('fullscreen_is_enabled')) {
+					if (ed.getParam('fullscreen_new_window'))
+						closeFullscreen(); // Call to close in new window
+					else {
+						window.setTimeout(function() {
+							tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
+							tinyMCE.remove(ed);
+							DOM.remove('mce_fullscreen_container');
+							de.style.overflow = ed.getParam('fullscreen_html_overflow');
+							DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow'));
+							window.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
+						}, 10);
+					}
+
+					return;
+				}
+
+				if (ed.getParam('fullscreen_new_window')) {
+					win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+					try {
+						win.resizeTo(screen.availWidth, screen.availHeight);
+					} catch (e) {
+						// Ignore
+					}
+				} else {
+					s.fullscreen_overflow = DOM.getStyle(document.body, 'overflow', 1) || 'auto';
+					s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
+					vp = DOM.getViewPort();
+					s.fullscreen_scrollx = vp.x;
+					s.fullscreen_scrolly = vp.y;
+
+					// Fixes an Opera bug where the scrollbars doesn't reappear
+					if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
+						s.fullscreen_overflow = 'auto';
+
+					// Fixes an IE bug where horizontal scrollbars would appear
+					if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
+						s.fullscreen_overflow = 'auto';
+
+					if (s.fullscreen_overflow == '0px')
+						s.fullscreen_overflow = '';
+
+					DOM.setStyle(document.body, 'overflow', 'hidden');
+					de.style.overflow = 'hidden'; //Fix for IE6/7
+					vp = DOM.getViewPort();
+					window.scrollTo(0, 0);
+
+					if (tinymce.isIE)
+						vp.h -= 1;
+
+					n = DOM.add(document.body, 'div', {id : 'mce_fullscreen_container', style : 'position:absolute;top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:150;'});
+					DOM.add(n, 'div', {id : 'mce_fullscreen'});
+
+					tinymce.each(ed.settings, function(v, n) {
+						s[n] = v;
+					});
+
+					s.id = 'mce_fullscreen';
+					s.width = n.clientWidth;
+					s.height = n.clientHeight - 15;
+					s.fullscreen_is_enabled = true;
+					s.fullscreen_editor_id = ed.id;
+					s.theme_advanced_resizing = false;
+
+					tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
+						s[k] = v;
+					});
+
+					if (s.theme_advanced_toolbar_location === 'external')
+						s.theme_advanced_toolbar_location = 'top';
+
+					t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
+					t.fullscreenEditor.onInit.add(function() {
+						t.fullscreenEditor.setContent(ed.getContent({format : 'raw', no_events : 1}), {format : 'raw', no_events : 1});
+					});
+
+					t.fullscreenEditor.render();
+					tinyMCE.add(t.fullscreenEditor);
+
+					t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
+					t.fullscreenElement.update();
+					//document.body.overflow = 'hidden';
+				}
+			});
+
+			// Register buttons
+			ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
+
+			ed.onNodeChange.add(function(ed, cm) {
+				cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Fullscreen',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm	(revision 1)
@@ -0,0 +1,90 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title></title>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript" src="../../tiny_mce.js"></script>
+	<script type="text/javascript">
+		function patchCallback(settings, key) {
+			if (settings[key])
+				settings[key] = "window.opener." + settings[key];
+		}
+
+		var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings;
+
+		// Clone array
+		for (var n in paSe)
+			settings[n] = paSe[n];
+
+		// Override options for fullscreen
+		for (var n in paSe.fullscreen_settings)
+			settings[n] = paSe.fullscreen_settings[n];
+
+		// Patch callbacks, make them point to window.opener
+		patchCallback(settings, 'urlconverter_callback');
+		patchCallback(settings, 'insertlink_callback');
+		patchCallback(settings, 'insertimage_callback');
+		patchCallback(settings, 'setupcontent_callback');
+		patchCallback(settings, 'save_callback');
+		patchCallback(settings, 'onchange_callback');
+		patchCallback(settings, 'init_instance_callback');
+		patchCallback(settings, 'file_browser_callback');
+		patchCallback(settings, 'cleanup_callback');
+		patchCallback(settings, 'execcommand_callback');
+		patchCallback(settings, 'oninit');
+
+		// Set options
+		delete settings.id;
+		settings['mode'] = 'exact';
+		settings['elements'] = 'fullscreenarea';
+		settings['add_unload_trigger'] = false;
+		settings['ask'] = false;
+		settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
+		settings['fullscreen_is_enabled'] = true;
+		settings['fullscreen_editor_id'] = window.opener.tinyMCE.activeEditor.id;
+		settings['theme_advanced_resizing'] = false;
+
+		function unloadHandler(e) {
+			moveContent();
+		}
+
+		function moveContent() {
+			window.opener.tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent({format : 'raw'}));
+		}
+
+		function closeFullscreen() {
+			moveContent();
+			window.close();
+		}
+
+		// Add onunload
+		tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
+
+		function doParentSubmit() {
+			moveContent();
+
+			if (window.opener.tinyMCE.selectedInstance.formElement.form)
+				window.opener.tinyMCE.selectedInstance.formElement.form.submit();
+
+			window.close();
+
+			return false;
+		}
+	</script>
+	<base target="_self" />
+</head>
+<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
+<form onsubmit="doParentSubmit();">
+<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
+</form>
+
+<script type="text/javascript">
+		var e = document.getElementById('fullscreenarea');
+		e.value = window.opener.tinyMCE.activeEditor.getContent({format : 'raw'});
+		settings['width'] = window.innerWidth || document.body.clientWidth;
+		settings['height'] = (window.innerHeight || document.body.clientHeight) - 18;
+		tinyMCE.init(settings);
+</script>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.IESpell',{init:function(ed,url){var t=this,sp;if(!tinymce.isIE)return;t.editor=ed;ed.addCommand('mceIESpell',function(){try{sp=new ActiveXObject("ieSpell.ieSpellExtension");sp.CheckDocumentNode(ed.getDoc().documentElement);}catch(e){if(e.number==-2146827859){ed.windowManager.confirm(ed.getLang("iespell.download"),function(s){if(s)window.open('http://www.iespell.com/download.php','ieSpellDownload','');});}else ed.windowManager.alert("Error Loading ieSpell: Exception "+e.number);}});ed.addButton('iespell',{title:'iespell.iespell_desc',cmd:'mceIESpell'});},getInfo:function(){return{longname:'IESpell (IE Only)',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('iespell',tinymce.plugins.IESpell);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,51 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.IESpell', {
+		init : function(ed, url) {
+			var t = this, sp;
+
+			if (!tinymce.isIE)
+				return;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceIESpell', function() {
+				try {
+					sp = new ActiveXObject("ieSpell.ieSpellExtension");
+					sp.CheckDocumentNode(ed.getDoc().documentElement);
+				} catch (e) {
+					if (e.number == -2146827859) {
+						ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
+							if (s)
+								window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
+						});
+					} else
+						ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
+				}
+			});
+
+			// Register buttons
+			ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'IESpell (IE Only)',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=1000;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' modal '+f.type;f.resizable=false;}if(f.statusbar)opt+=' statusbar';if(f.resizable)opt+=' resizable';if(f.minimizable)opt+=' minimizable';if(f.maximizable)opt+=' maximizable';if(f.movable)opt+=' movable';t._addAll(document.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'wrapper'+opt},['div',{id:id+'_top','class':'top'},['div',{'class':'left'}],['div',{'class':'center'}],['div',{'class':'right'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'middle'},['div',{id:id+'_left','class':'left'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'right'}]],['div',{id:id+'_bottom','class':'bottom'},['div',{'class':'left'}],['div',{'class':'center'}],['div',{'class':'right'}],['span',{id:id+'_status'},'Content']],['a',{'class':'move',href:'javascript:;'}],['a',{'class':'min',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'max',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'med',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'close',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'resize resize-n',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'resize resize-s',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'resize resize-w',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'resize resize-e',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'resize resize-nw',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'resize resize-ne',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'resize resize-sw',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'resize resize-se',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',f.url||f.file);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'button ok',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'button cancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'icon'});DOM.setHTML(id+'_content',f.content.replace('\n','<br />'));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='max'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','maximized');}else if(n.className=='med'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','maximized');}else if(n.className=='move')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'resize'))return t._startDrag(id,e,n.className.substring(7));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'close':t.close(null,id);return Event.cancel(e);case'button ok':case'button cancel':f.button_func(n.className=='button ok');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});t.focus(id);t._fixIELayout(id,1);return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'focus');DOM.addClass(id,'focus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;i<ne.length;i++)t._addAll(te,ne[i]);}},_startDrag:function(id,se,ac){var t=this,mu,mm,d=document,eb,w=t.windows[id],we=w.element,sp=we.getXY(),p,sz,ph,cp,vp,sx,sy,sex,sey,dx,dy,dw,dh;cp={x:0,y:0};vp=DOM.getViewPort();vp.w-=2;vp.h-=2;sex=se.screenX;sey=se.screenY;dx=dy=dw=dh=0;mu=Event.add(d,'mouseup',function(e){Event.remove(d,'mouseup',mu);Event.remove(d,'mousemove',mm);if(eb)eb.remove();we.moveBy(dx,dy);we.resizeBy(dw,dh);sz=we.getSize();DOM.setStyles(id+'_ifr',{width:sz.w-w.deltaWidth,height:sz.h-w.deltaHeight});t._fixIELayout(id,1);return Event.cancel(e);});if(ac!='move')startMove();function startMove(){if(eb)return;t._fixIELayout(id,0);DOM.add(d.body,'div',{id:'mceEventBlocker','class':'mceEventBlocker '+(t.editor.settings.inlinepopups_skin||'clearlooks2'),style:{left:vp.x,top:vp.y,width:vp.w-20,height:vp.h-20,zIndex:20001}});eb=new Element('mceEventBlocker');eb.update();p=we.getXY();sz=we.getSize();sx=cp.x+p.x-vp.x;sy=cp.y+p.y-vp.y;DOM.add(eb.get(),'div',{id:'mcePlaceHolder','class':'placeholder',style:{left:sx,top:sy,width:sz.w,height:sz.h}});ph=new Element('mcePlaceHolder');};mm=Event.add(d,'mousemove',function(e){var x,y,v;startMove();x=e.screenX-sex;y=e.screenY-sey;switch(ac){case'resize-w':dx=x;dw=0-x;break;case'resize-e':dw=x;break;case'resize-n':case'resize-nw':case'resize-ne':if(ac=="resize-nw"){dx=x;dw=0-x;}else if(ac=="resize-ne")dw=x;dy=y;dh=0-y;break;case'resize-s':case'resize-sw':case'resize-se':if(ac=="resize-sw"){dx=x;dw=0-x;}else if(ac=="resize-se")dw=x;dh=y;break;case'move':dx=x;dy=y;break;}if(dw<(v=w.features.min_width-sz.w)){if(dx!==0)dx+=dw-v;dw=v;}if(dh<(v=w.features.min_height-sz.h)){if(dy!==0)dy+=dh-v;dh=v;}dw=Math.min(dw,w.features.max_width-sz.w);dh=Math.min(dh,w.features.max_height-sz.h);dx=Math.max(dx,vp.x-(sx+vp.x));dy=Math.max(dy,vp.y-(sy+vp.y));dx=Math.min(dx,(vp.w+vp.x)-(sx+sz.w+vp.x));dy=Math.min(dy,(vp.h+vp.y)-(sy+sz.h+vp.y));if(dx+dy!==0){if(sx+dx<0)dx=0;if(sy+dy<0)dy=0;ph.moveTo(sx+dx,sy+dy);}if(dw+dh!==0)ph.resizeTo(sz.w+dw,sz.h+dh);return Event.cancel(e);});return Event.cancel(se);},resizeBy:function(dw,dh,id){var w=this.windows[id];if(w){w.element.resizeBy(dw,dh);w.iframeElement.resizeBy(dw,dh);}},close:function(win,id){var t=this,w,d=document,ix=0,fw;if(!id&&win){t.parent(win);return;}if(w=t.windows[id]){t.onClose.dispatch(t);Event.remove(d,'mousedown',w.mousedownFunc);Event.remove(d,'click',w.clickFunc);DOM.setAttrib(id+'_ifr','src','javascript:""');w.element.remove();delete t.windows[id];each(t.windows,function(w){if(w.zIndex>ix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(ti,id){DOM.get(id+'_title').innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,559 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
+
+	tinymce.create('tinymce.plugins.InlinePopups', {
+		init : function(ed, url) {
+			// Replace window manager
+			ed.onBeforeRenderUI.add(function() {
+				ed.windowManager = new tinymce.InlineWindowManager(ed);
+				DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'InlinePopups',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
+		InlineWindowManager : function(ed) {
+			var t = this;
+
+			t.parent(ed);
+			t.zIndex = 1000;
+		},
+
+		open : function(f, p) {
+			var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w;
+
+			f = f || {};
+			p = p || {};
+
+			// Run native windows
+			if (!f.inline)
+				return t.parent(f, p);
+
+			t.bookmark = ed.selection.getBookmark('simple');
+			id = DOM.uniqueId();
+			vp = DOM.getViewPort();
+			f.width = parseInt(f.width || 320);
+			f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
+			f.min_width = parseInt(f.min_width || 150);
+			f.min_height = parseInt(f.min_height || 100);
+			f.max_width = parseInt(f.max_width || 2000);
+			f.max_height = parseInt(f.max_height || 2000);
+			f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
+			f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
+			f.movable = f.resizable = true;
+			p.mce_width = f.width;
+			p.mce_height = f.height;
+			p.mce_inline = true;
+			p.mce_window_id = id;
+
+			// Transpose
+//			po = DOM.getPos(ed.getContainer());
+//			f.left -= po.x;
+//			f.top -= po.y;
+
+			t.features = f;
+			t.params = p;
+			t.onOpen.dispatch(t, f, p);
+
+			if (f.type) {
+				opt += ' modal ' + f.type;
+				f.resizable = false;
+			}
+
+			if (f.statusbar)
+				opt += ' statusbar';
+
+			if (f.resizable)
+				opt += ' resizable';
+
+			if (f.minimizable)
+				opt += ' minimizable';
+
+			if (f.maximizable)
+				opt += ' maximizable';
+
+			if (f.movable)
+				opt += ' movable';
+
+			// Create DOM objects
+			t._addAll(document.body, 
+				['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, 
+					['div', {id : id + '_wrapper', 'class' : 'wrapper' + opt},
+						['div', {id : id + '_top', 'class' : 'top'}, 
+							['div', {'class' : 'left'}],
+							['div', {'class' : 'center'}],
+							['div', {'class' : 'right'}],
+							['span', {id : id + '_title'}, f.title || '']
+						],
+
+						['div', {id : id + '_middle', 'class' : 'middle'}, 
+							['div', {id : id + '_left', 'class' : 'left'}],
+							['span', {id : id + '_content'}],
+							['div', {id : id + '_right', 'class' : 'right'}]
+						],
+
+						['div', {id : id + '_bottom', 'class' : 'bottom'},
+							['div', {'class' : 'left'}],
+							['div', {'class' : 'center'}],
+							['div', {'class' : 'right'}],
+							['span', {id : id + '_status'}, 'Content']
+						],
+
+						['a', {'class' : 'move', href : 'javascript:;'}],
+						['a', {'class' : 'min', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'max', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'med', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'close', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {id : id + '_resize_n', 'class' : 'resize resize-n', href : 'javascript:;'}],
+						['a', {id : id + '_resize_s', 'class' : 'resize resize-s', href : 'javascript:;'}],
+						['a', {id : id + '_resize_w', 'class' : 'resize resize-w', href : 'javascript:;'}],
+						['a', {id : id + '_resize_e', 'class' : 'resize resize-e', href : 'javascript:;'}],
+						['a', {id : id + '_resize_nw', 'class' : 'resize resize-nw', href : 'javascript:;'}],
+						['a', {id : id + '_resize_ne', 'class' : 'resize resize-ne', href : 'javascript:;'}],
+						['a', {id : id + '_resize_sw', 'class' : 'resize resize-sw', href : 'javascript:;'}],
+						['a', {id : id + '_resize_se', 'class' : 'resize resize-se', href : 'javascript:;'}]
+					]
+				]
+			);
+
+			DOM.setStyles(id, {top : -10000, left : -10000});
+
+			// Fix gecko rendering bug, where the editors iframe messed with window contents
+			if (tinymce.isGecko)
+				DOM.setStyle(id, 'overflow', 'auto');
+
+			// Measure borders
+			if (!f.type) {
+				dw += DOM.get(id + '_left').clientWidth;
+				dw += DOM.get(id + '_right').clientWidth;
+				dh += DOM.get(id + '_top').clientHeight;
+				dh += DOM.get(id + '_bottom').clientHeight;
+			}
+
+			// Resize window
+			DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
+
+			if (!f.type) {
+				DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
+				DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
+				DOM.setAttrib(id + '_ifr', 'src', f.url || f.file);
+			} else {
+				DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'button ok', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
+
+				if (f.type == 'confirm')
+					DOM.add(id + '_wrapper', 'a', {'class' : 'button cancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
+
+				DOM.add(id + '_middle', 'div', {'class' : 'icon'});
+				DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
+			}
+
+			// Register events
+			mdf = Event.add(id, 'mousedown', function(e) {
+				var n = e.target, w, vp;
+
+				w = t.windows[id];
+				t.focus(id);
+
+				if (n.nodeName == 'A' || n.nodeName == 'a') {
+					if (n.className == 'max') {
+						w.oldPos = w.element.getXY();
+						w.oldSize = w.element.getSize();
+
+						vp = DOM.getViewPort();
+
+						// Reduce viewport size to avoid scrollbars
+						vp.w -= 2;
+						vp.h -= 2;
+
+						w.element.moveTo(vp.x, vp.y);
+						w.element.resizeTo(vp.w, vp.h);
+						DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
+						DOM.addClass(id + '_wrapper', 'maximized');
+					} else if (n.className == 'med') {
+						// Reset to old size
+						w.element.moveTo(w.oldPos.x, w.oldPos.y);
+						w.element.resizeTo(w.oldSize.w, w.oldSize.h);
+						w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
+
+						DOM.removeClass(id + '_wrapper', 'maximized');
+					} else if (n.className == 'move')
+						return t._startDrag(id, e, n.className);
+					else if (DOM.hasClass(n, 'resize'))
+						return t._startDrag(id, e, n.className.substring(7));
+				}
+			});
+
+			clf = Event.add(id, 'click', function(e) {
+				var n = e.target;
+
+				t.focus(id);
+
+				if (n.nodeName == 'A' || n.nodeName == 'a') {
+					switch (n.className) {
+						case 'close':
+							t.close(null, id);
+							return Event.cancel(e);
+
+						case 'button ok':
+						case 'button cancel':
+							f.button_func(n.className == 'button ok');
+							return Event.cancel(e);
+					}
+				}
+			});
+
+			// Add window
+			t.windows = t.windows || {};
+			w = t.windows[id] = {
+				id : id,
+				mousedown_func : mdf,
+				click_func : clf,
+				element : new Element(id, {blocker : 1, container : ed.getContainer()}),
+				iframeElement : new Element(id + '_ifr'),
+				features : f,
+				deltaWidth : dw,
+				deltaHeight : dh
+			};
+
+			w.iframeElement.on('focus', function() {
+				t.focus(id);
+			});
+
+			t.focus(id);
+			t._fixIELayout(id, 1);
+
+//			if (DOM.get(id + '_ok'))
+//				DOM.get(id + '_ok').focus();
+
+			return w;
+		},
+
+		focus : function(id) {
+			var t = this, w = t.windows[id];
+
+			w.zIndex = this.zIndex++;
+			w.element.setStyle('zIndex', w.zIndex);
+			w.element.update();
+
+			id = id + '_wrapper';
+			DOM.removeClass(t.lastId, 'focus');
+			DOM.addClass(id, 'focus');
+			t.lastId = id;
+		},
+
+		_addAll : function(te, ne) {
+			var i, n, t = this, dom = tinymce.DOM;
+
+			if (is(ne, 'string'))
+				te.appendChild(dom.doc.createTextNode(ne));
+			else if (ne.length) {
+				te = te.appendChild(dom.create(ne[0], ne[1]));
+
+				for (i=2; i<ne.length; i++)
+					t._addAll(te, ne[i]);
+			}
+		},
+
+		_startDrag : function(id, se, ac) {
+			var t = this, mu, mm, d = document, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
+
+			// Get positons and sizes
+//			cp = DOM.getPos(t.editor.getContainer());
+			cp = {x : 0, y : 0};
+			vp = DOM.getViewPort();
+
+			// Reduce viewport size to avoid scrollbars
+			vp.w -= 2;
+			vp.h -= 2;
+
+			sex = se.screenX;
+			sey = se.screenY;
+			dx = dy = dw = dh = 0;
+
+			// Handle mouse up
+			mu = Event.add(d, 'mouseup', function(e) {
+				Event.remove(d, 'mouseup', mu);
+				Event.remove(d, 'mousemove', mm);
+
+				if (eb)
+					eb.remove();
+
+				we.moveBy(dx, dy);
+				we.resizeBy(dw, dh);
+				sz = we.getSize();
+				DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
+				t._fixIELayout(id, 1);
+
+				return Event.cancel(e);
+			});
+
+			if (ac != 'move')
+				startMove();
+
+			function startMove() {
+				if (eb)
+					return;
+
+				t._fixIELayout(id, 0);
+
+				// Setup event blocker
+				DOM.add(d.body, 'div', {
+					id : 'mceEventBlocker',
+					'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
+					style : {left : vp.x, top : vp.y, width : vp.w - 20, height : vp.h - 20, zIndex : 20001}
+				});
+				eb = new Element('mceEventBlocker');
+				eb.update();
+
+				// Setup placeholder
+				p = we.getXY();
+				sz = we.getSize();
+				sx = cp.x + p.x - vp.x;
+				sy = cp.y + p.y - vp.y;
+				DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'placeholder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
+				ph = new Element('mcePlaceHolder');
+			};
+
+			// Handle mouse move/drag
+			mm = Event.add(d, 'mousemove', function(e) {
+				var x, y, v;
+
+				startMove();
+
+				x = e.screenX - sex;
+				y = e.screenY - sey;
+
+				switch (ac) {
+					case 'resize-w':
+						dx = x;
+						dw = 0 - x;
+						break;
+
+					case 'resize-e':
+						dw = x;
+						break;
+
+					case 'resize-n':
+					case 'resize-nw':
+					case 'resize-ne':
+						if (ac == "resize-nw") {
+							dx = x;
+							dw = 0 - x;
+						} else if (ac == "resize-ne")
+							dw = x;
+
+						dy = y;
+						dh = 0 - y;
+						break;
+
+					case 'resize-s':
+					case 'resize-sw':
+					case 'resize-se':
+						if (ac == "resize-sw") {
+							dx = x;
+							dw = 0 - x;
+						} else if (ac == "resize-se")
+							dw = x;
+
+						dh = y;
+						break;
+
+					case 'move':
+						dx = x;
+						dy = y;
+						break;
+				}
+
+				// Boundary check
+				if (dw < (v = w.features.min_width - sz.w)) {
+					if (dx !== 0)
+						dx += dw - v;
+
+					dw = v;
+				}
+	
+				if (dh < (v = w.features.min_height - sz.h)) {
+					if (dy !== 0)
+						dy += dh - v;
+
+					dh = v;
+				}
+
+				dw = Math.min(dw, w.features.max_width - sz.w);
+				dh = Math.min(dh, w.features.max_height - sz.h);
+				dx = Math.max(dx, vp.x - (sx + vp.x));
+				dy = Math.max(dy, vp.y - (sy + vp.y));
+				dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
+				dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
+
+				// Move if needed
+				if (dx + dy !== 0) {
+					if (sx + dx < 0)
+						dx = 0;
+	
+					if (sy + dy < 0)
+						dy = 0;
+
+					ph.moveTo(sx + dx, sy + dy);
+				}
+
+				// Resize if needed
+				if (dw + dh !== 0)
+					ph.resizeTo(sz.w + dw, sz.h + dh);
+
+				return Event.cancel(e);
+			});
+
+			return Event.cancel(se);
+		},
+
+		resizeBy : function(dw, dh, id) {
+			var w = this.windows[id];
+
+			if (w) {
+				w.element.resizeBy(dw, dh);
+				w.iframeElement.resizeBy(dw, dh);
+			}
+		},
+
+		close : function(win, id) {
+			var t = this, w, d = document, ix = 0, fw;
+
+			// Probably not inline
+			if (!id && win) {
+				t.parent(win);
+				return;
+			}
+
+			if (w = t.windows[id]) {
+				t.onClose.dispatch(t);
+				Event.remove(d, 'mousedown', w.mousedownFunc);
+				Event.remove(d, 'click', w.clickFunc);
+
+				DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
+				w.element.remove();
+				delete t.windows[id];
+
+				// Find front most window and focus that
+				each (t.windows, function(w) {
+					if (w.zIndex > ix) {
+						fw = w;
+						ix = w.zIndex;
+					}
+				});
+
+				if (fw)
+					t.focus(fw.id);
+			}
+		},
+
+		setTitle : function(ti, id) {
+			DOM.get(id + '_title').innerHTML = DOM.encode(ti);
+		},
+
+		alert : function(txt, cb, s) {
+			var t = this, w;
+
+			w = t.open({
+				title : t,
+				type : 'alert',
+				button_func : function(s) {
+					if (cb)
+						cb.call(s || t, s);
+
+					t.close(null, w.id);
+				},
+				content : DOM.encode(t.editor.getLang(txt, txt)),
+				inline : 1,
+				width : 400,
+				height : 130
+			});
+		},
+
+		confirm : function(txt, cb, s) {
+			var t = this, w;
+
+			w = t.open({
+				title : t,
+				type : 'confirm',
+				button_func : function(s) {
+					if (cb)
+						cb.call(s || t, s);
+
+					t.close(null, w.id);
+				},
+				content : DOM.encode(t.editor.getLang(txt, txt)),
+				inline : 1,
+				width : 400,
+				height : 130
+			});
+		},
+
+		// Internal functions
+
+		_fixIELayout : function(id, s) {
+			var w, img;
+
+			if (!tinymce.isIE6)
+				return;
+
+			// Fixes the bug where hover flickers and does odd things in IE6
+			each(['n','s','w','e','nw','ne','sw','se'], function(v) {
+				var e = DOM.get(id + '_resize_' + v);
+
+				DOM.setStyles(e, {
+					width : s ? e.clientWidth : '',
+					height : s ? e.clientHeight : '',
+					cursor : DOM.getStyle(e, 'cursor', 1)
+				});
+
+				DOM.setStyle(id + "_bottom", 'bottom', '-1px');
+
+				e = 0;
+			});
+
+			// Fixes graphics glitch
+			if (w = this.windows[id]) {
+				// Fixes rendering bug after resize
+				w.element.hide();
+				w.element.show();
+
+				// Forced a repaint of the window
+				//DOM.get(id).style.filter = '';
+
+				// IE has a bug where images used in CSS won't get loaded
+				// sometimes when the cache in the browser is disabled
+				// This fix tries to solve it by loading the images using the image object
+				each(DOM.select('div,a', id), function(e, i) {
+					if (e.currentStyle.backgroundImage != 'none') {
+						img = new Image();
+						img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
+					}
+				});
+
+				DOM.get(id).style.filter = '';
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
+})();
+
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css	(revision 1)
@@ -0,0 +1,87 @@
+/* Clearlooks 2 */
+
+/* General */
+.clearlooks2 div, .clearlooks2 span, .clearlooks2 a {position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
+.clearlooks2 {position:absolute}
+.clearlooks2 .wrapper {position:static}
+.mceEventBlocker {position:absolute; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
+.clearlooks2 .placeholder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50)}
+
+/* Top */
+.clearlooks2 .top, .clearlooks2 .top div {top:0; width:100%; height:23px}
+.clearlooks2 .top .left {width:6px; background:url(img/corners.gif)}
+.clearlooks2 .top .center {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
+.clearlooks2 .top .right {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
+.clearlooks2 .top span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
+.clearlooks2 .focus .top .left {background:url(img/corners.gif) -6px 0}
+.clearlooks2 .focus .top .center {background:url(img/horizontal.gif) 0 -23px}
+.clearlooks2 .focus .top .right {background:url(img/corners.gif) -18px 0}
+.clearlooks2 .focus .top span {color:#FFF}
+
+/* Middle */
+.clearlooks2 .middle, .clearlooks2 .middle div {top:0}
+.clearlooks2 .middle {width:100%; height:100%; clip:rect(23px auto auto auto)}
+.clearlooks2 .middle .left {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
+.clearlooks2 .middle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
+.clearlooks2 .middle .right {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
+
+/* Bottom */
+.clearlooks2 .bottom, .clearlooks2 .bottom div {height:6px}
+.clearlooks2 .bottom {left:0; bottom:0; width:100%}
+.clearlooks2 .bottom div {top:0}
+.clearlooks2 .bottom .left {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
+.clearlooks2 .bottom .center {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
+.clearlooks2 .bottom .right {right:0; width:5px; background: url(img/corners.gif) -34px 0}
+.clearlooks2 .bottom span {display:none}
+.clearlooks2 .statusbar .bottom, .clearlooks2 .statusbar .bottom div {height:23px}
+.clearlooks2 .statusbar .bottom .left {background:url(img/corners.gif) -29px 0}
+.clearlooks2 .statusbar .bottom .center {background:url(img/horizontal.gif) 0 -52px}
+.clearlooks2 .statusbar .bottom .right {background:url(img/corners.gif) -24px 0}
+.clearlooks2 .statusbar .bottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
+
+/* Actions */
+.clearlooks2 a {width:29px; height:16px; top:3px;}
+.clearlooks2 .close {right:6px; background:url(img/buttons.gif) -87px 0}
+.clearlooks2 .min {display:none; right:68px; background:url(img/buttons.gif) 0 0}
+.clearlooks2 .med {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
+.clearlooks2 .max {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
+.clearlooks2 .move {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
+.clearlooks2 .movable .move {display:block}
+.clearlooks2 .focus .close {right:6px; background:url(img/buttons.gif) -87px -16px}
+.clearlooks2 .focus .min {right:68px; background:url(img/buttons.gif) 0 -16px}
+.clearlooks2 .focus .med {right:37px; background:url(img/buttons.gif) -29px -16px}
+.clearlooks2 .focus .max {right:37px; background:url(img/buttons.gif) -58px -16px}
+.clearlooks2 .focus .close:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .focus .close:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .focus .min:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
+.clearlooks2 .focus .med:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
+.clearlooks2 .focus .max:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
+
+/* Resize */
+.clearlooks2 .resize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
+.clearlooks2 .resizable .resize {display:block}
+.clearlooks2 .resizable .min, .clearlooks2 .max {display:none}
+.clearlooks2 .minimizable .min {display:block}
+.clearlooks2 .maximizable .max {display:block}
+.clearlooks2 .maximized .med {display:block}
+.clearlooks2 .maximized .max {display:none}
+.clearlooks2 a.resize-n {top:0; left:0; width:100%; cursor:n-resize}
+.clearlooks2 a.resize-nw {top:0; left:0; cursor:nw-resize}
+.clearlooks2 a.resize-ne {top:0; right:0; cursor:ne-resize}
+.clearlooks2 a.resize-w {top:0; left:0; height:100%; cursor:w-resize;}
+.clearlooks2 a.resize-e {top:0; right:0; height:100%; cursor:e-resize}
+.clearlooks2 a.resize-s {bottom:0; left:0; width:100%; cursor:s-resize}
+.clearlooks2 a.resize-sw {bottom:0; left:0; cursor:sw-resize}
+.clearlooks2 a.resize-se {bottom:0; right:0; cursor:se-resize}
+
+/* Alert/Confirm */
+.clearlooks2 .button {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
+.clearlooks2 .middle .icon {left:15px; top:35px; width:32px; height:32px}
+.clearlooks2 .alert .middle span, .clearlooks2 .confirm .middle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
+.clearlooks2 a:hover {font-weight:bold;}
+.clearlooks2 .alert .middle, .clearlooks2 .confirm .middle {background:#D6D7D5}
+.clearlooks2 .alert .ok {left:50%; top:auto; margin-left: -40px}
+.clearlooks2 .alert .icon {background:url(img/alert.gif)}
+.clearlooks2 .confirm .ok {left:50%; top:auto; margin-left: -90px}
+.clearlooks2 .confirm .cancel {left:50%; top:auto}
+.clearlooks2 .confirm .icon {background:url(img/confirm.gif)}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/inlinepopups/template.htm	(revision 1)
@@ -0,0 +1,387 @@
+<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Template for dialogs</title>
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />
+</head>
+<body>
+
+<div class="mceEditor">
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px;">
+		<div class="wrapper">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Blured</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px;">
+		<div class="wrapper movable focus">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Focused</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">
+		<div class="wrapper movable focus statusbar">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">
+		<div class="wrapper movable focus statusbar resizable">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar, Resizable</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">
+		<div class="wrapper movable focus resizable maximizable">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Resizable, Maximizable</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">
+		<div class="wrapper movable statusbar resizable maximizable">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Blurred, Maximizable, Statusbar, Resizable</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">
+		<div class="wrapper movable focus resizable maximized minimizable maximizable">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Maximized, Maximizable, Minimizable, Focused</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">
+		<div class="wrapper movable statusbar resizable maximized minimizable maximizable">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Maximized, Maximizable, Minimizable</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>Content</span>
+				<div class="right"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="min" href="#"></a>
+			<a class="med" href="#"></a>
+			<a class="max" href="#"></a>
+			<a class="close" href="#"></a>
+			<a class="resize resize-n" href="#"></a>
+			<a class="resize resize-s" href="#"></a>
+			<a class="resize resize-w" href="#"></a>
+			<a class="resize resize-e" href="#"></a>
+			<a class="resize resize-nw" href="#"></a>
+			<a class="resize resize-ne" href="#"></a>
+			<a class="resize resize-sw" href="#"></a>
+			<a class="resize resize-se" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">
+		<div class="wrapper movable focus modal alert">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Alert</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+				</span>
+				<div class="right"></div>
+				<div class="icon"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="button ok" href="#">Ok</a>
+			<a class="close" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">
+		<div class="wrapper movable focus modal confirm">
+			<div class="top">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+				<span>Confirm</span>
+			</div>
+
+			<div class="middle">
+				<div class="left"></div>
+				<span>
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					</span>
+				<div class="right"></div>
+				<div class="icon"></div>
+			</div>
+
+			<div class="bottom">
+				<div class="left"></div>
+				<div class="center"></div>
+				<div class="right"></div>
+			</div>
+
+			<a class="move" href="#"></a>
+			<a class="button ok" href="#">Ok</a>
+			<a class="button cancel" href="#">Cancel</a>
+			<a class="close" href="#"></a>
+		</div>
+	</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.InsertDateTime',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertDate',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_dateFormat",ed.getLang('insertdatetime.date_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addCommand('mceInsertTime',function(){var str=t._getDateTime(new Date(),ed.getParam("plugin_insertdate_timeFormat",ed.getLang('insertdatetime.time_fmt')));ed.execCommand('mceInsertContent',false,str);});ed.addButton('insertdate',{title:'insertdatetime.insertdate_desc',cmd:'mceInsertDate'});ed.addButton('inserttime',{title:'insertdatetime.inserttime_desc',cmd:'mceInsertTime'});},getInfo:function(){return{longname:'Insert date/time',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_getDateTime:function(d,fmt){var ed=this.editor;function addZeros(value,len){value=""+value;if(value.length<len){for(var i=0;i<(len-value.length);i++)value="0"+value;}return value;};fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('insertdatetime',tinymce.plugins.InsertDateTime);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,80 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.InsertDateTime', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			ed.addCommand('mceInsertDate', function() {
+				var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
+
+				ed.execCommand('mceInsertContent', false, str);
+			});
+
+			ed.addCommand('mceInsertTime', function() {
+				var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
+
+				ed.execCommand('mceInsertContent', false, str);
+			});
+
+			ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
+			ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Insert date/time',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_getDateTime : function(d, fmt) {
+			var ed = this.editor;
+
+			function addZeros(value, len) {
+				value = "" + value;
+
+				if (value.length < len) {
+					for (var i=0; i<(len-value.length); i++)
+						value = "0" + value;
+				}
+
+				return value;
+			};
+
+			fmt = fmt.replace("%D", "%m/%d/%y");
+			fmt = fmt.replace("%r", "%I:%M:%S %p");
+			fmt = fmt.replace("%Y", "" + d.getFullYear());
+			fmt = fmt.replace("%y", "" + d.getYear());
+			fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
+			fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
+			fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
+			fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
+			fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
+			fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
+			fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
+			fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
+			fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
+			fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
+			fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
+			fmt = fmt.replace("%%", "%");
+
+			return fmt;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Layer',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceInsertLayer',t._insertLayer,t);ed.addCommand('mceMoveForward',function(){t._move(1);});ed.addCommand('mceMoveBackward',function(){t._move(-1);});ed.addCommand('mceMakeAbsolute',function(){t._toggleAbsolute();});ed.addButton('moveforward',{title:'layer.forward_desc',cmd:'mceMoveForward'});ed.addButton('movebackward',{title:'layer.backward_desc',cmd:'mceMoveBackward'});ed.addButton('absolute',{title:'layer.absolute_desc',cmd:'mceMakeAbsolute'});ed.addButton('insertlayer',{title:'layer.insertlayer_desc',cmd:'mceInsertLayer'});ed.onInit.add(function(){if(tinymce.isIE)ed.execCommand('2D-Position');});ed.onNodeChange.add(t._nodeChange,t);ed.onVisualAid.add(t._visualAid,t);},getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var le,p;le=this._getParentLayer(n);p=ed.dom.getParent(n,'DIV,P,IMG');if(!p){cm.setDisabled('absolute',1);cm.setDisabled('moveforward',1);cm.setDisabled('movebackward',1);}else{cm.setDisabled('absolute',0);cm.setDisabled('moveforward',!le);cm.setDisabled('movebackward',!le);cm.setActive('absolute',le&&le.style.position.toLowerCase()=="absolute");}},_visualAid:function(ed,e,s){var dom=ed.dom;tinymce.each(dom.select('div,p',e),function(e){if(/^(absolute|relative|static)$/i.test(e.style.position)){if(s)dom.addClass(e,'mceVisualAid');else dom.removeClass(e,'mceVisualAid');}});},_move:function(d){var ed=this.editor,i,z=[],le=this._getParentLayer(ed.selection.getNode()),ci=-1,fi=-1,nl;nl=[];tinymce.walk(ed.getBody(),function(n){if(n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position))nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i;}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}ed.execCommand('mceRepaint');},_getParentLayer:function(n){return this.editor.dom.getParent(n,function(n){return n.nodeType==1&&/^(absolute|relative|static)$/i.test(n.style.position);});},_insertLayer:function(){var ed=this.editor,p=ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(),'*'));ed.dom.add(ed.getBody(),'div',{style:{position:'absolute',left:p.x,top:(p.y>20?p.y:20),width:100,height:100},'class':'mceVisualAid'},ed.selection.getContent()||ed.getLang('layer.content'));},_toggleAbsolute:function(){var ed=this.editor,le=this._getParentLayer(ed.selection.getNode());if(!le)le=ed.dom.getParent(ed.selection.getNode(),'DIV,P,IMG');if(le){if(le.style.position.toLowerCase()=="absolute"){ed.dom.setStyles(le,{position:'',left:'',top:'',width:'',height:''});ed.dom.removeClass(le,'mceVisualAid');}else{if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';le.style.position="absolute";ed.addVisual(ed.getBody());}ed.execCommand('mceRepaint');ed.nodeChanged();}}});tinymce.PluginManager.add('layer',tinymce.plugins.Layer);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,209 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Layer', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceInsertLayer', t._insertLayer, t);
+
+			ed.addCommand('mceMoveForward', function() {
+				t._move(1);
+			});
+
+			ed.addCommand('mceMoveBackward', function() {
+				t._move(-1);
+			});
+
+			ed.addCommand('mceMakeAbsolute', function() {
+				t._toggleAbsolute();
+			});
+
+			// Register buttons
+			ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
+			ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
+			ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
+			ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
+
+			ed.onInit.add(function() {
+				if (tinymce.isIE)
+					ed.execCommand('2D-Position');
+			});
+
+			ed.onNodeChange.add(t._nodeChange, t);
+			ed.onVisualAid.add(t._visualAid, t);
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Layer',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_nodeChange : function(ed, cm, n) {
+			var le, p;
+
+			le = this._getParentLayer(n);
+			p = ed.dom.getParent(n, 'DIV,P,IMG');
+
+			if (!p) {
+				cm.setDisabled('absolute', 1);
+				cm.setDisabled('moveforward', 1);
+				cm.setDisabled('movebackward', 1);
+			} else {
+				cm.setDisabled('absolute', 0);
+				cm.setDisabled('moveforward', !le);
+				cm.setDisabled('movebackward', !le);
+				cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
+			}
+		},
+
+		// Private methods
+
+		_visualAid : function(ed, e, s) {
+			var dom = ed.dom;
+
+			tinymce.each(dom.select('div,p', e), function(e) {
+				if (/^(absolute|relative|static)$/i.test(e.style.position)) {
+					if (s)
+						dom.addClass(e, 'mceVisualAid');
+					else
+						dom.removeClass(e, 'mceVisualAid');	
+				}
+			});
+		},
+
+		_move : function(d) {
+			var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
+
+			nl = [];
+			tinymce.walk(ed.getBody(), function(n) {
+				if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
+					nl.push(n); 
+			}, 'childNodes');
+
+			// Find z-indexes
+			for (i=0; i<nl.length; i++) {
+				z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
+
+				if (ci < 0 && nl[i] == le)
+					ci = i;
+			}
+
+			if (d < 0) {
+				// Move back
+
+				// Try find a lower one
+				for (i=0; i<z.length; i++) {
+					if (z[i] < z[ci]) {
+						fi = i;
+						break;
+					}
+				}
+
+				if (fi > -1) {
+					nl[ci].style.zIndex = z[fi];
+					nl[fi].style.zIndex = z[ci];
+				} else {
+					if (z[ci] > 0)
+						nl[ci].style.zIndex = z[ci] - 1;
+				}
+			} else {
+				// Move forward
+
+				// Try find a higher one
+				for (i=0; i<z.length; i++) {
+					if (z[i] > z[ci]) {
+						fi = i;
+						break;
+					}
+				}
+
+				if (fi > -1) {
+					nl[ci].style.zIndex = z[fi];
+					nl[fi].style.zIndex = z[ci];
+				} else
+					nl[ci].style.zIndex = z[ci] + 1;
+			}
+
+			ed.execCommand('mceRepaint');
+		},
+
+		_getParentLayer : function(n) {
+			return this.editor.dom.getParent(n, function(n) {
+				return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
+			});
+		},
+
+		_insertLayer : function() {
+			var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));
+
+			ed.dom.add(ed.getBody(), 'div', {
+				style : {
+					position : 'absolute',
+					left : p.x,
+					top : (p.y > 20 ? p.y : 20),
+					width : 100,
+					height : 100
+				},
+				'class' : 'mceVisualAid'
+			}, ed.selection.getContent() || ed.getLang('layer.content'));
+		},
+
+		_toggleAbsolute : function() {
+			var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
+
+			if (!le)
+				le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
+
+			if (le) {
+				if (le.style.position.toLowerCase() == "absolute") {
+					ed.dom.setStyles(le, {
+						position : '',
+						left : '',
+						top : '',
+						width : '',
+						height : ''
+					});
+
+					ed.dom.removeClass(le, 'mceVisualAid');
+				} else {
+					if (le.style.left == "")
+						le.style.left = 20 + 'px';
+
+					if (le.style.top == "")
+						le.style.top = 20 + 'px';
+
+					if (le.style.width == "")
+						le.style.width = le.width ? (le.width + 'px') : '100px';
+
+					if (le.style.height == "")
+						le.style.height = le.height ? (le.height + 'px') : '100px';
+
+					le.style.position = "absolute";
+					ed.addVisual(ed.getBody());
+				}
+
+				ed.execCommand('mceRepaint');
+				ed.nodeChanged();
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/content.css	(revision 1)
@@ -0,0 +1,6 @@
+.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}
+.mceItemShockWave {background-image: url(../img/shockwave.gif);}
+.mceItemFlash {background-image:url(../img/flash.gif);}
+.mceItemQuickTime {background-image:url(../img/quicktime.gif);}
+.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}
+.mceItemRealMedia {background-image:url(../img/realmedia.gif);}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/media.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/media.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/css/media.css	(revision 1)
@@ -0,0 +1,68 @@
+#id, #name, #hspace, #vspace, #class_name, #align {
+	width: 100px;
+}
+
+#hspace, #vspace {
+	width: 50px;
+}
+
+#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
+	width: 100px;
+}
+
+#flash_base, #flash_flashvars {
+	width: 240px;
+}
+
+#width, #height {
+	width: 40px;
+}
+
+#src, #media_type {
+	width: 250px;
+}
+
+#class {
+	width: 120px;
+}
+
+#prev {
+	margin: 0;
+	border: 1px solid black;
+	width: 99%;
+	height: 230px;
+	overflow: auto;
+}
+
+.panel_wrapper div.current {
+	height: 390px;
+	overflow: auto;
+}
+
+#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
+	display: none;
+}
+
+.mceAddSelectValue {
+	background-color: #DDDDDD;
+}
+
+#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
+	width: 70px;
+}
+
+#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
+	width: 70px;
+}
+
+#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
+	width: 70px;
+}
+
+#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
+	width: 90px;
+}
+
+#qt_qtsrc {
+	width: 200px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=eval("({"+c+"})");return'<img class="mceItem'+b+'" title="'+ed.dom.encode(c)+'" src="'+url+'/img/trans.gif" width="'+o.width+'" height="'+o.height+'" />'});h=h.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');h=h.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');h=h.replace(/<\/(object|embed)([^>]*)>/gi,'</span>');h=h.replace(/<param([^>]*)>/gi,function(a,b){return'<span '+b.replace(/value=/g,'_value=')+' class="mceItemParam"></span>'});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<img[^>]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='<script type="text/javascript">write'+cl.substring(7)+'({'+t._serialize(at)+'});</script>';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(v&&!/^(width|height|codebase|classid)$/.test(k))dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align'],function(n){var v=dom.getAttrib(n,'align');if(v)pa[v]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,323 @@
+/**
+ * $Id: editor_plugin_src.js 561 2008-01-23 15:18:19Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.plugins.MediaPlugin', {
+		init : function(ed, url) {
+			var t = this;
+			
+			t.editor = ed;
+			t.url = url;
+
+			function isMediaElm(n) {
+				return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);
+			};
+
+			// Register commands
+			ed.addCommand('mceMedia', function() {
+				ed.windowManager.open({
+					file : url + '/media.htm',
+					width : 430 + parseInt(ed.getLang('media.delta_width', 0)),
+					height : 470 + parseInt(ed.getLang('media.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});
+
+			ed.onNodeChange.add(function(ed, cm, n) {
+				cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));
+			});
+
+			ed.onInit.add(function() {
+				var lo = {
+					mceItemFlash : 'flash',
+					mceItemShockWave : 'shockwave',
+					mceItemWindowsMedia : 'windowsmedia',
+					mceItemQuickTime : 'quicktime',
+					mceItemRealMedia : 'realmedia'
+				};
+
+				ed.dom.loadCSS(url + "/css/content.css");
+
+				if (ed.theme.onResolveName) {
+					ed.theme.onResolveName.add(function(th, o) {
+						if (o.name == 'img') {
+							each(lo, function(v, k) {
+								if (ed.dom.hasClass(o.node, k)) {
+									o.name = v;
+									o.title = ed.dom.getAttrib(o.node, 'title');
+									return false;
+								}
+							});
+						}
+					});
+				}
+
+				if (ed && ed.plugins.contextmenu) {
+					ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
+						if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {
+							m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});
+						}
+					});
+				}
+			});
+
+			ed.onBeforeSetContent.add(function(ed, o) {
+				var h = o.content;
+
+				h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {
+					var o = eval("({" + c + "})");
+
+					return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'
+				});
+
+				h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');
+				h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');
+				h = h.replace(/<\/(object|embed)([^>]*)>/gi, '</span>');
+				h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/g, '_value=') + ' class="mceItemParam"></span>'});
+				h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');
+
+				o.content = h;
+			});
+
+			ed.onSetContent.add(function() {
+				t._spansToImgs(ed.getBody());
+			});
+
+			ed.onPreProcess.add(function(ed, o) {
+				var dom = ed.dom;
+
+				if (o.set) {
+					t._spansToImgs(o.node);
+
+					each(dom.select('IMG', o.node), function(n) {
+						var p;
+
+						if (isMediaElm(n)) {
+							p = t._parse(n.title);
+							dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));
+							dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));
+						}
+					});
+				}
+
+				if (o.get) {
+					each(dom.select('IMG', o.node), function(n) {
+						var ci, cb, mt;
+
+						if (ed.getParam('media_use_script')) {
+							if (isMediaElm(n))
+								n.className = n.className.replace(/mceItem/g, 'mceTemp');
+
+							return;
+						}
+
+						switch (n.className) {
+							case 'mceItemFlash':
+								ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
+								cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+								mt = 'application/x-shockwave-flash';
+								break;
+
+							case 'mceItemShockWave':
+								ci = '166b1bca-3f9c-11cf-8075-444553540000';
+								cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
+								mt = 'application/x-director';
+								break;
+
+							case 'mceItemWindowsMedia':
+								ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';
+								cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+								mt = 'application/x-mplayer2';
+								break;
+
+							case 'mceItemQuickTime':
+								ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';
+								cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
+								mt = 'video/quicktime';
+								break;
+
+							case 'mceItemRealMedia':
+								ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';
+								cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+								mt = 'audio/x-pn-realaudio-plugin';
+								break;
+						}
+
+						if (ci) {
+							dom.replace(t._buildObj({
+								classid : ci,
+								codebase : cb,
+								type : mt
+							}, n), n);
+						}
+					});
+				}
+			});
+
+			ed.onPostProcess.add(function(ed, o) {
+				o.content = o.content.replace(/_value=/g, 'value=');
+			});
+
+			if (ed.getParam('media_use_script')) {
+				function getAttr(s, n) {
+					n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);
+
+					return n ? ed.dom.decode(n[1]) : '';
+				};
+
+				ed.onPostProcess.add(function(ed, o) {
+					o.content = o.content.replace(/<img[^>]+>/g, function(im) {
+						var cl = getAttr(im, 'class');
+
+						if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {
+							at = t._parse(getAttr(im, 'title'));
+							at.width = getAttr(im, 'width');
+							at.height = getAttr(im, 'height');
+							im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';
+						}
+
+						return im;
+					});
+				});
+			}
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Media',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_buildObj : function(o, n) {
+			var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title);
+
+			p.width = o.width = dom.getAttrib(n, 'width') || 100;
+			p.height = o.height = dom.getAttrib(n, 'height') || 100;
+
+			ob = dom.create('span', {
+				mce_name : 'object',
+				classid : "clsid:" + o.classid,
+				codebase : o.codebase,
+				width : o.width,
+				height : o.height
+			});
+
+			if (p.src)
+				p.src = ed.convertURL(p.src, 'src', n);
+
+			each (p, function(v, k) {
+				if (v && !/^(width|height|codebase|classid)$/.test(k))
+					dom.add(ob, 'span', {mce_name : 'param', name : k, '_value' : v});
+			});
+
+			dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type}, p));
+
+			return ob;
+		},
+
+		_spansToImgs : function(p) {
+			var t = this, dom = t.editor.dom, im, ci;
+
+			each(dom.select('span', p), function(n) {
+				// Convert object into image
+				if (dom.getAttrib(n, 'class') == 'mceItemObject') {
+					ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');
+
+					switch (ci) {
+						case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
+							dom.replace(t._createImg('mceItemFlash', n), n);
+							break;
+
+						case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
+							dom.replace(t._createImg('mceItemShockWave', n), n);
+							break;
+
+						case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
+						case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
+						case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
+							dom.replace(t._createImg('mceItemWindowsMedia', n), n);
+							break;
+
+						case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
+							dom.replace(t._createImg('mceItemQuickTime', n), n);
+							break;
+
+						case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
+							dom.replace(t._createImg('mceItemRealMedia', n), n);
+							break;
+
+						default:
+							dom.replace(t._createImg('mceItemFlash', n), n);
+					}
+				}
+			});
+		},
+
+		_createImg : function(cl, n) {
+			var im, dom = this.editor.dom, pa = {}, ti = '';
+
+			// Create image
+			im = dom.create('img', {
+				src : this.url + '/img/trans.gif',
+				width : dom.getAttrib(n, 'width') || 100,
+				height : dom.getAttrib(n, 'height') || 100,
+				'class' : cl
+			});
+
+			// Setup base parameters
+			each(['id', 'name', 'width', 'height', 'bgcolor', 'align'], function(n) {
+				var v = dom.getAttrib(n, 'align');
+
+				if (v)
+					pa[v] = v;
+			});
+
+			// Add optional parameters
+			each(dom.select('span', n), function(n) {
+				if (dom.hasClass(n, 'mceItemParam'))
+					pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_value');
+			});
+
+			// Use src not movie
+			if (pa.movie) {
+				pa.src = pa.movie;
+				delete pa.movie;
+			}
+
+			delete pa.width;
+			delete pa.height;
+
+			im.title = this._serialize(pa);
+
+			return im;
+		},
+
+		_parse : function(s) {
+			return tinymce.util.JSON.parse('{' + s + '}');
+		},
+
+		_serialize : function(o) {
+			return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/embed.js	(revision 1)
@@ -0,0 +1,73 @@
+/**
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
+ */
+
+function writeFlash(p) {
+	writeEmbed(
+		'D27CDB6E-AE6D-11cf-96B8-444553540000',
+		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+		'application/x-shockwave-flash',
+		p
+	);
+}
+
+function writeShockWave(p) {
+	writeEmbed(
+	'166B1BCA-3F9C-11CF-8075-444553540000',
+	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
+	'application/x-director',
+		p
+	);
+}
+
+function writeQuickTime(p) {
+	writeEmbed(
+		'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+		'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
+		'video/quicktime',
+		p
+	);
+}
+
+function writeRealMedia(p) {
+	writeEmbed(
+		'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+		'audio/x-pn-realaudio-plugin',
+		p
+	);
+}
+
+function writeWindowsMedia(p) {
+	p.url = p.src;
+	writeEmbed(
+		'6BF52A52-394A-11D3-B153-00C04F79FAA6',
+		'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
+		'application/x-mplayer2',
+		p
+	);
+}
+
+function writeEmbed(cls, cb, mt, p) {
+	var h = '', n;
+
+	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
+	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
+	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
+	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
+	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
+	h += '>';
+
+	for (n in p)
+		h += '<param name="' + n + '" value="' + p[n] + '">';
+
+	h += '<embed type="' + mt + '"';
+
+	for (n in p)
+		h += n + '="' + p[n] + '" ';
+
+	h += '></embed></object>';
+
+	document.write(h);
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/media.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/media.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/js/media.js	(revision 1)
@@ -0,0 +1,616 @@
+tinyMCEPopup.requireLangPack();
+
+var oldWidth, oldHeight, ed, url;
+
+if (url = tinyMCEPopup.getParam("media_external_list_url"))
+	document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+
+function init() {
+	var pl = "", f, val;
+	var type = "flash", fe, i;
+
+	ed = tinyMCEPopup.editor;
+
+	tinyMCEPopup.resizeToInnerSize();
+	f = document.forms[0]
+
+	fe = ed.selection.getNode();
+	if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
+		pl = "x={" + fe.title + "};";
+
+		switch (ed.dom.getAttrib(fe, 'class')) {
+			case 'mceItemFlash':
+				type = 'flash';
+				break;
+
+			case 'mceItemFlashVideo':
+				type = 'flv';
+				break;
+
+			case 'mceItemShockWave':
+				type = 'shockwave';
+				break;
+
+			case 'mceItemWindowsMedia':
+				type = 'wmp';
+				break;
+
+			case 'mceItemQuickTime':
+				type = 'qt';
+				break;
+
+			case 'mceItemRealMedia':
+				type = 'rmp';
+				break;
+		}
+
+		document.forms[0].insert.value = ed.getLang('update', 'Insert', true); 
+	}
+
+	document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
+	document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var html = getMediaListHTML('medialist','src','media','media');
+	if (html == "")
+		document.getElementById("linklistrow").style.display = 'none';
+	else
+		document.getElementById("linklistcontainer").innerHTML = html;
+
+	// Resize some elements
+	if (isVisible('filebrowser'))
+		document.getElementById('src').style.width = '230px';
+
+	// Setup form
+	if (pl != "") {
+		pl = eval(pl);
+
+		switch (type) {
+			case "flash":
+				setBool(pl, 'flash', 'play');
+				setBool(pl, 'flash', 'loop');
+				setBool(pl, 'flash', 'menu');
+				setBool(pl, 'flash', 'swliveconnect');
+				setStr(pl, 'flash', 'quality');
+				setStr(pl, 'flash', 'scale');
+				setStr(pl, 'flash', 'salign');
+				setStr(pl, 'flash', 'wmode');
+				setStr(pl, 'flash', 'base');
+				setStr(pl, 'flash', 'flashvars');
+			break;
+
+			case "qt":
+				setBool(pl, 'qt', 'loop');
+				setBool(pl, 'qt', 'autoplay');
+				setBool(pl, 'qt', 'cache');
+				setBool(pl, 'qt', 'controller');
+				setBool(pl, 'qt', 'correction');
+				setBool(pl, 'qt', 'enablejavascript');
+				setBool(pl, 'qt', 'kioskmode');
+				setBool(pl, 'qt', 'autohref');
+				setBool(pl, 'qt', 'playeveryframe');
+				setBool(pl, 'qt', 'tarsetcache');
+				setStr(pl, 'qt', 'scale');
+				setStr(pl, 'qt', 'starttime');
+				setStr(pl, 'qt', 'endtime');
+				setStr(pl, 'qt', 'tarset');
+				setStr(pl, 'qt', 'qtsrcchokespeed');
+				setStr(pl, 'qt', 'volume');
+				setStr(pl, 'qt', 'qtsrc');
+			break;
+
+			case "shockwave":
+				setBool(pl, 'shockwave', 'sound');
+				setBool(pl, 'shockwave', 'progress');
+				setBool(pl, 'shockwave', 'autostart');
+				setBool(pl, 'shockwave', 'swliveconnect');
+				setStr(pl, 'shockwave', 'swvolume');
+				setStr(pl, 'shockwave', 'swstretchstyle');
+				setStr(pl, 'shockwave', 'swstretchhalign');
+				setStr(pl, 'shockwave', 'swstretchvalign');
+			break;
+
+			case "wmp":
+				setBool(pl, 'wmp', 'autostart');
+				setBool(pl, 'wmp', 'enabled');
+				setBool(pl, 'wmp', 'enablecontextmenu');
+				setBool(pl, 'wmp', 'fullscreen');
+				setBool(pl, 'wmp', 'invokeurls');
+				setBool(pl, 'wmp', 'mute');
+				setBool(pl, 'wmp', 'stretchtofit');
+				setBool(pl, 'wmp', 'windowlessvideo');
+				setStr(pl, 'wmp', 'balance');
+				setStr(pl, 'wmp', 'baseurl');
+				setStr(pl, 'wmp', 'captioningid');
+				setStr(pl, 'wmp', 'currentmarker');
+				setStr(pl, 'wmp', 'currentposition');
+				setStr(pl, 'wmp', 'defaultframe');
+				setStr(pl, 'wmp', 'playcount');
+				setStr(pl, 'wmp', 'rate');
+				setStr(pl, 'wmp', 'uimode');
+				setStr(pl, 'wmp', 'volume');
+			break;
+
+			case "rmp":
+				setBool(pl, 'rmp', 'autostart');
+				setBool(pl, 'rmp', 'loop');
+				setBool(pl, 'rmp', 'autogotourl');
+				setBool(pl, 'rmp', 'center');
+				setBool(pl, 'rmp', 'imagestatus');
+				setBool(pl, 'rmp', 'maintainaspect');
+				setBool(pl, 'rmp', 'nojava');
+				setBool(pl, 'rmp', 'prefetch');
+				setBool(pl, 'rmp', 'shuffle');
+				setStr(pl, 'rmp', 'console');
+				setStr(pl, 'rmp', 'controls');
+				setStr(pl, 'rmp', 'numloop');
+				setStr(pl, 'rmp', 'scriptcallbacks');
+			break;
+		}
+
+		setStr(pl, null, 'src');
+		setStr(pl, null, 'id');
+		setStr(pl, null, 'name');
+		setStr(pl, null, 'vspace');
+		setStr(pl, null, 'hspace');
+		setStr(pl, null, 'bgcolor');
+		setStr(pl, null, 'align');
+		setStr(pl, null, 'width');
+		setStr(pl, null, 'height');
+
+		if ((val = ed.dom.getAttrib(fe, "width")) != "")
+			pl.width = f.width.value = val;
+
+		if ((val = ed.dom.getAttrib(fe, "height")) != "")
+			pl.height = f.height.value = val;
+
+		oldWidth = pl.width ? parseInt(pl.width) : 0;
+		oldHeight = pl.height ? parseInt(pl.height) : 0;
+	} else
+		oldWidth = oldHeight = 0;
+
+	selectByValue(f, 'media_type', type);
+	changedType(type);
+	updateColor('bgcolor_pick', 'bgcolor');
+
+	TinyMCE_EditableSelects.init();
+	generatePreview();
+}
+
+function insertMedia() {
+	var fe, f = document.forms[0], h;
+
+	if (!AutoValidator.validate(f)) {
+		alert(ed.getLang('invalid_data'));
+		return false;
+	}
+
+	f.width.value = f.width.value == "" ? 100 : f.width.value;
+	f.height.value = f.height.value == "" ? 100 : f.height.value;
+
+	fe = ed.selection.getNode();
+	if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
+		switch (f.media_type.options[f.media_type.selectedIndex].value) {
+			case "flash":
+				fe.className = "mceItemFlash";
+				break;
+
+			case "flv":
+				fe.className = "mceItemFlashVideo";
+				break;
+
+			case "shockwave":
+				fe.className = "mceItemShockWave";
+				break;
+
+			case "qt":
+				fe.className = "mceItemQuickTime";
+				break;
+
+			case "wmp":
+				fe.className = "mceItemWindowsMedia";
+				break;
+
+			case "rmp":
+				fe.className = "mceItemRealMedia";
+				break;
+		}
+
+		if (fe.width != f.width.value || fe.height != f.height.height)
+			ed.execCommand('mceRepaint');
+
+		fe.title = serializeParameters();
+		fe.width = f.width.value;
+		fe.height = f.height.value;
+		fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
+		fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
+		fe.align = f.align.options[f.align.selectedIndex].value;
+	} else {
+		h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;
+
+		switch (f.media_type.options[f.media_type.selectedIndex].value) {
+			case "flash":
+				h += ' class="mceItemFlash"';
+				break;
+
+			case "flv":
+				h += ' class="mceItemFlashVideo"';
+				break;
+
+			case "shockwave":
+				h += ' class="mceItemShockWave"';
+				break;
+
+			case "qt":
+				h += ' class="mceItemQuickTime"';
+				break;
+
+			case "wmp":
+				h += ' class="mceItemWindowsMedia"';
+				break;
+
+			case "rmp":
+				h += ' class="mceItemRealMedia"';
+				break;
+		}
+
+		h += ' title="' + serializeParameters() + '"';
+		h += ' width="' + f.width.value + '"';
+		h += ' height="' + f.height.value + '"';
+		h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
+
+		h += ' />';
+
+		ed.execCommand('mceInsertContent', false, h);
+	}
+
+	tinyMCEPopup.close();
+}
+
+function updatePreview() {
+	var f = document.forms[0], type;
+
+	f.width.value = f.width.value || '320';
+	f.height.value = f.height.value || '240';
+
+	type = getType(f.src.value);
+	selectByValue(f, 'media_type', type);
+	changedType(type);
+	generatePreview();
+}
+
+function getMediaListHTML() {
+	if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
+		var html = "";
+
+		html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';
+		html += '<option value="">---</option>';
+
+		for (var i=0; i<tinyMCEMediaList.length; i++)
+			html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
+
+		html += '</select>';
+
+		return html;
+	}
+
+	return "";
+}
+
+function getType(v) {
+	var fo, i, c, el, x, f = document.forms[0];
+
+	fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
+
+	// YouTube
+	if (v.match(/v=(.+)(.*)/)) {
+		f.width.value = '425';
+		f.height.value = '350';
+		f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
+		return 'flash';
+	}
+
+	// Google video
+	if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
+		f.width.value = '425';
+		f.height.value = '326';
+		f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';
+		return 'flash';
+	}
+
+	for (i=0; i<fo.length; i++) {
+		c = fo[i].split('=');
+
+		el = c[1].split(',');
+		for (x=0; x<el.length; x++)
+		if (v.indexOf('.' + el[x]) != -1)
+			return c[0];
+	}
+
+	return null;
+}
+
+function switchType(v) {
+	var t = getType(v), d = document, f = d.forms[0];
+
+	if (!t)
+		return;
+
+	selectByValue(d.forms[0], 'media_type', t);
+	changedType(t);
+
+	// Update qtsrc also
+	if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
+		alert(ed.getLang("media_qt_stream_warn"));
+
+		if (f.qt_qtsrc.value == '')
+			f.qt_qtsrc.value = f.src.value;
+	}
+}
+
+function changedType(t) {
+	var d = document;
+
+	d.getElementById('flash_options').style.display = 'none';
+	d.getElementById('flv_options').style.display = 'none';
+	d.getElementById('qt_options').style.display = 'none';
+	d.getElementById('shockwave_options').style.display = 'none';
+	d.getElementById('wmp_options').style.display = 'none';
+	d.getElementById('rmp_options').style.display = 'none';
+	d.getElementById(t + '_options').style.display = 'block';
+}
+
+function serializeParameters() {
+	var d = document, f = d.forms[0], s = '';
+
+	switch (f.media_type.options[f.media_type.selectedIndex].value) {
+		case "flash":
+			s += getBool('flash', 'play', true);
+			s += getBool('flash', 'loop', true);
+			s += getBool('flash', 'menu', true);
+			s += getBool('flash', 'swliveconnect', false);
+			s += getStr('flash', 'quality');
+			s += getStr('flash', 'scale');
+			s += getStr('flash', 'salign');
+			s += getStr('flash', 'wmode');
+			s += getStr('flash', 'base');
+			s += getStr('flash', 'flashvars');
+		break;
+
+		case "qt":
+			s += getBool('qt', 'loop', false);
+			s += getBool('qt', 'autoplay', true);
+			s += getBool('qt', 'cache', false);
+			s += getBool('qt', 'controller', true);
+			s += getBool('qt', 'correction', false, 'none', 'full');
+			s += getBool('qt', 'enablejavascript', false);
+			s += getBool('qt', 'kioskmode', false);
+			s += getBool('qt', 'autohref', false);
+			s += getBool('qt', 'playeveryframe', false);
+			s += getBool('qt', 'targetcache', false);
+			s += getStr('qt', 'scale');
+			s += getStr('qt', 'starttime');
+			s += getStr('qt', 'endtime');
+			s += getStr('qt', 'target');
+			s += getStr('qt', 'qtsrcchokespeed');
+			s += getStr('qt', 'volume');
+			s += getStr('qt', 'qtsrc');
+		break;
+
+		case "shockwave":
+			s += getBool('shockwave', 'sound');
+			s += getBool('shockwave', 'progress');
+			s += getBool('shockwave', 'autostart');
+			s += getBool('shockwave', 'swliveconnect');
+			s += getStr('shockwave', 'swvolume');
+			s += getStr('shockwave', 'swstretchstyle');
+			s += getStr('shockwave', 'swstretchhalign');
+			s += getStr('shockwave', 'swstretchvalign');
+		break;
+
+		case "wmp":
+			s += getBool('wmp', 'autostart', true);
+			s += getBool('wmp', 'enabled', false);
+			s += getBool('wmp', 'enablecontextmenu', true);
+			s += getBool('wmp', 'fullscreen', false);
+			s += getBool('wmp', 'invokeurls', true);
+			s += getBool('wmp', 'mute', false);
+			s += getBool('wmp', 'stretchtofit', false);
+			s += getBool('wmp', 'windowlessvideo', false);
+			s += getStr('wmp', 'balance');
+			s += getStr('wmp', 'baseurl');
+			s += getStr('wmp', 'captioningid');
+			s += getStr('wmp', 'currentmarker');
+			s += getStr('wmp', 'currentposition');
+			s += getStr('wmp', 'defaultframe');
+			s += getStr('wmp', 'playcount');
+			s += getStr('wmp', 'rate');
+			s += getStr('wmp', 'uimode');
+			s += getStr('wmp', 'volume');
+		break;
+
+		case "rmp":
+			s += getBool('rmp', 'autostart', false);
+			s += getBool('rmp', 'loop', false);
+			s += getBool('rmp', 'autogotourl', true);
+			s += getBool('rmp', 'center', false);
+			s += getBool('rmp', 'imagestatus', true);
+			s += getBool('rmp', 'maintainaspect', false);
+			s += getBool('rmp', 'nojava', false);
+			s += getBool('rmp', 'prefetch', false);
+			s += getBool('rmp', 'shuffle', false);
+			s += getStr('rmp', 'console');
+			s += getStr('rmp', 'controls');
+			s += getStr('rmp', 'numloop');
+			s += getStr('rmp', 'scriptcallbacks');
+		break;
+	}
+
+	s += getStr(null, 'id');
+	s += getStr(null, 'name');
+	s += getStr(null, 'src');
+	s += getStr(null, 'align');
+	s += getStr(null, 'bgcolor');
+	s += getInt(null, 'vspace');
+	s += getInt(null, 'hspace');
+	s += getStr(null, 'width');
+	s += getStr(null, 'height');
+
+	s = s.length > 0 ? s.substring(0, s.length - 1) : s;
+
+	return s;
+}
+
+function setBool(pl, p, n) {
+	if (typeof(pl[n]) == "undefined")
+		return;
+
+	document.forms[0].elements[p + "_" + n].checked = pl[n];
+}
+
+function setStr(pl, p, n) {
+	var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
+
+	if (typeof(pl[n]) == "undefined")
+		return;
+
+	if (e.type == "text")
+		e.value = pl[n];
+	else
+		selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
+}
+
+function getBool(p, n, d, tv, fv) {
+	var v = document.forms[0].elements[p + "_" + n].checked;
+
+	tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
+	fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
+
+	return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ',');
+}
+
+function getStr(p, n, d) {
+	var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
+	var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
+
+	return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
+}
+
+function getInt(p, n, d) {
+	var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
+	var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
+
+	return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
+}
+
+function jsEncode(s) {
+	s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
+	s = s.replace(new RegExp('"', 'g'), '\\"');
+	s = s.replace(new RegExp("'", 'g'), "\\'");
+
+	return s;
+}
+
+function generatePreview(c) {
+	var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
+
+	p.innerHTML = '<!-- x --->';
+
+	nw = parseInt(f.width.value);
+	nh = parseInt(f.height.value);
+
+	if (f.width.value != "" && f.height.value != "") {
+		if (f.constrain.checked) {
+			if (c == 'width' && oldWidth != 0) {
+				wp = nw / oldWidth;
+				nh = Math.round(wp * nh);
+				f.height.value = nh;
+			} else if (c == 'height' && oldHeight != 0) {
+				hp = nh / oldHeight;
+				nw = Math.round(hp * nw);
+				f.width.value = nw;
+			}
+		}
+	}
+
+	if (f.width.value != "")
+		oldWidth = nw;
+
+	if (f.height.value != "")
+		oldHeight = nh;
+
+	// After constrain
+	pl = serializeParameters();
+
+	switch (f.media_type.options[f.media_type.selectedIndex].value) {
+		case "flash":
+			cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
+			codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
+			type = 'application/x-shockwave-flash';
+			break;
+
+		case "shockwave":
+			cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
+			codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
+			type = 'application/x-director';
+			break;
+
+		case "qt":
+			cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
+			codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
+			type = 'video/quicktime';
+			break;
+
+		case "wmp":
+			cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
+			codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+			type = 'application/x-mplayer2';
+			break;
+
+		case "rmp":
+			cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
+			codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
+			type = 'audio/x-pn-realaudio-plugin';
+			break;
+	}
+
+	if (pl == '') {
+		p.innerHTML = '';
+		return;
+	}
+
+	pl = eval('x={' + pl + '};');
+
+	if (!pl.src) {
+		p.innerHTML = '';
+		return;
+	}
+
+	pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);
+	pl.width = !pl.width ? 100 : pl.width;
+	pl.height = !pl.height ? 100 : pl.height;
+	pl.id = !pl.id ? 'obj' : pl.id;
+	pl.name = !pl.name ? 'eobj' : pl.name;
+	pl.align = !pl.align ? '' : pl.align;
+
+	h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
+
+	for (n in pl) {
+		h += '<param name="' + n + '" value="' + pl[n] + '">';
+
+		// Add extra url parameter if it's an absolute URL
+		if (n == 'src' && pl[n].indexOf('://') != -1)
+			h += '<param name="url" value="' + pl[n] + '" />';
+	}
+
+	h += '<embed type="' + type + '" ';
+
+	for (n in pl)
+		h += n + '="' + pl[n] + '" ';
+
+	h += '></embed></object>';
+
+	p.innerHTML = "<!-- x --->" + h;
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,103 @@
+tinyMCE.addI18n('en.media_dlg',{
+title:"Insert / edit embedded media",
+general:"General",
+advanced:"Advanced",
+file:"File/URL",
+list:"List",
+size:"Dimensions",
+preview:"Preview",
+constrain_proportions:"Constrain proportions",
+type:"Type",
+id:"Id",
+name:"Name",
+class_name:"Class",
+vspace:"V-Space",
+hspace:"H-Space",
+play:"Auto play",
+loop:"Loop",
+menu:"Show menu",
+quality:"Quality",
+scale:"Scale",
+align:"Align",
+salign:"SAlign",
+wmode:"WMode",
+bgcolor:"Background",
+base:"Base",
+flashvars:"Flashvars",
+liveconnect:"SWLiveConnect",
+autohref:"AutoHREF",
+cache:"Cache",
+hidden:"Hidden",
+controller:"Controller",
+kioskmode:"Kiosk mode",
+playeveryframe:"Play every frame",
+targetcache:"Target cache",
+correction:"No correction",
+enablejavascript:"Enable JavaScript",
+starttime:"Start time",
+endtime:"End time",
+href:"Href",
+qtsrcchokespeed:"Choke speed",
+target:"Target",
+volume:"Volume",
+autostart:"Auto start",
+enabled:"Enabled",
+fullscreen:"Fullscreen",
+invokeurls:"Invoke URLs",
+mute:"Mute",
+stretchtofit:"Stretch to fit",
+windowlessvideo:"Windowless video",
+balance:"Balance",
+baseurl:"Base URL",
+captioningid:"Captioning id",
+currentmarker:"Current marker",
+currentposition:"Current position",
+defaultframe:"Default frame",
+playcount:"Play count",
+rate:"Rate",
+uimode:"UI Mode",
+flash_options:"Flash options",
+qt_options:"Quicktime options",
+wmp_options:"Windows media player options",
+rmp_options:"Real media player options",
+shockwave_options:"Shockwave options",
+autogotourl:"Auto goto URL",
+center:"Center",
+imagestatus:"Image status",
+maintainaspect:"Maintain aspect",
+nojava:"No java",
+prefetch:"Prefetch",
+shuffle:"Shuffle",
+console:"Console",
+numloop:"Num loops",
+controls:"Controls",
+scriptcallbacks:"Script callbacks",
+swstretchstyle:"Stretch style",
+swstretchhalign:"Stretch H-Align",
+swstretchvalign:"Stretch V-Align",
+sound:"Sound",
+progress:"Progress",
+qtsrc:"QT Src",
+qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",
+align_top:"Top",
+align_right:"Right",
+align_bottom:"Bottom",
+align_left:"Left",
+align_center:"Center",
+align_top_left:"Top left",
+align_top_right:"Top right",
+align_bottom_left:"Bottom left",
+align_bottom_right:"Bottom right",
+flv_options:"Flash video options",
+flv_scalemode:"Scale mode",
+flv_buffer:"Buffer",
+flv_startimage:"Start image",
+flv_starttime:"Start time",
+flv_defaultvolume:"Default volumne",
+flv_hiddengui:"Hidden GUI",
+flv_autostart:"Auto start",
+flv_loop:"Loop",
+flv_showscalemodes:"Show scale modes",
+flv_smoothvideo:"Smooth video",
+flv_jscallback:"JS Callback"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/media.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/media.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/media/media.htm	(revision 1)
@@ -0,0 +1,823 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#media_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/media.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<link href="css/media.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body style="display: none">
+    <form onsubmit="insertMedia();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{#media_dlg.general}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+							<tr>
+								<td><label for="media_type">{#media_dlg.type}</label></td>
+								<td>
+									<select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
+										<option value="flash">Flash</option>
+										<!-- <option value="flv">Flash video (FLV)</option> -->
+										<option value="qt">Quicktime</option>
+										<option value="shockwave">Shockware</option>
+										<option value="wmp">Windows Media</option>
+										<option value="rmp">Real Media</option>
+									</select>
+								</td>
+							</tr>
+							<tr>
+							<td><label for="src">{#media_dlg.file}</label></td>
+							  <td>
+									<table border="0" cellspacing="0" cellpadding="0">
+									  <tr>
+										<td><input id="src" name="src" type="text" value="" onchange="switchType(this.value);generatePreview();" /></td>
+										<td id="filebrowsercontainer">&nbsp;</td>
+									  </tr>
+									</table>
+								</td>
+							</tr>
+							<tr id="linklistrow">
+								<td><label for="linklist">{#media_dlg.list}</label></td>
+								<td id="linklistcontainer">&nbsp;</td>
+							</tr>
+							<tr>
+								<td><label for="width">{#media_dlg.size}</label></td>
+								<td>
+									<table border="0" cellpadding="0" cellspacing="0">
+										<tr>
+											<td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size"  onchange="generatePreview('height');" /></td>
+											<td>&nbsp;&nbsp;<input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
+											<td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
+										</tr>
+									</table>
+								</td>
+							</tr>
+					</table>
+				</fieldset>
+
+				<fieldset>
+					<legend>{#media_dlg.preview}</legend>
+					<div id="prev"></div>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{#media_dlg.advanced}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0" width="100%">
+						<tr>
+							<td><label for="id">{#media_dlg.id}</label></td>
+							<td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
+							<td><label for="name">{#media_dlg.name}</label></td>
+							<td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="align">{#media_dlg.align}</label></td>
+							<td>
+								<select id="align" name="align" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="top">{#media_dlg.align_top}</option>
+									<option value="right">{#media_dlg.align_right}</option>
+									<option value="bottom">{#media_dlg.align_bottom}</option>
+									<option value="left">{#media_dlg.align_left}</option>
+								</select>
+							</td>
+
+							<td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="vspace">{#media_dlg.vspace}</label></td>
+							<td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
+							<td><label for="hspace">{#media_dlg.hspace}</label></td>
+							<td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset id="flash_options">
+					<legend>{#media_dlg.flash_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="flash_quality">{#media_dlg.quality}</label></td>
+							<td>
+								<select id="flash_quality" name="flash_quality" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="high">high</option>
+									<option value="low">low</option>
+									<option value="autolow">autolow</option>
+									<option value="autohigh">autohigh</option>
+									<option value="best">best</option>
+								</select>
+							</td>
+
+							<td><label for="flash_scale">{#media_dlg.scale}</label></td>
+							<td>
+								<select id="flash_scale" name="flash_scale" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="showall">showall</option>
+									<option value="noborder">noborder</option>
+									<option value="exactfit">exactfit</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
+							<td>
+								<select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="window">window</option>
+									<option value="opaque">opaque</option>
+									<option value="transparent">transparent</option>
+								</select>
+							</td>
+
+							<td><label for="flash_salign">{#media_dlg.salign}</label></td>
+							<td>
+								<select id="flash_salign" name="flash_salign" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="l">{#media_dlg.align_left}</option>
+									<option value="t">{#media_dlg.align_top}</option>
+									<option value="r">{#media_dlg.align_right}</option>
+									<option value="b">{#media_dlg.align_bottom}</option>
+									<option value="tl">{#media_dlg.align_top_left}</option>
+									<option value="tr">{#media_dlg.align_top_right}</option>
+									<option value="bl">{#media_dlg.align_bottom_left}</option>
+									<option value="br">{#media_dlg.align_bottom_right}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flash_play">{#media_dlg.play}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flash_loop">{#media_dlg.loop}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flash_menu">{#media_dlg.menu}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
+										<td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+
+					<table>
+						<tr>
+							<td><label for="flash_base">{#media_dlg.base}</label></td>
+							<td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
+							<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset id="flv_options">
+					<legend>{#media_dlg.flv_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>
+							<td>
+								<select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="none">none</option>
+									<option value="double">double</option>
+									<option value="full">full</option>
+								</select>
+							</td>
+
+							<td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>
+							<td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>
+							<td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>
+
+							<td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
+							<td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
+							<td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
+
+							<td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
+							<td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>
+										<td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>
+										<td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset id="qt_options">
+					<legend>{#media_dlg.qt_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
+										<td><label for="qt_loop">{#media_dlg.loop}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="qt_autoplay">{#media_dlg.play}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
+										<td><label for="qt_cache">{#media_dlg.cache}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="qt_controller">{#media_dlg.controller}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
+										<td><label for="qt_correction">{#media_dlg.correction}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
+										<td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
+										<td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
+										<td><label for="qt_autohref">{#media_dlg.autohref}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
+										<td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
+										<td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="qt_scale">{#media_dlg.scale}</label></td>
+							<td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
+									<option value="">{#not_set}</option> 
+									<option value="tofit">tofit</option>
+									<option value="aspect">aspect</option>
+								</select>
+							</td>
+
+							<td colspan="2">&nbsp;</td>
+						</tr>
+
+						<tr>
+							<td><label for="qt_starttime">{#media_dlg.starttime}</label></td>
+							<td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
+
+							<td><label for="qt_endtime">{#media_dlg.endtime}</label></td>
+							<td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="qt_target">{#media_dlg.target}</label></td>
+							<td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
+
+							<td><label for="qt_href">{#media_dlg.href}</label></td>
+							<td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
+							<td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
+
+							<td><label for="qt_volume">{#media_dlg.volume}</label></td>
+							<td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>
+							<td colspan="4">
+							<table border="0" cellspacing="0" cellpadding="0">
+								  <tr>
+									<td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
+									<td id="qtsrcfilebrowsercontainer">&nbsp;</td>
+								  </tr>
+							</table>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset id="wmp_options">
+					<legend>{#media_dlg.wmp_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
+										<td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
+										<td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
+										<td><label for="wmp_mute">{#media_dlg.mute}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
+										<td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
+										<td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="wmp_balance">{#media_dlg.balance}</label></td>
+							<td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
+
+							<td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>
+							<td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>
+							<td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
+
+							<td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>
+							<td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>
+							<td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
+
+							<td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>
+							<td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>
+							<td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
+
+							<td><label for="wmp_rate">{#media_dlg.rate}</label></td>
+							<td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>
+							<td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
+
+							<td><label for="wmp_volume">{#media_dlg.volume}</label></td>
+							<td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
+						</tr>
+
+					</table>
+				</fieldset>
+
+				<fieldset id="rmp_options">
+					<legend>{#media_dlg.rmp_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
+										<td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
+										<td><label for="rmp_loop">{#media_dlg.loop}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
+										<td><label for="rmp_center">{#media_dlg.center}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
+										<td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
+										<td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
+										<td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
+										<td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
+										<td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								&nbsp;
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="rmp_console">{#media_dlg.console}</label></td>
+							<td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
+
+							<td><label for="rmp_controls">{#media_dlg.controls}</label></td>
+							<td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>
+							<td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
+
+							<td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
+							<td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+
+				<fieldset id="shockwave_options">
+					<legend>{#media_dlg.shockwave_options}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
+							<td>
+								<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
+									<option value="none">{#not_set}</option>
+									<option value="meet">Meet</option>
+									<option value="fill">Fill</option>
+									<option value="stage">Stage</option>
+								</select>
+							</td>
+
+							<td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
+							<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
+						</tr>
+
+						<tr>
+							<td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
+							<td>
+								<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
+									<option value="none">{#not_set}</option>
+									<option value="left">{#media_dlg.align_left}</option>
+									<option value="center">{#media_dlg.align_center}</option>
+									<option value="right">{#media_dlg.align_right}</option>
+								</select>
+							</td>
+
+							<td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
+							<td>
+								<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
+									<option value="none">{#not_set}</option>
+									<option value="meet">Meet</option>
+									<option value="fill">Fill</option>
+									<option value="stage">Stage</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
+										<td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
+										<td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+
+
+						<tr>
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
+										<td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
+									</tr>
+								</table>
+							</td>
+
+							<td colspan="2">
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
+										<td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="insertMedia();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Nonbreaking',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceNonBreaking',function(){ed.execCommand('mceInsertContent',false,(ed.plugins.visualchars&&ed.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">&middot;</span>':'&nbsp;');});ed.addButton('nonbreaking',{title:'nonbreaking.nonbreaking_desc',cmd:'mceNonBreaking'});if(ed.getParam('nonbreaking_force_tab')){ed.onKeyDown.add(function(ed,e){if(tinymce.isIE&&e.keyCode==9){ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');ed.execCommand('mceNonBreaking');tinymce.dom.Event.cancel(e);}});}},getInfo:function(){return{longname:'Nonbreaking space',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('nonbreaking',tinymce.plugins.Nonbreaking);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,50 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Nonbreaking', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceNonBreaking', function() {
+				ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">&middot;</span>' : '&nbsp;');
+			});
+
+			// Register buttons
+			ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});
+
+			if (ed.getParam('nonbreaking_force_tab')) {
+				ed.onKeyDown.add(function(ed, e) {
+					if (tinymce.isIE && e.keyCode == 9) {
+						ed.execCommand('mceNonBreaking');
+						ed.execCommand('mceNonBreaking');
+						ed.execCommand('mceNonBreaking');
+						tinymce.dom.Event.cancel(e);
+					}
+				});
+			}
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Nonbreaking space',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+
+		// Private methods
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.NonEditablePlugin',{init:function(ed,url){var t=this,editClass,nonEditClass;t.editor=ed;editClass=ed.getParam("noneditable_editable_class","mceEditable");nonEditClass=ed.getParam("noneditable_noneditable_class","mceNonEditable");ed.onNodeChange.addToTop(function(ed,cm,n){var sc,ec;sc=ed.dom.getParent(ed.selection.getStart(),function(n){return ed.dom.hasClass(n,nonEditClass);});ec=ed.dom.getParent(ed.selection.getEnd(),function(n){return ed.dom.hasClass(n,nonEditClass);});if(sc||ec){t._setDisabled(1);return false;}else t._setDisabled(0);});},getInfo:function(){return{longname:'Non editable elements',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_block:function(ed,e){return Event.cancel(e);},_setDisabled:function(s){var t=this,ed=t.editor;tinymce.each(ed.controlManager.controls,function(c){c.setDisabled(s);});if(s!==t.disabled){if(s){ed.onKeyDown.addToTop(t._block);ed.onKeyPress.addToTop(t._block);ed.onKeyUp.addToTop(t._block);ed.onPaste.addToTop(t._block);}else{ed.onKeyDown.remove(t._block);ed.onKeyPress.remove(t._block);ed.onKeyUp.remove(t._block);ed.onPaste.remove(t._block);}t.disabled=s;}}});tinymce.PluginManager.add('noneditable',tinymce.plugins.NonEditablePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,81 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var Event = tinymce.dom.Event;
+
+	tinymce.create('tinymce.plugins.NonEditablePlugin', {
+		init : function(ed, url) {
+			var t = this, editClass, nonEditClass;
+
+			t.editor = ed;
+			editClass = ed.getParam("noneditable_editable_class", "mceEditable");
+			nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");
+
+			ed.onNodeChange.addToTop(function(ed, cm, n) {
+				var sc, ec;
+
+				// Block if start or end is inside a non editable element
+				sc = ed.dom.getParent(ed.selection.getStart(), function(n) {
+					return ed.dom.hasClass(n, nonEditClass);
+				});
+
+				ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {
+					return ed.dom.hasClass(n, nonEditClass);
+				});
+
+				// Block or unblock
+				if (sc || ec) {
+					t._setDisabled(1);
+					return false;
+				} else
+					t._setDisabled(0);
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Non editable elements',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		_block : function(ed, e) {
+			return Event.cancel(e);
+		},
+
+		_setDisabled : function(s) {
+			var t = this, ed = t.editor;
+
+			tinymce.each(ed.controlManager.controls, function(c) {
+				c.setDisabled(s);
+			});
+
+			if (s !== t.disabled) {
+				if (s) {
+					ed.onKeyDown.addToTop(t._block);
+					ed.onKeyPress.addToTop(t._block);
+					ed.onKeyUp.addToTop(t._block);
+					ed.onPaste.addToTop(t._block);
+				} else {
+					ed.onKeyDown.remove(t._block);
+					ed.onKeyPress.remove(t._block);
+					ed.onKeyUp.remove(t._block);
+					ed.onPaste.remove(t._block);
+				}
+
+				t.disabled = s;
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/css/content.css	(revision 1)
@@ -0,0 +1,1 @@
+.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.PageBreakPlugin',{init:function(ed,url){var pb='<img src="'+url+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',cls='mcePageBreak',sep=ed.getParam('pagebreak_separator','<!-- pagebreak -->'),pbRE;pbRE=new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return'\\'+a;}),'g');ed.addCommand('mcePageBreak',function(){ed.execCommand('mceInsertContent',0,pb);});ed.addButton('pagebreak',{title:'pagebreak.desc',cmd:cls});ed.onInit.add(function(){ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.node.nodeName=='IMG'&&ed.dom.hasClass(o.node,cls))o.name='pagebreak';});}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='IMG'&&ed.dom.hasClass(e,cls))ed.selection.select(e);});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('pagebreak',n.nodeName==='IMG'&&ed.dom.hasClass(n,cls));});ed.onBeforeSetContent.add(function(ed,o){o.content=o.content.replace(pbRE,pb);});ed.onPostProcess.add(function(ed,o){if(o.get)o.content=o.content.replace(/<img[^>]+>/g,function(im){if(im.indexOf('class="mcePageBreak')!==-1)im=sep;return im;});});},getInfo:function(){return{longname:'PageBreak',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('pagebreak',tinymce.plugins.PageBreakPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,73 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.PageBreakPlugin', {
+		init : function(ed, url) {
+			var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
+
+			pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
+
+			// Register commands
+			ed.addCommand('mcePageBreak', function() {
+				ed.execCommand('mceInsertContent', 0, pb);
+			});
+
+			// Register buttons
+			ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
+
+			ed.onInit.add(function() {
+				ed.dom.loadCSS(url + "/css/content.css");
+
+				if (ed.theme.onResolveName) {
+					ed.theme.onResolveName.add(function(th, o) {
+						if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
+							o.name = 'pagebreak';
+					});
+				}
+			});
+
+			ed.onClick.add(function(ed, e) {
+				e = e.target;
+
+				if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))
+					ed.selection.select(e);
+			});
+
+			ed.onNodeChange.add(function(ed, cm, n) {
+				cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));
+			});
+
+			ed.onBeforeSetContent.add(function(ed, o) {
+				o.content = o.content.replace(pbRE, pb);
+			});
+
+			ed.onPostProcess.add(function(ed, o) {
+				if (o.get)
+					o.content = o.content.replace(/<img[^>]+>/g, function(im) {
+						if (im.indexOf('class="mcePageBreak') !== -1)
+							im = sep;
+
+						return im;
+					});
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'PageBreak',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/blank.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/blank.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/blank.htm	(revision 1)
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>blank_page</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link href="css/blank.css" rel="stylesheet" type="text/css" />
+<base target="_self" />
+<script type="text/javascript">
+function init() {
+	if (parent.tinymce.isIE)
+		document.body.contentEditable = true;
+	else
+		document.designMode = 'on';
+
+	parent.initIframe(document);
+	window.focus();
+}
+</script>
+</head>
+<body onload="init();">
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/blank.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/blank.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/blank.css	(revision 1)
@@ -0,0 +1,14 @@
+html, body {height:98%}
+body {
+background-color: #FFFFFF;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size: 10px;
+scrollbar-3dlight-color: #F0F0EE;
+scrollbar-arrow-color: #676662;
+scrollbar-base-color: #F0F0EE;
+scrollbar-darkshadow-color: #DDDDDD;
+scrollbar-face-color: #E0E0DD;
+scrollbar-highlight-color: #F0F0EE;
+scrollbar-shadow-color: #F0F0EE;
+scrollbar-track-color: #F5F5F5;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/css/pasteword.css	(revision 1)
@@ -0,0 +1,3 @@
+.sourceIframe {
+	border: 1px solid #808080;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var Event=tinymce.dom.Event;tinymce.create('tinymce.plugins.PastePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePasteText',function(ui,v){if(ui){ed.windowManager.open({file:url+'/pastetext.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertText(v.html,v.linebreaks);});ed.addCommand('mcePasteWord',function(ui,v){if(ui){ed.windowManager.open({file:url+'/pasteword.htm',width:450,height:400,inline:1},{plugin_url:url});}else t._insertWordContent(v);});ed.addCommand('mceSelectAll',function(){ed.execCommand('selectall');});ed.addButton('pastetext',{title:'paste.paste_text_desc',cmd:'mcePasteText',ui:true});ed.addButton('pasteword',{title:'paste.paste_word_desc',cmd:'mcePasteWord',ui:true});ed.addButton('selectall',{title:'paste.selectall_desc',cmd:'mceSelectAll'});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)});}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true);},1);Event.cancel(e);}});}},getInfo:function(){return{longname:'Paste text/word',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);content=content.replace(/\r\n\r\n/g,'</p><p>');content=content.replace(/\r\r/g,'</p><p>');content=content.replace(/\n\n/g,'</p><p>');if((pos=content.indexOf('</p><p>'))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'<br />');content=content.replace(/\r/g,'<br />');content=content.replace(/\n/g,'<br />');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=this.editor.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=this.editor.getParam("paste_replace_list",'\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i<rl.length;i+=2)content=content.replace(new RegExp(rl[i],'gi'),rl[i+1]);if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>','gi'),'<p><b>$1</b></p>');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)<BR>","gi"),"<p>"+middot+"$1</p>");content=content.replace(new RegExp('<SPAN style="mso-list: Ignore">','gi'),"<span>"+bull);content=content.replace(/<o:p><\/o:p>/gi,"");content=content.replace(new RegExp('<br style="page-break-before: always;.*>','gi'),'-- page break --');content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");if(this.editor.getParam("paste_remove_spans",true))content=content.replace(/<\/?span[^>]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('</p>','<br /><br />','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi,'<p>&nbsp;&nbsp;</p>');content=content.replace(/<h[1-6]>/gi,'<p><b>');content=content.replace(/<\/h[1-6]>/gi,'</b></p>');content=content.replace(/<b>&nbsp;<\/b>/gi,'<b>&nbsp;&nbsp;</b>');content=content.replace(/^(&nbsp;)*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=this.editor.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i<s.length;i++){var c=s.charAt(i);if(l.indexOf(c)!=-1)o+='\\'+c;else o+=c;}return o;},_convertMiddots:function(div,search,class_name){var mdot=String.fromCharCode(183);var bull=String.fromCharCode(8226);var nodes=div.getElementsByTagName("p");var prevul;for(var i=0;i<nodes.length;i++){var p=nodes[i];if(p.innerHTML.indexOf(search)==0){var ul=document.createElement("ul");if(class_name)ul.className=class_name;var li=document.createElement("li");li.innerHTML=p.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');ul.appendChild(li);var np=p.nextSibling;while(np){if(np.nodeType==3&&new RegExp('^\\s$','m').test(np.nodeValue)){np=np.nextSibling;continue;}if(search==mdot){if(np.nodeType==1&&new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)){if(!prevul){prevul=ul;ul=document.createElement("ul");prevul.appendChild(ul);}np.innerHTML=np.innerHTML.replace(/^o/,'');}else{if(prevul){ul=prevul;prevul=null;}if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}}else{if(np.nodeType!=1||np.innerHTML.indexOf(search)!=0)break;}var cp=np.nextSibling;var li=document.createElement("li");li.innerHTML=np.innerHTML.replace(new RegExp(''+mdot+'|'+bull+'|--list--|&nbsp;',"gi"),'');np.parentNode.removeChild(np);ul.appendChild(li);np=cp;}p.parentNode.replaceChild(ul,p);return true;}}return false;},_clipboardHTML:function(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}});tinymce.PluginManager.add('paste',tinymce.plugins.PastePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,383 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var Event = tinymce.dom.Event;
+
+	tinymce.create('tinymce.plugins.PastePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed; 
+
+			// Register commands
+			ed.addCommand('mcePasteText', function(ui, v) {
+				if (ui) {
+					ed.windowManager.open({
+						file : url + '/pastetext.htm',
+						width : 450,
+						height : 400,
+						inline : 1
+					}, {
+						plugin_url : url
+					});
+				} else
+					t._insertText(v.html, v.linebreaks);
+			});
+
+			ed.addCommand('mcePasteWord', function(ui, v) {
+				if (ui) {
+					ed.windowManager.open({
+						file : url + '/pasteword.htm',
+						width : 450,
+						height : 400,
+						inline : 1
+					}, {
+						plugin_url : url
+					});
+				} else
+					t._insertWordContent(v);
+			});
+
+			ed.addCommand('mceSelectAll', function() {
+				ed.execCommand('selectall'); 
+			});
+
+			// Register buttons
+			ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true});
+			ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true});
+			ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'});
+
+			if (ed.getParam("paste_auto_cleanup_on_paste", false)) {
+				ed.onPaste.add(function(ed, e) {
+					return t._handlePasteEvent(e)
+				});
+			}
+
+			if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) {
+				// Force paste dialog if non IE browser
+				ed.onKeyDown.add(function(ed, e) {
+					if (e.ctrlKey && e.keyCode == 86) {
+						window.setTimeout(function() {
+							ed.execCommand("mcePasteText", true);
+						}, 1);
+
+						Event.cancel(e);
+					}
+				});
+			}
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Paste text/word',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_handlePasteEvent : function(e) {
+			var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r;
+
+			// Removes italic, strong etc, the if was needed due to bug #1437114
+			if (ed && (r = sel.getRng()) && r.text.length > 0)
+				ed.execCommand('delete');
+
+			if (html && html.length > 0)
+				ed.execCommand('mcePasteWord', false, html);
+
+			return Event.cancel(e);
+		},
+
+		_insertText : function(content, bLinebreaks) { 
+			if (content && content.length > 0) {
+				if (bLinebreaks) { 
+					// Special paragraph treatment 
+					if (this.editor.getParam("paste_create_paragraphs", true)) {
+						var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+						for (var i=0; i<rl.length; i+=2)
+							content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+						content = content.replace(/\r\n\r\n/g, '</p><p>');
+						content = content.replace(/\r\r/g, '</p><p>');
+						content = content.replace(/\n\n/g, '</p><p>');
+
+						// Has paragraphs 
+						if ((pos = content.indexOf('</p><p>')) != -1) { 
+							this.editor.execCommand("Delete"); 
+
+							var node = this.editor.selection.getNode(); 
+
+							// Get list of elements to break 
+							var breakElms = [];
+
+							do { 
+								if (node.nodeType == 1) { 
+									// Don't break tables and break at body 
+									if (node.nodeName == "TD" || node.nodeName == "BODY") 
+										break; 
+			
+									breakElms[breakElms.length] = node; 
+								} 
+							} while(node = node.parentNode); 
+
+							var before = "", after = "</p>"; 
+							before += content.substring(0, pos); 
+
+							for (var i=0; i<breakElms.length; i++) { 
+								before += "</" + breakElms[i].nodeName + ">"; 
+								after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; 
+							} 
+
+							before += "<p>"; 
+							content = before + content.substring(pos+7) + after; 
+						} 
+					} 
+
+					if (this.editor.getParam("paste_create_linebreaks", true)) {
+						content = content.replace(/\r\n/g, '<br />');
+						content = content.replace(/\r/g, '<br />');
+						content = content.replace(/\n/g, '<br />');
+					}
+				} 
+			
+				this.editor.execCommand("mceInsertRawHTML", false, content); 
+			}
+		},
+
+		_insertWordContent : function(content) { 
+			var t = this, ed = t.editor;
+
+			if (content && content.length > 0) {
+				// Cleanup Word content
+				var bull = String.fromCharCode(8226);
+				var middot = String.fromCharCode(183);
+				var cb;
+
+				if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "")
+					content = eval(cb + "('before', content)");
+
+				var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+				for (var i=0; i<rl.length; i+=2)
+					content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+				if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
+					content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
+				}
+
+				content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
+				content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
+				content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
+				content = content.replace(/<o:p><\/o:p>/gi, "");
+				content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
+				content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), "");  // Word comments
+
+				if (this.editor.getParam("paste_remove_spans", true))
+					content = content.replace(/<\/?span[^>]*>/gi, "");
+
+				if (this.editor.getParam("paste_remove_styles", true))
+					content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
+
+				content = content.replace(/<\/?font[^>]*>/gi, "");
+
+				// Strips class attributes.
+				switch (this.editor.getParam("paste_strip_class_attributes", "all")) {
+					case "all":
+						content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+						break;
+
+					case "mso":
+						content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
+						break;
+				}
+
+				content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI());
+				content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+				content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+				content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+				content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
+				content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
+
+		//		content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
+		//		content = content.replace(/<p>&nbsp;<\/p>/gi, '');
+
+				if (!this.editor.getParam('force_p_newlines')) {
+					content = content.replace('', '' ,'gi');
+					content = content.replace('</p>', '<br /><br />' ,'gi');
+				}
+
+				if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) {
+					content = content.replace(/<\/?p[^>]*>/gi, "");
+				}
+
+				content = content.replace(/<\/?div[^>]*>/gi, "");
+
+				// Convert all middlot lists to UL lists
+				if (this.editor.getParam("paste_convert_middot_lists", true)) {
+					var div = ed.dom.create("div", null, content);
+
+					// Convert all middot paragraphs to li elements
+					var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList");
+
+					while (this._convertMiddots(div, "--list--")) ; // bull
+					while (this._convertMiddots(div, middot, className)) ; // Middot
+					while (this._convertMiddots(div, bull)) ; // bull
+
+					content = div.innerHTML;
+				}
+
+				// Replace all headers with strong and fix some other issues
+				if (this.editor.getParam("paste_convert_headers_to_strong", false)) {
+					content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
+					content = content.replace(/<h[1-6]>/gi, '<p><b>');
+					content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
+					content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
+					content = content.replace(/^(&nbsp;)*/gi, '');
+				}
+
+				content = content.replace(/--list--/gi, ""); // Remove --list--
+
+				if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "")
+					content = eval(cb + "('after', content)");
+
+				// Insert cleaned content
+				this.editor.execCommand("mceInsertContent", false, content);
+
+				if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) {
+					var ed = this.editor;
+
+					window.setTimeout(function() {
+						ed.execCommand("mceCleanup");
+					}, 1); // Do normal cleanup detached from this thread
+				}
+			}
+		},
+
+		_reEscape : function(s) {
+			var l = "?.\\*[](){}+^$:";
+			var o = "";
+
+			for (var i=0; i<s.length; i++) {
+				var c = s.charAt(i);
+
+				if (l.indexOf(c) != -1)
+					o += '\\' + c;
+				else
+					o += c;
+			}
+
+			return o;
+		},
+
+		_convertMiddots : function(div, search, class_name) {
+			var mdot = String.fromCharCode(183);
+			var bull = String.fromCharCode(8226);
+
+			var nodes = div.getElementsByTagName("p");
+			var prevul;
+			for (var i=0; i<nodes.length; i++) {
+				var p = nodes[i];
+
+				// Is middot
+				if (p.innerHTML.indexOf(search) == 0) {
+					var ul = document.createElement("ul");
+
+					if (class_name)
+						ul.className = class_name;
+
+					// Add the first one
+					var li = document.createElement("li");
+					li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+					ul.appendChild(li);
+
+					// Add the rest
+					var np = p.nextSibling;
+					while (np) {
+						// If the node is whitespace, then
+						// ignore it and continue on.
+						if (np.nodeType == 3 && new RegExp('^\\s$', 'm').test(np.nodeValue)) {
+								np = np.nextSibling;
+								continue;
+						}
+
+						if (search == mdot) {
+								if (np.nodeType == 1 && new RegExp('^o(\\s+|&nbsp;)').test(np.innerHTML)) {
+										// Second level of nesting
+										if (!prevul) {
+												prevul = ul;
+												ul = document.createElement("ul");
+												prevul.appendChild(ul);
+										}
+										np.innerHTML = np.innerHTML.replace(/^o/, '');
+								} else {
+										// Pop the stack if we're going back up to the first level
+										if (prevul) {
+												ul = prevul;
+												prevul = null;
+										}
+										// Not element or middot paragraph
+										if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+												break;
+								}
+						} else {
+								// Not element or middot paragraph
+								if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+										break;
+							}
+
+						var cp = np.nextSibling;
+						var li = document.createElement("li");
+						li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+						np.parentNode.removeChild(np);
+						ul.appendChild(li);
+						np = cp;
+					}
+
+					p.parentNode.replaceChild(ul, p);
+
+					return true;
+				}
+			}
+
+			return false;
+		},
+
+		_clipboardHTML : function() {
+			var div = document.getElementById('_TinyMCE_clipboardHTML');
+
+			if (!div) {
+				var div = document.createElement('DIV');
+				div.id = '_TinyMCE_clipboardHTML';
+
+				with (div.style) {
+					visibility = 'hidden';
+					overflow = 'hidden';
+					position = 'absolute';
+					width = 1;
+					height = 1;
+				}
+
+				document.body.appendChild(div);
+			}
+
+			div.innerHTML = '';
+			var rng = document.body.createTextRange();
+			rng.moveToElementText(div);
+			rng.execCommand('Paste');
+			var html = div.innerHTML;
+			div.innerHTML = '';
+			return html;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('paste', tinymce.plugins.PastePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pastetext.js	(revision 1)
@@ -0,0 +1,42 @@
+tinyMCEPopup.requireLangPack();
+
+function saveContent() {
+	if (document.forms[0].htmlSource.value == '') {
+		tinyMCEPopup.close();
+		return false;
+	}
+
+	tinyMCEPopup.execCommand('mcePasteText', false, {
+		html : document.forms[0].htmlSource.value,
+		linebreaks : document.forms[0].linebreaks.checked
+	});
+
+	tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	// Remove Gecko spellchecking
+	if (tinymce.isGecko)
+		document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
+
+	resizeInputs();
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+	if (!tinymce.isIE) {
+		wHeight = self.innerHeight-80;
+		wWidth = self.innerWidth-17;
+	} else {
+		wHeight = document.body.clientHeight-80;
+		wWidth = document.body.clientWidth-17;
+	}
+
+	document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
+	document.forms[0].htmlSource.style.width  = Math.abs(wWidth) + 'px';
+}
+
+tinyMCEPopup.onInit.add(onLoadInit);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/js/pasteword.js	(revision 1)
@@ -0,0 +1,56 @@
+tinyMCEPopup.requireLangPack();
+
+function saveContent() {
+	var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
+
+	if (html == ''){
+		tinyMCEPopup.close();
+		return false;
+	}
+
+	tinyMCEPopup.execCommand('mcePasteWord', false, html);
+	tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	// Fix for endless reloading in FF
+	window.setTimeout('createIFrame();', 10);
+}
+
+function createIFrame() {
+	document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function initIframe(doc) {
+	var dir = tinyMCEPopup.editor.settings.directionality;
+
+	doc.body.dir = dir;
+
+	// Remove Gecko spellchecking
+	if (tinymce.isGecko)
+		doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
+
+	resizeInputs();
+}
+
+function resizeInputs() {
+	if (!tinymce.isIE) {
+		wHeight = self.innerHeight - 80;
+		wWidth = self.innerWidth - 18;
+	} else {
+		wHeight = document.body.clientHeight - 80;
+		wWidth = document.body.clientWidth - 18;
+	}
+
+	var elm = document.getElementById('frmData');
+	if (elm) {
+		elm.style.height = Math.abs(wHeight) + 'px';
+		elm.style.width  = Math.abs(wWidth) + 'px';
+	}
+}
+
+tinyMCEPopup.onInit.add(onLoadInit);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.paste_dlg',{
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
+text_linebreaks:"Keep linebreaks",
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pastetext.htm	(revision 1)
@@ -0,0 +1,34 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#paste.paste_text_desc}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/pastetext.js"></script>
+	<base target="_self" />
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+<form name="source" onsubmit="saveContent();">
+	<div style="float: left" class="title">{#paste.paste_text_desc}</div>
+
+	<div style="float: right">
+		<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
+	</div>
+
+	<br style="clear: both" />
+
+	<div>{#paste_dlg.text_title}</div>
+
+	<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" name="insert" value="{#insert}" onclick="saveContent();" id="insert" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+		</div>
+	</div>
+</form>
+</body> 
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/paste/pasteword.htm	(revision 1)
@@ -0,0 +1,29 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>{#paste.paste_word_desc}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/pasteword.js"></script>
+	<link href="css/pasteword.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+	<form name="source" onsubmit="saveContent();" action="#">
+		<div class="title">{#paste.paste_word_desc}</div>
+
+		<div>{#paste_dlg.word_title}</div>
+
+		<div id="iframecontainer"></div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="saveContent();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mcePreview',t._preview,t);ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_preview:function(){var ed=this.editor,win,html,c,pos,pos2,css,i,page=ed.getParam("plugin_preview_pageurl",null),w=ed.getParam("plugin_preview_width","550"),h=ed.getParam("plugin_preview_height","600");if(page){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",null),width:w,height:h},{resizable:"yes",scrollbars:"yes",inline:1});}else{win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+w+",height="+h);html="";c=ed.getContent();pos=c.indexOf('<body');css=ed.getParam("content_css",'').split(',');tinymce.map(css,function(u){return ed.documentBaseURI.toAbsolute(u);});if(pos!=-1){pos=c.indexOf('>',pos);pos2=c.lastIndexOf('</body>');c=c.substring(pos+1,pos2);}html+=ed.getParam('doctype');html+='<html xmlns="http://www.w3.org/1999/xhtml">';html+='<head>';html+='<title>'+ed.getLang('preview.preview_desc')+'</title>';html+='<base href="'+ed.documentBaseURI.getURI()+'" />';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';for(i=0;i<css.length;i++)html+='<link href="'+css[i]+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body dir="'+ed.getParam("directionality")+'" onload="window.opener.tinymce.EditorManager.get(\''+ed.id+'\').plugins[\'preview\']._onLoad(window,document);">';html+=c;html+='</body>';html+='</html>';win.document.write(html);win.document.close();}},_onLoad:function(w,d){var t=this,nl,i,el=[],sv,ne;t._doc=d;w.writeFlash=t._writeFlash;w.writeShockWave=t._writeShockWave;w.writeQuickTime=t._writeQuickTime;w.writeRealMedia=t._writeRealMedia;w.writeWindowsMedia=t._writeWindowsMedia;w.writeEmbed=t._writeEmbed;nl=d.getElementsByTagName("script");for(i=0;i<nl.length;i++){sv=tinymce.isIE?nl[i].innerHTML:nl[i].firstChild.nodeValue;if(new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*','g').test(sv))el[el.length]=nl[i];}for(i=0;i<el.length;i++){ne=d.createElement("div");ne.innerHTML=d._embeds[i];el[i].parentNode.insertBefore(ne.firstChild,el[i]);}},_writeFlash:function(p){p.src=this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('D27CDB6E-AE6D-11cf-96B8-444553540000','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','application/x-shockwave-flash',p);},_writeShockWave:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('166B1BCA-3F9C-11CF-8075-444553540000','http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0','application/x-director',p);},_writeQuickTime:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('02BF25D5-8C17-4B23-BC80-D3488ABDDC6B','http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0','video/quicktime',p);},_writeRealMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);TinyMCE_PreviewPlugin._writeEmbed('CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0','audio/x-pn-realaudio-plugin',p);},_writeWindowsMedia:function(p){this.editor.documentBaseURI.toAbsolute(p.src);p.url=p.src;TinyMCE_PreviewPlugin._writeEmbed('6BF52A52-394A-11D3-B153-00C04F79FAA6','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701','application/x-mplayer2',p);},_writeEmbed:function(cls,cb,mt,p){var h='',n,d=t._doc,ne,c;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?'id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?'name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?'width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?'height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?'align="'+p.align+'"':'';h+='>';for(n in p)h+='<param name="'+n+'" value="'+p[n]+'">';h+='<embed type="'+mt+'"';for(n in p)h+=n+'="'+p[n]+'" ';h+='></embed></object>';d._embeds[d._embeds.length]=h;}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,187 @@
+/**
+ * $Id: editor_plugin_src.js 537 2008-01-14 16:38:33Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Preview', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			ed.addCommand('mcePreview', t._preview, t);
+			ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Preview',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_preview : function() {
+			var ed = this.editor, win, html, c, pos, pos2, css, i, page = ed.getParam("plugin_preview_pageurl", null), w = ed.getParam("plugin_preview_width", "550"), h = ed.getParam("plugin_preview_height", "600");
+
+			// Use a custom preview page
+			if (page) {
+				ed.windowManager.open({
+					file : ed.getParam("plugin_preview_pageurl", null),
+					width : w,
+					height : h
+				}, {
+					resizable : "yes",
+					scrollbars : "yes",
+					inline : 1
+				});
+			} else {
+				win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + w + ",height="  + h);
+				html = "";
+				c = ed.getContent();
+				pos = c.indexOf('<body');
+				css = ed.getParam("content_css", '').split(',');
+
+				tinymce.map(css, function(u) {
+					return ed.documentBaseURI.toAbsolute(u);
+				});
+
+				if (pos != -1) {
+					pos = c.indexOf('>', pos);
+					pos2 = c.lastIndexOf('</body>');
+					c = c.substring(pos + 1, pos2);
+				}
+
+				html += ed.getParam('doctype');
+				html += '<html xmlns="http://www.w3.org/1999/xhtml">';
+				html += '<head>';
+				html += '<title>' + ed.getLang('preview.preview_desc') + '</title>';
+				html += '<base href="' + ed.documentBaseURI.getURI() + '" />';
+				html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+
+				for (i=0; i<css.length; i++)
+					html += '<link href="' + css[i] + '" rel="stylesheet" type="text/css" />';
+
+				html += '</head>';
+				html += '<body dir="' + ed.getParam("directionality") + '" onload="window.opener.tinymce.EditorManager.get(\'' + ed.id + '\').plugins[\'preview\']._onLoad(window,document);">';
+				html += c;
+				html += '</body>';
+				html += '</html>';
+
+				win.document.write(html);
+				win.document.close();
+			}
+		},
+
+		_onLoad : function(w, d) {
+			var t = this, nl, i, el = [], sv, ne;
+
+			t._doc = d;
+			w.writeFlash = t._writeFlash;
+			w.writeShockWave = t._writeShockWave;
+			w.writeQuickTime = t._writeQuickTime;
+			w.writeRealMedia = t._writeRealMedia;
+			w.writeWindowsMedia = t._writeWindowsMedia;
+			w.writeEmbed = t._writeEmbed;
+
+			nl = d.getElementsByTagName("script");
+			for (i=0; i<nl.length; i++) {
+				sv = tinymce.isIE ? nl[i].innerHTML : nl[i].firstChild.nodeValue;
+
+				if (new RegExp('write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\\(.*', 'g').test(sv))
+					el[el.length] = nl[i];
+			}
+
+			for (i=0; i<el.length; i++) {
+				ne = d.createElement("div");
+				ne.innerHTML = d._embeds[i];
+				el[i].parentNode.insertBefore(ne.firstChild, el[i]);
+			}
+		},
+
+		_writeFlash : function(p) {
+			p.src = this.editor.documentBaseURI.toAbsolute(p.src);
+			TinyMCE_PreviewPlugin._writeEmbed(
+				'D27CDB6E-AE6D-11cf-96B8-444553540000',
+				'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+				'application/x-shockwave-flash',
+				p
+			);
+		},
+
+		_writeShockWave : function(p) {
+			this.editor.documentBaseURI.toAbsolute(p.src);
+			TinyMCE_PreviewPlugin._writeEmbed(
+				'166B1BCA-3F9C-11CF-8075-444553540000',
+				'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
+				'application/x-director',
+				p
+			);
+		},
+
+		_writeQuickTime : function(p) {
+			this.editor.documentBaseURI.toAbsolute(p.src);
+			TinyMCE_PreviewPlugin._writeEmbed(
+				'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+				'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
+				'video/quicktime',
+				p
+			);
+		},
+
+		_writeRealMedia : function(p) {
+			this.editor.documentBaseURI.toAbsolute(p.src);
+			TinyMCE_PreviewPlugin._writeEmbed(
+				'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+				'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+				'audio/x-pn-realaudio-plugin',
+				p
+			);
+		},
+
+		_writeWindowsMedia : function(p) {
+			this.editor.documentBaseURI.toAbsolute(p.src);
+			p.url = p.src;
+			TinyMCE_PreviewPlugin._writeEmbed(
+				'6BF52A52-394A-11D3-B153-00C04F79FAA6',
+				'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
+				'application/x-mplayer2',
+				p
+			);
+		},
+
+		_writeEmbed : function(cls, cb, mt, p) {
+			var h = '', n, d = t._doc, ne, c;
+
+			h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+			h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
+			h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
+			h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
+			h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
+			h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
+			h += '>';
+
+			for (n in p)
+				h += '<param name="' + n + '" value="' + p[n] + '">';
+
+			h += '<embed type="' + mt + '"';
+
+			for (n in p)
+				h += n + '="' + p[n] + '" ';
+
+			h += '></embed></object>';
+
+			d._embeds[d._embeds.length] = h;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/example.html
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/example.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/example.html	(revision 1)
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script language="javascript" src="../../tiny_mce_popup.js"></script>
+<script type="text/javascript" src="jscripts/embed.js"></script>
+<script type="text/javascript">
+tinyMCEPopup.onInit.add(function(ed) {
+	var dom = tinyMCEPopup.dom;
+
+	// Load editor content_css
+	tinymce.each(ed.settings.content_css.split(','), function(u) {
+		dom.loadCSS(ed.documentBaseURI.toAbsolute(u));
+	});
+
+	// Place contents inside div container
+	dom.setHTML('content', ed.getContent());
+});
+</script>
+<title>Example of a custom preview page</title>
+</head>
+<body>
+
+Editor contents: <br />
+<div id="content">
+<!-- Gets filled with editor contents -->
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js	(revision 1)
@@ -0,0 +1,73 @@
+/**
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
+ */
+
+function writeFlash(p) {
+	writeEmbed(
+		'D27CDB6E-AE6D-11cf-96B8-444553540000',
+		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+		'application/x-shockwave-flash',
+		p
+	);
+}
+
+function writeShockWave(p) {
+	writeEmbed(
+	'166B1BCA-3F9C-11CF-8075-444553540000',
+	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
+	'application/x-director',
+		p
+	);
+}
+
+function writeQuickTime(p) {
+	writeEmbed(
+		'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+		'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
+		'video/quicktime',
+		p
+	);
+}
+
+function writeRealMedia(p) {
+	writeEmbed(
+		'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+		'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+		'audio/x-pn-realaudio-plugin',
+		p
+	);
+}
+
+function writeWindowsMedia(p) {
+	p.url = p.src;
+	writeEmbed(
+		'6BF52A52-394A-11D3-B153-00C04F79FAA6',
+		'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
+		'application/x-mplayer2',
+		p
+	);
+}
+
+function writeEmbed(cls, cb, mt, p) {
+	var h = '', n;
+
+	h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+	h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
+	h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
+	h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
+	h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
+	h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
+	h += '>';
+
+	for (n in p)
+		h += '<param name="' + n + '" value="' + p[n] + '">';
+
+	h += '<embed type="' + mt + '"';
+
+	for (n in p)
+		h += n + '="' + p[n] + '" ';
+
+	h += '></embed></object>';
+
+	document.write(h);
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.addButton('print',{title:'print.print_desc',cmd:'mcePrint'});},getInfo:function(){return{longname:'Print',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('print',tinymce.plugins.Print);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,31 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Print', {
+		init : function(ed, url) {
+			ed.addCommand('mcePrint', function() {
+				ed.getWin().print();
+			});
+
+			ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Print',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('print', tinymce.plugins.Print);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/blank.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/blank.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/blank.htm	(revision 1)
@@ -0,0 +1,1 @@
+<!-- WebKit -->
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'<span id="_mce_tmp">XX</span>');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&e.shiftKey){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onBeforeExecCommand.add(function(ed,c,b){var r=t.bookmarkRng;if(r){ed.selection.setRng(r);t.bookmarkRng=null;}});ed.onInit.add(function(){t._fixWebKitSpans();ed.windowManager.onOpen.add(function(){var r=ed.selection.getRng();if(r.startContainer!=ed.getDoc()){t.bookmarkRng=r.cloneRange();}});ed.windowManager.onClose.add(function(){t.bookmarkRng=null;});if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,'</$1>');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/safari/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,414 @@
+/**
+ * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit;
+
+	tinymce.create('tinymce.plugins.Safari', {
+		init : function(ed) {
+			var t = this, dom;
+
+			// Ignore on non webkit
+			if (!tinymce.isWebKit)
+				return;
+
+			t.editor = ed;
+			t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large'];
+			t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];
+
+			// Safari will crash if the build in createlink command is used
+/*			ed.addCommand('CreateLink', function(u, v) {
+				ed.execCommand("mceInsertContent", false, '<a href="' + dom.encode(v) + '">' + ed.selection.getContent() + '</a>');
+			});*/
+
+			// Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004
+			ed.addCommand('FormatBlock', function(u, v) {
+				var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock);
+
+				if (e)
+					dom.replace(dom.create(v), e, 1);
+				else
+					ed.getDoc().execCommand("FormatBlock", false, v);
+			});
+
+			// Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382
+			ed.addCommand('mceInsertContent', function(u, v) {
+				ed.getDoc().execCommand("InsertText", false, 'mce_marker');
+				ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, v + '<span id="_mce_tmp">XX</span>');
+				ed.selection.select(ed.dom.get('_mce_tmp'));
+				ed.getDoc().execCommand("Delete", false, ' ');
+			});
+
+			// Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973
+			ed.onKeyPress.add(function(ed, e) {
+				if (e.keyCode == 13 && e.shiftKey) {
+					t._insertBR(ed);
+					Event.cancel(e);
+				}
+			});
+
+			// Safari returns incorrect values
+			ed.addQueryValueHandler('FontSize', function(u, v) {
+				var e, v;
+
+				// Check for the real font size at the start of selection
+				if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontSize))
+					return tinymce.inArray(t.namedFontSizes, v) + 1;
+
+				// Check for the real font size at the end of selection
+				if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontSize))
+					return tinymce.inArray(t.namedFontSizes, v) + 1;
+
+				// Return default value it's better than nothing right!
+				return ed.getDoc().queryCommandValue('FontSize');
+			});
+
+			// Safari returns incorrect values
+			ed.addQueryValueHandler('FontName', function(u, v) {
+				var e, v;
+
+				// Check for the real font name at the start of selection
+				if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontFamily))
+					return v.replace(/, /g, ',');
+
+				// Check for the real font name at the end of selection
+				if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontFamily))
+					return v.replace(/, /g, ',');
+
+				// Return default value it's better than nothing right!
+				return ed.getDoc().queryCommandValue('FontName');
+			});
+
+			// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
+			ed.onClick.add(function(ed, e) {
+				e = e.target;
+
+				if (e.nodeName == 'IMG') {
+					t.selElm = e;
+					ed.selection.select(e);
+				} else
+					t.selElm = null;
+			});
+
+			ed.onBeforeExecCommand.add(function(ed, c, b) {
+				var r = t.bookmarkRng;
+
+				// Restore selection
+				if (r) {
+					ed.selection.setRng(r);
+					t.bookmarkRng = null;
+					//console.debug('restore', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
+				}
+			});
+
+			ed.onInit.add(function() {
+				t._fixWebKitSpans();
+
+				ed.windowManager.onOpen.add(function() {
+					var r = ed.selection.getRng();
+
+					// Store selection if valid
+					if (r.startContainer != ed.getDoc()) {
+						t.bookmarkRng = r.cloneRange();
+						//console.debug('store', r.startContainer, r.startOffset, r.endContainer, r.endOffset);
+					}
+				});
+
+				ed.windowManager.onClose.add(function() {
+					t.bookmarkRng = null;
+				});
+
+				if (isOldWebKit)
+					t._patchSafari2x(ed);
+			});
+
+			ed.onSetContent.add(function() {
+				dom = ed.dom;
+
+				// Convert strong,b,em,u,strike to spans
+				each(['strong','b','em','u','strike','sub','sup','a'], function(v) {
+					each(grep(dom.select(v)).reverse(), function(n) {
+						var nn = n.nodeName.toLowerCase(), st;
+
+						// Convert anchors into images
+						if (nn == 'a') {
+							if (n.name)
+								dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n);
+
+							return;
+						}
+
+						switch (nn) {
+							case 'b':
+							case 'strong':
+								if (nn == 'b')
+									nn = 'strong';
+
+								st = 'font-weight: bold;';
+								break;
+
+							case 'em':
+								st = 'font-style: italic;';
+								break;
+
+							case 'u':
+								st = 'text-decoration: underline;';
+								break;
+
+							case 'sub':
+								st = 'vertical-align: sub;';
+								break;
+
+							case 'sup':
+								st = 'vertical-align: super;';
+								break;
+
+							case 'strike':
+								st = 'text-decoration: line-through;';
+								break;
+						}
+
+						dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1);
+					});
+				});
+			});
+
+			ed.onPreProcess.add(function(ed, o) {
+				dom = ed.dom;
+
+				each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) {
+					var v, bg;
+
+					if (o.get) {
+						if (dom.hasClass(n, 'Apple-style-span')) {
+							bg = n.style.backgroundColor;
+
+							switch (dom.getAttrib(n, 'mce_name')) {
+								case 'font':
+									if (!ed.settings.convert_fonts_to_spans)
+										dom.setAttrib(n, 'style', '');
+									break;
+
+								case 'strong':
+								case 'em':
+								case 'sub':
+								case 'sup':
+									dom.setAttrib(n, 'style', '');
+									break;
+
+								case 'strike':
+								case 'u':
+									if (!ed.settings.inline_styles)
+										dom.setAttrib(n, 'style', '');
+									else
+										dom.setAttrib(n, 'mce_name', '');
+
+									break;
+
+								default:
+									if (!ed.settings.inline_styles)
+										dom.setAttrib(n, 'style', '');
+							}
+
+
+							if (bg)
+								n.style.backgroundColor = bg;
+						}
+					}
+
+					if (dom.hasClass(n, 'mceItemRemoved'))
+						dom.remove(n, 1);
+				});
+			});
+
+			ed.onPostProcess.add(function(ed, o) {
+				// Safari adds BR at end of all block elements
+				o.content = o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g, '</$1>');
+
+				// Safari adds id="undefined" to HR elements
+				o.content = o.content.replace(/ id=\"undefined\"/g, '');
+			});
+		},
+
+		_fixWebKitSpans : function() {
+			var t = this, ed = t.editor;
+
+			if (!isOldWebKit) {
+				// Use mutator events on new WebKit
+				Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) {
+					e = e.target;
+
+					if (e && e.nodeType == 1)
+						t._fixAppleSpan(e);
+				});
+			} else {
+				// Do post command processing in old WebKit since the browser crashes on Mutator events :(
+				ed.onExecCommand.add(function() {
+					each(ed.dom.select('span'), function(n) {
+						t._fixAppleSpan(n);
+					});
+
+					ed.nodeChanged();
+				});
+			}
+		},
+
+		_fixAppleSpan : function(e) {
+			var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p;
+
+			if (dom.getAttrib(e, 'mce_fixed'))
+				return;
+
+			// Handle Apple style spans
+			if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') {
+				st = e.style;
+
+				if (!s.convert_fonts_to_spans) {
+					if (st.fontSize) {
+						dom.setAttrib(e, 'mce_name', 'font');
+						dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1);
+					}
+
+					if (st.fontFamily) {
+						dom.setAttrib(e, 'mce_name', 'font');
+						dom.setAttrib(e, 'face', st.fontFamily);
+					}
+
+					if (st.color) {
+						dom.setAttrib(e, 'mce_name', 'font');
+						dom.setAttrib(e, 'color', dom.toHex(st.color));
+					}
+
+					if (st.backgroundColor) {
+						dom.setAttrib(e, 'mce_name', 'font');
+						dom.setStyle(e, 'background-color', st.backgroundColor);
+					}
+				} else {
+					if (st.fontSize)
+						dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]);
+				}
+
+				if (st.fontWeight == 'bold')
+					dom.setAttrib(e, 'mce_name', 'strong');
+
+				if (st.fontStyle == 'italic')
+					dom.setAttrib(e, 'mce_name', 'em');
+
+				if (st.textDecoration == 'underline')
+					dom.setAttrib(e, 'mce_name', 'u');
+
+				if (st.textDecoration == 'line-through')
+					dom.setAttrib(e, 'mce_name', 'strike');
+
+				if (st.verticalAlign == 'super')
+					dom.setAttrib(e, 'mce_name', 'sup');
+
+				if (st.verticalAlign == 'sub')
+					dom.setAttrib(e, 'mce_name', 'sub');
+
+				dom.setAttrib(e, 'mce_fixed', '1');
+			}
+		},
+
+		_patchSafari2x : function(ed) {
+			var t = this, setContent, getNode, dom = ed.dom, lr;
+
+			// Inline dialogs
+			if (ed.windowManager.onBeforeOpen) {
+				ed.windowManager.onBeforeOpen.add(function() {
+					r = ed.selection.getRng();
+				});
+			}
+
+			// Fake select on 2.x
+			ed.selection.select = function(n) {
+				this.getSel().setBaseAndExtent(n, 0, n, 1);
+			};
+
+			getNode = ed.selection.getNode;
+			ed.selection.getNode = function() {
+				return t.selElm || getNode.call(this);
+			};
+
+			// Fake range on Safari 2.x
+			ed.selection.getRng = function() {
+				var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di;
+
+				// Fake range on Safari 2.x
+				if (s.anchorNode) {
+					r = d.createRange();
+
+					try {
+						// Setup before range
+						rb = d.createRange();
+						rb.setStart(s.anchorNode, s.anchorOffset);
+						rb.collapse(1);
+
+						// Setup after range
+						ra = d.createRange();
+						ra.setStart(s.focusNode, s.focusOffset);
+						ra.collapse(1);
+
+						// Setup start/end points by comparing locations
+						di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
+						r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset);
+						r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset);
+
+						lr = r;
+					} catch (ex) {
+						// Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!!
+					}
+				}
+
+				return r || lr;
+			};
+
+			// Fix setContent so it works
+			setContent = ed.selection.setContent;
+			ed.selection.setContent = function(h, s) {
+				var r = this.getRng(), b;
+
+				try {
+					setContent.call(this, h, s);
+				} catch (ex) {
+					// Workaround for Safari 2.x
+					b = dom.create('body');
+					b.innerHTML = h;
+
+					each(b.childNodes, function(n) {
+						r.insertNode(n.cloneNode(true));
+					});
+				}
+			};
+		},
+
+		_insertBR : function(ed) {
+			var dom = ed.dom, s = ed.selection, r = s.getRng(), br;
+
+			// Insert BR element
+			r.insertNode(br = dom.create('br'));
+
+			// Place caret after BR
+			r.setStartAfter(br);
+			r.setEndAfter(br);
+			s.setRng(r);
+
+			// Could not place caret after BR then insert an nbsp entity and move the caret
+			if (s.getSel().focusNode == br.previousSibling) {
+				s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));
+				s.collapse(1);
+			}
+
+			// Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117
+			ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y);
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('safari', tinymce.plugins.Safari);
+})();
+
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.getLang('save.save_desc'),'mceSave');},getInfo:function(){return{longname:'Save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;if(ed.getParam("fullscreen_is_enabled"))return true;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return true;if(formObj){tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");return true;},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,103 @@
+/**
+ * $Id: editor_plugin_src.js 531 2008-01-14 13:34:28Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.Save', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceSave', t._save, t);
+			ed.addCommand('mceCancel', t._cancel, t);
+
+			// Register buttons
+			ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'});
+			ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'});
+
+			ed.onNodeChange.add(t._nodeChange, t);
+			ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave');
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Save',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_nodeChange : function(ed, cm, n) {
+			var ed = this.editor;
+
+			if (ed.getParam('save_enablewhendirty')) {
+				cm.setDisabled('save', !ed.isDirty());
+				cm.setDisabled('cancel', !ed.isDirty());
+			}
+		},
+
+		// Private methods
+
+		_save : function() {
+			var ed = this.editor, formObj, os, i, elementId;
+
+			if (ed.getParam("fullscreen_is_enabled"))
+				return true;
+
+			formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');
+
+			if (ed.getParam("save_enablewhendirty") && !ed.isDirty())
+				return true;
+
+			if (formObj) {
+				tinyMCE.triggerSave();
+
+				// Use callback instead
+				if (os = ed.getParam("save_onsavecallback")) {
+					if (ed.execCallback('save_onsavecallback', ed)) {
+						ed.startContent = tinymce.trim(ed.getContent({format : 'raw'}));
+						ed.nodeChanged();
+					}
+
+					return;
+				}
+
+				ed.isNotDirty = true;
+
+				if (formObj.onsubmit == null || formObj.onsubmit() != false)
+					formObj.submit();
+
+				ed.nodeChanged();
+			} else
+				ed.windowManager.alert("Error: No form element found.");
+
+			return true;
+		},
+
+		_cancel : function() {
+			var ed = this.editor, os, h = tinymce.trim(ed.startContent);
+
+			// Use callback instead
+			if (os = ed.getParam("save_oncancelcallback")) {
+				ed.execCallback('save_oncancelcallback', ed);
+				return;
+			}
+
+			ed.setContent(h);
+			ed.undoManager.clear();
+			ed.nodeChanged();
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('save', tinymce.plugins.Save);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css	(revision 1)
@@ -0,0 +1,6 @@
+.panel_wrapper {height:85px;}
+.panel_wrapper div.current {height:85px;}
+
+/* IE */
+* html .panel_wrapper {height:100px;}
+* html .panel_wrapper div.current {height:100px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:400+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.addShortcut('ctrl+f','searchreplace.search_desc','mceSearch');},getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('searchreplace',tinymce.plugins.SearchReplacePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,53 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.SearchReplacePlugin', {
+		init : function(ed, url) {
+			function open(m) {
+				ed.windowManager.open({
+					file : url + '/searchreplace.htm',
+					width : 400 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
+					height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
+					inline : 1
+				}, {
+					mode : m,
+					search_string : ed.selection.getContent({format : 'text'}),
+					plugin_url : url
+				});
+			};
+
+			// Register commands
+			ed.addCommand('mceSearch', function() {
+				open('search');
+			});
+
+			ed.addCommand('mceReplace', function() {
+				open('replace');
+			});
+
+			// Register buttons
+			ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
+			ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
+
+			ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Search/Replace',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js	(revision 1)
@@ -0,0 +1,109 @@
+tinyMCEPopup.requireLangPack();
+
+var SearchReplaceDialog = {
+	init : function(ed) {
+		var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
+
+		this.switchMode(m);
+
+		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
+	},
+
+	switchMode : function(m) {
+		var f, lm = this.lastMode;
+
+		if (lm != m) {
+			f = document.forms[0];
+
+			if (lm) {
+				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
+				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
+				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
+				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
+			}
+
+			mcTabs.displayTab(m + '_tab',  m + '_panel');
+			document.getElementById("replace_buttons").style.visibility = (m == "replace") ? "visible" : "hidden";
+			this.lastMode = m;
+		}
+	},
+
+	searchNext : function(a) {
+		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
+
+		// Get input
+		f = document.forms[0];
+		s = f[m + '_panel_searchstring'].value;
+		b = f[m + '_panel_backwardsu'].checked;
+		ca = f[m + '_panel_casesensitivebox'].checked;
+		rs = f['replace_panel_replacestring'].value;
+
+		function fix() {
+			// Correct Firefox graphics glitches
+			r = se.getRng().cloneRange();
+			ed.getDoc().execCommand('SelectAll', false, null);
+			se.setRng(r);
+		};
+
+		function replace() {
+			if (tinymce.isIE)
+				ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE
+			else
+				ed.getDoc().execCommand('InsertHTML', false, rs);
+		};
+
+		// IE flags
+		if (ca)
+			fl = fl | 4;
+
+		switch (a) {
+			case 'all':
+				if (tinymce.isIE) {
+					while (r.findText(s, b ? -1 : 1, fl)) {
+						r.scrollIntoView();
+						r.select();
+						replace();
+						fo = 1;
+					}
+
+					tinyMCEPopup.storeSelection();
+				} else {
+					while (w.find(s, ca, b, false, false, false, false)) {
+						replace();
+						fo = 1;
+					}
+				}
+
+				if (fo)
+					wm.alert(ed.getLang('searchreplace_dlg.allreplaced'));
+				else
+					wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+				return;
+
+			case 'current':
+				replace();
+				break;
+		}
+
+		se.collapse(b);
+		r = se.getRng();
+
+		if (tinymce.isIE) {
+			if (r.findText(s, b ? -1 : 1, fl)) {
+				r.scrollIntoView();
+				r.select();
+			} else
+				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+			tinyMCEPopup.storeSelection();
+		} else {
+			if (!w.find(s, ca, b, false, false, false, false))
+				wm.alert(ed.getLang('searchreplace_dlg.notfound'));
+			else
+				fix();
+		}
+	}
+};
+
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,16 @@
+tinyMCE.addI18n('en.searchreplace_dlg',{
+searchnext_desc:"Find again",
+notfound:"The search has been completed. The search string could not be found.",
+search_title:"Find",
+replace_title:"Find/Replace",
+allreplaced:"All occurrences of the search string were replaced.",
+findwhat:"Find what",
+replacewith:"Replace with",
+direction:"Direction",
+up:"Up",
+down:"Down",
+mcase:"Match case",
+findnext:"Find next",
+replace:"Replace",
+replaceall:"Replace all"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm	(revision 1)
@@ -0,0 +1,107 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#searchreplace_dlg.replace_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/searchreplace.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
+	<base target="_self" />
+</head>
+<body style="display:none;">
+<form onsubmit="return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
+			<li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="search_panel" class="panel">
+			<table border="0" cellspacing="0" cellpadding="2">
+				<tr>
+					<td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
+					<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table border="0" cellspacing="0" cellpadding="0" class="direction">
+							<tr>
+								<td><label>{#searchreplace_dlg.direction}</label></td>
+								<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
+								<td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+								<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+								<td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table border="0" cellspacing="0" cellpadding="0">
+							<tr>
+								<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+								<td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+			</table>
+		</div>
+
+		<div id="replace_panel" class="panel">
+			<table border="0" cellspacing="0" cellpadding="2">
+				<tr>
+					<td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
+					<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
+				</tr>
+				<tr>
+					<td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
+					<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table border="0" cellspacing="0" cellpadding="0" class="direction">
+							<tr>
+								<td><label>{#searchreplace_dlg.direction}</label></td>
+								<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
+								<td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+								<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+								<td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table border="0" cellspacing="0" cellpadding="0">
+							<tr>
+								<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+								<td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+			</table>
+		</div>
+
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" onclick="SearchReplaceDialog.searchNext('none');" />
+			<span id="replace_buttons">
+				<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
+				<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
+			</span>
+		</div>
+
+		<div style="float: right">	
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/css/props.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/css/props.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/css/props.css	(revision 1)
@@ -0,0 +1,13 @@
+#text_font {width:250px;}
+#text_size {width:70px;}
+.mceAddSelectValue {background:#DDD;}
+select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}
+#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}
+#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}
+#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}
+.panel_wrapper div.current {padding-top:10px;height:230px;}
+.delim {border-left:1px solid gray;}
+.tdelim {border-bottom:1px solid gray;}
+#block_display {width:145px;}
+#list_type {width:115px;}
+.disabled {background:#EEE;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.addButton('styleprops',{title:'style.desc',cmd:'mceStyleProps'});},getInfo:function(){return{longname:'Style',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('style',tinymce.plugins.StylePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,48 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.StylePlugin', {
+		init : function(ed, url) {
+			// Register commands
+			ed.addCommand('mceStyleProps', function() {
+				ed.windowManager.open({
+					file : url + '/props.htm',
+					width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
+					height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url,
+					style_text : ed.selection.getNode().style.cssText
+				});
+			});
+
+			ed.addCommand('mceSetElementStyle', function(ui, v) {
+				if (e = ed.selection.getNode()) {
+					ed.dom.setAttrib(e, 'style', v);
+					ed.execCommand('mceRepaint');
+				}
+			});
+
+			// Register buttons
+			ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Style',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/js/props.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/js/props.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/js/props.js	(revision 1)
@@ -0,0 +1,636 @@
+tinyMCEPopup.requireLangPack();
+
+var defaultFonts = "" + 
+	"Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + 
+	"Times New Roman, Times, serif=Times New Roman, Times, serif;" + 
+	"Courier New, Courier, mono=Courier New, Courier, mono;" + 
+	"Times New Roman, Times, serif=Times New Roman, Times, serif;" + 
+	"Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + 
+	"Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + 
+	"Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";
+
+var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";
+var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%";
+var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%";
+var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%";
+var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";
+var defaultTextStyle = "normal;italic;oblique";
+var defaultVariant = "normal;small-caps";
+var defaultLineHeight = "normal";
+var defaultAttachment = "fixed;scroll";
+var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";
+var defaultPosH = "left;center;right";
+var defaultPosV = "top;center;bottom";
+var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";
+var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";
+var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";
+var defaultBorderWidth = "thin;medium;thick";
+var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";
+
+function init() {
+	var ce = document.getElementById('container'), h;
+
+	ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');
+
+	h = getBrowserHTML('background_image_browser','background_image','image','advimage');
+	document.getElementById("background_image_browser").innerHTML = h;
+
+	document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');
+	document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');
+	document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');
+	document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');
+	document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
+	document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');
+
+	fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);
+	fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);
+	fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);
+	fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);
+	fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);
+	fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);
+	fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);
+	fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);
+
+	fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);
+	fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);
+
+	fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);
+
+	fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);
+	fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);
+
+	fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);
+	fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);
+	fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);
+	fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);
+	fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);
+	fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);
+	fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);
+	fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);
+	fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);
+
+	fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);
+	fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);
+	fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);
+
+	fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);
+	fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);
+	fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);
+	fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);
+
+	fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);
+	fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);
+	fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);
+	fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);
+
+	fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);
+
+	fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);
+	fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);
+
+	fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);
+	fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);
+
+	fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);
+
+	fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);
+
+	fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);
+	fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);
+
+	TinyMCE_EditableSelects.init();
+	setupFormData();
+	showDisabledControls();
+}
+
+function setupFormData() {
+	var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
+
+	// Setup text fields
+
+	selectByValue(f, 'text_font', ce.style.fontFamily, true, true);
+	selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);
+	selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));
+	selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);
+	selectByValue(f, 'text_style', ce.style.fontStyle, true, true);
+	selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);
+	selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));
+	selectByValue(f, 'text_case', ce.style.textTransform, true, true);
+	selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);
+	f.text_color.value = ce.style.color;
+	updateColor('text_color_pick', 'text_color');
+	f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');
+	f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
+	f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
+	f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
+
+	// Setup background fields
+
+	f.background_color.value = ce.style.backgroundColor;
+	updateColor('background_color_pick', 'background_color');
+	f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);
+	selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);
+	selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);
+	selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));
+	selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);
+	selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));
+
+	// Setup block fields
+
+	selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);
+	selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));
+	selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);
+	selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));
+	selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);
+	selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);
+	f.block_text_indent.value = getNum(ce.style.textIndent);
+	selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));
+	selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);
+	selectByValue(f, 'block_display', ce.style.display, true, true);
+
+	// Setup box fields
+
+	f.box_width.value = getNum(ce.style.width);
+	selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));
+
+	f.box_height.value = getNum(ce.style.height);
+	selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));
+
+	if (tinymce.isGecko)
+		selectByValue(f, 'box_float', ce.style.cssFloat, true, true);
+	else
+		selectByValue(f, 'box_float', ce.style.styleFloat, true, true);
+
+	selectByValue(f, 'box_clear', ce.style.clear, true, true);
+
+	setupBox(f, ce, 'box_padding', 'padding', '');
+	setupBox(f, ce, 'box_margin', 'margin', '');
+
+	// Setup border fields
+
+	setupBox(f, ce, 'border_style', 'border', 'Style');
+	setupBox(f, ce, 'border_width', 'border', 'Width');
+	setupBox(f, ce, 'border_color', 'border', 'Color');
+
+	updateColor('border_color_top_pick', 'border_color_top');
+	updateColor('border_color_right_pick', 'border_color_right');
+	updateColor('border_color_bottom_pick', 'border_color_bottom');
+	updateColor('border_color_left_pick', 'border_color_left');
+
+	// Setup list fields
+
+	selectByValue(f, 'list_type', ce.style.listStyleType, true, true);
+	selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);
+	f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+	// Setup box fields
+
+	selectByValue(f, 'positioning_type', ce.style.position, true, true);
+	selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);
+	selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);
+	f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";
+
+	f.positioning_width.value = getNum(ce.style.width);
+	selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));
+
+	f.positioning_height.value = getNum(ce.style.height);
+	selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));
+
+	setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left'));
+
+	s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");
+	s = s.replace(/,/g, ' ');
+
+	if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) {
+		f.positioning_clip_top.value = getNum(getVal(s, 0));
+		selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+		f.positioning_clip_right.value = getNum(getVal(s, 1));
+		selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));
+		f.positioning_clip_bottom.value = getNum(getVal(s, 2));
+		selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));
+		f.positioning_clip_left.value = getNum(getVal(s, 3));
+		selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));
+	} else {
+		f.positioning_clip_top.value = getNum(getVal(s, 0));
+		selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));
+		f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;
+	}
+
+//	setupBox(f, ce, '', 'border', 'Color');
+}
+
+function getMeasurement(s) {
+	return s.replace(/^([0-9]+)(.*)$/, "$2");
+}
+
+function getNum(s) {
+	if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s))
+		return s.replace(/[^0-9]/g, '');
+
+	return s;
+}
+
+function inStr(s, n) {
+	return new RegExp(n, 'gi').test(s);
+}
+
+function getVal(s, i) {
+	var a = s.split(' ');
+
+	if (a.length > 1)
+		return a[i];
+
+	return "";
+}
+
+function setValue(f, n, v) {
+	if (f.elements[n].type == "text")
+		f.elements[n].value = v;
+	else
+		selectByValue(f, n, v, true, true);
+}
+
+function setupBox(f, ce, fp, pr, sf, b) {
+	if (typeof(b) == "undefined")
+		b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+	if (isSame(ce, pr, sf, b)) {
+		f.elements[fp + "_same"].checked = true;
+
+		setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+		f.elements[fp + "_top"].disabled = false;
+
+		f.elements[fp + "_right"].value = "";
+		f.elements[fp + "_right"].disabled = true;
+		f.elements[fp + "_bottom"].value = "";
+		f.elements[fp + "_bottom"].disabled = true;
+		f.elements[fp + "_left"].value = "";
+		f.elements[fp + "_left"].disabled = true;
+
+		if (f.elements[fp + "_top_measurement"]) {
+			selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+			f.elements[fp + "_left_measurement"].disabled = true;
+			f.elements[fp + "_bottom_measurement"].disabled = true;
+			f.elements[fp + "_right_measurement"].disabled = true;
+		}
+	} else {
+		f.elements[fp + "_same"].checked = false;
+
+		setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));
+		f.elements[fp + "_top"].disabled = false;
+
+		setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));
+		f.elements[fp + "_right"].disabled = false;
+
+		setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));
+		f.elements[fp + "_bottom"].disabled = false;
+
+		setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));
+		f.elements[fp + "_left"].disabled = false;
+
+		if (f.elements[fp + "_top_measurement"]) {
+			selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));
+			selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));
+			selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));
+			selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));
+			f.elements[fp + "_left_measurement"].disabled = false;
+			f.elements[fp + "_bottom_measurement"].disabled = false;
+			f.elements[fp + "_right_measurement"].disabled = false;
+		}
+	}
+}
+
+function isSame(e, pr, sf, b) {
+	var a = new Array(), i, x;
+
+	if (typeof(b) == "undefined")
+		b = new Array('Top', 'Right', 'Bottom', 'Left');
+
+	if (typeof(sf) == "undefined" || sf == null)
+		sf = "";
+
+	a[0] = e.style[pr + b[0] + sf];
+	a[1] = e.style[pr + b[1] + sf];
+	a[2] = e.style[pr + b[2] + sf];
+	a[3] = e.style[pr + b[3] + sf];
+
+	for (i=0; i<a.length; i++) {
+		if (a[i] == null)
+			return false;
+
+		for (x=0; x<a.length; x++) {
+			if (a[x] != a[i])
+				return false;
+		}
+	}
+
+	return true;
+};
+
+function hasEqualValues(a) {
+	var i, x;
+
+	for (i=0; i<a.length; i++) {
+		if (a[i] == null)
+			return false;
+
+		for (x=0; x<a.length; x++) {
+			if (a[x] != a[i])
+				return false;
+		}
+	}
+
+	return true;
+}
+
+function applyAction() {
+	var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;
+
+	generateCSS();
+
+	tinyMCEPopup.restoreSelection();
+	ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
+}
+
+function updateAction() {
+	applyAction();
+	tinyMCEPopup.close();
+}
+
+function generateCSS() {
+	var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;
+
+	ce.style.cssText = "";
+
+	// Build text styles
+	ce.style.fontFamily = f.text_font.value;
+	ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");
+	ce.style.fontStyle = f.text_style.value;
+	ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");
+	ce.style.textTransform = f.text_case.value;
+	ce.style.fontWeight = f.text_weight.value;
+	ce.style.fontVariant = f.text_variant.value;
+	ce.style.color = f.text_color.value;
+
+	s = "";
+	s += f.text_underline.checked ? " underline" : "";
+	s += f.text_overline.checked ? " overline" : "";
+	s += f.text_linethrough.checked ? " line-through" : "";
+	s += f.text_blink.checked ? " blink" : "";
+	s = s.length > 0 ? s.substring(1) : s;
+
+	if (f.text_none.checked)
+		s = "none";
+
+	ce.style.textDecoration = s;
+
+	// Build background styles
+
+	ce.style.backgroundColor = f.background_color.value;
+	ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";
+	ce.style.backgroundRepeat = f.background_repeat.value;
+	ce.style.backgroundAttachment = f.background_attachment.value;
+
+	if (f.background_hpos.value != "") {
+		s = "";
+		s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";
+		s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");
+		ce.style.backgroundPosition = s;
+	}
+
+	// Build block styles
+
+	ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");
+	ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");
+	ce.style.verticalAlign = f.block_vertical_alignment.value;
+	ce.style.textAlign = f.block_text_align.value;
+	ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");
+	ce.style.whiteSpace = f.block_whitespace.value;
+	ce.style.display = f.block_display.value;
+
+	// Build box styles
+
+	ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");
+	ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");
+	ce.style.styleFloat = f.box_float.value;
+
+	if (tinymce.isGecko)
+		ce.style.cssFloat = f.box_float.value;
+
+	ce.style.clear = f.box_clear.value;
+
+	if (!f.box_padding_same.checked) {
+		ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");
+		ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");
+		ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");
+		ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");
+	} else
+		ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");		
+
+	if (!f.box_margin_same.checked) {
+		ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");
+		ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");
+		ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");
+		ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");
+	} else
+		ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");		
+
+	// Build border styles
+
+	if (!f.border_style_same.checked) {
+		ce.style.borderTopStyle = f.border_style_top.value;
+		ce.style.borderRightStyle = f.border_style_right.value;
+		ce.style.borderBottomStyle = f.border_style_bottom.value;
+		ce.style.borderLeftStyle = f.border_style_left.value;
+	} else
+		ce.style.borderStyle = f.border_style_top.value;
+
+	if (!f.border_width_same.checked) {
+		ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");
+		ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");
+		ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");
+		ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");
+	} else
+		ce.style.borderWidth = f.border_width_top.value;
+
+	if (!f.border_color_same.checked) {
+		ce.style.borderTopColor = f.border_color_top.value;
+		ce.style.borderRightColor = f.border_color_right.value;
+		ce.style.borderBottomColor = f.border_color_bottom.value;
+		ce.style.borderLeftColor = f.border_color_left.value;
+	} else
+		ce.style.borderColor = f.border_color_top.value;
+
+	// Build list styles
+
+	ce.style.listStyleType = f.list_type.value;
+	ce.style.listStylePosition = f.list_position.value;
+	ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";
+
+	// Build positioning styles
+
+	ce.style.position = f.positioning_type.value;
+	ce.style.visibility = f.positioning_visibility.value;
+
+	if (ce.style.width == "")
+		ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");
+
+	if (ce.style.height == "")
+		ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");
+
+	ce.style.zIndex = f.positioning_zindex.value;
+	ce.style.overflow = f.positioning_overflow.value;
+
+	if (!f.positioning_placement_same.checked) {
+		ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+		ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");
+		ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");
+		ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");
+	} else {
+		s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");
+		ce.style.top = s;
+		ce.style.right = s;
+		ce.style.bottom = s;
+		ce.style.left = s;
+	}
+
+	if (!f.positioning_clip_same.checked) {
+		s = "rect(";
+		s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";
+		s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";
+		s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";
+		s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");
+		s += ")";
+
+		if (s != "rect(auto auto auto auto)")
+			ce.style.clip = s;
+	} else {
+		s = "rect(";
+		t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";
+		s += t + " ";
+		s += t + " ";
+		s += t + " ";
+		s += t + ")";
+
+		if (s != "rect(auto auto auto auto)")
+			ce.style.clip = s;
+	}
+
+	ce.style.cssText = ce.style.cssText;
+}
+
+function isNum(s) {
+	return new RegExp('[0-9]+', 'g').test(s);
+}
+
+function showDisabledControls() {
+	var f = document.forms, i, a;
+
+	for (i=0; i<f.length; i++) {
+		for (a=0; a<f[i].elements.length; a++) {
+			if (f[i].elements[a].disabled)
+				tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");
+			else
+				tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");
+		}
+	}
+}
+
+function fillSelect(f, s, param, dval, sep, em) {
+	var i, ar, p, se;
+
+	f = document.forms[f];
+	sep = typeof(sep) == "undefined" ? ";" : sep;
+
+	if (em)
+		addSelectValue(f, s, "", "");
+
+	ar = tinyMCEPopup.getParam(param, dval).split(sep);
+	for (i=0; i<ar.length; i++) {
+		se = false;
+
+		if (ar[i].charAt(0) == '+') {
+			ar[i] = ar[i].substring(1);
+			se = true;
+		}
+
+		p = ar[i].split('=');
+
+		if (p.length > 1) {
+			addSelectValue(f, s, p[0], p[1]);
+
+			if (se)
+				selectByValue(f, s, p[1]);
+		} else {
+			addSelectValue(f, s, p[0], p[0]);
+
+			if (se)
+				selectByValue(f, s, p[0]);
+		}
+	}
+}
+
+function toggleSame(ce, pre) {
+	var el = document.forms[0].elements, i;
+
+	if (ce.checked) {
+		el[pre + "_top"].disabled = false;
+		el[pre + "_right"].disabled = true;
+		el[pre + "_bottom"].disabled = true;
+		el[pre + "_left"].disabled = true;
+
+		if (el[pre + "_top_measurement"]) {
+			el[pre + "_top_measurement"].disabled = false;
+			el[pre + "_right_measurement"].disabled = true;
+			el[pre + "_bottom_measurement"].disabled = true;
+			el[pre + "_left_measurement"].disabled = true;
+		}
+	} else {
+		el[pre + "_top"].disabled = false;
+		el[pre + "_right"].disabled = false;
+		el[pre + "_bottom"].disabled = false;
+		el[pre + "_left"].disabled = false;
+
+		if (el[pre + "_top_measurement"]) {
+			el[pre + "_top_measurement"].disabled = false;
+			el[pre + "_right_measurement"].disabled = false;
+			el[pre + "_bottom_measurement"].disabled = false;
+			el[pre + "_left_measurement"].disabled = false;
+		}
+	}
+
+	showDisabledControls();
+}
+
+function synch(fr, to) {
+	var f = document.forms[0];
+
+	f.elements[to].value = f.elements[fr].value;
+
+	if (f.elements[fr + "_measurement"])
+		selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,63 @@
+tinyMCE.addI18n('en.style_dlg',{
+title:"Edit CSS Style",
+apply:"Apply",
+text_tab:"Text",
+background_tab:"Background",
+block_tab:"Block",
+box_tab:"Box",
+border_tab:"Border",
+list_tab:"List",
+positioning_tab:"Positioning",
+text_props:"Text",
+text_font:"Font",
+text_size:"Size",
+text_weight:"Weight",
+text_style:"Style",
+text_variant:"Variant",
+text_lineheight:"Line height",
+text_case:"Case",
+text_color:"Color",
+text_decoration:"Decoration",
+text_overline:"overline",
+text_underline:"underline",
+text_striketrough:"strikethrough",
+text_blink:"blink",
+text_none:"none",
+background_color:"Background color",
+background_image:"Background image",
+background_repeat:"Repeat",
+background_attachment:"Attachment",
+background_hpos:"Horizontal position",
+background_vpos:"Vertical position",
+block_wordspacing:"Word spacing",
+block_letterspacing:"Letter spacing",
+block_vertical_alignment:"Vertical alignment",
+block_text_align:"Text align",
+block_text_indent:"Text indent",
+block_whitespace:"Whitespace",
+block_display:"Display",
+box_width:"Width",
+box_height:"Height",
+box_float:"Float",
+box_clear:"Clear",
+padding:"Padding",
+same:"Same for all",
+top:"Top",
+right:"Right",
+bottom:"Bottom",
+left:"Left",
+margin:"Margin",
+style:"Style",
+width:"Width",
+height:"Height",
+color:"Color",
+list_type:"Type",
+bullet_image:"Bullet image",
+position:"Position",
+positioning_type:"Type",
+visibility:"Visibility",
+zindex:"Z-index",
+overflow:"Overflow",
+placement:"Placement",
+clip:"Clip"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/props.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/props.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/style/props.htm	(revision 1)
@@ -0,0 +1,731 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#style_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/props.js"></script>
+	<link href="css/props.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+
+<body id="styleprops" style="display: none">
+<form onSubmit="updateAction();return false;" action="#">
+<div class="tabs">
+	<ul>
+		<li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
+		<li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
+		<li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
+		<li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
+		<li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
+		<li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
+		<li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
+	</ul>
+</div>
+
+<div class="panel_wrapper">
+<div id="text_panel" class="panel current">
+	<table border="0" width="100%">
+		<tr>
+			<td><label for="text_font">{#style_dlg.text_font}</label></td>
+			<td colspan="3">
+				<select id="text_font" name="text_font" class="mceEditableSelect" onChange="alert(this.options[this.selectedIndex].value);"></select>
+			</td>
+		</tr>
+		<tr>
+			<td><label for="text_size">{#style_dlg.text_size}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
+						<td>&nbsp;</td>
+      <td><select id="text_size_measurement" name="text_size_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+			<td><label for="text_weight">{#style_dlg.text_weight}</label></td>
+			<td>
+				<select id="text_weight" name="text_weight"></select>
+			</td>
+		</tr>
+		<tr>
+			<td><label for="text_style">{#style_dlg.text_style}</label></td>
+			<td>
+				<select id="text_style" name="text_style" class="mceEditableSelect"></select>
+			</td>
+			<td><label for="text_variant">{#style_dlg.text_variant}</label></td>
+			<td>
+				<select id="text_variant" name="text_variant"></select>
+			</td>
+		</tr>
+		<tr>
+			<td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td>
+							<select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
+						</td>
+						<td>&nbsp;</td>
+						<td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+			<td><label for="text_case">{#style_dlg.text_case}</label></td>
+			<td>
+				<select id="text_case" name="text_case"></select>
+			</td>
+		</tr>
+		<tr>
+			<td><label for="text_color">{#style_dlg.text_color}</label></td>
+			<td colspan="2">
+				<table border="0" cellpadding="0" cellspacing="0">
+					<tr>
+						<td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
+						<td id="text_color_pickcontainer">&nbsp;</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+		<tr>
+			<td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
+			<td colspan="2">
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
+						<td><label for="text_underline">{#style_dlg.text_underline}</label></td>
+					</tr>
+					<tr>
+						<td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
+						<td><label for="text_overline">{#style_dlg.text_overline}</label></td>
+					</tr>
+					<tr>
+						<td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
+						<td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
+					</tr>
+					<tr>
+						<td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
+						<td><label for="text_blink">{#style_dlg.text_blink}</label></td>
+					</tr>
+					<tr>
+						<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td>
+						<td><label for="text_none">{#style_dlg.text_none}</label></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</div>
+
+<div id="background_panel" class="panel">
+	<table border="0">
+		<tr>
+			<td><label for="background_color">{#style_dlg.background_color}</label></td>
+			<td>
+				<table border="0" cellpadding="0" cellspacing="0">
+					<tr>
+						<td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
+						<td id="background_color_pickcontainer">&nbsp;</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="background_image">{#style_dlg.background_image}</label></td>
+			<td><table border="0" cellspacing="0" cellpadding="0">
+				<tr> 
+				  <td><input id="background_image" name="background_image" type="text" /></td> 
+				  <td id="background_image_browser">&nbsp;</td>
+				</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
+			<td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
+			<td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
+						<td>&nbsp;</td>
+						<td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
+						<td>&nbsp;</td>
+						<td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</div>
+
+<div id="block_panel" class="panel">
+	<table border="0">
+		<tr>
+			<td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
+						<td>&nbsp;</td>
+						<td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
+						<td>&nbsp;</td>
+						<td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
+			<td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
+			<td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
+			<td>
+				<table border="0" cellspacing="0" cellpadding="0">
+					<tr>
+						<td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
+						<td>&nbsp;</td>
+						<td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+
+		<tr>
+			<td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
+			<td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="block_display">{#style_dlg.block_display}</label></td>
+			<td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
+		</tr>
+	</table>
+</div>
+
+<div id="box_panel" class="panel">
+<table border="0">
+	<tr>
+		<td><label for="box_width">{#style_dlg.box_width}</label></td>
+		<td>
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
+					<td>&nbsp;</td>
+					<td><select id="box_width_measurement" name="box_width_measurement"></select></td>
+				</tr>
+			</table>
+		</td>
+		<td>&nbsp;&nbsp;&nbsp;<label for="box_float">{#style_dlg.box_float}</label></td>
+		<td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
+	</tr>
+
+	<tr>
+		<td><label for="box_height">{#style_dlg.box_height}</label></td>
+		<td>
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
+					<td>&nbsp;</td>
+					<td><select id="box_height_measurement" name="box_height_measurement"></select></td>
+				</tr>
+			</table>
+		</td>
+		<td>&nbsp;&nbsp;&nbsp;<label for="box_clear">{#style_dlg.box_clear}</label></td>
+		<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
+	</tr>
+</table>
+<div style="float: left; width: 49%">
+	<fieldset>
+		<legend>{#style_dlg.padding}</legend>
+
+		<table border="0">
+			<tr>
+				<td>&nbsp;</td>
+				<td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
+			</tr>
+			<tr>
+				<td><label for="box_padding_top">{#style_dlg.top}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_padding_right">{#style_dlg.right}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_padding_left">{#style_dlg.left}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+	<fieldset>
+		<legend>{#style_dlg.margin}</legend>
+
+		<table border="0">
+			<tr>
+				<td>&nbsp;</td>
+				<td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
+			</tr>
+			<tr>
+				<td><label for="box_margin_top">{#style_dlg.top}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_margin_right">{#style_dlg.right}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="box_margin_left">{#style_dlg.left}</label></td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</fieldset>
+</div>
+<br style="clear: both" />
+</div>
+
+<div id="border_panel" class="panel">
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+	<td class="tdelim">&nbsp;</td>
+	<td class="tdelim delim">&nbsp;</td>
+	<td class="tdelim">{#style_dlg.style}</td>
+	<td class="tdelim delim">&nbsp;</td>
+	<td class="tdelim">{#style_dlg.width}</td>
+	<td class="tdelim delim">&nbsp;</td>
+	<td class="tdelim">{#style_dlg.color}</td>
+</tr>
+
+<tr>
+	<td>&nbsp;</td>
+	<td class="delim">&nbsp;</td>
+	<td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
+	<td class="delim">&nbsp;</td>
+	<td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
+	<td class="delim">&nbsp;</td>
+	<td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
+</tr>
+
+<tr>
+	<td>{#style_dlg.top}</td>
+	<td class="delim">&nbsp;</td>
+	<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellspacing="0" cellpadding="0">
+			<tr>
+				<td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
+				<td>&nbsp;</td>
+				<td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td>
+			</tr>
+		</table>
+	</td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
+				<td id="border_color_top_pickcontainer">&nbsp;</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+
+<tr>
+	<td>{#style_dlg.right}</td>
+	<td class="delim">&nbsp;</td>
+	<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellspacing="0" cellpadding="0">
+			<tr>
+				<td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
+				<td>&nbsp;</td>
+				<td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td>
+			</tr>
+		</table>
+	</td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
+				<td id="border_color_right_pickcontainer">&nbsp;</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+
+<tr>
+	<td>{#style_dlg.bottom}</td>
+	<td class="delim">&nbsp;</td>
+	<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellspacing="0" cellpadding="0">
+			<tr>
+				<td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+				<td>&nbsp;</td>
+				<td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td>
+			</tr>
+		</table>
+	</td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
+				<td id="border_color_bottom_pickcontainer">&nbsp;</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+
+<tr>
+	<td>{#style_dlg.left}</td>
+	<td class="delim">&nbsp;</td>
+	<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellspacing="0" cellpadding="0">
+			<tr>
+				<td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
+				<td>&nbsp;</td>
+				<td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td>
+			</tr>
+		</table>
+	</td>
+	<td class="delim">&nbsp;</td>
+	<td>
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
+				<td id="border_color_left_pickcontainer">&nbsp;</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+</table>
+</div>
+
+<div id="list_panel" class="panel">
+	<table border="0">
+		<tr>
+			<td><label for="list_type">{#style_dlg.list_type}</label></td>
+			<td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
+		</tr>
+
+		<tr>
+			<td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
+			<td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
+		</tr>
+
+		<tr>
+			<td><label for="list_position">{#style_dlg.position}</label></td>
+			<td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
+		</tr>
+	</table>
+</div>
+
+<div id="positioning_panel" class="panel">
+<table border="0">
+	<tr>
+		<td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
+		<td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
+		<td>&nbsp;&nbsp;&nbsp;<label for="positioning_visibility">{#style_dlg.visibility}</label></td>
+		<td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
+	</tr>
+
+	<tr>
+		<td><label for="positioning_width">{#style_dlg.width}</label></td>
+		<td>
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
+					<td>&nbsp;</td>
+					<td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td>
+				</tr>
+			</table>
+		</td>
+		<td>&nbsp;&nbsp;&nbsp;<label for="positioning_zindex">{#style_dlg.zindex}</label></td>
+		<td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
+	</tr>
+
+	<tr>
+		<td><label for="positioning_height">{#style_dlg.height}</label></td>
+		<td>
+			<table border="0" cellspacing="0" cellpadding="0">
+				<tr>
+					<td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
+					<td>&nbsp;</td>
+					<td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td>
+				</tr>
+			</table>
+		</td>
+		<td>&nbsp;&nbsp;&nbsp;<label for="positioning_overflow">{#style_dlg.overflow}</label></td>
+		<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
+	</tr>
+</table>
+
+<div style="float: left; width: 49%">
+	<fieldset>
+		<legend>{#style_dlg.placement}</legend>
+
+		<table border="0">
+			<tr>
+				<td>&nbsp;</td>
+				<td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.top}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.right}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.bottom}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.left}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+	<fieldset>
+		<legend>{#style_dlg.clip}</legend>
+
+		<table border="0">
+			<tr>
+				<td>&nbsp;</td>
+				<td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.top}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.right}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.bottom}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			<tr>
+				<td>{#style_dlg.left}</td>
+				<td>
+					<table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
+							<td>&nbsp;</td>
+							<td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	</fieldset>
+</div>
+<br style="clear: both" />
+</div>
+</div>
+
+<div class="mceActionPanel">
+	<div style="float: left">
+		<div style="float: left"><input type="button" id="insert" name="insert" value="{#update}" onClick="updateAction();" /></div>
+
+		<div style="float: left">&nbsp;<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div>
+		<br style="clear: both" />
+	</div>
+
+	<div style="float: right">
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
+	</div>
+</div>
+</form>
+
+<div style="display: none">
+	<div id="container"></div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/cell.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/cell.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/cell.htm	(revision 1)
@@ -0,0 +1,183 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#table_dlg.cell_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/cell.js"></script>
+	<link href="css/cell.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablecell" style="display: none">
+	<form onsubmit="updateAction();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{#table_dlg.general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="align">{#table_dlg.align}</label></td>
+							<td>
+								<select id="align" name="align">
+									<option value="">{#not_set}</option>
+									<option value="center">{#table_dlg.align_middle}</option>
+									<option value="left">{#table_dlg.align_left}</option>
+									<option value="right">{#table_dlg.align_right}</option>
+								</select>
+							</td>
+		
+							<td><label for="celltype">{#table_dlg.cell_type}</label></td>
+							<td>
+								<select id="celltype" name="celltype">
+									<option value="td">{#table_dlg.td}</option>
+									<option value="th">{#table_dlg.th}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{#table_dlg.valign}</label></td>
+							<td>
+								<select id="valign" name="valign">
+									<option value="">{#not_set}</option>
+									<option value="top">{#table_dlg.align_top}</option>
+									<option value="middle">{#table_dlg.align_middle}</option>
+									<option value="bottom">{#table_dlg.align_bottom}</option>
+								</select>
+							</td>
+
+							<td><label for="scope">{#table_dlg.scope}</label></td>
+							<td>
+								<select id="scope" name="scope">
+									<option value="">{#not_set}</option>
+									<option value="col">{#table.col}</option>
+									<option value="row">{#table.row}</option>
+									<option value="rowgroup">{#table_dlg.rowgroup}</option>
+									<option value="colgroup">{#table_dlg.colgroup}</option>
+								</select>
+							</td>
+
+						</tr>
+
+						<tr>
+							<td><label for="width">{#table_dlg.width}</label></td>
+							<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+
+							<td><label for="height">{#table_dlg.height}</label></td>
+							<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{#class_name}</label></td>
+							<td colspan="3">
+								<select id="class" name="class">
+									<option value="" selected="selected">{#not_set}</option>
+								</select>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{#table_dlg.advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{#table_dlg.id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{#table_dlg.style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#table_dlg.ltr}</option> 
+										<option value="rtl">{#table_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="cell">{#table_dlg.cell_cell}</option>
+					<option value="row">{#table_dlg.cell_row}</option>
+					<option value="all">{#table_dlg.cell_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{#update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/cell.css	(revision 1)
@@ -0,0 +1,17 @@
+/* CSS file for cell dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#class {
+	width: 150px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/row.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/row.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/row.css	(revision 1)
@@ -0,0 +1,25 @@
+/* CSS file for row dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#rowtype,#align,#valign,#class,#height {
+	width: 150px;
+}
+
+#height {
+	width: 50px;	
+}
+
+.col2 {
+	padding-left: 20px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/table.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/table.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/css/table.css	(revision 1)
@@ -0,0 +1,13 @@
+/* CSS file for table dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 245px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#class {
+	width: 150px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','table.delete_col_desc','mceTableDeleteCol'],['delete_row','table.delete_row_desc','mceTableDeleteRow'],['col_after','table.col_after_desc','mceTableInsertColAfter'],['col_before','table.col_before_desc','mceTableInsertColBefore'],['row_after','table.row_after_desc','mceTableInsertRowAfter'],['row_before','table.row_before_desc','mceTableInsertRowBefore'],['row_props','table.row_desc','mceTableRowProps',true],['cell_props','table.cell_desc','mceTableCellProps',true],['split_cells','table.split_cells_desc','mceTableSplitCells',true],['merge_cells','table.merge_cells_desc','mceTableMergeCells',true]],function(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm;if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getTableGrid(table){var grid=new Array(),rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td;}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='<br mce_bogus="1"/>';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=html.replace(/[ \t\r\n]/g,"");if(chk!="<br/>"&&chk!="<br>"&&chk!='<br mce_bogus="1"/>'&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,1032 @@
+/**
+ * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.plugins.TablePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+			t.url = url;
+
+			// Register buttons
+			each([
+				['table', 'table.desc', 'mceInsertTable', true],
+				['delete_table', 'table.del', 'mceTableDelete'],
+				['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
+				['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
+				['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
+				['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
+				['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
+				['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
+				['row_props', 'table.row_desc', 'mceTableRowProps', true],
+				['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
+				['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
+				['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
+			], function(c) {
+				ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
+			});
+
+			ed.onInit.add(function() {
+				if (ed && ed.plugins.contextmenu) {
+					ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
+						var sm;
+
+						if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) {
+							m.removeAll();
+							m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}});
+							m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true});
+							m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true});
+							m.addSeparator();
+
+							// Cell menu
+							sm = m.addMenu({title : 'table.cell'});
+							sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true});
+							sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true});
+							sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true});
+
+							// Row menu
+							sm = m.addMenu({title : 'table.row'});
+							sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true});
+							sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
+							sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
+							sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
+							sm.addSeparator();
+							sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
+							sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
+							sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'});
+							sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'});
+
+							// Column menu
+							sm = m.addMenu({title : 'table.col'});
+							sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
+							sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
+							sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
+						} else
+							m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true});
+					});
+				}
+			});
+
+			ed.onNodeChange.add(function(ed, cm, n) {
+				var p = ed.dom.getParent(n, 'td,th,caption');
+
+				cm.setActive('table', !!p);
+				if (p && p.nodeName === 'CAPTION')
+					p = null;
+
+				cm.setDisabled('delete_table', !p);
+				cm.setDisabled('delete_col', !p);
+				cm.setDisabled('delete_table', !p);
+				cm.setDisabled('delete_row', !p);
+				cm.setDisabled('col_after', !p);
+				cm.setDisabled('col_before', !p);
+				cm.setDisabled('row_after', !p);
+				cm.setDisabled('row_before', !p);
+				cm.setDisabled('row_props', !p);
+				cm.setDisabled('cell_props', !p);
+				cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2));
+				cm.setDisabled('merge_cells', !p);
+			});
+		},
+
+		execCommand : function(cmd, ui, val) {
+			var ed = this.editor, b;
+
+			// Is table command
+			switch (cmd) {
+				case "mceInsertTable":
+				case "mceTableRowProps":
+				case "mceTableCellProps":
+				case "mceTableSplitCells":
+				case "mceTableMergeCells":
+				case "mceTableInsertRowBefore":
+				case "mceTableInsertRowAfter":
+				case "mceTableDeleteRow":
+				case "mceTableInsertColBefore":
+				case "mceTableInsertColAfter":
+				case "mceTableDeleteCol":
+				case "mceTableCutRow":
+				case "mceTableCopyRow":
+				case "mceTablePasteRowBefore":
+				case "mceTablePasteRowAfter":
+				case "mceTableDelete":
+					ed.execCommand('mceBeginUndoLevel');
+					this._doExecCommand(cmd, ui, val);
+					ed.execCommand('mceEndUndoLevel');
+
+					return true;
+			}
+
+			// Pass to next handler in chain
+			return false;
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Tables',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private plugin internal methods
+
+		/**
+		 * Executes the table commands.
+		 */
+		_doExecCommand : function(command, user_interface, value) {
+			var inst = this.editor, ed = inst, url = this.url;
+			var focusElm = inst.selection.getNode();
+			var trElm = inst.dom.getParent(focusElm, "tr");
+			var tdElm = inst.dom.getParent(focusElm, "td,th");
+			var tableElm = inst.dom.getParent(focusElm, "table");
+			var doc = inst.contentWindow.document;
+			var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
+
+			// Get first TD if no TD found
+			if (trElm && tdElm == null)
+				tdElm = trElm.cells[0];
+
+			function inArray(ar, v) {
+				for (var i=0; i<ar.length; i++) {
+					// Is array
+					if (ar[i].length > 0 && inArray(ar[i], v))
+						return true;
+
+					// Found value
+					if (ar[i] == v)
+						return true;
+				}
+
+				return false;
+			}
+
+			function select(dx, dy) {
+				var td;
+
+				grid = getTableGrid(tableElm);
+				dx = dx || 0;
+				dy = dy || 0;
+				dx = Math.max(cpos.cellindex + dx, 0);
+				dy = Math.max(cpos.rowindex + dy, 0);
+
+				// Recalculate grid and select
+				inst.execCommand('mceRepaint');
+				td = getCell(grid, dy, dx);
+
+				if (td) {
+					inst.selection.select(td.firstChild || td);
+					inst.selection.collapse(1);
+				}
+			};
+
+			function makeTD() {
+				var newTD = doc.createElement("td");
+
+				if (!tinymce.isIE)
+					newTD.innerHTML = '<br mce_bogus="1"/>';
+			}
+
+			function getColRowSpan(td) {
+				var colspan = inst.dom.getAttrib(td, "colspan");
+				var rowspan = inst.dom.getAttrib(td, "rowspan");
+
+				colspan = colspan == "" ? 1 : parseInt(colspan);
+				rowspan = rowspan == "" ? 1 : parseInt(rowspan);
+
+				return {colspan : colspan, rowspan : rowspan};
+			}
+
+			function getCellPos(grid, td) {
+				var x, y;
+
+				for (y=0; y<grid.length; y++) {
+					for (x=0; x<grid[y].length; x++) {
+						if (grid[y][x] == td)
+							return {cellindex : x, rowindex : y};
+					}
+				}
+
+				return null;
+			}
+
+			function getCell(grid, row, col) {
+				if (grid[row] && grid[row][col])
+					return grid[row][col];
+
+				return null;
+			}
+
+			function getTableGrid(table) {
+				var grid = new Array(), rows = table.rows, x, y, td, sd, xstart, x2, y2;
+
+				for (y=0; y<rows.length; y++) {
+					for (x=0; x<rows[y].cells.length; x++) {
+						td = rows[y].cells[x];
+						sd = getColRowSpan(td);
+
+						// All ready filled
+						for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
+
+						// Fill box
+						for (y2=y; y2<y+sd['rowspan']; y2++) {
+							if (!grid[y2])
+								grid[y2] = new Array();
+
+							for (x2=xstart; x2<xstart+sd['colspan']; x2++)
+								grid[y2][x2] = td;
+						}
+					}
+				}
+
+				return grid;
+			}
+
+			function trimRow(table, tr, td, new_tr) {
+				var grid = getTableGrid(table), cpos = getCellPos(grid, td);
+				var cells, lastElm;
+
+				// Time to crop away some
+				if (new_tr.cells.length != tr.childNodes.length) {
+					cells = tr.childNodes;
+					lastElm = null;
+
+					for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
+						var remove = true;
+						var sd = getColRowSpan(td);
+
+						// Remove due to rowspan
+						if (inArray(cells, td)) {
+							new_tr.childNodes[x]._delete = true;
+						} else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
+							for (var i=x; i<x+td.colSpan; i++)
+								new_tr.childNodes[i]._delete = true;
+						}
+
+						if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
+							td.rowSpan = sd.rowspan + 1;
+
+						lastElm = td;
+					}
+
+					deleteMarked(tableElm);
+				}
+			}
+
+			function prevElm(node, name) {
+				while ((node = node.previousSibling) != null) {
+					if (node.nodeName == name)
+						return node;
+				}
+
+				return null;
+			}
+
+			function nextElm(node, names) {
+				var namesAr = names.split(',');
+
+				while ((node = node.nextSibling) != null) {
+					for (var i=0; i<namesAr.length; i++) {
+						if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
+							return node;
+					}
+				}
+
+				return null;
+			}
+
+			function deleteMarked(tbl) {
+				if (tbl.rows == 0)
+					return;
+
+				var tr = tbl.rows[0];
+				do {
+					var next = nextElm(tr, "TR");
+
+					// Delete row
+					if (tr._delete) {
+						tr.parentNode.removeChild(tr);
+						continue;
+					}
+
+					// Delete cells
+					var td = tr.cells[0];
+					if (td.cells > 1) {
+						do {
+							var nexttd = nextElm(td, "TD,TH");
+
+							if (td._delete)
+								td.parentNode.removeChild(td);
+						} while ((td = nexttd) != null);
+					}
+				} while ((tr = next) != null);
+			}
+
+			function addRows(td_elm, tr_elm, rowspan) {
+				// Add rows
+				td_elm.rowSpan = 1;
+				var trNext = nextElm(tr_elm, "TR");
+				for (var i=1; i<rowspan && trNext; i++) {
+					var newTD = doc.createElement("td");
+
+					if (!tinymce.isIE)
+						newTD.innerHTML = '<br mce_bogus="1"/>';
+
+					if (tinymce.isIE)
+						trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
+					else
+						trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
+
+					trNext = nextElm(trNext, "TR");
+				}
+			}
+
+			function copyRow(doc, table, tr) {
+				var grid = getTableGrid(table);
+				var newTR = tr.cloneNode(false);
+				var cpos = getCellPos(grid, tr.cells[0]);
+				var lastCell = null;
+				var tableBorder = inst.dom.getAttrib(table, "border");
+				var tdElm = null;
+
+				for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+					var newTD = null;
+
+					if (lastCell != tdElm) {
+						for (var i=0; i<tr.cells.length; i++) {
+							if (tdElm == tr.cells[i]) {
+								newTD = tdElm.cloneNode(true);
+								break;
+							}
+						}
+					}
+
+					if (newTD == null) {
+						newTD = doc.createElement("td");
+
+						if (!tinymce.isIE)
+							newTD.innerHTML = '<br mce_bogus="1"/>';
+					}
+
+					// Reset col/row span
+					newTD.colSpan = 1;
+					newTD.rowSpan = 1;
+
+					newTR.appendChild(newTD);
+
+					lastCell = tdElm;
+				}
+
+				return newTR;
+			}
+
+			// ---- Commands -----
+
+			// Handle commands
+			switch (command) {
+				case "mceTableRowProps":
+					if (trElm == null)
+						return true;
+
+					if (user_interface) {
+						inst.windowManager.open({
+							url : url + '/row.htm',
+							width : 400 + parseInt(inst.getLang('table.rowprops_delta_width', 0)),
+							height : 295 + parseInt(inst.getLang('table.rowprops_delta_height', 0)),
+							inline : 1
+						}, {
+							plugin_url : url
+						});
+					}
+
+					return true;
+
+				case "mceTableCellProps":
+					if (tdElm == null)
+						return true;
+
+					if (user_interface) {
+						inst.windowManager.open({
+							url : url + '/cell.htm',
+							width : 400 + parseInt(inst.getLang('table.cellprops_delta_width', 0)),
+							height : 295 + parseInt(inst.getLang('table.cellprops_delta_height', 0)),
+							inline : 1
+						}, {
+							plugin_url : url
+						});
+					}
+
+					return true;
+
+				case "mceInsertTable":
+					if (user_interface) {
+						inst.windowManager.open({
+							url : url + '/table.htm',
+							width : 400 + parseInt(inst.getLang('table.table_delta_width', 0)),
+							height : 320 + parseInt(inst.getLang('table.table_delta_height', 0)),
+							inline : 1
+						}, {
+							plugin_url : url,
+							action : value ? value.action : 0
+						});
+					}
+
+					return true;
+
+				case "mceTableDelete":
+					var table = inst.dom.getParent(inst.selection.getNode(), "table");
+					if (table) {
+						table.parentNode.removeChild(table);
+						inst.execCommand('mceRepaint');
+					}
+					return true;
+
+				case "mceTableSplitCells":
+				case "mceTableMergeCells":
+				case "mceTableInsertRowBefore":
+				case "mceTableInsertRowAfter":
+				case "mceTableDeleteRow":
+				case "mceTableInsertColBefore":
+				case "mceTableInsertColAfter":
+				case "mceTableDeleteCol":
+				case "mceTableCutRow":
+				case "mceTableCopyRow":
+				case "mceTablePasteRowBefore":
+				case "mceTablePasteRowAfter":
+					// No table just return (invalid command)
+					if (!tableElm)
+						return true;
+
+					// Table has a tbody use that reference
+					// Changed logic by ApTest 2005.07.12 (www.aptest.com)
+					// Now lookk at the focused element and take its parentNode.  That will be a tbody or a table.
+					if (trElm && tableElm != trElm.parentNode)
+						tableElm = trElm.parentNode;
+
+					if (tableElm && trElm) {
+						switch (command) {
+							case "mceTableCutRow":
+								if (!trElm || !tdElm)
+									return true;
+
+								inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+								inst.execCommand("mceTableDeleteRow");
+								break;
+
+							case "mceTableCopyRow":
+								if (!trElm || !tdElm)
+									return true;
+
+								inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+								break;
+
+							case "mceTablePasteRowBefore":
+								if (!trElm || !tdElm)
+									return true;
+
+								var newTR = inst.tableRowClipboard.cloneNode(true);
+
+								var prevTR = prevElm(trElm, "TR");
+								if (prevTR != null)
+									trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
+
+								trElm.parentNode.insertBefore(newTR, trElm);
+								break;
+
+							case "mceTablePasteRowAfter":
+								if (!trElm || !tdElm)
+									return true;
+								
+								var nextTR = nextElm(trElm, "TR");
+								var newTR = inst.tableRowClipboard.cloneNode(true);
+
+								trimRow(tableElm, trElm, tdElm, newTR);
+
+								if (nextTR == null)
+									trElm.parentNode.appendChild(newTR);
+								else
+									nextTR.parentNode.insertBefore(newTR, nextTR);
+
+								break;
+
+							case "mceTableInsertRowBefore":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+								var newTR = doc.createElement("tr");
+								var lastTDElm = null;
+
+								cpos.rowindex--;
+								if (cpos.rowindex < 0)
+									cpos.rowindex = 0;
+
+								// Create cells
+								for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd['rowspan'] == 1) {
+											var newTD = doc.createElement("td");
+
+											if (!tinymce.isIE)
+												newTD.innerHTML = '<br mce_bogus="1"/>';
+
+											newTD.colSpan = tdElm.colSpan;
+
+											newTR.appendChild(newTD);
+										} else
+											tdElm.rowSpan = sd['rowspan'] + 1;
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								trElm.parentNode.insertBefore(newTR, trElm);
+								select(0, 1);
+							break;
+
+							case "mceTableInsertRowAfter":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+								var newTR = doc.createElement("tr");
+								var lastTDElm = null;
+
+								// Create cells
+								for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd['rowspan'] == 1) {
+											var newTD = doc.createElement("td");
+
+											if (!tinymce.isIE)
+												newTD.innerHTML = '<br mce_bogus="1"/>';
+
+											newTD.colSpan = tdElm.colSpan;
+
+											newTR.appendChild(newTD);
+										} else
+											tdElm.rowSpan = sd['rowspan'] + 1;
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								if (newTR.hasChildNodes()) {
+									var nextTR = nextElm(trElm, "TR");
+									if (nextTR)
+										nextTR.parentNode.insertBefore(newTR, nextTR);
+									else
+										tableElm.appendChild(newTR);
+								}
+
+								select(0, 1);
+							break;
+
+							case "mceTableDeleteRow":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+
+								// Only one row, remove whole table
+								if (grid.length == 1) {
+									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
+									return true;
+								}
+
+								// Move down row spanned cells
+								var cells = trElm.cells;
+								var nextTR = nextElm(trElm, "TR");
+								for (var x=0; x<cells.length; x++) {
+									if (cells[x].rowSpan > 1) {
+										var newTD = cells[x].cloneNode(true);
+										var sd = getColRowSpan(cells[x]);
+
+										newTD.rowSpan = sd.rowspan - 1;
+
+										var nextTD = nextTR.cells[x];
+
+										if (nextTD == null)
+											nextTR.appendChild(newTD);
+										else
+											nextTR.insertBefore(newTD, nextTD);
+									}
+								}
+
+								// Delete cells
+								var lastTDElm = null;
+								for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd.rowspan > 1) {
+											tdElm.rowSpan = sd.rowspan - 1;
+										} else {
+											trElm = tdElm.parentNode;
+
+											if (trElm.parentNode)
+												trElm._delete = true;
+										}
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								deleteMarked(tableElm);
+
+								select(0, -1);
+							break;
+
+							case "mceTableInsertColBefore":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+								var lastTDElm = null;
+
+								for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd['colspan'] == 1) {
+											var newTD = doc.createElement(tdElm.nodeName);
+
+											if (!tinymce.isIE)
+												newTD.innerHTML = '<br mce_bogus="1"/>';
+
+											newTD.rowSpan = tdElm.rowSpan;
+
+											tdElm.parentNode.insertBefore(newTD, tdElm);
+										} else
+											tdElm.colSpan++;
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								select();
+							break;
+
+							case "mceTableInsertColAfter":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+								var lastTDElm = null;
+
+								for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd['colspan'] == 1) {
+											var newTD = doc.createElement(tdElm.nodeName);
+
+											if (!tinymce.isIE)
+												newTD.innerHTML = '<br mce_bogus="1"/>';
+
+											newTD.rowSpan = tdElm.rowSpan;
+
+											var nextTD = nextElm(tdElm, "TD,TH");
+											if (nextTD == null)
+												tdElm.parentNode.appendChild(newTD);
+											else
+												nextTD.parentNode.insertBefore(newTD, nextTD);
+										} else
+											tdElm.colSpan++;
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								select(1);
+							break;
+
+							case "mceTableDeleteCol":
+								if (!trElm || !tdElm)
+									return true;
+
+								var grid = getTableGrid(tableElm);
+								var cpos = getCellPos(grid, tdElm);
+								var lastTDElm = null;
+
+								// Only one col, remove whole table
+								if (grid.length > 1 && grid[0].length <= 1) {
+									inst.dom.remove(inst.dom.getParent(tableElm, "table"));
+									return true;
+								}
+
+								// Delete cells
+								for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+									if (tdElm != lastTDElm) {
+										var sd = getColRowSpan(tdElm);
+
+										if (sd['colspan'] > 1)
+											tdElm.colSpan = sd['colspan'] - 1;
+										else {
+											if (tdElm.parentNode)
+												tdElm.parentNode.removeChild(tdElm);
+										}
+
+										lastTDElm = tdElm;
+									}
+								}
+
+								select(-1);
+							break;
+
+						case "mceTableSplitCells":
+							if (!trElm || !tdElm)
+								return true;
+
+							var spandata = getColRowSpan(tdElm);
+
+							var colspan = spandata["colspan"];
+							var rowspan = spandata["rowspan"];
+
+							// Needs splitting
+							if (colspan > 1 || rowspan > 1) {
+								// Generate cols
+								tdElm.colSpan = 1;
+								for (var i=1; i<colspan; i++) {
+									var newTD = doc.createElement("td");
+
+									if (!tinymce.isIE)
+										newTD.innerHTML = '<br mce_bogus="1"/>';
+
+									trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
+
+									if (rowspan > 1)
+										addRows(newTD, trElm, rowspan);
+								}
+
+								addRows(tdElm, trElm, rowspan);
+							}
+
+							// Apply visual aids
+							tableElm = inst.dom.getParent(inst.selection.getNode(), "table");
+							break;
+
+						case "mceTableMergeCells":
+							var rows = [];
+							var sel = inst.selection.getSel();
+							var grid = getTableGrid(tableElm);
+
+							if (tinymce.isIE || sel.rangeCount == 1) {
+								if (user_interface) {
+									// Setup template
+									var sp = getColRowSpan(tdElm);
+
+									inst.windowManager.open({
+										url : url + '/merge_cells.htm',
+										width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)),
+										height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)),
+										inline : 1
+									}, {
+										action : "update",
+										numcols : sp.colspan,
+										numrows : sp.rowspan,
+										plugin_url : url
+									});
+
+									return true;
+								} else {
+									var numRows = parseInt(value['numrows']);
+									var numCols = parseInt(value['numcols']);
+									var cpos = getCellPos(grid, tdElm);
+
+									if (("" + numRows) == "NaN")
+										numRows = 1;
+
+									if (("" + numCols) == "NaN")
+										numCols = 1;
+
+									// Get rows and cells
+									var tRows = tableElm.rows;
+									for (var y=cpos.rowindex; y<grid.length; y++) {
+										var rowCells = new Array();
+
+										for (var x=cpos.cellindex; x<grid[y].length; x++) {
+											var td = getCell(grid, y, x);
+
+											if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
+												var cp = getCellPos(grid, td);
+
+												// Within range
+												if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
+													rowCells[rowCells.length] = td;
+											}
+										}
+
+										if (rowCells.length > 0)
+											rows[rows.length] = rowCells;
+									}
+
+									//return true;
+								}
+							} else {
+								var cells = [];
+								var sel = inst.selection.getSel();
+								var lastTR = null;
+								var curRow = null;
+								var x1 = -1, y1 = -1, x2, y2;
+
+								// Only one cell selected, whats the point?
+								if (sel.rangeCount < 2)
+									return true;
+
+								// Get all selected cells
+								for (var i=0; i<sel.rangeCount; i++) {
+									var rng = sel.getRangeAt(i);
+									var tdElm = rng.startContainer.childNodes[rng.startOffset];
+
+									if (!tdElm)
+										break;
+
+									if (tdElm.nodeName == "TD")
+										cells[cells.length] = tdElm;
+								}
+
+								// Get rows and cells
+								var tRows = tableElm.rows;
+								for (var y=0; y<tRows.length; y++) {
+									var rowCells = new Array();
+
+									for (var x=0; x<tRows[y].cells.length; x++) {
+										var td = tRows[y].cells[x];
+
+										for (var i=0; i<cells.length; i++) {
+											if (td == cells[i]) {
+												rowCells[rowCells.length] = td;
+											}
+										}
+									}
+
+									if (rowCells.length > 0)
+										rows[rows.length] = rowCells;
+								}
+
+								// Find selected cells in grid and box
+								var curRow = new Array();
+								var lastTR = null;
+								for (var y=0; y<grid.length; y++) {
+									for (var x=0; x<grid[y].length; x++) {
+										grid[y][x]._selected = false;
+
+										for (var i=0; i<cells.length; i++) {
+											if (grid[y][x] == cells[i]) {
+												// Get start pos
+												if (x1 == -1) {
+													x1 = x;
+													y1 = y;
+												}
+
+												// Get end pos
+												x2 = x;
+												y2 = y;
+
+												grid[y][x]._selected = true;
+											}
+										}
+									}
+								}
+
+								// Is there gaps, if so deny
+								for (var y=y1; y<=y2; y++) {
+									for (var x=x1; x<=x2; x++) {
+										if (!grid[y][x]._selected) {
+											alert("Invalid selection for merge.");
+											return true;
+										}
+									}
+								}
+							}
+
+							// Validate selection and get total rowspan and colspan
+							var rowSpan = 1, colSpan = 1;
+
+							// Validate horizontal and get total colspan
+							var lastRowSpan = -1;
+							for (var y=0; y<rows.length; y++) {
+								var rowColSpan = 0;
+
+								for (var x=0; x<rows[y].length; x++) {
+									var sd = getColRowSpan(rows[y][x]);
+
+									rowColSpan += sd['colspan'];
+
+									if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
+										alert("Invalid selection for merge.");
+										return true;
+									}
+
+									lastRowSpan = sd['rowspan'];
+								}
+
+								if (rowColSpan > colSpan)
+									colSpan = rowColSpan;
+
+								lastRowSpan = -1;
+							}
+
+							// Validate vertical and get total rowspan
+							var lastColSpan = -1;
+							for (var x=0; x<rows[0].length; x++) {
+								var colRowSpan = 0;
+
+								for (var y=0; y<rows.length; y++) {
+									var sd = getColRowSpan(rows[y][x]);
+
+									colRowSpan += sd['rowspan'];
+
+									if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
+										alert("Invalid selection for merge.");
+										return true;
+									}
+
+									lastColSpan = sd['colspan'];
+								}
+
+								if (colRowSpan > rowSpan)
+									rowSpan = colRowSpan;
+
+								lastColSpan = -1;
+							}
+
+							// Setup td
+							tdElm = rows[0][0];
+							tdElm.rowSpan = rowSpan;
+							tdElm.colSpan = colSpan;
+
+							// Merge cells
+							for (var y=0; y<rows.length; y++) {
+								for (var x=0; x<rows[y].length; x++) {
+									var html = rows[y][x].innerHTML;
+									var chk = html.replace(/[ \t\r\n]/g, "");
+
+									if (chk != "<br/>" && chk != "<br>" && chk != '<br mce_bogus="1"/>' && (x+y > 0))
+										tdElm.innerHTML += html;
+
+									// Not current cell
+									if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
+										var cpos = getCellPos(grid, rows[y][x]);
+										var tr = rows[y][x].parentNode;
+
+										tr.removeChild(rows[y][x]);
+										rows[y][x]._deleted = true;
+
+										// Empty TR, remove it
+										if (!tr.hasChildNodes()) {
+											tr.parentNode.removeChild(tr);
+
+											var lastCell = null;
+											for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
+												if (cellElm != lastCell && cellElm.rowSpan > 1)
+													cellElm.rowSpan--;
+
+												lastCell = cellElm;
+											}
+
+											if (tdElm.rowSpan > 1)
+												tdElm.rowSpan--;
+										}
+									}
+								}
+							}
+
+							break;
+						}
+
+						tableElm = inst.dom.getParent(inst.selection.getNode(), "table");
+						inst.addVisual(tableElm);
+						inst.nodeChanged();
+					}
+
+				return true;
+			}
+
+			// Pass to next handler in chain
+			return false;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/cell.js	(revision 1)
@@ -0,0 +1,258 @@
+tinyMCEPopup.requireLangPack();
+
+var ed;
+
+function init() {
+	ed = tinyMCEPopup.editor;
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
+
+	var inst = ed;
+	var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th");
+	var formObj = document.forms[0];
+	var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
+
+	// Get table cell data
+	var celltype = tdElm.nodeName.toLowerCase();
+	var align = ed.dom.getAttrib(tdElm, 'align');
+	var valign = ed.dom.getAttrib(tdElm, 'valign');
+	var width = trimSize(getStyle(tdElm, 'width', 'width'));
+	var height = trimSize(getStyle(tdElm, 'height', 'height'));
+	var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
+	var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
+	var className = ed.dom.getAttrib(tdElm, 'class');
+	var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = ed.dom.getAttrib(tdElm, 'id');
+	var lang = ed.dom.getAttrib(tdElm, 'lang');
+	var dir = ed.dom.getAttrib(tdElm, 'dir');
+	var scope = ed.dom.getAttrib(tdElm, 'scope');
+
+	// Setup form
+	addClassesToList('class', 'table_cell_styles');
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = ed.dom.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'celltype', celltype);
+	selectByValue(formObj, 'dir', dir);
+	selectByValue(formObj, 'scope', scope);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	var el = ed.selection.getNode();
+	var inst = ed;
+	var tdElm = ed.dom.getParent(el, "td,th");
+	var trElm = ed.dom.getParent(el, "tr");
+	var tableElm = ed.dom.getParent(el, "table");
+	var formObj = document.forms[0];
+
+	ed.execCommand('mceBeginUndoLevel');
+
+	switch (getSelectValue(formObj, 'action')) {
+		case "cell":
+			var celltype = getSelectValue(formObj, 'celltype');
+			var scope = getSelectValue(formObj, 'scope');
+
+			if (ed.getParam("accessibility_warnings")) {
+				if (celltype == "th" && scope == "")
+					var answer = confirm(ed.getLang('table_dlg.missing_scope', '', true));
+				else
+					var answer = true;
+
+				if (!answer)
+					return;
+			}
+
+			updateCell(tdElm);
+			break;
+
+		case "row":
+			var cell = trElm.firstChild;
+
+			if (cell.nodeName != "TD" && cell.nodeName != "TH")
+				cell = nextCell(cell);
+
+			do {
+				cell = updateCell(cell, true);
+			} while ((cell = nextCell(cell)) != null);
+
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				var cell = rows[i].firstChild;
+
+				if (cell.nodeName != "TD" && cell.nodeName != "TH")
+					cell = nextCell(cell);
+
+				do {
+					cell = updateCell(cell, true);
+				} while ((cell = nextCell(cell)) != null);
+			}
+
+			break;
+	}
+
+	ed.addVisual();
+	ed.nodeChanged();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function nextCell(elm) {
+	while ((elm = elm.nextSibling) != null) {
+		if (elm.nodeName == "TD" || elm.nodeName == "TH")
+			return elm;
+	}
+
+	return null;
+}
+
+function updateCell(td, skip_id) {
+	var inst = ed;
+	var formObj = document.forms[0];
+	var curCellType = td.nodeName.toLowerCase();
+	var celltype = getSelectValue(formObj, 'celltype');
+	var doc = inst.getDoc();
+	var dom = ed.dom;
+
+	if (!skip_id)
+		td.setAttribute('id', formObj.id.value);
+
+	td.setAttribute('align', formObj.align.value);
+	td.setAttribute('vAlign', formObj.valign.value);
+	td.setAttribute('lang', formObj.lang.value);
+	td.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
+	td.setAttribute('scope', formObj.scope.value);
+	ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	ed.dom.setAttrib(td, 'width', '');
+	ed.dom.setAttrib(td, 'height', '');
+	ed.dom.setAttrib(td, 'bgColor', '');
+	ed.dom.setAttrib(td, 'borderColor', '');
+	ed.dom.setAttrib(td, 'background', '');
+
+	// Set styles
+	td.style.width = getCSSSize(formObj.width.value);
+	td.style.height = getCSSSize(formObj.height.value);
+	if (formObj.bordercolor.value != "") {
+		td.style.borderColor = formObj.bordercolor.value;
+		td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
+		td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
+	} else
+		td.style.borderColor = '';
+
+	td.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		td.style.backgroundImage = '';
+
+	if (curCellType != celltype) {
+		// changing to a different node type
+		var newCell = doc.createElement(celltype);
+
+		for (var c=0; c<td.childNodes.length; c++)
+			newCell.appendChild(td.childNodes[c].cloneNode(1));
+
+		for (var a=0; a<td.attributes.length; a++) {
+			var attr = td.attributes[a];
+			newCell.setAttribute(attr.name, attr.value);
+		}
+
+		td.parentNode.replaceChild(newCell, td);
+		td = newCell;
+	}
+
+	dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
+
+	return td;
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = ed.dom.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = ed.dom.serializeStyle(st);
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = ed.dom.parseStyle(formObj.style.value);
+
+	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = getCSSSize(width);
+	else
+		st['width'] = "";
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = ed.dom.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = ed.dom.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+	st['border-color'] = formObj.bordercolor.value;
+
+	formObj.style.value = ed.dom.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = ed.dom.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/merge_cells.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/merge_cells.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/merge_cells.js	(revision 1)
@@ -0,0 +1,28 @@
+tinyMCEPopup.requireLangPack();
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var formObj = document.forms[0];
+
+	formObj.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
+	formObj.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
+}
+
+function mergeCells() {
+	var args = new Array();
+	var formObj = document.forms[0];
+
+	if (!AutoValidator.validate(formObj)) {
+		alert(tinyMCEPopup.getLang('invalid_data'));
+		return false;
+	}
+
+	args["numcols"] = formObj.numcols.value;
+	args["numrows"] = formObj.numrows.value;
+
+	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/row.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/row.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/row.js	(revision 1)
@@ -0,0 +1,207 @@
+tinyMCEPopup.requireLangPack();
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var inst = tinyMCEPopup.editor;
+	var dom = inst.dom;
+	var trElm = dom.getParent(inst.selection.getNode(), "tr");
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(dom.getAttrib(trElm, "style"));
+
+	// Get table row data
+	var rowtype = trElm.parentNode.nodeName.toLowerCase();
+	var align = dom.getAttrib(trElm, 'align');
+	var valign = dom.getAttrib(trElm, 'valign');
+	var height = trimSize(getStyle(trElm, 'height', 'height'));
+	var className = dom.getAttrib(trElm, 'class');
+	var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
+	var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = dom.getAttrib(trElm, 'id');
+	var lang = dom.getAttrib(trElm, 'lang');
+	var dir = dom.getAttrib(trElm, 'dir');
+
+	// Setup form
+	addClassesToList('class', 'table_row_styles');
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = dom.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'rowtype', rowtype);
+	selectByValue(formObj, 'dir', dir);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	var inst = tinyMCEPopup.editor;
+	var dom = inst.dom;
+	var trElm = dom.getParent(inst.selection.getNode(), "tr");
+	var tableElm = dom.getParent(inst.selection.getNode(), "table");
+	var formObj = document.forms[0];
+	var action = getSelectValue(formObj, 'action');
+
+	inst.execCommand('mceBeginUndoLevel');
+
+	switch (action) {
+		case "row":
+			updateRow(trElm);
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++)
+				updateRow(rows[i], true);
+
+			break;
+
+		case "odd":
+		case "even":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
+					updateRow(rows[i], true, true);
+			}
+
+			break;
+	}
+
+	inst.addVisual();
+	inst.nodeChanged();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function updateRow(tr_elm, skip_id, skip_parent) {
+	var inst = tinyMCEPopup.editor;
+	var formObj = document.forms[0];
+	var dom = inst.dom;
+	var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
+	var rowtype = getSelectValue(formObj, 'rowtype');
+	var doc = inst.getDoc();
+
+	// Update row element
+	if (!skip_id)
+		tr_elm.setAttribute('id', formObj.id.value);
+
+	tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
+	tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
+	tr_elm.setAttribute('lang', formObj.lang.value);
+	tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
+	dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	tr_elm.setAttribute('background', '');
+	tr_elm.setAttribute('bgColor', '');
+	tr_elm.setAttribute('height', '');
+
+	// Set styles
+	tr_elm.style.height = getCSSSize(formObj.height.value);
+	tr_elm.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		tr_elm.style.backgroundImage = '';
+
+	// Setup new rowtype
+	if (curRowType != rowtype && !skip_parent) {
+		// first, clone the node we are working on
+		var newRow = tr_elm.cloneNode(1);
+
+		// next, find the parent of its new destination (creating it if necessary)
+		var theTable = dom.getParent(tr_elm, "table");
+		var dest = rowtype;
+		var newParent = null;
+		for (var i = 0; i < theTable.childNodes.length; i++) {
+			if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
+				newParent = theTable.childNodes[i];
+		}
+
+		if (newParent == null) {
+			newParent = doc.createElement(dest);
+
+			if (dest == "thead")
+				theTable.insertBefore(newParent, theTable.firstChild);
+			else
+				theTable.appendChild(newParent);
+		}
+
+		// append the row to the new parent
+		newParent.appendChild(newRow);
+
+		// remove the original
+		tr_elm.parentNode.removeChild(tr_elm);
+
+		// set tr_elm to the new node
+		tr_elm = newRow;
+	}
+
+	dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
+	var st = dom.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
+	var st = dom.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
+	var st = dom.parseStyle(formObj.style.value);
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
+	var st = dom.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/table.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/table.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/js/table.js	(revision 1)
@@ -0,0 +1,382 @@
+tinyMCEPopup.requireLangPack();
+
+var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
+
+function insertTable() {
+	var formObj = document.forms[0];
+	var inst = tinyMCEPopup.editor, dom = inst.dom;
+	var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
+	var html = '', capEl, elm;
+	var cellLimit, rowLimit, colLimit;
+
+	if (!AutoValidator.validate(formObj)) {
+		alert(inst.getLang('invalid_data'));
+		return false;
+	}
+
+	elm = dom.getParent(inst.selection.getNode(), 'table');
+
+	// Get form data
+	cols = formObj.elements['cols'].value;
+	rows = formObj.elements['rows'].value;
+	border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;
+	cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
+	cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
+	align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
+	frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value;
+	rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value;
+	width = formObj.elements['width'].value;
+	height = formObj.elements['height'].value;
+	bordercolor = formObj.elements['bordercolor'].value;
+	bgcolor = formObj.elements['bgcolor'].value;
+	className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
+	id = formObj.elements['id'].value;
+	summary = formObj.elements['summary'].value;
+	style = formObj.elements['style'].value;
+	dir = formObj.elements['dir'].value;
+	lang = formObj.elements['lang'].value;
+	background = formObj.elements['backgroundimage'].value;
+	caption = formObj.elements['caption'].checked;
+
+	cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);
+	rowLimit = tinyMCEPopup.getParam('table_row_limit', false);
+	colLimit = tinyMCEPopup.getParam('table_col_limit', false);
+
+	// Validate table size
+	if (colLimit && cols > colLimit) {
+		alert(inst.getLang('table_col_limit', '', true, {cols : colLimit}));
+		return false;
+	} else if (rowLimit && rows > rowLimit) {
+		alert(inst.getLang('table_row_limit', '', true, {rows : rowLimit}));
+		return false;
+	} else if (cellLimit && cols * rows > cellLimit) {
+		alert(inst.getLang('table_cell_limit', '', true, {cells : cellLimit}));
+		return false;
+	}
+
+	// Update table
+	if (action == "update") {
+		inst.execCommand('mceBeginUndoLevel');
+
+		dom.setAttrib(elm, 'cellPadding', cellpadding, true);
+		dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
+		dom.setAttrib(elm, 'border', border);
+		dom.setAttrib(elm, 'align', align);
+		dom.setAttrib(elm, 'frame', frame);
+		dom.setAttrib(elm, 'rules', rules);
+		dom.setAttrib(elm, 'class', className);
+		dom.setAttrib(elm, 'style', style);
+		dom.setAttrib(elm, 'id', id);
+		dom.setAttrib(elm, 'summary', summary);
+		dom.setAttrib(elm, 'dir', dir);
+		dom.setAttrib(elm, 'lang', lang);
+
+		capEl = inst.dom.select('caption', elm)[0];
+
+		if (capEl && !caption)
+			capEl.parentNode.removeChild(capEl);
+
+		if (!capEl && caption) {
+			capEl = elm.ownerDocument.createElement('caption');
+
+			if (!tinymce.isIE)
+				capEl.innerHTML = '<br mce_bogus="1"/>';
+
+			elm.insertBefore(capEl, elm.firstChild);
+		}
+
+		dom.setAttrib(elm, 'width', width, true);
+
+		// Remove these since they are not valid XHTML
+		dom.setAttrib(elm, 'borderColor', '');
+		dom.setAttrib(elm, 'bgColor', '');
+		dom.setAttrib(elm, 'background', '');
+		dom.setAttrib(elm, 'height', '');
+
+		if (background != '')
+			elm.style.backgroundImage = "url('" + background + "')";
+		else
+			elm.style.backgroundImage = '';
+
+/*		if (tinyMCEPopup.getParam("inline_styles")) {
+			if (width != '')
+				elm.style.width = getCSSSize(width);
+		}*/
+
+		if (bordercolor != "") {
+			elm.style.borderColor = bordercolor;
+			elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
+			elm.style.borderWidth = border == "" ? "1px" : border;
+		} else
+			elm.style.borderColor = '';
+
+		elm.style.backgroundColor = bgcolor;
+		elm.style.height = getCSSSize(height);
+
+		inst.addVisual();
+
+		// Fix for stange MSIE align bug
+		//elm.outerHTML = elm.outerHTML;
+
+		inst.nodeChanged();
+		inst.execCommand('mceEndUndoLevel');
+
+		// Repaint if dimensions changed
+		if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
+			inst.execCommand('mceRepaint');
+
+		tinyMCEPopup.close();
+		return true;
+	}
+
+	// Create new table
+	html += '<table';
+
+	html += makeAttrib('id', id);
+	html += makeAttrib('border', border);
+	html += makeAttrib('cellpadding', cellpadding);
+	html += makeAttrib('cellspacing', cellspacing);
+	html += makeAttrib('width', width);
+	//html += makeAttrib('height', height);
+	//html += makeAttrib('bordercolor', bordercolor);
+	//html += makeAttrib('bgcolor', bgcolor);
+	html += makeAttrib('align', align);
+	html += makeAttrib('frame', frame);
+	html += makeAttrib('rules', rules);
+	html += makeAttrib('class', className);
+	html += makeAttrib('style', style);
+	html += makeAttrib('summary', summary);
+	html += makeAttrib('dir', dir);
+	html += makeAttrib('lang', lang);
+	html += '>';
+
+	if (caption) {
+		if (!tinymce.isIE)
+			html += '<caption><br mce_bogus="1"/></caption>';
+		else
+			html += '<caption></caption>';
+	}
+
+	for (var y=0; y<rows; y++) {
+		html += "<tr>";
+
+		for (var x=0; x<cols; x++) {
+			if (!tinymce.isIE)
+				html += '<td><br mce_bogus="1"/></td>';
+			else
+				html += '<td></td>';
+		}
+
+		html += "</tr>";
+	}
+
+	html += "</table>";
+
+	inst.execCommand('mceBeginUndoLevel');
+	inst.execCommand('mceInsertContent', false, html);
+	inst.addVisual();
+	inst.execCommand('mceEndUndoLevel');
+
+	tinyMCEPopup.close();
+}
+
+function makeAttrib(attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib];
+
+	if (typeof(value) == "undefined" || value == null) {
+		value = "";
+
+		if (valueElm)
+			value = valueElm.value;
+	}
+
+	if (value == "")
+		return "";
+
+	// XML encode it
+	value = value.replace(/&/g, '&amp;');
+	value = value.replace(/\"/g, '&quot;');
+	value = value.replace(/</g, '&lt;');
+	value = value.replace(/>/g, '&gt;');
+
+	return ' ' + attrib + '="' + value + '"';
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');
+	var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
+	var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;
+	var inst = tinyMCEPopup.editor, dom = inst.dom;
+	var formObj = document.forms[0];
+	var elm = dom.getParent(inst.selection.getNode(), "table");
+
+	action = tinyMCEPopup.getWindowArg('action');
+
+	if (!action)
+		action = elm ? "update" : "insert";
+
+	if (elm && action != "insert") {
+		var rowsAr = elm.rows;
+		var cols = 0;
+		for (var i=0; i<rowsAr.length; i++)
+			if (rowsAr[i].cells.length > cols)
+				cols = rowsAr[i].cells.length;
+
+		cols = cols;
+		rows = rowsAr.length;
+
+		st = dom.parseStyle(dom.getAttrib(elm, "style"));
+		border = trimSize(getStyle(elm, 'border', 'borderWidth'));
+		cellpadding = dom.getAttrib(elm, 'cellpadding', "");
+		cellspacing = dom.getAttrib(elm, 'cellspacing', "");
+		width = trimSize(getStyle(elm, 'width', 'width'));
+		height = trimSize(getStyle(elm, 'height', 'height'));
+		bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
+		bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
+		align = dom.getAttrib(elm, 'align', align);
+		frame = dom.getAttrib(elm, 'frame');
+		rules = dom.getAttrib(elm, 'rules');
+		className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));
+		id = dom.getAttrib(elm, 'id');
+		summary = dom.getAttrib(elm, 'summary');
+		style = dom.serializeStyle(st);
+		dir = dom.getAttrib(elm, 'dir');
+		lang = dom.getAttrib(elm, 'lang');
+		background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+		formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;
+
+		orgTableWidth = width;
+		orgTableHeight = height;
+
+		action = "update";
+		formObj.insert.value = inst.getLang('update');
+	}
+
+	addClassesToList('class', "table_styles");
+
+	// Update form
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'frame', frame);
+	selectByValue(formObj, 'rules', rules);
+	selectByValue(formObj, 'class', className);
+	formObj.cols.value = cols;
+	formObj.rows.value = rows;
+	formObj.border.value = border;
+	formObj.cellpadding.value = cellpadding;
+	formObj.cellspacing.value = cellspacing;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.id.value = id;
+	formObj.summary.value = summary;
+	formObj.style.value = style;
+	formObj.dir.value = dir;
+	formObj.lang.value = lang;
+	formObj.backgroundimage.value = background;
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	// Disable some fields in update mode
+	if (action == "update") {
+		formObj.cols.disabled = true;
+		formObj.rows.disabled = true;
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(formObj.style.value);
+
+/*	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";
+	else
+		st['width'] = "";*/
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedBorder() {
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(formObj.style.value);
+
+	// Update border width if the element has a color
+	if (formObj.border.value != "" && formObj.bordercolor.value != "")
+		st['border-width'] = formObj.border.value + "px";
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	if (formObj.bordercolor.value != "") {
+		st['border-color'] = formObj.bordercolor.value;
+
+		// Add border-width if it's missing
+		if (!st['border-width'])
+			st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
+	}
+
+	formObj.style.value = dom.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = dom.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,74 @@
+tinyMCE.addI18n('en.table_dlg',{
+general_tab:"General",
+advanced_tab:"Advanced",
+general_props:"General properties",
+advanced_props:"Advanced properties",
+rowtype:"Row in table part",
+title:"Insert/Modify table",
+width:"Width",
+height:"Height",
+cols:"Cols",
+rows:"Rows",
+cellspacing:"Cellspacing",
+cellpadding:"Cellpadding",
+border:"Border",
+align:"Alignment",
+align_default:"Default",
+align_left:"Left",
+align_right:"Right",
+align_middle:"Center",
+row_title:"Table row properties",
+cell_title:"Table cell properties",
+cell_type:"Cell type",
+valign:"Vertical alignment",
+align_top:"Top",
+align_bottom:"Bottom",
+bordercolor:"Border color",
+bgcolor:"Background color",
+merge_cells_title:"Merge table cells",
+id:"Id",
+style:"Style",
+langdir:"Language direction",
+langcode:"Language code",
+mime:"Target MIME type",
+ltr:"Left to right",
+rtl:"Right to left",
+bgimage:"Background image",
+summary:"Summary",
+td:"Data",
+th:"Header",
+cell_cell:"Update current cell",
+cell_row:"Update all cells in row",
+cell_all:"Update all cells in table",
+row_row:"Update current row",
+row_odd:"Update odd rows in table",
+row_even:"Update even rows in table",
+row_all:"Update all rows in table",
+thead:"Table Head",
+tbody:"Table Body",
+tfoot:"Table Foot",
+scope:"Scope",
+rowgroup:"Row Group",
+colgroup:"Col Group",
+col_limit:"You've exceeded the maximum number of columns of {$cols}.",
+row_limit:"You've exceeded the maximum number of rows of {$rows}.",
+cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
+missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
+caption:"Table caption",
+frame:"Frame",
+frame_none:"none",
+frame_groups:"groups",
+frame_rows:"rows",
+frame_cols:"cols",
+frame_all:"all",
+rules:"Rules",
+rules_void:"void",
+rules_above:"above",
+rules_below:"below",
+rules_hsides:"hsides",
+rules_lhs:"lhs",
+rules_rhs:"rhs",
+rules_vsides:"vsides",
+rules_box:"box",
+rules_border:"border"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/merge_cells.htm	(revision 1)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#table_dlg.merge_cells_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/merge_cells.js"></script>
+	<base target="_self" />
+</head>
+<body style="margin: 8px" style="display: none">
+<form onsubmit="insertTable();return false;" action="#">
+	<fieldset>
+		<legend>{#table_dlg.merge_cells_title}</legend>
+		  <table border="0" cellpadding="0" cellspacing="3" width="100%">
+			  <tr>
+				<td>{#table_dlg.cols}:</td>
+				<td align="right"><input type="text" name="numcols" value="" class="number min1" style="width: 30px" /></td>
+			  </tr>
+			  <tr>
+				<td>{#table_dlg.rows}:</td>
+				<td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
+			  </tr>
+		  </table>
+	</fieldset>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="mergeCells();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/row.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/row.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/row.htm	(revision 1)
@@ -0,0 +1,160 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#table_dlg.row_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/row.js"></script>
+	<link href="css/row.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablerow" style="display: none">
+	<form onsubmit="updateAction();return false;">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{#table_dlg.general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="rowtype">{#table_dlg.rowtype}</label></td>
+							<td class="col2">
+								<select id="rowtype" name="rowtype">
+									<option value="thead">{#table_dlg.thead}</option>
+									<option value="tbody">{#table_dlg.tbody}</option>
+									<option value="tfoot">{#table_dlg.tfoot}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="align">{#table_dlg.align}</label></td>
+							<td class="col2">
+								<select id="align" name="align">
+									<option value="">{#not_set}</option>
+									<option value="center">{#table_dlg.align_middle}</option>
+									<option value="left">{#table_dlg.align_left}</option>
+									<option value="right">{#table_dlg.align_right}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{#table_dlg.valign}</label></td>
+							<td class="col2">
+								<select id="valign" name="valign">
+									<option value="">{#not_set}</option>
+									<option value="top">{#table_dlg.align_top}</option>
+									<option value="middle">{#table_dlg.align_middle}</option>
+									<option value="bottom">{#table_dlg.align_bottom}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{#class_name}</label></td>
+							<td class="col2">
+								<select id="class" name="class">
+									<option value="" selected="selected">{#not_set}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="height">{#table_dlg.height}</label></td>
+							<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{#table_dlg.advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{#table_dlg.id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{#table_dlg.style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#table_dlg.ltr}</option> 
+										<option value="rtl">{#table_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="row">{#table_dlg.row_row}</option>
+					<option value="odd">{#table_dlg.row_odd}</option>
+					<option value="even">{#table_dlg.row_even}</option>
+					<option value="all">{#table_dlg.row_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{#update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/table.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/table.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/table/table.htm	(revision 1)
@@ -0,0 +1,192 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#table_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/table.js"></script>
+	<link href="css/table.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="table" style="display: none">
+	<form onsubmit="insertTable();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{#table_dlg.general_props}</legend>
+					  <table border="0" cellpadding="4" cellspacing="0" width="100%">
+							  <tr>
+								<td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>
+								<td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
+								<td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>
+								<td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>
+								<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
+								<td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>
+								<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>
+								<td><select id="align" name="align">
+									<option value="">{#not_set}</option>
+									<option value="center">{#table_dlg.align_middle}</option>
+									<option value="left">{#table_dlg.align_left}</option>
+									<option value="right">{#table_dlg.align_right}</option>
+								  </select></td>
+								<td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
+								<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
+							  </tr>
+							  <tr id="width_row">
+								<td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
+								<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
+								<td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
+								<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
+							  </tr>
+							  <tr id="styleSelectRow">
+								<td><label id="classlabel" for="class">{#class_name}</label></td>
+								<td colspan="3">
+								 <select id="class" name="class">
+									<option value="" selected>{#not_set}</option>
+								 </select></td>
+							  </tr>
+							  <tr>
+								<td class="column1"><label for="caption">{#table_dlg.caption}</label></td> 
+								<td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> 
+							  </tr>
+							</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{#table_dlg.advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{#table_dlg.id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="summary">{#table_dlg.summary}</label></td> 
+							<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{#table_dlg.style}</label></td>
+							<td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" class="advfield" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="frame">{#table_dlg.frame}</label></td> 
+							<td>
+								<select id="frame" name="frame" class="advfield"> 
+										<option value="">{#not_set}</option> 
+										<option value="none">{#table_dlg.frame_none}</option>
+										<option value="groups">{#table_dlg.frame_groups}</option>
+										<option value="rows">{#table_dlg.frame_rows}</option>
+										<option value="cols">{#table_dlg.frame_cols}</option>
+										<option value="all">{#table_dlg.frame_all}</option>
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="rules">{#table_dlg.rules}</label></td> 
+							<td>
+								<select id="rules" name="rules" class="advfield"> 
+										<option value="">{#not_set}</option> 
+										<option value="void">{#table_dlg.rules_void}</option>
+										<option value="above">{#table_dlg.rules_above}</option> 
+										<option value="below">{#table_dlg.rules_below}</option> 
+										<option value="hsides">{#table_dlg.rules_hsides}</option> 
+										<option value="lhs">{#table_dlg.rules_lhs}</option> 
+										<option value="rhs">{#table_dlg.rules_rhs}</option> 
+										<option value="vsides">{#table_dlg.rules_vsides}</option> 
+										<option value="box">{#table_dlg.rules_box}</option> 
+										<option value="border">{#table_dlg.rules_border}</option> 
+									</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" class="advfield"> 
+										<option value="">{#not_set}</option> 
+										<option value="ltr">{#table_dlg.ltr}</option> 
+										<option value="rtl">{#table_dlg.rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="insertTable();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/blank.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/blank.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/blank.htm	(revision 1)
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>blank_page</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+	<script type="text/javascript">
+		parent.TemplateDialog.loadCSSFiles(document);
+	</script>
+</head>
+<body id="mceTemplatePreview" class="mceContentBody">
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/css/template.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/css/template.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/css/template.css	(revision 1)
@@ -0,0 +1,23 @@
+#frmbody {
+	padding: 10px;
+	background-color: #FFF;
+	border: 1px solid #CCC;
+}
+
+.frmRow {
+	margin-bottom: 10px;
+}
+
+#templatesrc {
+	border: none;
+	width: 320px;
+	height: 240px;
+}
+
+.title {
+	padding-bottom: 5px;
+}
+
+.mceActionPanel {
+	padding-top: 5px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TemplatePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceTemplate',function(ui){ed.windowManager.open({file:url+'/template.htm',width:ed.getParam('template_popup_width',750),height:ed.getParam('template_popup_height',600),inline:1},{plugin_url:url});});ed.addCommand('mceInsertTemplate',t._insertTemplate,t);ed.addButton('template',{title:'template.desc',cmd:'mceTemplate'});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('div',o.node),function(e){if(dom.hasClass(e,'mceTmpl')){each(dom.select('*',e),function(e){if(dom.hasClass(e,ed.getParam('template_mdate_classes').replace(/\s+/g,'|')))e.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));});t._replaceVals(e);}});});},getInfo:function(){return{longname:'Template plugin',author:'Moxiecode Systems AB',authorurl:'http://www.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_insertTemplate:function(ui,v){var t=this,ed=t.editor,h,el,dom=ed.dom,sel=ed.selection.getContent();h=v.content;each(t.editor.getParam('template_replace_values'),function(v,k){if(typeof(v)!='function')h=h.replace(new RegExp('\\{\\$'+k+'\\}','g'),v);});el=dom.create('div',null,h);function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(dom.select('*',el),function(n){if(hasClass(n,ed.getParam('template_cdate_classes','cdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_cdate_format",ed.getLang("template.cdate_format")));if(hasClass(n,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));if(hasClass(n,ed.getParam('template_selected_content_classes','selcontent').replace(/\s+/g,'|')))n.innerHTML=sel;});t._replaceVals(el);ed.execCommand('mceInsertContent',false,el.innerHTML);ed.addVisual();},_replaceVals:function(e){var dom=this.editor.dom,vl=this.editor.getParam('template_replace_values');each(dom.select('*',e),function(e){each(vl,function(v,k){if(dom.hasClass(e,k)){if(typeof(vl[k])=='function')vl[k](e);}});});},_getDateTime:function(d,fmt){if(!fmt)return"";function addZeros(value,len){var i;value=""+value;if(value.length<len){for(i=0;i<(len-value.length);i++)value="0"+value;}return value;}fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+d.getFullYear());fmt=fmt.replace("%y",""+d.getYear());fmt=fmt.replace("%m",addZeros(d.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(d.getDate(),2));fmt=fmt.replace("%H",""+addZeros(d.getHours(),2));fmt=fmt.replace("%M",""+addZeros(d.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(d.getSeconds(),2));fmt=fmt.replace("%I",""+((d.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(d.getHours()<12?"AM":"PM"));fmt=fmt.replace("%B",""+tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);fmt=fmt.replace("%b",""+tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);fmt=fmt.replace("%A",""+tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);fmt=fmt.replace("%a",""+tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);fmt=fmt.replace("%%","%");return fmt;}});tinymce.PluginManager.add('template',tinymce.plugins.TemplatePlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,149 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.plugins.TemplatePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceTemplate', function(ui) {
+				ed.windowManager.open({
+					file : url + '/template.htm',
+					width : ed.getParam('template_popup_width', 750),
+					height : ed.getParam('template_popup_height', 600),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceInsertTemplate', t._insertTemplate, t);
+
+			// Register buttons
+			ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});
+
+			ed.onPreProcess.add(function(ed, o) {
+				var dom = ed.dom;
+
+				each(dom.select('div', o.node), function(e) {
+					if (dom.hasClass(e, 'mceTmpl')) {
+						each(dom.select('*', e), function(e) {
+							if (dom.hasClass(e, ed.getParam('template_mdate_classes').replace(/\s+/g, '|')))
+								e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));
+						});
+
+						t._replaceVals(e);
+					}
+				});
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Template plugin',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://www.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		_insertTemplate : function(ui, v) {
+			var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();
+
+			h = v.content;
+
+			each(t.editor.getParam('template_replace_values'), function(v, k) {
+				if (typeof(v) != 'function')
+					h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
+			});
+
+			el = dom.create('div', null, h);
+
+			function hasClass(n, c) {
+				return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
+			};
+
+			each(dom.select('*', el), function(n) {
+				// Replace cdate
+				if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|')))
+					n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format")));
+
+				// Replace mdate
+				if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))
+					n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));
+
+				// Replace selection
+				if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|')))
+					n.innerHTML = sel;
+			});
+
+			t._replaceVals(el);
+
+			ed.execCommand('mceInsertContent', false, el.innerHTML);
+			ed.addVisual();
+		},
+
+		_replaceVals : function(e) {
+			var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');
+
+			each(dom.select('*', e), function(e) {
+				each(vl, function(v, k) {
+					if (dom.hasClass(e, k)) {
+						if (typeof(vl[k]) == 'function')
+							vl[k](e);
+					}
+				});
+			});
+		},
+
+		_getDateTime : function(d, fmt) {
+				if (!fmt)
+					return "";
+
+				function addZeros(value, len) {
+					var i;
+
+					value = "" + value;
+
+					if (value.length < len) {
+						for (i=0; i<(len-value.length); i++)
+							value = "0" + value;
+					}
+
+					return value;
+				}
+
+				fmt = fmt.replace("%D", "%m/%d/%y");
+				fmt = fmt.replace("%r", "%I:%M:%S %p");
+				fmt = fmt.replace("%Y", "" + d.getFullYear());
+				fmt = fmt.replace("%y", "" + d.getYear());
+				fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
+				fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
+				fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
+				fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
+				fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
+				fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
+				fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
+				fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]);
+				fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]);
+				fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]);
+				fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]);
+				fmt = fmt.replace("%%", "%");
+
+				return fmt;
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/js/template.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/js/template.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/js/template.js	(revision 1)
@@ -0,0 +1,100 @@
+tinyMCEPopup.requireLangPack();
+
+var TemplateDialog = {
+	preInit : function() {
+		var url = tinyMCEPopup.getParam("template_external_list_url");
+
+		if (url != null)
+			document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');
+	},
+
+	init : function() {
+		var ed = tinyMCEPopup.editor, tsrc, sel, x, u;
+
+ 		tsrc = ed.getParam("template_templates", false);
+ 		sel = document.getElementById('tpath');
+
+		// Setup external template list
+		if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {
+			for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)
+				tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});
+		}
+
+		for (x=0; x<tsrc.length; x++)
+			sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));
+
+		this.resize();
+	},
+
+	resize : function() {
+		var w, h, e;
+
+		if (!self.innerWidth) {
+			w = document.body.clientWidth - 50;
+			h = document.body.clientHeight - 160;
+		} else {
+			w = self.innerWidth - 50;
+			h = self.innerHeight - 170;
+		}
+
+		e = document.getElementById('templatesrc');
+
+		if (e) {
+			e.style.height = Math.abs(h) + 'px';
+			e.style.width  = Math.abs(w - 5) + 'px';
+		}
+	},
+
+	loadCSSFiles : function(d) {
+		var ed = tinyMCEPopup.editor;
+
+		tinymce.each(ed.getParam("content_css", '').split(','), function(u) {
+			d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');
+		});
+	},
+
+	selectTemplate : function(u) {
+		var d = window.frames['templatesrc'].document;
+
+		if (!u)
+			return;
+
+		d.body.innerHTML = this.templateHTML = this.getFileContents(u);
+	},
+
+ 	insert : function() {
+		tinyMCEPopup.execCommand('mceInsertTemplate', false, {
+			content : this.templateHTML,
+			selection : tinyMCEPopup.editor.selection.getContent()
+		});
+
+		tinyMCEPopup.close();
+	},
+
+	getFileContents : function(u) {
+		var x, d, t = 'text/plain';
+
+		function g(s) {
+			x = 0;
+
+			try {
+				x = new ActiveXObject(s);
+			} catch (s) {
+			}
+
+			return x;
+		};
+
+		x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();
+
+		// Synchronous AJAX load file
+		x.overrideMimeType && x.overrideMimeType(t);
+		x.open("GET", u, false);
+		x.send(null);
+
+		return x.responseText;
+	}
+};
+
+TemplateDialog.preInit();
+tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,15 @@
+tinyMCE.addI18n('en.template_dlg',{
+title:"Templates",
+label:"Template",
+desc_label:"Description",
+desc:"Insert predefined template content",
+select:"Select a template",
+preview:"Preview",
+warning:"Warning: Updating a template with a different one may cause data loss.",
+mdate_format:"%Y-%m-%d %H:%M:%S",
+cdate_format:"%Y-%m-%d %H:%M:%S",
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/template.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/template.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/template/template.htm	(revision 1)
@@ -0,0 +1,39 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#template_dlg.title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/template.js"></script>
+	<link href="css/template.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body onresize="TemplateDialog.resize();"> 
+	<form onsubmit="TemplateDialog.insert();return false;">
+		<div id="frmbody">
+			<div class="title">{#template_dlg.desc}</div>
+			<div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>
+			<select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value);">
+				<option value="">{#template_dlg.select}...</option>
+			</select>
+			<span id="warning"></span></div>
+			<div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>
+			<span id="tmpldesc"></span></div>
+			<fieldset>
+				<legend>{#template_dlg.preview}</legend>
+				<iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>
+			</fieldset>
+		</div>
+		
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{#insert}" onclick="TemplateDialog.insert();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+
+			<br style="clear:both" />
+		</div>
+	</form>
+</body> 
+</html> 
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.VisualChars',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceVisualChars',t._toggleVisualChars,t);ed.addButton('visualchars',{title:'visualchars.desc',cmd:'mceVisualChars'});ed.onBeforeGetContent.add(function(ed,o){if(t.state){t.state=true;t._toggleVisualChars();}});},getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_toggleVisualChars:function(){var t=this,ed=t.editor,nl,i,h,d=ed.getDoc(),b=ed.getBody(),nv,s=ed.selection,bo;t.state=!t.state;ed.controlManager.setActive('visualchars',t.state);if(t.state){nl=[];tinymce.walk(b,function(n){if(n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1)nl.push(n);},'childNodes');for(i=0;i<nl.length;i++){nv=nl[i].nodeValue;nv=nv.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');nv=nv.replace(/\u00a0/g,'\u00b7');ed.dom.setOuterHTML(nl[i],nv,d);}}else{nl=tinymce.grep(ed.dom.select('span',b),function(n){return ed.dom.hasClass(n,'mceVisualNbsp');});for(i=0;i<nl.length;i++)ed.dom.setOuterHTML(nl[i],nl[i].innerHTML.replace(/(&middot;|\u00b7)/g,'&nbsp;'),d);}}});tinymce.PluginManager.add('visualchars',tinymce.plugins.VisualChars);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,73 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.VisualChars', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceVisualChars', t._toggleVisualChars, t);
+
+			// Register buttons
+			ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});
+
+			ed.onBeforeGetContent.add(function(ed, o) {
+				if (t.state) {
+					t.state = true;
+					t._toggleVisualChars();
+				}
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Visual characters',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		// Private methods
+
+		_toggleVisualChars : function() {
+			var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo;
+
+			t.state = !t.state;
+			ed.controlManager.setActive('visualchars', t.state);
+
+			if (t.state) {
+				nl = [];
+				tinymce.walk(b, function(n) {
+					if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1)
+						nl.push(n);
+				}, 'childNodes');
+
+				for (i=0; i<nl.length; i++) {
+					nv = nl[i].nodeValue;
+					nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHidden mceVisualNbsp">$1</span>');
+					nv = nv.replace(/\u00a0/g, '\u00b7');
+					ed.dom.setOuterHTML(nl[i], nv, d);
+				}
+			} else {
+				nl = tinymce.grep(ed.dom.select('span', b), function(n) {
+					return ed.dom.hasClass(n, 'mceVisualNbsp');
+				});
+
+				for (i=0; i<nl.length; i++)
+					ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(&middot;|\u00b7)/g, '&nbsp;'), d);
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/abbr.htm	(revision 1)
@@ -0,0 +1,149 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.title_abbr_element}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="js/element_common.js"></script>
+	<script type="text/javascript" src="js/abbr.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/popup.css" />
+	<base target="_self" />
+</head>
+<body style="display: none">
+<form onsubmit="insertAbbr();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
+			<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> 
+						<td>
+							<select id="class" name="class" class="field mceEditableSelect">
+								<option value="">{#not_set}</option> 
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir" class="field"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" class="field" />
+						</td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="insertAbbr();" />
+		</div>
+		<div style="float: left">
+			<input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/acronym.htm	(revision 1)
@@ -0,0 +1,149 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.title_acronym_element}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="js/element_common.js"></script>
+	<script type="text/javascript" src="js/acronym.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/popup.css" />
+	<base target="_self" />
+</head>
+<body style="display: none">
+<form onsubmit="insertAcronym();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
+			<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> 
+						<td>
+							<select id="class" name="class" class="field mceEditableSelect">
+								<option value="">{#not_set}</option> 
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir" class="field"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" class="field" />
+						</td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="insertAcronym();" />
+		</div>
+		<div style="float: left">
+			<input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/attributes.htm	(revision 1)
@@ -0,0 +1,154 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.attribs_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/attributes.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/attributes.css" />
+	<base target="_self" />
+</head>
+<body style="display: none">
+<form onsubmit="insertAction();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>
+			<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" /></td> 
+					</tr>
+					<tr>
+						<td><label id="classlabel" for="classlist">{#class_name}</label></td>
+						<td>
+							<select id="classlist" name="classlist" class="mceEditableSelect">
+								<option value="" selected>{#not_set}</option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" />
+						</td> 
+					</tr>
+					<tr>
+							<td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>
+							<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
+						</tr>
+
+						<tr>
+							<td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>
+							<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
+						</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#insert}" onclick="insertAction();" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/cite.htm	(revision 1)
@@ -0,0 +1,149 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.title_cite_element}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="js/element_common.js"></script>
+	<script type="text/javascript" src="js/cite.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/popup.css" />
+	<base target="_self" />
+</head>
+<body style="display: none">
+<form onsubmit="insertCite();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
+			<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> 
+						<td>
+							<select id="class" name="class" class="field mceEditableSelect">
+								<option value="">{#not_set}</option> 
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir" class="field"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" class="field" />
+						</td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="insertCite();" />
+		</div>
+		<div style="float: left">
+			<input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css	(revision 1)
@@ -0,0 +1,11 @@
+.panel_wrapper div.current {
+	height: 290px;
+}
+
+#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
+	width: 200px;
+}
+
+#events_panel input {
+	width: 200px;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/popup.css	(revision 1)
@@ -0,0 +1,9 @@
+input.field, select.field {width:200px;}
+input.picker {width:179px; margin-left: 5px;}
+input.disabled {border-color:#F2F2F2;}
+img.picker {vertical-align:text-bottom; cursor:pointer;}
+h1 {padding: 0 0 5px 0;}
+.panel_wrapper div.current {height:160px;}
+#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}
+a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}
+#datetime {width:180px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css	(revision 1)
@@ -0,0 +1,24 @@
+ins {
+	border-bottom: 1px solid green;
+	text-decoration: none;
+	color: green;
+}
+
+del {
+	color: Red;
+	text-decoration: line-through;
+}
+
+cite {
+	border-bottom: 1px dashed blue;
+}
+
+acronym {
+	border-bottom: 1px dotted #CCC;
+	cursor: help;
+}
+
+abbr, html\:abbr {
+	border-bottom: 1px dashed #CCC;
+	cursor: help;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/del.htm	(revision 1)
@@ -0,0 +1,170 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.title_del_element}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="js/element_common.js"></script>
+	<script type="text/javascript" src="js/del.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/popup.css" />
+	<base target="_self" />
+</head>
+<body id="xhtmlxtrasins" style="display: none">
+<form onsubmit="insertDel();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
+			<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>
+						<td>
+							<table border="0" cellspacing="0" cellpadding="0">
+								<tr> 
+									<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field" /></td> 
+									<td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
+								</tr>
+							</table>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>
+						<td><input id="cite" name="cite" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> 
+						<td>
+							<select id="class" name="class" class="field mceEditableSelect">
+								<option value="">{#not_set}</option> 
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir" class="field"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" class="field" />
+						</td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="insertDel();" />
+		</div>
+		<div style="float: left">
+			<input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/<abbr([^>]+)>/gi,'<html:abbr $1>');o.content=o.content.replace(/<\/abbr>/gi,'</html:abbr>');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');if(n){cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}else{cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);}});},getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('xhtmlxtras',tinymce.plugins.XHTMLXtrasPlugin);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js	(revision 1)
@@ -0,0 +1,134 @@
+/**
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
+		init : function(ed, url) {
+			// Register commands
+			ed.addCommand('mceCite', function() {
+				ed.windowManager.open({
+					file : url + '/cite.htm',
+					width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),
+					height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceAcronym', function() {
+				ed.windowManager.open({
+					file : url + '/acronym.htm',
+					width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
+					height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceAbbr', function() {
+				ed.windowManager.open({
+					file : url + '/abbr.htm',
+					width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
+					height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceDel', function() {
+				ed.windowManager.open({
+					file : url + '/del.htm',
+					width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
+					height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceIns', function() {
+				ed.windowManager.open({
+					file : url + '/ins.htm',
+					width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
+					height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			ed.addCommand('mceAttributes', function() {
+				ed.windowManager.open({
+					file : url + '/attributes.htm',
+					width : 380,
+					height : 370,
+					inline : 1
+				}, {
+					plugin_url : url
+				});
+			});
+
+			// Register buttons
+			ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});
+			ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});
+			ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});
+			ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});
+			ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});
+			ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
+
+			if (tinymce.isIE) {
+				function fix(ed, o) {
+					if (o.set) {
+						o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>');
+						o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>');
+					}
+				};
+
+				ed.onBeforeSetContent.add(fix);
+				ed.onPostProcess.add(fix);
+			}
+
+			ed.onNodeChange.add(function(ed, cm, n, co) {
+				n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');
+
+				cm.setDisabled('cite', co);
+				cm.setDisabled('acronym', co);
+				cm.setDisabled('abbr', co);
+				cm.setDisabled('del', co);
+				cm.setDisabled('ins', co);
+				cm.setDisabled('attribs', n && n.nodeName == 'BODY');
+
+				if (n) {
+					cm.setDisabled(n.nodeName.toLowerCase(), 0);
+					cm.setActive(n.nodeName.toLowerCase(), 1);
+				} else {
+					cm.setActive('cite', 0);
+					cm.setActive('acronym', 0);
+					cm.setActive('abbr', 0);
+					cm.setActive('del', 0);
+					cm.setActive('ins', 0);
+				}
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'XHTML Xtras Plugin',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/ins.htm	(revision 1)
@@ -0,0 +1,170 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#xhtmlxtras_dlg.title_ins_element}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/editable_selects.js"></script>
+	<script type="text/javascript" src="js/element_common.js"></script>
+	<script type="text/javascript" src="js/ins.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/popup.css" />
+	<base target="_self" />
+</head>
+<body id="xhtmlxtrasins" style="display: none">
+<form onsubmit="insertIns();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>
+			<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> 
+						<td>
+							<table border="0" cellspacing="0" cellpadding="0">
+								<tr> 
+									<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field" /></td> 
+									<td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" alt="{#xhtmlxtras_dlg.insert_date}" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>
+								</tr>
+							</table>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> 
+						<td><input id="cite" name="cite" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> 
+						<td><input id="title" name="title" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> 
+						<td><input id="id" name="id" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> 
+						<td>
+							<select id="class" name="class" class="field mceEditableSelect">
+								<option value="">{#not_set}</option> 
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> 
+						<td><input id="style" name="style" type="text" value="" class="field" /></td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> 
+						<td>
+							<select id="dir" name="dir" class="field"> 
+								<option value="">{#not_set}</option> 
+								<option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> 
+								<option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> 
+							</select>
+						</td> 
+					</tr>
+					<tr>
+						<td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> 
+						<td>
+							<input id="lang" name="lang" type="text" value="" class="field" />
+						</td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+		<div id="events_panel" class="panel">
+			<fieldset>
+				<legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>
+
+				<table border="0" cellpadding="0" cellspacing="4">
+					<tr>
+						<td class="label"><label for="onfocus">onfocus</label>:</td> 
+						<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onblur">onblur</label>:</td> 
+						<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onclick">onclick</label>:</td> 
+						<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="ondblclick">ondblclick</label>:</td> 
+						<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousedown">onmousedown</label>:</td> 
+						<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseup">onmouseup</label>:</td> 
+						<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseover">onmouseover</label>:</td> 
+						<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmousemove">onmousemove</label>:</td> 
+						<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onmouseout">onmouseout</label>:</td> 
+						<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeypress">onkeypress</label>:</td> 
+						<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeydown">onkeydown</label>:</td> 
+						<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> 
+					</tr>
+
+					<tr>
+						<td class="label"><label for="onkeyup">onkeyup</label>:</td> 
+						<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> 
+					</tr>
+				</table>
+			</fieldset>
+		</div>
+	</div>
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="insertIns();" />
+		</div>
+		<div style="float: left">
+			<input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />
+		</div>
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js	(revision 1)
@@ -0,0 +1,25 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	SXE.initElementDialog('abbr');
+	if (SXE.currentAction == "update") {
+		SXE.showRemoveButton();
+	}
+}
+
+function insertAbbr() {
+	SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
+	tinyMCEPopup.close();
+}
+
+function removeAbbr() {
+	SXE.removeElement('abbr');
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js	(revision 1)
@@ -0,0 +1,25 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	SXE.initElementDialog('acronym');
+	if (SXE.currentAction == "update") {
+		SXE.showRemoveButton();
+	}
+}
+
+function insertAcronym() {
+	SXE.insertElement('acronym');
+	tinyMCEPopup.close();
+}
+
+function removeAcronym() {
+	SXE.removeElement('acronym');
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js	(revision 1)
@@ -0,0 +1,123 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+	var inst = tinyMCEPopup.editor;
+	var dom = inst.dom;
+	var elm = inst.selection.getNode();
+	var f = document.forms[0];
+	var onclick = dom.getAttrib(elm, 'onclick');
+
+	setFormValue('title', dom.getAttrib(elm, 'title'));
+	setFormValue('id', dom.getAttrib(elm, 'id'));
+	setFormValue('style', dom.getAttrib(elm, "style"));
+	setFormValue('dir', dom.getAttrib(elm, 'dir'));
+	setFormValue('lang', dom.getAttrib(elm, 'lang'));
+	setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
+	setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
+	setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
+	setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
+	setFormValue('onclick', onclick);
+	setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
+	setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
+	setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
+	setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
+	setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
+	setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
+	setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
+	setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
+	setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
+	className = dom.getAttrib(elm, 'class');
+
+	addClassesToList('classlist', 'advlink_styles');
+	selectByValue(f, 'classlist', className, true);
+
+	TinyMCE_EditableSelects.init();
+}
+
+function setFormValue(name, value) {
+	if(value && document.forms[0].elements[name]){
+		document.forms[0].elements[name].value = value;
+	}
+}
+
+function insertAction() {
+	var inst = tinyMCEPopup.editor;
+	var elm = inst.selection.getNode();
+
+	tinyMCEPopup.execCommand("mceBeginUndoLevel");	
+	setAllAttribs(elm);
+	tinyMCEPopup.execCommand("mceEndUndoLevel");
+	tinyMCEPopup.close();
+}
+
+function setAttrib(elm, attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib.toLowerCase()];
+	var inst = tinyMCEPopup.editor;
+	var dom = inst.dom;
+
+	if (typeof(value) == "undefined" || value == null) {
+		value = "";
+
+		if (valueElm)
+			value = valueElm.value;
+	}
+
+	if (value != "") {
+		dom.setAttrib(elm, attrib.toLowerCase(), value);
+
+		if (attrib == "style")
+			attrib = "style.cssText";
+
+		if (attrib.substring(0, 2) == 'on')
+			value = 'return true;' + value;
+
+		if (attrib == "class")
+			attrib = "className";
+
+		eval('elm.' + attrib + "=value;");
+	} else
+		elm.removeAttribute(attrib);
+}
+
+function setAllAttribs(elm) {
+	var f = document.forms[0];
+
+	setAttrib(elm, 'title');
+	setAttrib(elm, 'id');
+	setAttrib(elm, 'style');
+	setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
+	setAttrib(elm, 'dir');
+	setAttrib(elm, 'lang');
+	setAttrib(elm, 'tabindex');
+	setAttrib(elm, 'accesskey');
+	setAttrib(elm, 'onfocus');
+	setAttrib(elm, 'onblur');
+	setAttrib(elm, 'onclick');
+	setAttrib(elm, 'ondblclick');
+	setAttrib(elm, 'onmousedown');
+	setAttrib(elm, 'onmouseup');
+	setAttrib(elm, 'onmouseover');
+	setAttrib(elm, 'onmousemove');
+	setAttrib(elm, 'onmouseout');
+	setAttrib(elm, 'onkeypress');
+	setAttrib(elm, 'onkeydown');
+	setAttrib(elm, 'onkeyup');
+
+	// Refresh in old MSIE
+//	if (tinyMCE.isMSIE5)
+//		elm.outerHTML = elm.outerHTML;
+}
+
+function insertAttribute() {
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
+tinyMCEPopup.requireLangPack();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/cite.js	(revision 1)
@@ -0,0 +1,25 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	SXE.initElementDialog('cite');
+	if (SXE.currentAction == "update") {
+		SXE.showRemoveButton();
+	}
+}
+
+function insertCite() {
+	SXE.insertElement('cite');
+	tinyMCEPopup.close();
+}
+
+function removeCite() {
+	SXE.removeElement('cite');
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/del.js	(revision 1)
@@ -0,0 +1,50 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	SXE.initElementDialog('del');
+	if (SXE.currentAction == "update") {
+		setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
+		setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
+		SXE.showRemoveButton();
+	}
+}
+
+function setElementAttribs(elm) {
+	setAllCommonAttribs(elm);
+	setAttrib(elm, 'datetime');
+	setAttrib(elm, 'cite');
+}
+
+function insertDel() {
+	var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
+
+	tinyMCEPopup.execCommand('mceBeginUndoLevel');
+	if (elm == null) {
+		var s = SXE.inst.selection.getContent();
+		if(s.length > 0) {
+			tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
+			var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
+			for (var i=0; i<elementArray.length; i++) {
+				var elm = elementArray[i];
+				setElementAttribs(elm);
+			}
+		}
+	} else {
+		setElementAttribs(elm);
+	}
+	tinyMCEPopup.editor.nodeChanged();
+	tinyMCEPopup.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function removeDel() {
+	SXE.removeElement('del');
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js	(revision 1)
@@ -0,0 +1,221 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+tinyMCEPopup.requireLangPack();
+
+function initCommonAttributes(elm) {
+	var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
+
+	// Setup form data for common element attributes
+	setFormValue('title', dom.getAttrib(elm, 'title'));
+	setFormValue('id', dom.getAttrib(elm, 'id'));
+	selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
+	setFormValue('style', dom.getAttrib(elm, 'style'));
+	selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
+	setFormValue('lang', dom.getAttrib(elm, 'lang'));
+	setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
+	setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
+	setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
+	setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
+	setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
+	setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
+	setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
+	setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
+	setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
+	setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
+	setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
+	setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
+}
+
+function setFormValue(name, value) {
+	if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
+}
+
+function insertDateTime(id) {
+	document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
+}
+
+function getDateTime(d, fmt) {
+	fmt = fmt.replace("%D", "%m/%d/%y");
+	fmt = fmt.replace("%r", "%I:%M:%S %p");
+	fmt = fmt.replace("%Y", "" + d.getFullYear());
+	fmt = fmt.replace("%y", "" + d.getYear());
+	fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
+	fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
+	fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
+	fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
+	fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
+	fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
+	fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
+	fmt = fmt.replace("%%", "%");
+
+	return fmt;
+}
+
+function addZeros(value, len) {
+	var i;
+
+	value = "" + value;
+
+	if (value.length < len) {
+		for (i=0; i<(len-value.length); i++)
+			value = "0" + value;
+	}
+
+	return value;
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+	if (!form_obj || !form_obj.elements[field_name])
+		return;
+
+	var sel = form_obj.elements[field_name];
+
+	var found = false;
+	for (var i=0; i<sel.options.length; i++) {
+		var option = sel.options[i];
+
+		if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+			option.selected = true;
+			found = true;
+		} else
+			option.selected = false;
+	}
+
+	if (!found && add_custom && value != '') {
+		var option = new Option('Value: ' + value, value);
+		option.selected = true;
+		sel.options[sel.options.length] = option;
+	}
+
+	return found;
+}
+
+function setAttrib(elm, attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib.toLowerCase()];
+	tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
+}
+
+function setAllCommonAttribs(elm) {
+	setAttrib(elm, 'title');
+	setAttrib(elm, 'id');
+	setAttrib(elm, 'class');
+	setAttrib(elm, 'style');
+	setAttrib(elm, 'dir');
+	setAttrib(elm, 'lang');
+	/*setAttrib(elm, 'onfocus');
+	setAttrib(elm, 'onblur');
+	setAttrib(elm, 'onclick');
+	setAttrib(elm, 'ondblclick');
+	setAttrib(elm, 'onmousedown');
+	setAttrib(elm, 'onmouseup');
+	setAttrib(elm, 'onmouseover');
+	setAttrib(elm, 'onmousemove');
+	setAttrib(elm, 'onmouseout');
+	setAttrib(elm, 'onkeypress');
+	setAttrib(elm, 'onkeydown');
+	setAttrib(elm, 'onkeyup');*/
+}
+
+SXE = {
+	currentAction : "insert",
+	inst : tinyMCEPopup.editor,
+	updateElement : null
+}
+
+SXE.focusElement = SXE.inst.selection.getNode();
+
+SXE.initElementDialog = function(element_name) {
+	addClassesToList('class', 'xhtmlxtras_styles');
+	TinyMCE_EditableSelects.init();
+
+	element_name = element_name.toLowerCase();
+	var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
+	if (elm != null && elm.nodeName == element_name.toUpperCase()) {
+		SXE.currentAction = "update";
+	}
+
+	if (SXE.currentAction == "update") {
+		initCommonAttributes(elm);
+		SXE.updateElement = elm;
+	}
+
+	document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); 
+}
+
+SXE.insertElement = function(element_name) {
+	var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
+
+	tinyMCEPopup.execCommand('mceBeginUndoLevel');
+	if (elm == null) {
+		var s = SXE.inst.selection.getContent();
+		if(s.length > 0) {
+			tagName = element_name;
+
+			if (tinymce.isIE && element_name.indexOf('html:') == 0)
+				element_name = element_name.substring(5).toLowerCase();
+
+			h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
+
+			tinyMCEPopup.execCommand('mceInsertContent', false, h);
+
+			var elementArray = tinymce.grep(SXE.inst.dom.select(element_name), function(n) {return n.id == '#sxe_temp_' + element_name + '#';});
+			for (var i=0; i<elementArray.length; i++) {
+				var elm = elementArray[i];
+
+				elm.id = '';
+				elm.setAttribute('id', '');
+				elm.removeAttribute('id');
+
+				setAllCommonAttribs(elm);
+			}
+		}
+	} else {
+		setAllCommonAttribs(elm);
+	}
+	SXE.inst.nodeChanged();
+	tinyMCEPopup.execCommand('mceEndUndoLevel');
+}
+
+SXE.removeElement = function(element_name){
+	element_name = element_name.toLowerCase();
+	elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
+	if(elm && elm.nodeName == element_name.toUpperCase()){
+		tinyMCEPopup.execCommand('mceBeginUndoLevel');
+		tinyMCE.execCommand('mceRemoveNode', false, elm);
+		SXE.inst.nodeChanged();
+		tinyMCEPopup.execCommand('mceEndUndoLevel');
+	}
+}
+
+SXE.showRemoveButton = function() {
+		document.getElementById("remove").style.display = 'block';
+}
+
+SXE.containsClass = function(elm,cl) {
+	return (elm.className.indexOf(cl) > -1) ? true : false;
+}
+
+SXE.removeClass = function(elm,cl) {
+	if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
+		return true;
+	}
+	var classNames = elm.className.split(" ");
+	var newClassNames = "";
+	for (var x = 0, cnl = classNames.length; x < cnl; x++) {
+		if (classNames[x] != cl) {
+			newClassNames += (classNames[x] + " ");
+		}
+	}
+	elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
+}
+
+SXE.addClass = function(elm,cl) {
+	if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
+	return true;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/js/ins.js	(revision 1)
@@ -0,0 +1,49 @@
+ /**
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
+ *
+ * @author Moxiecode - based on work by Andrew Tetlaw
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function init() {
+	SXE.initElementDialog('ins');
+	if (SXE.currentAction == "update") {
+		setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
+		setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
+		SXE.showRemoveButton();
+	}
+}
+
+function setElementAttribs(elm) {
+	setAllCommonAttribs(elm);
+	setAttrib(elm, 'datetime');
+	setAttrib(elm, 'cite');
+}
+
+function insertIns() {
+	var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
+	tinyMCEPopup.execCommand('mceBeginUndoLevel');
+	if (elm == null) {
+		var s = SXE.inst.selection.getContent();
+		if(s.length > 0) {
+			tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
+			var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
+			for (var i=0; i<elementArray.length; i++) {
+				var elm = elementArray[i];
+				setElementAttribs(elm);
+			}
+		}
+	} else {
+		setElementAttribs(elm);
+	}
+	tinyMCEPopup.editor.nodeChanged();
+	tinyMCEPopup.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function removeIns() {
+	SXE.removeElement('ins');
+	tinyMCEPopup.close();
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,32 @@
+tinyMCE.addI18n('en.xhtmlxtras_dlg',{
+attribute_label_title:"Title",
+attribute_label_id:"ID",
+attribute_label_class:"Class",
+attribute_label_style:"Style",
+attribute_label_cite:"Cite",
+attribute_label_datetime:"Date/Time",
+attribute_label_langdir:"Text Direction",
+attribute_option_ltr:"Left to right",
+attribute_option_rtl:"Right to left",
+attribute_label_langcode:"Language",
+attribute_label_tabindex:"TabIndex",
+attribute_label_accesskey:"AccessKey",
+attribute_events_tab:"Events",
+attribute_attrib_tab:"Attributes",
+general_tab:"General",
+attrib_tab:"Attributes",
+events_tab:"Events",
+fieldset_general_tab:"General Settings",
+fieldset_attrib_tab:"Element Attributes",
+fieldset_events_tab:"Element Events",
+title_ins_element:"Insertion Element",
+title_del_element:"Deletion Element",
+title_acronym_element:"Acronym Element",
+title_abbr_element:"Abbreviation Element",
+title_cite_element:"Citation Element",
+remove:"Remove",
+insert_date:"Insert current date/time",
+option_ltr:"Left to right",
+option_rtl:"Right to left",
+attribs_title:"Insert/Edit Attributes"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/about.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/about.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/about.htm	(revision 1)
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.about_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="js/about.js"></script>
+</head>
+<body id="about" style="display: none">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
+				<li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
+				<li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<h3>{#advanced_dlg.about_title}</h3>
+				<p>Version: <span id="version"></span> (<span id="date"></span>)</p>
+				<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
+				by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
+				<p>Copyright &copy; 2003-2007, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
+				<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
+
+				<div id="buttoncontainer">
+					<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
+					<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>
+					<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>
+				</div>
+			</div>
+
+			<div id="plugins_panel" class="panel">
+				<div id="pluginscontainer">
+					<h3>{#advanced_dlg.about_loaded}</h3>
+
+					<div id="plugintablecontainer">
+					</div>
+
+					<p>&nbsp;</p>
+				</div>
+			</div>
+
+			<div id="help_panel" class="panel noscroll" style="overflow: visible;">
+				<div id="iframecontainer"></div>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/anchor.htm	(revision 1)
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.anchor_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/anchor.js"></script>
+	<base target="_self" />
+</head>
+<body style="display: none">
+<form onsubmit="AnchorDialog.update();return false;" action="#">
+	<table border="0" cellpadding="4" cellspacing="0">
+		<tr>
+			<td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>
+		</tr>
+		<tr>
+			<td nowrap="nowrap">{#advanced_dlg.anchor_name}:</td>
+			<td><input name="anchorName" type="text" id="anchorName" value="" style="width: 200px" /></td>
+		</tr>
+	</table>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#update}" onclick="AnchorDialog.update();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/charmap.htm	(revision 1)
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.charmap_title}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/charmap.js"></script>
+	<base target="_self" />
+</head>
+<body style="display: none">
+<table align="center" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+        <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>
+    </tr>
+    <tr>
+        <td id="charmap" rowspan="2" align="left" valign="top">
+			<!-- Chars will be rendered here -->
+        </td>
+        <td width="100" align="center" valign="top">
+            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height: 100px">
+                <tr>
+                    <td class="charmapOver" style="font-size: 40px; height:80px;" id="codeV">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 10px; font-family: Arial, Helvetica, sans-serif; text-align:center;" id="codeN">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td valign="bottom" style="padding-bottom: 3px;">
+            <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 1px;">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm	(revision 1)
@@ -0,0 +1,74 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.colorpicker_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="js/color_picker.js"></script>
+	<base target="_self" />
+</head>
+<body id="colorpicker" style="display: none">
+	<div class="tabs">
+		<ul>
+			<li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
+			<li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
+			<li id="named_tab"><span><a  href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="picker_panel" class="panel current">
+			<fieldset>
+				<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
+				<div id="picker">
+					<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" />
+
+					<div id="light">
+						<!-- Will be filled with divs -->
+					</div>
+
+					<br style="clear: both" />
+				</div>
+			</fieldset>
+		</div>
+
+		<div id="rgb_panel" class="panel">
+			<fieldset>
+				<legend>{#advanced_dlg.colorpicker_palette_title}</legend>
+				<div id="webcolors">
+					<!-- Gets filled with web safe colors-->
+				</div>
+
+				<br style="clear: both" />
+			</fieldset>
+		</div>
+
+		<div id="named_panel" class="panel">
+			<fieldset>
+				<legend>{#advanced_dlg.colorpicker_named_title}</legend>
+				<div id="namedcolors">
+					<!-- Gets filled with named colors-->
+				</div>
+
+				<br style="clear: both" />
+
+				<div id="colornamecontainer">
+					{#advanced_dlg.colorpicker_name} <span id="colorname"></span>
+				</div>
+			</fieldset>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#apply}" onclick="insertAction();" />
+		</div>
+
+		<div id="preview"></div>
+
+		<div id="previewblock">
+			<label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text" />
+		</div>
+	</div>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if(s.theme_advanced_path_location)s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});each((t.settings.theme_advanced_styles||'').split(';'),function(v){var p=v.split('=');if(v)c.add(t.editor.translate(p[0]),p[1]);});c.onPostRender.add(function(ed,n){Event.add(n,'focus',t._importClasses,t);Event.add(n,'mousedown',t._importClasses,t);});return c;},_createFontSelect:function(){var c,t=this;c=t.editor.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});each(t.settings.theme_advanced_fonts.split(';'),function(v){var p=v.split('='),st;if(p[1].indexOf('dings')==-1)st='font-family:'+p[1];c.add(t.editor.translate(p[0]),p[1],{style:st});});return c;},_createFontSizeSelect:function(){var c,t=this,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=t.editor.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});each(t.settings.theme_advanced_font_sizes.split(','),function(v){c.add(lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'fontSize'+v});});return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});each(t.settings.theme_advanced_blockformats.split(','),function(v){c.add(t.editor.translate(fmts[v]),v,{element:v,'class':v.indexOf('h')==0?'':'preview'});});return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('div',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=sc.rows;DOM.addClass(nl[0],'first');DOM.addClass(nl[nl.length-1],'last');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'first');DOM.addClass(n.childNodes[n.childNodes.length-1],'last');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.href.replace(/^[^#]*#/,''));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},'<!-- IE -->'),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each((s.theme_advanced_containers||'').split(','),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(c.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc),align:s['theme_advanced_container_'+c+'_align']||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(s.theme_advanced_disable.split(','),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(v.split(','),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[];n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar',align:s.theme_advanced_toolbar_align});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},'<!-- IE -->'));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},'<!-- IE -->'));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},'<!-- IE -->'));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':'&nbsp;');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'resize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=o.cw+'px';c.style.height=o.ch+'px';DOM.get(ed.id+'_ifr').style.height=(parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(document,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(document,'mouseup',function(e){var ifr;Event.remove(document,'mousemove',mf);Event.remove(document,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=(r.w+r.dx)+'px';c.style.height=(r.h+r.dy)+'px';ifr.style.height=(ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"#"+(de++)+"",onmousedown:"return false;",title:ti},na);if(p.hasChildNodes()){p.insertBefore(document.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{func:function(co){t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{func:function(co){t.editor.execCommand('HiliteColor',false,co);}});}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}());
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/editor_template_src.js	(revision 1)
@@ -0,0 +1,999 @@
+/**
+ * $Id: editor_template_src.js 555 2008-01-19 19:08:37Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID;
+
+	// Tell it to load theme specific language pack(s)
+	tinymce.ThemeManager.requireLangPack('advanced');
+
+	tinymce.create('tinymce.themes.AdvancedTheme', {
+		// Control name lookup, format: title, command
+		controls : {
+			bold : ['bold_desc', 'Bold'],
+			italic : ['italic_desc', 'Italic'],
+			underline : ['underline_desc', 'Underline'],
+			strikethrough : ['striketrough_desc', 'Strikethrough'],
+			justifyleft : ['justifyleft_desc', 'JustifyLeft'],
+			justifycenter : ['justifycenter_desc', 'JustifyCenter'],
+			justifyright : ['justifyright_desc', 'JustifyRight'],
+			justifyfull : ['justifyfull_desc', 'JustifyFull'],
+			bullist : ['bullist_desc', 'InsertUnorderedList'],
+			numlist : ['numlist_desc', 'InsertOrderedList'],
+			outdent : ['outdent_desc', 'Outdent'],
+			indent : ['indent_desc', 'Indent'],
+			cut : ['cut_desc', 'Cut'],
+			copy : ['copy_desc', 'Copy'],
+			paste : ['paste_desc', 'Paste'],
+			undo : ['undo_desc', 'Undo'],
+			redo : ['redo_desc', 'Redo'],
+			link : ['link_desc', 'mceLink'],
+			unlink : ['unlink_desc', 'unlink'],
+			image : ['image_desc', 'mceImage'],
+			cleanup : ['cleanup_desc', 'mceCleanup'],
+			help : ['help_desc', 'mceHelp'],
+			code : ['code_desc', 'mceCodeEditor'],
+			hr : ['hr_desc', 'InsertHorizontalRule'],
+			removeformat : ['removeformat_desc', 'RemoveFormat'],
+			sub : ['sub_desc', 'subscript'],
+			sup : ['sup_desc', 'superscript'],
+			forecolor : ['forecolor_desc', 'ForeColor'],
+			forecolorpicker : ['forecolor_desc', 'mceForeColor'],
+			backcolor : ['backcolor_desc', 'HiliteColor'],
+			backcolorpicker : ['backcolor_desc', 'mceBackColor'],
+			charmap : ['charmap_desc', 'mceCharMap'],
+			visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
+			anchor : ['anchor_desc', 'mceInsertAnchor'],
+			newdocument : ['newdocument_desc', 'mceNewDocument'],
+			blockquote : ['blockquote_desc', 'mceBlockQuote']
+		},
+
+		stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
+
+		init : function(ed, url) {
+			var t = this, s;
+
+			t.editor = ed;
+			t.url = url;
+			t.onResolveName = new tinymce.util.Dispatcher(this);
+
+			// Default settings
+			t.settings = s = extend({
+				theme_advanced_path : true,
+				theme_advanced_toolbar_location : 'bottom',
+				theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
+				theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
+				theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
+				theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
+				theme_advanced_toolbar_align : "center",
+				theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
+				theme_advanced_font_sizes : "1,2,3,4,5,6,7",
+				theme_advanced_more_colors : 1,
+				theme_advanced_row_height : 23,
+				theme_advanced_resize_horizontal : 1,
+				theme_advanced_resizing_use_cookie : 1
+			}, ed.settings);
+
+			if (s.theme_advanced_path_location)
+				s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
+
+			if (s.theme_advanced_statusbar_location == 'none')
+				s.theme_advanced_statusbar_location = 0;
+
+			// Init editor
+			ed.onInit.add(function() {
+				ed.onNodeChange.add(t._nodeChanged, t);
+				ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css"));
+			});
+
+			ed.onSetProgressState.add(function(ed, b, ti) {
+				var co, id = ed.id, tb;
+
+				if (b) {
+					t.progressTimer = setTimeout(function() {
+						co = ed.getContainer();
+						co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
+						tb = DOM.get(ed.id + '_tbl');
+
+						DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
+						DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
+					}, ti || 0);
+				} else {
+					DOM.remove(id + '_blocker');
+					DOM.remove(id + '_progress');
+					clearTimeout(t.progressTimer);
+				}
+			});
+
+			DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css || "themes/advanced/skins/" + ed.settings.skin + "/ui.css"));
+		},
+
+		createControl : function(n, cf) {
+			var cd, c;
+
+			if (c = cf.createControl(n))
+				return c;
+
+			switch (n) {
+				case "styleselect":
+					return this._createStyleSelect();
+
+				case "formatselect":
+					return this._createBlockFormats();
+
+				case "fontselect":
+					return this._createFontSelect();
+
+				case "fontsizeselect":
+					return this._createFontSizeSelect();
+
+				case "forecolor":
+					return this._createForeColorMenu();
+
+				case "backcolor":
+					return this._createBackColorMenu();
+			}
+
+			if ((cd = this.controls[n]))
+				return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
+		},
+
+		execCommand : function(cmd, ui, val) {
+			var f = this['_' + cmd];
+
+			if (f) {
+				f.call(this, ui, val);
+				return true;
+			}
+
+			return false;
+		},
+
+		_importClasses : function() {
+			var ed = this.editor, c = ed.controlManager.get('styleselect');
+
+			if (c.getLength() == 0) {
+				each(ed.dom.getClasses(), function(o) {
+					c.add(o['class'], o['class']);
+				});
+			}
+		},
+
+		_createStyleSelect : function(n) {
+			var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', {
+				title : 'advanced.style_select',
+				onselect : function(v) {
+					if (c.selectedValue === v) {
+						ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'});
+						c.select();
+						return false;
+					} else
+						ed.execCommand('mceSetCSSClass', 0, v);
+				}
+			});
+
+			each((t.settings.theme_advanced_styles || '').split(';'), function(v) {
+				var p = v.split('=');
+
+				if (v)
+					c.add(t.editor.translate(p[0]), p[1]);
+			});
+
+			c.onPostRender.add(function(ed, n) {
+				Event.add(n, 'focus', t._importClasses, t);
+				Event.add(n, 'mousedown', t._importClasses, t);
+			});
+
+			return c;
+		},
+
+		_createFontSelect : function() {
+			var c, t = this;
+
+			c = t.editor.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'});
+
+			each(t.settings.theme_advanced_fonts.split(';'), function(v) {
+				var p = v.split('='), st;
+
+				if (p[1].indexOf('dings') == -1)
+					st = 'font-family:' + p[1];
+
+				c.add(t.editor.translate(p[0]), p[1], {style : st});
+			});
+
+			return c;
+		},
+
+		_createFontSizeSelect : function() {
+			var c, t = this, lo = [
+				"1 (8 pt)",
+				"2 (10 pt)",
+				"3 (12 pt)",
+				"4 (14 pt)",
+				"5 (18 pt)",
+				"6 (24 pt)",
+				"7 (36 pt)"
+			], fz = [8, 10, 12, 14, 18, 24, 36];
+
+			c = t.editor.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', cmd : 'FontSize'});
+
+			each(t.settings.theme_advanced_font_sizes.split(','), function(v) {
+				c.add(lo[parseInt(v) - 1], v, {'style' : 'font-size:' + fz[v - 1] + 'pt', 'class' : 'fontSize' + v});
+			});
+
+			return c;
+		},
+
+		_createBlockFormats : function() {
+			var c, fmts = {
+				p : 'advanced.paragraph',
+				address : 'advanced.address',
+				pre : 'advanced.pre',
+				h1 : 'advanced.h1',
+				h2 : 'advanced.h2',
+				h3 : 'advanced.h3',
+				h4 : 'advanced.h4',
+				h5 : 'advanced.h5',
+				h6 : 'advanced.h6',
+				div : 'advanced.div',
+				blockquote : 'advanced.blockquote',
+				code : 'advanced.code',
+				dt : 'advanced.dt',
+				dd : 'advanced.dd',
+				samp : 'advanced.samp'
+			}, t = this;
+
+			c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
+
+			each(t.settings.theme_advanced_blockformats.split(','), function(v) {
+				c.add(t.editor.translate(fmts[v]), v, {element : v, 'class' : v.indexOf('h') == 0 ? '' : 'preview'});
+			});
+
+			return c;
+		},
+
+		_createForeColorMenu : function() {
+			var c, t = this, s = t.settings, o = {}, v;
+
+			if (s.theme_advanced_more_colors) {
+				o.more_colors_func = function() {
+					t._mceColorPicker(0, {
+						color : c.value,
+						func : function(co) {
+							c.setColor(co);
+						}
+					});
+				};
+			}
+
+			if (v = s.theme_advanced_text_colors)
+				o.colors = v;
+
+			o.title = 'advanced.forecolor_desc';
+			o.cmd = 'ForeColor';
+			o.scope = this;
+
+			c = t.editor.controlManager.createColorSplitButton('forecolor', o);
+
+			return c;
+		},
+
+		_createBackColorMenu : function() {
+			var c, t = this, s = t.settings, o = {}, v;
+
+			if (s.theme_advanced_more_colors) {
+				o.more_colors_func = function() {
+					t._mceColorPicker(0, {
+						color : c.value,
+						func : function(co) {
+							c.setColor(co);
+						}
+					});
+				};
+			}
+
+			if (v = s.theme_advanced_background_colors)
+				o.colors = v;
+
+			o.title = 'advanced.backcolor_desc';
+			o.cmd = 'HiliteColor';
+			o.scope = this;
+
+			c = t.editor.controlManager.createColorSplitButton('backcolor', o);
+
+			return c;
+		},
+
+		renderUI : function(o) {
+			var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
+
+			n = p = DOM.create('div', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin'});
+
+			if (!DOM.boxModel)
+				n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
+
+			n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
+			n = tb = DOM.add(n, 'tbody');
+
+			switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
+				case "rowlayout":
+					ic = t._rowLayout(s, tb, o);
+					break;
+
+				case "customlayout":
+					ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
+					break;
+
+				default:
+					ic = t._simpleLayout(s, tb, o, p);
+			}
+
+			n = o.targetNode;
+
+			// Add classes to first and last TRs
+			nl = sc.rows;
+			DOM.addClass(nl[0], 'first');
+			DOM.addClass(nl[nl.length - 1], 'last');
+
+			// Add classes to first and last TDs
+			each(DOM.select('tr', tb), function(n) {
+				DOM.addClass(n.firstChild, 'first');
+				DOM.addClass(n.childNodes[n.childNodes.length - 1], 'last');
+			});
+
+			if (DOM.get(s.theme_advanced_toolbar_container))
+				DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
+			else
+				DOM.insertAfter(p, n);
+
+			Event.add(ed.id + '_path_row', 'click', function(e) {
+				e = e.target;
+
+				if (e.nodeName == 'A') {
+					t._sel(e.href.replace(/^[^#]*#/, ''));
+
+					return Event.cancel(e);
+				}
+			});
+/*
+			if (DOM.get(ed.id + '_path_row')) {
+				Event.add(ed.id + '_tbl', 'mouseover', function(e) {
+					var re;
+	
+					e = e.target;
+
+					if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
+						re = DOM.get(ed.id + '_path_row');
+						t.lastPath = re.innerHTML;
+						DOM.setHTML(re, e.parentNode.title);
+					}
+				});
+
+				Event.add(ed.id + '_tbl', 'mouseout', function(e) {
+					if (t.lastPath) {
+						DOM.setHTML(ed.id + '_path_row', t.lastPath);
+						t.lastPath = 0;
+					}
+				});
+			}
+*/
+
+			if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus'))
+				Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
+
+			if (s.theme_advanced_toolbar_location == 'external')
+				o.deltaHeight = 0;
+
+			t.deltaHeight = o.deltaHeight;
+			o.targetNode = null;
+
+			return {
+				iframeContainer : ic,
+				editorContainer : ed.id + '_parent',
+				sizeContainer : sc,
+				deltaHeight : o.deltaHeight
+			};
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Simple theme',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			}
+		},
+
+		_simpleLayout : function(s, tb, o, p) {
+			var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
+
+			// Create toolbar container at top
+			if (lo == 'top')
+				t._addToolbars(tb, o);
+
+			// Create external toolbar
+			if (lo == 'external') {
+				n = c = DOM.create('div', {style : 'position:relative'});
+				n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
+				DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
+				n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
+				etb = DOM.add(n, 'tbody');
+
+				if (p.firstChild.className == 'mceOldBoxModel')
+					p.firstChild.appendChild(c);
+				else
+					p.insertBefore(c, p.firstChild);
+
+				t._addToolbars(etb, o);
+
+				ed.onMouseUp.add(function() {
+					var e = DOM.get(ed.id + '_external');
+					DOM.show(e);
+
+					DOM.hide(lastExtID);
+
+					var f = Event.add(ed.id + '_external_close', 'click', function() {
+						DOM.hide(ed.id + '_external');
+						Event.remove(ed.id + '_external_close', 'click', f);
+					});
+
+					DOM.show(e);
+					DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
+
+					// Fixes IE rendering bug
+					DOM.hide(e);
+					DOM.show(e);
+					e.style.filter = '';
+
+					lastExtID = ed.id + '_external';
+
+					e = null;
+				});
+			}
+
+			if (sl == 'top')
+				t._addStatusBar(tb, o);
+
+			// Create iframe container
+			if (!s.theme_advanced_toolbar_container) {
+				n = DOM.add(tb, 'tr');
+				n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+			}
+
+			// Create toolbar container at bottom
+			if (lo == 'bottom')
+				t._addToolbars(tb, o);
+
+			if (sl == 'bottom')
+				t._addStatusBar(tb, o);
+
+			return ic;
+		},
+
+		_rowLayout : function(s, tb, o) {
+			var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to;
+
+			dc = s.theme_advanced_containers_default_class || '';
+			da = s.theme_advanced_containers_default_align || 'center';
+
+			each((s.theme_advanced_containers || '').split(','), function(c, i) {
+				var v = s['theme_advanced_container_' + c] || '';
+
+				switch (c.toLowerCase()) {
+					case 'mceeditor':
+						n = DOM.add(tb, 'tr');
+						n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+						break;
+
+					case 'mceelementpath':
+						t._addStatusBar(tb, o);
+						break;
+
+					default:
+						n = DOM.add(DOM.add(tb, 'tr'), 'td', {
+							'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc),
+							align : s['theme_advanced_container_' + c + '_align'] || da
+						});
+
+						to = cf.createToolbar("toolbar" + i);
+						t._addControls(v, to);
+						DOM.setHTML(n, to.renderHTML());
+						o.deltaHeight -= s.theme_advanced_row_height;
+				}
+			});
+
+			return ic;
+		},
+
+		_addControls : function(v, tb) {
+			var t = this, s = t.settings, di, cf = t.editor.controlManager;
+
+			if (s.theme_advanced_disable && !t._disabled) {
+				di = {};
+
+				each(s.theme_advanced_disable.split(','), function(v) {
+					di[v] = 1;
+				});
+
+				t._disabled = di;
+			} else
+				di = t._disabled;
+
+			each(v.split(','), function(n) {
+				var c;
+
+				if (di && di[n])
+					return;
+
+				// Compatiblity with 2.x
+				if (n == 'tablecontrols') {
+					each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
+						n = t.createControl(n, cf);
+
+						if (n)
+							tb.add(n);
+					});
+
+					return;
+				}
+
+				c = t.createControl(n, cf);
+
+				if (c)
+					tb.add(c);
+			});
+		},
+
+		_addToolbars : function(c, o) {
+			var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [];
+
+			n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar', align : s.theme_advanced_toolbar_align});
+
+			if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus'))
+				h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
+
+			h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));
+
+			// Create toolbar and add the controls
+			for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
+				tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
+
+				if (s['theme_advanced_buttons' + i + '_add'])
+					v += ',' + s['theme_advanced_buttons' + i + '_add'];
+
+				if (s['theme_advanced_buttons' + i + '_add_before'])
+					v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
+
+				t._addControls(v, tb);
+
+				//n.appendChild(n = tb.render());
+				h.push(tb.renderHTML());
+
+				o.deltaHeight -= s.theme_advanced_row_height;
+			}
+
+			h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
+			DOM.setHTML(n, h.join(''));
+		},
+
+		_addStatusBar : function(tb, o) {
+			var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
+
+			n = DOM.add(tb, 'tr');
+			n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
+			n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : '&nbsp;');
+			DOM.add(n, 'a', {href : '#', accesskey : 'x'});
+
+			if (s.theme_advanced_resizing && !tinymce.isOldWebKit) {
+				DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'resize'});
+
+				if (s.theme_advanced_resizing_use_cookie) {
+					ed.onPostRender.add(function() {
+						var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
+
+						if (!o)
+							return;
+
+						if (s.theme_advanced_resize_horizontal)
+							c.style.width = o.cw + 'px';
+
+						c.style.height = o.ch + 'px';
+						DOM.get(ed.id + '_ifr').style.height = (parseInt(o.ch) + t.deltaHeight) + 'px';
+					});
+				}
+
+				ed.onPostRender.add(function() {
+					Event.add(ed.id + '_resize', 'mousedown', function(e) {
+						var c, p, w, h, n, pa;
+
+						// Measure container
+						c = DOM.get(ed.id + '_tbl');
+						w = c.clientWidth;
+						h = c.clientHeight;
+
+						miw = s.theme_advanced_resizing_min_width || 100;
+						mih = s.theme_advanced_resizing_min_height || 100;
+						maw = s.theme_advanced_resizing_max_width || 0xFFFF;
+						mah = s.theme_advanced_resizing_max_height || 0xFFFF;
+
+						// Setup placeholder
+						p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'});
+						DOM.setStyles(p, {width : w, height : h});
+
+						// Replace with placeholder
+						DOM.hide(c);
+						DOM.show(p);
+
+						// Create internal resize obj
+						r = {
+							x : e.screenX,
+							y : e.screenY,
+							w : w,
+							h : h,
+							dx : null,
+							dy : null
+						};
+
+						// Start listening
+						mf = Event.add(document, 'mousemove', function(e) {
+							var w, h;
+
+							// Calc delta values
+							r.dx = e.screenX - r.x;
+							r.dy = e.screenY - r.y;
+
+							// Boundery fix box
+							w = Math.max(miw, r.w + r.dx);
+							h = Math.max(mih, r.h + r.dy);
+							w = Math.min(maw, w);
+							h = Math.min(mah, h);
+
+							// Resize placeholder
+							if (s.theme_advanced_resize_horizontal)
+								p.style.width = w + 'px';
+
+							p.style.height = h + 'px';
+
+							return Event.cancel(e);
+						});
+
+						me = Event.add(document, 'mouseup', function(e) {
+							var ifr;
+
+							// Stop listening
+							Event.remove(document, 'mousemove', mf);
+							Event.remove(document, 'mouseup', me);
+
+							c.style.display = '';
+							DOM.remove(p);
+
+							if (r.dx === null)
+								return;
+
+							ifr = DOM.get(ed.id + '_ifr');
+
+							if (s.theme_advanced_resize_horizontal)
+								c.style.width = (r.w + r.dx) + 'px';
+
+							c.style.height = (r.h + r.dy) + 'px';
+							ifr.style.height = (ifr.clientHeight + r.dy) + 'px';
+
+							if (s.theme_advanced_resizing_use_cookie) {
+								Cookie.setHash("TinyMCE_" + ed.id + "_size", {
+									cw : r.w + r.dx,
+									ch : r.h + r.dy
+								});
+							}
+						});
+
+						return Event.cancel(e);
+					});
+				});
+			}
+
+			o.deltaHeight -= 21;
+			n = tb = null;
+		},
+
+		_nodeChanged : function(ed, cm, n, co) {
+			var t = this, p, de = 0, v, c, s = t.settings;
+
+			tinymce.each(t.stateControls, function(c) {
+				cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
+			});
+
+			cm.setActive('visualaid', ed.hasVisual);
+			cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
+			cm.setDisabled('redo', !ed.undoManager.hasRedo());
+			cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
+
+			p = DOM.getParent(n, 'A');
+			if (c = cm.get('link')) {
+				if (!p || !p.name) {
+					c.setDisabled(!p && co);
+					c.setActive(!!p);
+				}
+			}
+
+			if (c = cm.get('unlink')) {
+				c.setDisabled(!p && co);
+				c.setActive(!!p && !p.name);
+			}
+
+			if (c = cm.get('anchor')) {
+				c.setActive(!!p && p.name);
+
+				if (tinymce.isWebKit) {
+					p = DOM.getParent(n, 'IMG');
+					c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a');
+				}
+			}
+
+			p = DOM.getParent(n, 'IMG');
+			if (c = cm.get('image'))
+				c.setActive(!!p && n.className.indexOf('mceItem') == -1);
+
+			if (c = cm.get('styleselect')) {
+				if (n.className) {
+					t._importClasses();
+					c.select(n.className);
+				} else
+					c.select();
+			}
+
+			if (c = cm.get('formatselect')) {
+				p = DOM.getParent(n, DOM.isBlock);
+
+				if (p)
+					c.select(p.nodeName.toLowerCase());
+			}
+
+			if (c = cm.get('fontselect'))
+				c.select(ed.queryCommandValue('FontName'));
+
+			if (c = cm.get('fontsizeselect'))
+				c.select(ed.queryCommandValue('FontSize'));
+
+			if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
+				p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
+				DOM.setHTML(p, '');
+
+				ed.dom.getParent(n, function(n) {
+					var na = n.nodeName.toLowerCase(), u, pi, ti = '';
+
+					// Ignore non element and hidden elements
+					if (n.nodeType != 1 || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
+						return;
+
+					// Fake name
+					if (v = DOM.getAttrib(n, 'mce_name'))
+						na = v;
+	
+					// Handle prefix
+					if (tinymce.isIE && n.scopeName !== 'HTML')
+						na = n.scopeName + ':' + na;
+
+					// Remove internal prefix
+					na = na.replace(/mce\:/g, '');
+
+					// Handle node name
+					switch (na) {
+						case 'b':
+							na = 'strong';
+							break;
+
+						case 'i':
+							na = 'em';
+							break;
+
+						case 'img':
+							if (v = DOM.getAttrib(n, 'src'))
+								ti += 'src: ' + v + ' ';
+
+							break;
+
+						case 'a':
+							if (v = DOM.getAttrib(n, 'name')) {
+								ti += 'name: ' + v + ' ';
+								na += '#' + v;
+							}
+
+							if (v = DOM.getAttrib(n, 'href'))
+								ti += 'href: ' + v + ' ';
+
+							break;
+
+						case 'font':
+							if (s.convert_fonts_to_spans)
+								na = 'span';
+
+							if (v = DOM.getAttrib(n, 'face'))
+								ti += 'font: ' + v + ' ';
+
+							if (v = DOM.getAttrib(n, 'size'))
+								ti += 'size: ' + v + ' ';
+
+							if (v = DOM.getAttrib(n, 'color'))
+								ti += 'color: ' + v + ' ';
+
+							break;
+
+						case 'span':
+							if (v = DOM.getAttrib(n, 'style'))
+								ti += 'style: ' + v + ' ';
+
+							break;
+					}
+
+					if (v = DOM.getAttrib(n, 'id'))
+						ti += 'id: ' + v + ' ';
+
+					if (v = n.className) {
+						v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, '');
+
+						if (v && v.indexOf('mceItem') == -1) {
+							ti += 'class: ' + v + ' ';
+
+							if (DOM.isBlock(n) || na == 'img' || na == 'span')
+								na += '.' + v;
+						}
+					}
+
+					na = na.replace(/(html:)/g, '');
+					na = {name : na, node : n, title : ti};
+					t.onResolveName.dispatch(t, na);
+					ti = na.title;
+					na = na.name;
+
+					//u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
+					pi = DOM.create('a', {'href' : "#" + (de++) + "", onmousedown : "return false;", title : ti}, na);
+
+					if (p.hasChildNodes()) {
+						p.insertBefore(document.createTextNode(' \u00bb '), p.firstChild);
+						p.insertBefore(pi, p.firstChild);
+					} else
+						p.appendChild(pi);
+				}, ed.getBody());
+			}
+		},
+
+		// Commands gets called by execCommand
+
+		_sel : function(v) {
+			this.editor.execCommand('mceSelectNodeDepth', false, v);
+		},
+
+		_mceInsertAnchor : function(ui, v) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/anchor.htm',
+				width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
+				height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceCharMap : function() {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/charmap.htm',
+				width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
+				height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceHelp : function() {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/about.htm',
+				width : 480,
+				height : 380,
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceColorPicker : function(u, v) {
+			var ed = this.editor;
+
+			v = v || {};
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/color_picker.htm',
+				width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
+				height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
+				close_previous : false,
+				inline : true
+			}, {
+				input_color : v.color,
+				func : v.func,
+				theme_url : this.url
+			});
+		},
+
+		_mceCodeEditor : function(ui, val) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/source_editor.htm',
+				width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
+				height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
+				inline : true,
+				resizable : true,
+				maximizable : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceImage : function(ui, val) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/image.htm',
+				width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
+				height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceLink : function(ui, val) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : tinymce.baseURL + '/themes/advanced/link.htm',
+				width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
+				height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceNewDocument : function() {
+			var ed = this.editor;
+
+			ed.windowManager.confirm('advanced.newdocument', function(s) {
+				if (s)
+					ed.execCommand('mceSetContent', false, '');
+			});
+		},
+
+		_mceForeColor : function() {
+			var t = this;
+
+			this._mceColorPicker(0, {
+				func : function(co) {
+					t.editor.execCommand('ForeColor', false, co);
+				}
+			});
+		},
+
+		_mceBackColor : function() {
+			var t = this;
+
+			this._mceColorPicker(0, {
+				func : function(co) {
+					t.editor.execCommand('HiliteColor', false, co);
+				}
+			});
+		}
+	});
+
+	tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
+}());
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/image.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/image.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/image.htm	(revision 1)
@@ -0,0 +1,86 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.image_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/image.js"></script>
+	<base target="_self" />
+</head>
+<body id="image" style="display: none">
+<form onsubmit="ImageDialog.update();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+     <table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td><input id="src" name="src" type="text" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
+                  <td id="srcbrowsercontainer">&nbsp;</td>
+                </tr>
+              </table></td>
+          </tr>
+		  <tr>
+			<td><label for="image_list">{#advanced_dlg.image_list}</label></td>
+			<td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
+		  </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
+            <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
+            <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
+                <option value="">{#not_set}</option>
+                <option value="baseline">{#advanced_dlg.image_align_baseline}</option>
+                <option value="top">{#advanced_dlg.image_align_top}</option>
+                <option value="middle">{#advanced_dlg.image_align_middle}</option>
+                <option value="bottom">{#advanced_dlg.image_align_bottom}</option>
+                <option value="text-top">{#advanced_dlg.image_align_texttop}</option>
+                <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
+                <option value="left">{#advanced_dlg.image_align_left}</option>
+                <option value="right">{#advanced_dlg.image_align_right}</option>
+              </select></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
+            <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
+              x
+              <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
+            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
+            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
+            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+          </tr>
+        </table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#insert}" onclick="ImageDialog.update();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/about.js	(revision 1)
@@ -0,0 +1,76 @@
+tinyMCEPopup.requireLangPack();
+
+function init() {
+	var ed, tcont;
+
+	tinyMCEPopup.resizeToInnerSize();
+	ed = tinyMCEPopup.editor;
+
+	// Give FF some time
+	window.setTimeout('insertHelpIFrame();', 10);
+
+	tcont = document.getElementById('plugintablecontainer');
+	document.getElementById('plugins_tab').style.display = 'none';
+
+	var html = "";
+	html += '<table id="plugintable">';
+	html += '<thead>';
+	html += '<tr>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';
+	html += '</tr>';
+	html += '</thead>';
+	html += '<tbody>';
+
+	tinymce.each(ed.plugins, function(p, n) {
+		var info;
+
+		if (!p.getInfo)
+			return;
+
+		html += '<tr>';
+
+		info = p.getInfo();
+
+		if (info.infourl != null && info.infourl != '')
+			html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';
+		else
+			html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';
+
+		if (info.authorurl != null && info.authorurl != '')
+			html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';
+		else
+			html += '<td width="35%">' + info.author + '</td>';
+
+		html += '<td width="15%">' + info.version + '</td>';
+		html += '</tr>';
+
+		document.getElementById('plugins_tab').style.display = '';
+
+	});
+
+	html += '</tbody>';
+	html += '</table>';
+
+	tcont.innerHTML = html;
+
+	tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
+	tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;
+}
+
+function insertHelpIFrame() {
+	var html;
+
+	if (tinyMCEPopup.getParam('docs_url')) {
+		html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
+		document.getElementById('iframecontainer').innerHTML = html;
+		document.getElementById('help_tab').style.display = 'block';
+	}
+}
+
+tinyMCEPopup.onInit.add(init);
+
+// For modal dialogs in IE
+if (tinymce.isIE)
+	document.write('<base target="_self" />');
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/anchor.js	(revision 1)
@@ -0,0 +1,33 @@
+tinyMCEPopup.requireLangPack();
+
+var AnchorDialog = {
+	init : function(ed) {
+		var action, elm, f = document.forms[0];
+
+		this.editor = ed;
+		elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
+		v = ed.dom.getAttrib(elm, 'name');
+
+		if (v)
+			f.anchorName.value = v;
+
+		f.insert.value = ed.getLang(elm ? 'update' : 'insert');
+	},
+
+	update : function() {
+		var ed = this.editor;
+		
+		tinyMCEPopup.restoreSelection();
+		ed.selection.collapse(1);
+
+		// Webkit acts weird if empty inline element is inserted so we need to use a image instead
+		if (tinymce.isWebKit)
+			ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
+		else
+			ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));
+
+		tinyMCEPopup.close();
+	}
+};
+
+tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/charmap.js	(revision 1)
@@ -0,0 +1,328 @@
+tinyMCEPopup.requireLangPack();
+
+var charmap = [
+	['&nbsp;',    '&#160;',  true, 'no-break space'],
+	['&amp;',     '&#38;',   true, 'ampersand'],
+	['&quot;',    '&#34;',   true, 'quotation mark'],
+// finance
+	['&cent;',    '&#162;',  true, 'cent sign'],
+	['&euro;',    '&#8364;', true, 'euro sign'],
+	['&pound;',   '&#163;',  true, 'pound sign'],
+	['&yen;',     '&#165;',  true, 'yen sign'],
+// signs
+	['&copy;',    '&#169;',  true, 'copyright sign'],
+	['&reg;',     '&#174;',  true, 'registered sign'],
+	['&trade;',   '&#8482;', true, 'trade mark sign'],
+	['&permil;',  '&#8240;', true, 'per mille sign'],
+	['&micro;',   '&#181;',  true, 'micro sign'],
+	['&middot;',  '&#183;',  true, 'middle dot'],
+	['&bull;',    '&#8226;', true, 'bullet'],
+	['&hellip;',  '&#8230;', true, 'three dot leader'],
+	['&prime;',   '&#8242;', true, 'minutes / feet'],
+	['&Prime;',   '&#8243;', true, 'seconds / inches'],
+	['&sect;',    '&#167;',  true, 'section sign'],
+	['&para;',    '&#182;',  true, 'paragraph sign'],
+	['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],
+// quotations
+	['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],
+	['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],
+	['&laquo;',   '&#171;',  true, 'left pointing guillemet'],
+	['&raquo;',   '&#187;',  true, 'right pointing guillemet'],
+	['&lsquo;',   '&#8216;', true, 'left single quotation mark'],
+	['&rsquo;',   '&#8217;', true, 'right single quotation mark'],
+	['&ldquo;',   '&#8220;', true, 'left double quotation mark'],
+	['&rdquo;',   '&#8221;', true, 'right double quotation mark'],
+	['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],
+	['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],
+	['&lt;',      '&#60;',   true, 'less-than sign'],
+	['&gt;',      '&#62;',   true, 'greater-than sign'],
+	['&le;',      '&#8804;', true, 'less-than or equal to'],
+	['&ge;',      '&#8805;', true, 'greater-than or equal to'],
+	['&ndash;',   '&#8211;', true, 'en dash'],
+	['&mdash;',   '&#8212;', true, 'em dash'],
+	['&macr;',    '&#175;',  true, 'macron'],
+	['&oline;',   '&#8254;', true, 'overline'],
+	['&curren;',  '&#164;',  true, 'currency sign'],
+	['&brvbar;',  '&#166;',  true, 'broken bar'],
+	['&uml;',     '&#168;',  true, 'diaeresis'],
+	['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],
+	['&iquest;',  '&#191;',  true, 'turned question mark'],
+	['&circ;',    '&#710;',  true, 'circumflex accent'],
+	['&tilde;',   '&#732;',  true, 'small tilde'],
+	['&deg;',     '&#176;',  true, 'degree sign'],
+	['&minus;',   '&#8722;', true, 'minus sign'],
+	['&plusmn;',  '&#177;',  true, 'plus-minus sign'],
+	['&divide;',  '&#247;',  true, 'division sign'],
+	['&frasl;',   '&#8260;', true, 'fraction slash'],
+	['&times;',   '&#215;',  true, 'multiplication sign'],
+	['&sup1;',    '&#185;',  true, 'superscript one'],
+	['&sup2;',    '&#178;',  true, 'superscript two'],
+	['&sup3;',    '&#179;',  true, 'superscript three'],
+	['&frac14;',  '&#188;',  true, 'fraction one quarter'],
+	['&frac12;',  '&#189;',  true, 'fraction one half'],
+	['&frac34;',  '&#190;',  true, 'fraction three quarters'],
+// math / logical
+	['&fnof;',    '&#402;',  true, 'function / florin'],
+	['&int;',     '&#8747;', true, 'integral'],
+	['&sum;',     '&#8721;', true, 'n-ary sumation'],
+	['&infin;',   '&#8734;', true, 'infinity'],
+	['&radic;',   '&#8730;', true, 'square root'],
+	['&sim;',     '&#8764;', false,'similar to'],
+	['&cong;',    '&#8773;', false,'approximately equal to'],
+	['&asymp;',   '&#8776;', true, 'almost equal to'],
+	['&ne;',      '&#8800;', true, 'not equal to'],
+	['&equiv;',   '&#8801;', true, 'identical to'],
+	['&isin;',    '&#8712;', false,'element of'],
+	['&notin;',   '&#8713;', false,'not an element of'],
+	['&ni;',      '&#8715;', false,'contains as member'],
+	['&prod;',    '&#8719;', true, 'n-ary product'],
+	['&and;',     '&#8743;', false,'logical and'],
+	['&or;',      '&#8744;', false,'logical or'],
+	['&not;',     '&#172;',  true, 'not sign'],
+	['&cap;',     '&#8745;', true, 'intersection'],
+	['&cup;',     '&#8746;', false,'union'],
+	['&part;',    '&#8706;', true, 'partial differential'],
+	['&forall;',  '&#8704;', false,'for all'],
+	['&exist;',   '&#8707;', false,'there exists'],
+	['&empty;',   '&#8709;', false,'diameter'],
+	['&nabla;',   '&#8711;', false,'backward difference'],
+	['&lowast;',  '&#8727;', false,'asterisk operator'],
+	['&prop;',    '&#8733;', false,'proportional to'],
+	['&ang;',     '&#8736;', false,'angle'],
+// undefined
+	['&acute;',   '&#180;',  true, 'acute accent'],
+	['&cedil;',   '&#184;',  true, 'cedilla'],
+	['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],
+	['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],
+	['&dagger;',  '&#8224;', true, 'dagger'],
+	['&Dagger;',  '&#8225;', true, 'double dagger'],
+// alphabetical special chars
+	['&Agrave;',  '&#192;',  true, 'A - grave'],
+	['&Aacute;',  '&#193;',  true, 'A - acute'],
+	['&Acirc;',   '&#194;',  true, 'A - circumflex'],
+	['&Atilde;',  '&#195;',  true, 'A - tilde'],
+	['&Auml;',    '&#196;',  true, 'A - diaeresis'],
+	['&Aring;',   '&#197;',  true, 'A - ring above'],
+	['&AElig;',   '&#198;',  true, 'ligature AE'],
+	['&Ccedil;',  '&#199;',  true, 'C - cedilla'],
+	['&Egrave;',  '&#200;',  true, 'E - grave'],
+	['&Eacute;',  '&#201;',  true, 'E - acute'],
+	['&Ecirc;',   '&#202;',  true, 'E - circumflex'],
+	['&Euml;',    '&#203;',  true, 'E - diaeresis'],
+	['&Igrave;',  '&#204;',  true, 'I - grave'],
+	['&Iacute;',  '&#205;',  true, 'I - acute'],
+	['&Icirc;',   '&#206;',  true, 'I - circumflex'],
+	['&Iuml;',    '&#207;',  true, 'I - diaeresis'],
+	['&ETH;',     '&#208;',  true, 'ETH'],
+	['&Ntilde;',  '&#209;',  true, 'N - tilde'],
+	['&Ograve;',  '&#210;',  true, 'O - grave'],
+	['&Oacute;',  '&#211;',  true, 'O - acute'],
+	['&Ocirc;',   '&#212;',  true, 'O - circumflex'],
+	['&Otilde;',  '&#213;',  true, 'O - tilde'],
+	['&Ouml;',    '&#214;',  true, 'O - diaeresis'],
+	['&Oslash;',  '&#216;',  true, 'O - slash'],
+	['&OElig;',   '&#338;',  true, 'ligature OE'],
+	['&Scaron;',  '&#352;',  true, 'S - caron'],
+	['&Ugrave;',  '&#217;',  true, 'U - grave'],
+	['&Uacute;',  '&#218;',  true, 'U - acute'],
+	['&Ucirc;',   '&#219;',  true, 'U - circumflex'],
+	['&Uuml;',    '&#220;',  true, 'U - diaeresis'],
+	['&Yacute;',  '&#221;',  true, 'Y - acute'],
+	['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],
+	['&THORN;',   '&#222;',  true, 'THORN'],
+	['&agrave;',  '&#224;',  true, 'a - grave'],
+	['&aacute;',  '&#225;',  true, 'a - acute'],
+	['&acirc;',   '&#226;',  true, 'a - circumflex'],
+	['&atilde;',  '&#227;',  true, 'a - tilde'],
+	['&auml;',    '&#228;',  true, 'a - diaeresis'],
+	['&aring;',   '&#229;',  true, 'a - ring above'],
+	['&aelig;',   '&#230;',  true, 'ligature ae'],
+	['&ccedil;',  '&#231;',  true, 'c - cedilla'],
+	['&egrave;',  '&#232;',  true, 'e - grave'],
+	['&eacute;',  '&#233;',  true, 'e - acute'],
+	['&ecirc;',   '&#234;',  true, 'e - circumflex'],
+	['&euml;',    '&#235;',  true, 'e - diaeresis'],
+	['&igrave;',  '&#236;',  true, 'i - grave'],
+	['&iacute;',  '&#237;',  true, 'i - acute'],
+	['&icirc;',   '&#238;',  true, 'i - circumflex'],
+	['&iuml;',    '&#239;',  true, 'i - diaeresis'],
+	['&eth;',     '&#240;',  true, 'eth'],
+	['&ntilde;',  '&#241;',  true, 'n - tilde'],
+	['&ograve;',  '&#242;',  true, 'o - grave'],
+	['&oacute;',  '&#243;',  true, 'o - acute'],
+	['&ocirc;',   '&#244;',  true, 'o - circumflex'],
+	['&otilde;',  '&#245;',  true, 'o - tilde'],
+	['&ouml;',    '&#246;',  true, 'o - diaeresis'],
+	['&oslash;',  '&#248;',  true, 'o slash'],
+	['&oelig;',   '&#339;',  true, 'ligature oe'],
+	['&scaron;',  '&#353;',  true, 's - caron'],
+	['&ugrave;',  '&#249;',  true, 'u - grave'],
+	['&uacute;',  '&#250;',  true, 'u - acute'],
+	['&ucirc;',   '&#251;',  true, 'u - circumflex'],
+	['&uuml;',    '&#252;',  true, 'u - diaeresis'],
+	['&yacute;',  '&#253;',  true, 'y - acute'],
+	['&thorn;',   '&#254;',  true, 'thorn'],
+	['&yuml;',    '&#255;',  true, 'y - diaeresis'],
+    ['&Alpha;',   '&#913;',  true, 'Alpha'],
+	['&Beta;',    '&#914;',  true, 'Beta'],
+	['&Gamma;',   '&#915;',  true, 'Gamma'],
+	['&Delta;',   '&#916;',  true, 'Delta'],
+	['&Epsilon;', '&#917;',  true, 'Epsilon'],
+	['&Zeta;',    '&#918;',  true, 'Zeta'],
+	['&Eta;',     '&#919;',  true, 'Eta'],
+	['&Theta;',   '&#920;',  true, 'Theta'],
+	['&Iota;',    '&#921;',  true, 'Iota'],
+	['&Kappa;',   '&#922;',  true, 'Kappa'],
+	['&Lambda;',  '&#923;',  true, 'Lambda'],
+	['&Mu;',      '&#924;',  true, 'Mu'],
+	['&Nu;',      '&#925;',  true, 'Nu'],
+	['&Xi;',      '&#926;',  true, 'Xi'],
+	['&Omicron;', '&#927;',  true, 'Omicron'],
+	['&Pi;',      '&#928;',  true, 'Pi'],
+	['&Rho;',     '&#929;',  true, 'Rho'],
+	['&Sigma;',   '&#931;',  true, 'Sigma'],
+	['&Tau;',     '&#932;',  true, 'Tau'],
+	['&Upsilon;', '&#933;',  true, 'Upsilon'],
+	['&Phi;',     '&#934;',  true, 'Phi'],
+	['&Chi;',     '&#935;',  true, 'Chi'],
+	['&Psi;',     '&#936;',  true, 'Psi'],
+	['&Omega;',   '&#937;',  true, 'Omega'],
+	['&alpha;',   '&#945;',  true, 'alpha'],
+	['&beta;',    '&#946;',  true, 'beta'],
+	['&gamma;',   '&#947;',  true, 'gamma'],
+	['&delta;',   '&#948;',  true, 'delta'],
+	['&epsilon;', '&#949;',  true, 'epsilon'],
+	['&zeta;',    '&#950;',  true, 'zeta'],
+	['&eta;',     '&#951;',  true, 'eta'],
+	['&theta;',   '&#952;',  true, 'theta'],
+	['&iota;',    '&#953;',  true, 'iota'],
+	['&kappa;',   '&#954;',  true, 'kappa'],
+	['&lambda;',  '&#955;',  true, 'lambda'],
+	['&mu;',      '&#956;',  true, 'mu'],
+	['&nu;',      '&#957;',  true, 'nu'],
+	['&xi;',      '&#958;',  true, 'xi'],
+	['&omicron;', '&#959;',  true, 'omicron'],
+	['&pi;',      '&#960;',  true, 'pi'],
+	['&rho;',     '&#961;',  true, 'rho'],
+	['&sigmaf;',  '&#962;',  true, 'final sigma'],
+	['&sigma;',   '&#963;',  true, 'sigma'],
+	['&tau;',     '&#964;',  true, 'tau'],
+	['&upsilon;', '&#965;',  true, 'upsilon'],
+	['&phi;',     '&#966;',  true, 'phi'],
+	['&chi;',     '&#967;',  true, 'chi'],
+	['&psi;',     '&#968;',  true, 'psi'],
+	['&omega;',   '&#969;',  true, 'omega'],
+// symbols
+	['&alefsym;', '&#8501;', false,'alef symbol'],
+	['&piv;',     '&#982;',  false,'pi symbol'],
+	['&real;',    '&#8476;', false,'real part symbol'],
+	['&thetasym;','&#977;',  false,'theta symbol'],
+	['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],
+	['&weierp;',  '&#8472;', false,'Weierstrass p'],
+	['&image;',   '&#8465;', false,'imaginary part'],
+// arrows
+	['&larr;',    '&#8592;', true, 'leftwards arrow'],
+	['&uarr;',    '&#8593;', true, 'upwards arrow'],
+	['&rarr;',    '&#8594;', true, 'rightwards arrow'],
+	['&darr;',    '&#8595;', true, 'downwards arrow'],
+	['&harr;',    '&#8596;', true, 'left right arrow'],
+	['&crarr;',   '&#8629;', false,'carriage return'],
+	['&lArr;',    '&#8656;', false,'leftwards double arrow'],
+	['&uArr;',    '&#8657;', false,'upwards double arrow'],
+	['&rArr;',    '&#8658;', false,'rightwards double arrow'],
+	['&dArr;',    '&#8659;', false,'downwards double arrow'],
+	['&hArr;',    '&#8660;', false,'left right double arrow'],
+	['&there4;',  '&#8756;', false,'therefore'],
+	['&sub;',     '&#8834;', false,'subset of'],
+	['&sup;',     '&#8835;', false,'superset of'],
+	['&nsub;',    '&#8836;', false,'not a subset of'],
+	['&sube;',    '&#8838;', false,'subset of or equal to'],
+	['&supe;',    '&#8839;', false,'superset of or equal to'],
+	['&oplus;',   '&#8853;', false,'circled plus'],
+	['&otimes;',  '&#8855;', false,'circled times'],
+	['&perp;',    '&#8869;', false,'perpendicular'],
+	['&sdot;',    '&#8901;', false,'dot operator'],
+	['&lceil;',   '&#8968;', false,'left ceiling'],
+	['&rceil;',   '&#8969;', false,'right ceiling'],
+	['&lfloor;',  '&#8970;', false,'left floor'],
+	['&rfloor;',  '&#8971;', false,'right floor'],
+	['&lang;',    '&#9001;', false,'left-pointing angle bracket'],
+	['&rang;',    '&#9002;', false,'right-pointing angle bracket'],
+	['&loz;',     '&#9674;', true,'lozenge'],
+	['&spades;',  '&#9824;', false,'black spade suit'],
+	['&clubs;',   '&#9827;', true, 'black club suit'],
+	['&hearts;',  '&#9829;', true, 'black heart suit'],
+	['&diams;',   '&#9830;', true, 'black diamond suit'],
+	['&ensp;',    '&#8194;', false,'en space'],
+	['&emsp;',    '&#8195;', false,'em space'],
+	['&thinsp;',  '&#8201;', false,'thin space'],
+	['&zwnj;',    '&#8204;', false,'zero width non-joiner'],
+	['&zwj;',     '&#8205;', false,'zero width joiner'],
+	['&lrm;',     '&#8206;', false,'left-to-right mark'],
+	['&rlm;',     '&#8207;', false,'right-to-left mark'],
+	['&shy;',     '&#173;',  false,'soft hyphen']
+];
+
+tinyMCEPopup.onInit.add(function() {
+	tinyMCEPopup.dom.setHTML('charmap', renderCharMapHTML());
+});
+
+function renderCharMapHTML() {
+	var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
+	var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+	var cols=-1;
+
+	for (i=0; i<charmap.length; i++) {
+		if (charmap[i][2]==true) {
+			cols++;
+			html += ''
+				+ '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
+				+ ' onmouseover="this.className=\'charmapOver\';'
+				+ 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
+				+ ' onmouseout="this.className=\'charmap\';"'
+				+ ' nowrap="nowrap" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');"><a style="text-decoration: none;" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+				+ charmap[i][1]
+				+ '</a></td>';
+			if ((cols+1) % charsPerRow == 0)
+				html += '</tr><tr height="' + tdHeight + '">';
+		}
+	 }
+
+	if (cols % charsPerRow > 0) {
+		var padd = charsPerRow - (cols % charsPerRow);
+		for (var i=0; i<padd-1; i++)
+			html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+	}
+
+	html += '</tr></table>';
+
+	return html;
+}
+
+function insertChar(chr) {
+	tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+	// Refocus in window
+	if (tinyMCEPopup.isWindow)
+		window.focus();
+
+	tinyMCEPopup.editor.focus();
+	tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+	var elmA = document.getElementById('codeA');
+	var elmB = document.getElementById('codeB');
+	var elmV = document.getElementById('codeV');
+	var elmN = document.getElementById('codeN');
+
+	if (codeA=='#160;') {
+		elmV.innerHTML = '__';
+	} else {
+		elmV.innerHTML = '&' + codeA;
+	}
+
+	elmB.innerHTML = '&amp;' + codeA;
+	elmA.innerHTML = '&amp;' + codeB;
+	elmN.innerHTML = codeN;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/color_picker.js	(revision 1)
@@ -0,0 +1,245 @@
+tinyMCEPopup.requireLangPack();
+
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
+
+var colors = new Array(
+	"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+	"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+	"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+	"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+	"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+	"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+	"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+	"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+	"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+	"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+	"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+	"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+	"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+	"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+	"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+	"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+	"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+	"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+	"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+	"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+	"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+	"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+	"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+	"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+	"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+	"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+	"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+);
+
+var named = {
+	'#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
+	'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',
+	'#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',
+	'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',
+	'#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',
+	'#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',
+	'#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',
+	'#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',
+	'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',
+	'#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',
+	'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',
+	'#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',
+	'#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',
+	'#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
+	'#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',
+	'#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',
+	'#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',
+	'#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',
+	'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',
+	'#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',
+	'#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',
+	'#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
+	'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'
+};
+
+function init() {
+	var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));
+
+	tinyMCEPopup.resizeToInnerSize();
+
+	generatePicker();
+
+	if (inputColor) {
+		changeFinalColor(inputColor);
+
+		col = convertHexToRGB(inputColor);
+
+		if (col)
+			updateLight(col.r, col.g, col.b);
+	}
+}
+
+function insertAction() {
+	var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
+
+	tinyMCEPopup.restoreSelection();
+
+	if (f)
+		f(color);
+
+	tinyMCEPopup.close();
+}
+
+function showColor(color, name) {
+	if (name)
+		document.getElementById("colorname").innerHTML = name;
+
+	document.getElementById("preview").style.backgroundColor = color;
+	document.getElementById("color").value = color.toLowerCase();
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	if (!col)
+		return col;
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return {r : r, g : g, b : b};
+	}
+
+	return null;
+}
+
+function generatePicker() {
+	var el = document.getElementById('light'), h = '', i;
+
+	for (i = 0; i < detail; i++){
+		h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+		+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
+		+ ' onmousedown="isMouseDown = true; return false;"'
+		+ ' onmouseup="isMouseDown = false;"'
+		+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+		+ ' onmouseover="isMouseOver = true;"'
+		+ ' onmouseout="isMouseOver = false;"'
+		+ '></div>';
+	}
+
+	el.innerHTML = h;
+}
+
+function generateWebColors() {
+	var el = document.getElementById('webcolors'), h = '', i;
+
+	if (el.className == 'generated')
+		return;
+
+	h += '<table border="0" cellspacing="1" cellpadding="0">'
+		+ '<tr>';
+
+	for (i=0; i<colors.length; i++) {
+		h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
+			+ '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'
+			+ '</a></td>';
+		if ((i+1) % 18 == 0)
+			h += '</tr><tr>';
+	}
+
+	h += '</table>';
+
+	el.innerHTML = h;
+	el.className = 'generated';
+}
+
+function generateNamedColors() {
+	var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
+
+	if (el.className == 'generated')
+		return;
+
+	for (n in named) {
+		v = named[n];
+		h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n +  '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'
+	}
+
+	el.innerHTML = h;
+	el.className = 'generated';
+}
+
+function dechex(n) {
+	return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
+}
+
+function computeColor(e) {
+	var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
+
+	x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
+	y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
+
+	partWidth = document.getElementById('colors').width / 6;
+	partDetail = detail / 2;
+	imHeight = document.getElementById('colors').height;
+
+	r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
+	g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255	+ (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
+	b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
+
+	coef = (imHeight - y) / imHeight;
+	r = 128 + (r - 128) * coef;
+	g = 128 + (g - 128) * coef;
+	b = 128 + (b - 128) * coef;
+
+	changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
+	updateLight(r, g, b);
+}
+
+function updateLight(r, g, b) {
+	var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
+
+	for (i=0; i<detail; i++) {
+		if ((i>=0) && (i<partDetail)) {
+			finalCoef = i / partDetail;
+			finalR = dechex(255 - (255 - r) * finalCoef);
+			finalG = dechex(255 - (255 - g) * finalCoef);
+			finalB = dechex(255 - (255 - b) * finalCoef);
+		} else {
+			finalCoef = 2 - i / partDetail;
+			finalR = dechex(r * finalCoef);
+			finalG = dechex(g * finalCoef);
+			finalB = dechex(b * finalCoef);
+		}
+
+		color = finalR + finalG + finalB;
+
+		document.getElementById('gs' + i).style.backgroundColor = '#'+color;
+	}
+}
+
+function changeFinalColor(color) {
+	if (color.indexOf('#') == -1)
+		color = convertRGBToHex(color);
+
+	document.getElementById('preview').style.backgroundColor = color;
+	document.getElementById('color').value = color;
+}
+
+tinyMCEPopup.onInit.add(init);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/image.js	(revision 1)
@@ -0,0 +1,239 @@
+var ImageDialog = {
+	preInit : function() {
+		var url;
+
+		tinyMCEPopup.requireLangPack();
+
+		if (url = tinyMCEPopup.getParam("external_image_list_url"))
+			document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+	},
+
+	init : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+		// Setup browse button
+		document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+		if (isVisible('srcbrowser'))
+			document.getElementById('src').style.width = '180px';
+
+		e = ed.selection.getNode();
+
+		this.fillFileList('image_list', 'tinyMCEImageList');
+
+		if (e.nodeName == 'IMG') {
+			f.src.value = ed.dom.getAttrib(e, 'src');
+			f.alt.value = ed.dom.getAttrib(e, 'alt');
+			f.border.value = this.getAttrib(e, 'border');
+			f.vspace.value = this.getAttrib(e, 'vspace');
+			f.hspace.value = this.getAttrib(e, 'hspace');
+			f.width.value = ed.dom.getAttrib(e, 'width');
+			f.height.value = ed.dom.getAttrib(e, 'height');
+			f.insert.value = ed.getLang('update');
+			this.styleVal = ed.dom.getAttrib(e, 'style');
+			selectByValue(f, 'image_list', f.src.value);
+			selectByValue(f, 'align', this.getAttrib(e, 'align'));
+			this.updateStyle();
+		}
+	},
+
+	fillFileList : function(id, l) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		l = window[l];
+
+		if (l && l.length > 0) {
+			lst.options[lst.options.length] = new Option('', '');
+
+			tinymce.each(l, function(o) {
+				lst.options[lst.options.length] = new Option(o[0], o[1]);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	update : function() {
+		var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
+
+		if (f.src.value === '') {
+			ed.dom.remove(ed.selection.getNode());
+			ed.execCommand('mceRepaint');
+			tinyMCEPopup.close();
+			return;
+		}
+
+		if (!ed.settings.inline_styles) {
+			args = tinymce.extend(args, {
+				vspace : nl.vspace.value,
+				hspace : nl.hspace.value,
+				border : nl.border.value,
+				align : getSelectValue(f, 'align')
+			});
+		} else
+			args.style = this.styleVal;
+
+		tinymce.extend(args, {
+			src : f.src.value,
+			alt : f.alt.value,
+			width : f.width.value,
+			height : f.height.value
+		});
+
+		el = ed.selection.getNode();
+
+		if (el && el.nodeName == 'IMG') {
+			ed.dom.setAttribs(el, args);
+		} else {
+			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" src="javascript:;" />');
+			ed.dom.setAttribs('__mce_tmp', args);
+			ed.dom.setAttrib('__mce_tmp', 'id', '');
+		}
+
+		tinyMCEPopup.close();
+	},
+
+	updateStyle : function() {
+		var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
+
+		if (tinyMCEPopup.editor.settings.inline_styles) {
+			st = tinyMCEPopup.dom.parseStyle(this.styleVal);
+
+			// Handle align
+			v = getSelectValue(f, 'align');
+			if (v) {
+				if (v == 'left' || v == 'right') {
+					st['float'] = v;
+					delete st['vertical-align'];
+				} else {
+					st['vertical-align'] = v;
+					delete st['float'];
+				}
+			} else {
+				delete st['float'];
+				delete st['vertical-align'];
+			}
+
+			// Handle border
+			v = f.border.value;
+			if (v || v == '0') {
+				if (v == '0')
+					st['border'] = '0';
+				else
+					st['border'] = v + 'px solid black';
+			} else
+				delete st['border'];
+
+			// Handle hspace
+			v = f.hspace.value;
+			if (v) {
+				delete st['margin'];
+				st['margin-left'] = v + 'px';
+				st['margin-right'] = v + 'px';
+			} else {
+				delete st['margin-left'];
+				delete st['margin-right'];
+			}
+
+			// Handle vspace
+			v = f.vspace.value;
+			if (v) {
+				delete st['margin'];
+				st['margin-top'] = v + 'px';
+				st['margin-bottom'] = v + 'px';
+			} else {
+				delete st['margin-top'];
+				delete st['margin-bottom'];
+			}
+
+			// Merge
+			st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
+			this.styleVal = dom.serializeStyle(st);
+		}
+	},
+
+	getAttrib : function(e, at) {
+		var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
+
+		if (ed.settings.inline_styles) {
+			switch (at) {
+				case 'align':
+					if (v = dom.getStyle(e, 'float'))
+						return v;
+
+					if (v = dom.getStyle(e, 'vertical-align'))
+						return v;
+
+					break;
+
+				case 'hspace':
+					v = dom.getStyle(e, 'margin-left')
+					v2 = dom.getStyle(e, 'margin-right');
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'vspace':
+					v = dom.getStyle(e, 'margin-top')
+					v2 = dom.getStyle(e, 'margin-bottom');
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'border':
+					v = 0;
+
+					tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
+						sv = dom.getStyle(e, 'border-' + sv + '-width');
+
+						// False or not the same as prev
+						if (!sv || (sv != v && v !== 0)) {
+							v = 0;
+							return false;
+						}
+
+						if (sv)
+							v = sv;
+					});
+
+					if (v)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+			}
+		}
+
+		if (v = dom.getAttrib(e, at))
+			return v;
+
+		return '';
+	},
+
+	resetImageData : function() {
+		var f = document.forms[0];
+
+		f.width.value = f.height.value = "";	
+	},
+
+	updateImageData : function() {
+		var f = document.forms[0], t = ImageDialog;
+
+		if (f.width.value == "")
+			f.width.value = t.preloadImg.width;
+
+		if (f.height.value == "")
+			f.height.value = t.preloadImg.height;
+	},
+
+	getImageData : function() {
+		var f = document.forms[0];
+
+		this.preloadImg = new Image();
+		this.preloadImg.onload = this.updateImageData;
+		this.preloadImg.onerror = this.resetImageData;
+		this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);
+	}
+};
+
+ImageDialog.preInit();
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/link.js	(revision 1)
@@ -0,0 +1,124 @@
+tinyMCEPopup.requireLangPack();
+
+var LinkDialog = {
+	preInit : function() {
+		var url;
+
+		if (url = tinyMCEPopup.getParam("external_link_list_url"))
+			document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+	},
+
+	init : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+		// Setup browse button
+		document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');
+		if (isVisible('hrefbrowser'))
+			document.getElementById('href').style.width = '180px';
+
+		this.fillClassList('class_list');
+		this.fillFileList('link_list', 'tinyMCELinkList');
+		this.fillTargetList('target_list');
+
+		if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {
+			f.href.value = ed.dom.getAttrib(e, 'href');
+			f.linktitle.value = ed.dom.getAttrib(e, 'title');
+			f.insert.value = ed.getLang('update');
+			selectByValue(f, 'link_list', f.href.value);
+			selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));
+			selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));
+		}
+	},
+
+	update : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;
+
+		// Remove element if there is no href
+		if (!f.href.value) {
+			e = ed.dom.getParent(ed.selection.getNode(), 'A');
+			if (e) {
+				tinyMCEPopup.execCommand("mceBeginUndoLevel");
+				b = ed.selection.getBookmark();
+				ed.dom.remove(e, 1);
+				ed.selection.moveToBookmark(b);
+				tinyMCEPopup.execCommand("mceEndUndoLevel");
+				tinyMCEPopup.close();
+				return;
+			}
+		}
+
+		ed.execCommand('mceInsertLink', false, {
+			href : f.href.value,
+			title : f.linktitle.value,
+			target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
+			'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
+		});
+
+		tinyMCEPopup.close();
+	},
+
+	checkPrefix : function(n) {
+		if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))
+			n.value = 'mailto:' + n.value;
+
+		if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))
+			n.value = 'http://' + n.value;
+	},
+
+	fillFileList : function(id, l) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		l = window[l];
+
+		if (l && l.length > 0) {
+			lst.options[lst.options.length] = new Option('', '');
+
+			tinymce.each(l, function(o) {
+				lst.options[lst.options.length] = new Option(o[0], o[1]);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	fillClassList : function(id) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
+			cl = [];
+
+			tinymce.each(v.split(';'), function(v) {
+				var p = v.split('=');
+
+				cl.push({'title' : p[0], 'class' : p[1]});
+			});
+		} else
+			cl = tinyMCEPopup.editor.dom.getClasses();
+
+		if (cl.length > 0) {
+			lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+
+			tinymce.each(cl, function(o) {
+				lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	fillTargetList : function(id) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v;
+
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');
+
+		if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {
+			tinymce.each(v.split(','), function(v) {
+				v = v.split('=');
+				html += '<option value="' + v[1] + '">' + v[0] + '</option>';
+			});
+		}
+	}
+};
+
+LinkDialog.preInit();
+tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/js/source_editor.js	(revision 1)
@@ -0,0 +1,62 @@
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(onLoadInit);
+
+function saveContent() {
+	tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value);
+	tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	// Remove Gecko spellchecking
+	if (tinymce.isGecko)
+		document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
+
+	document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent();
+
+	if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
+		setWrap('soft');
+		document.getElementById('wraped').checked = true;
+	}
+
+	resizeInputs();
+}
+
+function setWrap(val) {
+	var v, n, s = document.getElementById('htmlSource');
+
+	s.wrap = val;
+
+	if (!tinymce.isIE) {
+		v = s.value;
+		n = s.cloneNode(false);
+		n.setAttribute("wrap", val);
+		s.parentNode.replaceChild(n, s);
+		n.value = v;
+	}
+}
+
+function toggleWordWrap(elm) {
+	if (elm.checked)
+		setWrap('soft');
+	else
+		setWrap('off');
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+	var el = document.getElementById('htmlSource');
+
+	if (!tinymce.isIE) {
+		 wHeight = self.innerHeight - 65;
+		 wWidth = self.innerWidth - 16;
+	} else {
+		 wHeight = document.body.clientHeight - 70;
+		 wWidth = document.body.clientWidth - 16;
+	}
+
+	el.style.height = Math.abs(wHeight) + 'px';
+	el.style.width  = Math.abs(wWidth) + 'px';
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js	(revision 1)
@@ -0,0 +1,62 @@
+tinyMCE.addI18n('en.advanced',{
+style_select:"Styles",
+font_size:"Font size",
+fontdefault:"Font family",
+block:"Format",
+paragraph:"Paragraph",
+div:"Div",
+address:"Address",
+pre:"Preformatted",
+h1:"Heading 1",
+h2:"Heading 2",
+h3:"Heading 3",
+h4:"Heading 4",
+h5:"Heading 5",
+h6:"Heading 6",
+blockquote:"Blockquote",
+code:"Code",
+samp:"Code sample",
+dt:"Definition term ",
+dd:"Definition description",
+bold_desc:"Bold (Ctrl+B)",
+italic_desc:"Italic (Ctrl+I)",
+underline_desc:"Underline (Ctrl+U)",
+striketrough_desc:"Strikethrough",
+justifyleft_desc:"Align left",
+justifycenter_desc:"Align center",
+justifyright_desc:"Align right",
+justifyfull_desc:"Align full",
+bullist_desc:"Unordered list",
+numlist_desc:"Ordered list",
+outdent_desc:"Outdent",
+indent_desc:"Indent",
+undo_desc:"Undo (Ctrl+Z)",
+redo_desc:"Redo (Ctrl+Y)",
+link_desc:"Insert/edit link",
+unlink_desc:"Unlink",
+image_desc:"Insert/edit image",
+cleanup_desc:"Cleanup messy code",
+code_desc:"Edit HTML Source",
+sub_desc:"Subscript",
+sup_desc:"Superscript",
+hr_desc:"Insert horizontal ruler",
+removeformat_desc:"Remove formatting",
+custom1_desc:"Your custom description here",
+forecolor_desc:"Select text color",
+backcolor_desc:"Select background color",
+charmap_desc:"Insert custom character",
+visualaid_desc:"Toggle guidelines/invisible elements",
+anchor_desc:"Insert/edit anchor",
+cut_desc:"Cut",
+copy_desc:"Copy",
+paste_desc:"Paste",
+image_props_desc:"Image properties",
+newdocument_desc:"New document",
+help_desc:"Help",
+blockquote_desc:"Blockquote",
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
+path:"Path",
+newdocument:"Are you sure you want clear all contents?",
+toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
+more_colors:"More colors"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js	(revision 1)
@@ -0,0 +1,51 @@
+tinyMCE.addI18n('en.advanced_dlg',{
+about_title:"About TinyMCE",
+about_general:"About",
+about_help:"Help",
+about_license:"License",
+about_plugins:"Plugins",
+about_plugin:"Plugin",
+about_author:"Author",
+about_version:"Version",
+about_loaded:"Loaded plugins",
+anchor_title:"Insert/edit anchor",
+anchor_name:"Anchor name",
+code_title:"HTML Source Editor",
+code_wordwrap:"Word wrap",
+colorpicker_title:"Select a color",
+colorpicker_picker_tab:"Picker",
+colorpicker_picker_title:"Color picker",
+colorpicker_palette_tab:"Palette",
+colorpicker_palette_title:"Palette colors",
+colorpicker_named_tab:"Named",
+colorpicker_named_title:"Named colors",
+colorpicker_color:"Color:",
+colorpicker_name:"Name:",
+charmap_title:"Select custom character",
+image_title:"Insert/edit image",
+image_src:"Image URL",
+image_alt:"Image description",
+image_list:"Image list",
+image_border:"Border",
+image_dimensions:"Dimensions",
+image_vspace:"Vertical space",
+image_hspace:"Horizontal space",
+image_align:"Alignment",
+image_align_baseline:"Baseline",
+image_align_top:"Top",
+image_align_middle:"Middle",
+image_align_bottom:"Bottom",
+image_align_texttop:"Text top",
+image_align_textbottom:"Text bottom",
+image_align_left:"Left",
+image_align_right:"Right",
+link_title:"Insert/edit link",
+link_url:"Link URL",
+link_target:"Target",
+link_target_same:"Open link in the same window",
+link_target_blank:"Open link in a new window",
+link_titlefield:"Title",
+link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
+link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
+link_list:"Link list"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/link.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/link.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/link.htm	(revision 1)
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.link_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/link.js"></script>
+	<base target="_self" />
+</head>
+<body id="link" style="display: none">
+<form onsubmit="LinkDialog.update();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+
+		<table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"> 
+				  <tr> 
+					<td><input id="href" name="href" type="text" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> 
+					<td id="hrefbrowsercontainer">&nbsp;</td>
+				  </tr> 
+				</table></td>
+          </tr>
+		  <tr>
+			<td><label for="link_list">{#advanced_dlg.link_list}</label></td>
+			<td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
+		  </tr>
+		<tr>
+			<td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
+			<td><select id="target_list" name="target_list"></select></td>
+		</tr>
+          <tr>
+            <td nowrap="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
+            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
+          </tr>
+			<tr>
+				<td><label for="class_list">{#class_name}</label></td>
+				<td><select id="class_list" name="class_list"></select></td>
+			</tr>
+        </table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{#insert}" onclick="LinkDialog.update();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/content.css	(revision 1)
@@ -0,0 +1,18 @@
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px; }
+body {background:#FFF;}
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;}
+a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}
+img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;}
+img {border:0;}
+
+/* IE */
+* html body {
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css	(revision 1)
@@ -0,0 +1,111 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+}
+
+#insert {background:url(img/buttons.png) 0 -52px;}
+#cancel {background:url(img/buttons.png) 0 0;}
+
+/* Browse */
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border-style:solid; border-width:1px; border-color:#AAA;}
+td.charmap, td.charmapOver {color:#000; border-color:#AAA; border-style:solid; border-width:1px; text-align:center; font-size:12px;}
+td.charmapOver {background:#CCC; cursor:default;}
+a.charmap {color:#000; text-decoration:none}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:18px;}
+.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/default/ui.css	(revision 1)
@@ -0,0 +1,193 @@
+/* Reset */
+.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate}
+.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
+.defaultSkin table td {vertical-align:middle}
+
+/* Containers */
+.defaultSkin table {background:#F0F0EE}
+.defaultSkin iframe {display:block; background:#fff}
+.defaultSkin .mceToolbar {height:26px}
+.defaultSkin .left {text-align:left}
+.defaultSkin .right {text-align:right}
+
+/* External */
+.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
+.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
+
+/* Layout */
+.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC;}
+.defaultSkin table.mceLayout tr.first td {border-top:1px solid #CCC}
+.defaultSkin table.mceLayout tr.last td {border-bottom:1px solid #CCC}
+.defaultSkin table.mceToolbar, .defaultSkin tr.first .mceToolbar tr td, .defaultSkin tr.last .mceToolbar tr td {border:0; margin:0; padding:0;}
+.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
+.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC;}
+.defaultSkin .mceStatusbar {position:relative; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; padding:2px; color:#000; display:block}
+.defaultSkin .mceStatusbar a.resize {display:block; position:absolute; top:0; right:0; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
+.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
+.defaultSkin table.mceToolbar {margin-left:3px}
+.defaultSkin span.icon, .defaultSkin img.icon {display:block; width:20px; height:20px}
+.defaultSkin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px;}
+.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
+.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceButtonDisabled .icon {opacity:0.3; filter:alpha(opacity=30)}
+
+/* Separator */
+.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
+
+/* ListBox */
+.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
+.defaultSkin .mceListBox .text {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
+.defaultSkin .mceListBox .open {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
+.defaultSkin table.mceListBoxEnabled:hover .text, .defaultSkin .mceListBoxHover .text, .defaultSkin .mceListBoxSelected .text {border:1px solid #A2ABC0; border-right:0; background:#FFF}
+.defaultSkin table.mceListBoxEnabled:hover .open, .defaultSkin .mceListBoxHover .open, .defaultSkin .mceListBoxSelected .open {background-color:#FFF; border:1px solid #A2ABC0}
+.defaultSkin .mceListBoxDisabled a.text {color:gray; background-color:transparent;}
+.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
+.defaultSkin .mceOldBoxModel .mceListBox .text {height:22px}
+.defaultSkin .mceOldBoxModel .mceListBox .open {width:11px; height:22px;}
+.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
+
+/* SplitButton */
+.defaultSkin .mceSplitButton {width:32px; height:20px}
+.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
+.defaultSkin .mceSplitButton a.action {width:20px; border:1px solid #F0F0EE; border-right:0;}
+.defaultSkin .mceSplitButton span.action {width:20px; background:url(../../img/icons.gif) 20px 20px;}
+.defaultSkin .mceSplitButton a.open {width:9px; border:1px solid #F0F0EE;}
+.defaultSkin .mceSplitButton span.open {width:9px; background:url(../../img/icons.gif) -741px 0;}
+.defaultSkin table.mceSplitButtonEnabled:hover a.action, .defaultSkin .mceSplitButtonHover a.action, .defaultSkin .mceSplitButtonSelected a.action {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
+.defaultSkin table.mceSplitButtonEnabled:hover a.open, .defaultSkin .mceSplitButtonHover a.open, .defaultSkin .mceSplitButtonSelected a.open {border:1px solid #0A246A;}
+.defaultSkin table.mceSplitButtonEnabled:hover span.open, .defaultSkin .mceSplitButtonHover span.open, .defaultSkin .mceSplitButtonSelected span.open {background-color:#B2BBD0}
+.defaultSkin .mceSplitButtonDisabled .action, .defaultSkin .mceSplitButtonDisabled span.open {opacity:0.3; filter:alpha(opacity=30)}
+.defaultSkin .mceSplitButtonActive a.action {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceSplitButtonActive a.open {border-left:0;}
+
+/* ColorSplitButton */
+.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
+.defaultSkin .mceColorSplitMenu td {padding:2px}
+.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
+.defaultSkin .mceColorSplitMenu td.morecolors {padding:1px 3px 1px 1px}
+.defaultSkin .mceColorSplitMenu a.morecolors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.defaultSkin .mceColorSplitMenu a.morecolors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
+.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
+.defaultSkin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden}
+
+/* Menu */
+.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
+.defaultSkin .noIcons span.icon {width:0;}
+.defaultSkin .noIcons a .text {padding-left:10px}
+.defaultSkin .mceMenu table {background:#FFF}
+.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
+.defaultSkin .mceMenu td {height:20px}
+.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
+.defaultSkin .mceMenu .text {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
+.defaultSkin .mceMenu span.text, .defaultSkin .mceMenu .preview {font-size:11px}
+.defaultSkin .mceMenu pre.text {font-family:Monospace}
+.defaultSkin .mceMenu .icon {position:absolute; top:0; left:0; width:22px;}
+.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
+.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
+.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
+.defaultSkin .mceMenuItemTitle span.text {color:#000; font-weight:bold; padding-left:4px}
+.defaultSkin .mceMenuItemDisabled .text {color:#888}
+.defaultSkin .mceMenuItemSelected .icon {background:url(img/menu_check.gif)}
+.defaultSkin .noIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
+.defaultSkin .mceMenu span.mceMenuLine {display:none}
+.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
+
+/* Progress,Resize */
+.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; filter:alpha(opacity=50); background:#FFF}
+.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+.defaultSkin .mcePlaceHolder {border:1px dotted gray}
+
+/* Theme */
+.defaultSkin span.bold {background-position:0 0}
+.defaultSkin span.italic {background-position:-60px 0}
+.defaultSkin span.underline {background-position:-140px 0}
+.defaultSkin span.strikethrough {background-position:-120px 0}
+.defaultSkin span.undo {background-position:-160px 0}
+.defaultSkin span.redo {background-position:-100px 0}
+.defaultSkin span.cleanup {background-position:-40px 0}
+.defaultSkin span.bullist {background-position:-20px 0}
+.defaultSkin span.numlist {background-position:-80px 0}
+.defaultSkin span.justifyleft {background-position:-460px 0}
+.defaultSkin span.justifyright {background-position:-480px 0}
+.defaultSkin span.justifycenter {background-position:-420px 0}
+.defaultSkin span.justifyfull {background-position:-440px 0}
+.defaultSkin span.anchor {background-position:-200px 0}
+.defaultSkin span.indent {background-position:-400px 0}
+.defaultSkin span.outdent {background-position:-540px 0}
+.defaultSkin span.link {background-position:-500px 0}
+.defaultSkin span.unlink {background-position:-640px 0}
+.defaultSkin span.sub {background-position:-600px 0}
+.defaultSkin span.sup {background-position:-620px 0}
+.defaultSkin span.removeformat {background-position:-580px 0}
+.defaultSkin span.newdocument {background-position:-520px 0}
+.defaultSkin span.image {background-position:-380px 0}
+.defaultSkin span.help {background-position:-340px 0}
+.defaultSkin span.code {background-position:-260px 0}
+.defaultSkin span.hr {background-position:-360px 0}
+.defaultSkin span.visualaid {background-position:-660px 0}
+.defaultSkin span.charmap {background-position:-240px 0}
+.defaultSkin span.paste {background-position:-560px 0}
+.defaultSkin span.copy {background-position:-700px 0}
+.defaultSkin span.cut {background-position:-680px 0}
+.defaultSkin span.blockquote {background-position:-220px 0}
+.defaultSkin .forecolor span.action {background-position:-720px 0}
+.defaultSkin .backcolor span.action {background-position:-760px 0}
+.defaultSkin .forecolorpicker {background-position:-720px 0}
+.defaultSkin .backcolorpicker {background-position:-760px 0}
+
+/* Plugins */
+.defaultSkin span.advhr {background-position:-0px -20px}
+.defaultSkin span.ltr {background-position:-20px -20px}
+.defaultSkin span.rtl {background-position:-40px -20px}
+.defaultSkin span.emotions {background-position:-60px -20px}
+.defaultSkin span.fullpage {background-position:-80px -20px}
+.defaultSkin span.fullscreen {background-position:-100px -20px}
+.defaultSkin span.iespell {background-position:-120px -20px}
+.defaultSkin span.insertdate {background-position:-140px -20px}
+.defaultSkin span.inserttime {background-position:-160px -20px}
+.defaultSkin span.absolute {background-position:-180px -20px}
+.defaultSkin span.backward {background-position:-200px -20px}
+.defaultSkin span.forward {background-position:-220px -20px}
+.defaultSkin span.insert_layer {background-position:-240px -20px}
+.defaultSkin span.insertlayer {background-position:-260px -20px}
+.defaultSkin span.movebackward {background-position:-280px -20px}
+.defaultSkin span.moveforward {background-position:-300px -20px}
+.defaultSkin span.media {background-position:-320px -20px}
+.defaultSkin span.nonbreaking {background-position:-340px -20px}
+.defaultSkin span.pastetext {background-position:-360px -20px}
+.defaultSkin span.pasteword {background-position:-380px -20px}
+.defaultSkin span.selectall {background-position:-400px -20px}
+.defaultSkin span.preview {background-position:-420px -20px}
+.defaultSkin span.print {background-position:-440px -20px}
+.defaultSkin span.cancel {background-position:-460px -20px}
+.defaultSkin span.save {background-position:-480px -20px}
+.defaultSkin span.replace {background-position:-500px -20px}
+.defaultSkin span.search {background-position:-520px -20px}
+.defaultSkin span.styleprops {background-position:-560px -20px}
+.defaultSkin span.table {background-position:-580px -20px}
+.defaultSkin span.cell_props {background-position:-600px -20px}
+.defaultSkin span.delete_table {background-position:-620px -20px}
+.defaultSkin span.delete_col {background-position:-640px -20px}
+.defaultSkin span.delete_row {background-position:-660px -20px}
+.defaultSkin span.col_after {background-position:-680px -20px}
+.defaultSkin span.col_before {background-position:-700px -20px}
+.defaultSkin span.row_after {background-position:-720px -20px}
+.defaultSkin span.row_before {background-position:-740px -20px}
+.defaultSkin span.merge_cells {background-position:-760px -20px}
+.defaultSkin span.table_props {background-position:-980px -20px}
+.defaultSkin span.row_props {background-position:-780px -20px}
+.defaultSkin span.split_cells {background-position:-800px -20px}
+.defaultSkin span.template {background-position:-820px -20px}
+.defaultSkin span.visualchars {background-position:-840px -20px}
+.defaultSkin span.abbr {background-position:-860px -20px}
+.defaultSkin span.acronym {background-position:-880px -20px}
+.defaultSkin span.attribs {background-position:-900px -20px}
+.defaultSkin span.cite {background-position:-920px -20px}
+.defaultSkin span.del {background-position:-940px -20px}
+.defaultSkin span.ins {background-position:-960px -20px}
+.defaultSkin span.pagebreak {background-position:0 -40px}
+.defaultSkin .spellchecker span.action {background-position:-540px -20px}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css	(revision 1)
@@ -0,0 +1,18 @@
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
+body {background:#FFF;}
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;}
+a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
+img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
+img {border:0;}
+
+/* IE */
+* html body {
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css	(revision 1)
@@ -0,0 +1,111 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(../default/img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+}
+
+#insert {background:url(../default/img/buttons.png) 0 -52px;}
+#cancel {background:url(../default/img/buttons.png) 0 0;}
+
+/* Browse */
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border-style:solid; border-width:1px; border-color:#AAA;}
+td.charmap, td.charmapOver {color:#000; border-color:#AAA; border-style:solid; border-width:1px; text-align:center; font-size:12px;}
+td.charmapOver {background:#CCC; cursor:default;}
+a.charmap {color:#000; text-decoration:none}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:18px;}
+.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css	(revision 1)
@@ -0,0 +1,193 @@
+/* Reset */
+.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate}
+.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
+.o2k7Skin table td {vertical-align:middle}
+
+/* Containers */
+.o2k7Skin table {background:#E5EFFD}
+.o2k7Skin iframe {display:block; background:#FFF;}
+.o2k7Skin .mceToolbar {height:26px}
+
+/* External */
+.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}
+.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
+
+/* Layout */
+.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
+.o2k7Skin table.mceLayout tr.first td {border-top:1px solid #ABC6DD}
+.o2k7Skin table.mceLayout tr.last td {border-bottom:1px solid #ABC6DD}
+.o2k7Skin table.mceToolbar, .o2k7Skin tr.first .mceToolbar tr td, .o2k7Skin tr.last .mceToolbar tr td {border:0; margin:0; padding:0}
+.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
+.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px;}
+.o2k7Skin .mceStatusbar div {float:left; padding:2px;}
+.o2k7Skin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
+.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
+.o2k7Skin table.mceToolbar {margin-left:3px}
+.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
+.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
+.o2k7Skin .mceToolbar .mceToolbarEndListBox span {display:none}
+.o2k7Skin span.icon, .o2k7Skin img.icon {display:block; width:20px; height:20px}
+.o2k7Skin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
+.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}
+.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}
+.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
+.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}
+.o2k7Skin .mceButtonDisabled .icon {opacity:0.3; filter:alpha(opacity=30)}
+
+/* Separator */
+.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
+
+/* ListBox */
+.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
+.o2k7Skin .mceListBox .text {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
+.o2k7Skin .mceListBox .open {width:14px; height:22px; background:url(img/button_bg.png) -66px 0; margin-right:2px}
+.o2k7Skin table.mceListBoxEnabled:hover .text, .o2k7Skin .mceListBoxHover .text, .o2k7Skin .mceListBoxSelected .text {background:#FFF}
+.o2k7Skin table.mceListBoxEnabled:hover .open, .o2k7Skin .mceListBoxHover .open, .o2k7Skin .mceListBoxSelected .open {background-position:-66px -22px}
+.o2k7Skin .mceListBoxDisabled .text {color:gray}
+.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
+.o2k7Skin .mceOldBoxModel .mceListBox .text {height:22px}
+.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
+
+/* SplitButton */
+.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}
+.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
+.o2k7Skin .mceSplitButton a.action {width:22px}
+.o2k7Skin .mceSplitButton span.action {width:22px; background:url(../../img/icons.gif) 20px 20px}
+.o2k7Skin .mceSplitButton a.open {width:10px}
+.o2k7Skin .mceSplitButton span.open {width:10px; background:url(img/button_bg.png) -44px 0}
+.o2k7Skin table.mceSplitButtonEnabled:hover a.action, .o2k7Skin .mceSplitButtonHover a.action, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}
+.o2k7Skin table.mceSplitButtonEnabled:hover span.open, .o2k7Skin .mceSplitButtonHover span.open, .o2k7Skin .mceSplitButtonSelected span.open {background-position:-44px -44px}
+.o2k7Skin .mceSplitButtonDisabled .action {opacity:0.3; filter:alpha(opacity=30)}
+.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}
+
+/* ColorSplitButton */
+.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
+.o2k7Skin .mceColorSplitMenu td {padding:2px}
+.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
+.o2k7Skin .mceColorSplitMenu td.morecolors {padding:1px 3px 1px 1px}
+.o2k7Skin .mceColorSplitMenu a.morecolors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.o2k7Skin .mceColorSplitMenu a.morecolors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
+.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}
+.o2k7Skin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden}
+
+/* Menu */
+.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}
+.o2k7Skin .noIcons span.icon {width:0;}
+.o2k7Skin .noIcons a .text {padding-left:10px}
+.o2k7Skin .mceMenu table {background:#FFF}
+.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}
+.o2k7Skin .mceMenu td {height:20px}
+.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}
+.o2k7Skin .mceMenu .text {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
+.o2k7Skin .mceMenu span.text, .o2k7Skin .mceMenu .preview {font-size:11px}
+.o2k7Skin .mceMenu pre.text {font-family:Monospace}
+.o2k7Skin .mceMenu .icon {position:absolute; top:0; left:0; width:22px;}
+.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
+.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}
+.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}
+.o2k7Skin .mceMenuItemTitle span.text {color:#000; font-weight:bold; padding-left:4px}
+.o2k7Skin .mceMenuItemDisabled .text {color:#888}
+.o2k7Skin .mceMenuItemSelected .icon {background:url(../default/img/menu_check.gif)}
+.o2k7Skin .noIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
+.o2k7Skin .mceMenu span.mceMenuLine {display:none}
+.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
+
+/* Progress,Resize */
+.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; filter:alpha(opacity=50); background:#FFF}
+.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+.o2k7Skin .mcePlaceHolder {border:1px dotted gray}
+
+/* Theme */
+.o2k7Skin span.bold {background-position:0 0}
+.o2k7Skin span.italic {background-position:-60px 0}
+.o2k7Skin span.underline {background-position:-140px 0}
+.o2k7Skin span.strikethrough {background-position:-120px 0}
+.o2k7Skin span.undo {background-position:-160px 0}
+.o2k7Skin span.redo {background-position:-100px 0}
+.o2k7Skin span.cleanup {background-position:-40px 0}
+.o2k7Skin span.bullist {background-position:-20px 0}
+.o2k7Skin span.numlist {background-position:-80px 0}
+.o2k7Skin span.justifyleft {background-position:-460px 0}
+.o2k7Skin span.justifyright {background-position:-480px 0}
+.o2k7Skin span.justifycenter {background-position:-420px 0}
+.o2k7Skin span.justifyfull {background-position:-440px 0}
+.o2k7Skin span.anchor {background-position:-200px 0}
+.o2k7Skin span.indent {background-position:-400px 0}
+.o2k7Skin span.outdent {background-position:-540px 0}
+.o2k7Skin span.link {background-position:-500px 0}
+.o2k7Skin span.unlink {background-position:-640px 0}
+.o2k7Skin span.sub {background-position:-600px 0}
+.o2k7Skin span.sup {background-position:-620px 0}
+.o2k7Skin span.removeformat {background-position:-580px 0}
+.o2k7Skin span.newdocument {background-position:-520px 0}
+.o2k7Skin span.image {background-position:-380px 0}
+.o2k7Skin span.help {background-position:-340px 0}
+.o2k7Skin span.code {background-position:-260px 0}
+.o2k7Skin span.hr {background-position:-360px 0}
+.o2k7Skin span.visualaid {background-position:-660px 0}
+.o2k7Skin span.charmap {background-position:-240px 0}
+.o2k7Skin span.paste {background-position:-560px 0}
+.o2k7Skin span.copy {background-position:-700px 0}
+.o2k7Skin span.cut {background-position:-680px 0}
+.o2k7Skin span.blockquote {background-position:-220px 0}
+.o2k7Skin .forecolor span.action {background-position:-720px 0}
+.o2k7Skin .backcolor span.action {background-position:-760px 0}
+.o2k7Skin .forecolorpicker {background-position:-720px 0}
+.o2k7Skin .backcolorpicker {background-position:-760px 0}
+
+/* Plugins */
+.o2k7Skin span.advhr {background-position:-0px -20px}
+.o2k7Skin span.ltr {background-position:-20px -20px}
+.o2k7Skin span.rtl {background-position:-40px -20px}
+.o2k7Skin span.emotions {background-position:-60px -20px}
+.o2k7Skin span.fullpage {background-position:-80px -20px}
+.o2k7Skin span.fullscreen {background-position:-100px -20px}
+.o2k7Skin span.iespell {background-position:-120px -20px}
+.o2k7Skin span.insertdate {background-position:-140px -20px}
+.o2k7Skin span.inserttime {background-position:-160px -20px}
+.o2k7Skin span.absolute {background-position:-180px -20px}
+.o2k7Skin span.backward {background-position:-200px -20px}
+.o2k7Skin span.forward {background-position:-220px -20px}
+.o2k7Skin span.insert_layer {background-position:-240px -20px}
+.o2k7Skin span.insertlayer {background-position:-260px -20px}
+.o2k7Skin span.movebackward {background-position:-280px -20px}
+.o2k7Skin span.moveforward {background-position:-300px -20px}
+.o2k7Skin span.media {background-position:-320px -20px}
+.o2k7Skin span.nonbreaking {background-position:-340px -20px}
+.o2k7Skin span.pastetext {background-position:-360px -20px}
+.o2k7Skin span.pasteword {background-position:-380px -20px}
+.o2k7Skin span.selectall {background-position:-400px -20px}
+.o2k7Skin span.preview {background-position:-420px -20px}
+.o2k7Skin span.print {background-position:-440px -20px}
+.o2k7Skin span.cancel {background-position:-460px -20px}
+.o2k7Skin span.save {background-position:-480px -20px}
+.o2k7Skin span.replace {background-position:-500px -20px}
+.o2k7Skin span.search {background-position:-520px -20px}
+.o2k7Skin span.styleprops {background-position:-560px -20px}
+.o2k7Skin span.table {background-position:-580px -20px}
+.o2k7Skin span.cell_props {background-position:-600px -20px}
+.o2k7Skin span.delete_table {background-position:-620px -20px}
+.o2k7Skin span.delete_col {background-position:-640px -20px}
+.o2k7Skin span.delete_row {background-position:-660px -20px}
+.o2k7Skin span.col_after {background-position:-680px -20px}
+.o2k7Skin span.col_before {background-position:-700px -20px}
+.o2k7Skin span.row_after {background-position:-720px -20px}
+.o2k7Skin span.row_before {background-position:-740px -20px}
+.o2k7Skin span.merge_cells {background-position:-760px -20px}
+.o2k7Skin span.table_props {background-position:-980px -20px}
+.o2k7Skin span.row_props {background-position:-780px -20px}
+.o2k7Skin span.split_cells {background-position:-800px -20px}
+.o2k7Skin span.template {background-position:-820px -20px}
+.o2k7Skin span.visualchars {background-position:-840px -20px}
+.o2k7Skin span.abbr {background-position:-860px -20px}
+.o2k7Skin span.acronym {background-position:-880px -20px}
+.o2k7Skin span.attribs {background-position:-900px -20px}
+.o2k7Skin span.cite {background-position:-920px -20px}
+.o2k7Skin span.del {background-position:-940px -20px}
+.o2k7Skin span.ins {background-position:-960px -20px}
+.o2k7Skin span.pagebreak {background-position:0 -40px}
+.o2k7Skin .spellchecker span.action {background-position:-540px -20px}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/advanced/source_editor.htm	(revision 1)
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>{#advanced_dlg.code_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/source_editor.js"></script>
+	<base target="_self" />
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+	<form name="source" onsubmit="saveContent();" action="#">
+		<div style="float: left" class="title">{#advanced_dlg.code_title}</div>
+
+		<div id="wrapline" style="float: right">
+			<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>
+		</div>
+
+		<br style="clear: both" />
+
+		<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off"></textarea>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" name="insert" value="{#update}" onclick="saveContent();" id="insert" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js	(revision 1)
@@ -0,0 +1,1 @@
+(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS(url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('div',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar last',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,deltaHeight:-20};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add('simple',tinymce.themes.SimpleTheme);})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js	(revision 1)
@@ -0,0 +1,85 @@
+/**
+ * $Id: editor_template_src.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * This file is meant to showcase how to create a simple theme. The advanced
+ * theme is more suitable for production use.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+	var DOM = tinymce.DOM;
+
+	// Tell it to load theme specific language pack(s)
+	tinymce.ThemeManager.requireLangPack('simple');
+
+	tinymce.create('tinymce.themes.SimpleTheme', {
+		init : function(ed, url) {
+			var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
+
+			t.editor = ed;
+
+			ed.onInit.add(function() {
+				ed.onNodeChange.add(function(ed, cm) {
+					tinymce.each(states, function(c) {
+						cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
+					});
+				});
+
+				ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");
+			});
+
+			DOM.loadCSS(url + "/skins/" + s.skin + "/ui.css");
+		},
+
+		renderUI : function(o) {
+			var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;
+
+			n = DOM.insertAfter(DOM.create('div', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);
+			n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});
+			n = tb = DOM.add(n, 'tbody');
+
+			// Create iframe container
+			n = DOM.add(tb, 'tr');
+			n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});
+
+			// Create toolbar container
+			n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar last', align : 'center'});
+
+			// Create toolbar
+			tb = t.toolbar = cf.createToolbar("tools1");
+			tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));
+			tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));
+			tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));
+			tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));
+			tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));
+			tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));
+			tb.renderTo(n);
+
+			return {
+				iframeContainer : ic,
+				editorContainer : ed.id + '_container',
+				sizeContainer : sc,
+				deltaHeight : -20
+			};
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Simple theme',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			}
+		}
+	});
+
+	tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);
+})();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/langs/en.js	(revision 1)
@@ -0,0 +1,11 @@
+tinyMCE.addI18n('en.simple',{
+bold_desc:"Bold (Ctrl+B)",
+italic_desc:"Italic (Ctrl+I)",
+underline_desc:"Underline (Ctrl+U)",
+striketrough_desc:"Strikethrough",
+bullist_desc:"Unordered list",
+numlist_desc:"Ordered list",
+undo_desc:"Undo (Ctrl+Z)",
+redo_desc:"Redo (Ctrl+Y)",
+cleanup_desc:"Cleanup messy code"
+});
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/content.css	(revision 1)
@@ -0,0 +1,25 @@
+body, td, pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+body {
+	background-color: #ffffff;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB;
+}
+
+/* MSIE specific */
+
+* html body {
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;	
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/default/ui.css	(revision 1)
@@ -0,0 +1,32 @@
+/* Reset */
+.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
+
+/* Containers */
+.defaultSimpleSkin {position:relative}
+.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}
+.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}
+.defaultSimpleSkin .mceToolbar {height:24px;}
+
+/* Layout */
+.defaultSimpleSkin span.icon, .defaultSimpleSkin img.icon {display:block; width:20px; height:20px}
+.defaultSimpleSkin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}
+.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
+.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; filter:alpha(opacity=30)}
+
+/* Separator */
+.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}
+
+/* Theme */
+.defaultSimpleSkin span.bold {background-position:0 0}
+.defaultSimpleSkin span.italic {background-position:-60px 0}
+.defaultSimpleSkin span.underline {background-position:-140px 0}
+.defaultSimpleSkin span.strikethrough {background-position:-120px 0}
+.defaultSimpleSkin span.undo {background-position:-160px 0}
+.defaultSimpleSkin span.redo {background-position:-100px 0}
+.defaultSimpleSkin span.cleanup {background-position:-40px 0}
+.defaultSimpleSkin span.insertunorderedlist {background-position:-20px 0}
+.defaultSimpleSkin span.insertorderedlist {background-position:-80px 0}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/content.css	(revision 1)
@@ -0,0 +1,17 @@
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+
+body {background: #FFF;}
+.mceVisualAid {border: 1px dashed #BBB;}
+
+/* IE */
+
+* html body {
+scrollbar-3dlight-color: #F0F0EE;
+scrollbar-arrow-color: #676662;
+scrollbar-base-color: #F0F0EE;
+scrollbar-darkshadow-color: #DDDDDD;
+scrollbar-face-color: #E0E0DD;
+scrollbar-highlight-color: #F0F0EE;
+scrollbar-shadow-color: #F0F0EE;
+scrollbar-track-color: #F5F5F5;	
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/themes/simple/skins/o2k7/ui.css	(revision 1)
@@ -0,0 +1,35 @@
+/* Reset */
+.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
+
+/* Containers */
+.o2k7SimpleSkin {position:relative}
+.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}
+.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}
+.o2k7SimpleSkin .mceToolbar {height:26px;}
+
+/* Layout */
+.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
+.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
+.o2k7SimpleSkin span.icon, .o2k7SimpleSkin img.icon {display:block; width:20px; height:20px}
+.o2k7SimpleSkin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
+.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}
+.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
+.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}
+.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; filter:alpha(opacity=30)}
+
+/* Separator */
+.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
+
+/* Theme */
+.o2k7SimpleSkin span.bold {background-position:0 0}
+.o2k7SimpleSkin span.italic {background-position:-60px 0}
+.o2k7SimpleSkin span.underline {background-position:-140px 0}
+.o2k7SimpleSkin span.strikethrough {background-position:-120px 0}
+.o2k7SimpleSkin span.undo {background-position:-160px 0}
+.o2k7SimpleSkin span.redo {background-position:-100px 0}
+.o2k7SimpleSkin span.cleanup {background-position:-40px 0}
+.o2k7SimpleSkin span.insertunorderedlist {background-position:-20px 0}
+.o2k7SimpleSkin span.insertorderedlist {background-position:-80px 0}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js	(revision 1)
@@ -0,0 +1,1 @@
+var tinymce={majorVersion:'3',minorVersion:'0',releaseDate:'2008-01-30',_init:function(){var t=this,ua=navigator.userAgent,i,nl,n,base;t.isOpera=window.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!window.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(navigator.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;if(window.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;return;}t.suffix='';nl=document.getElementsByTagName('base');for(i=0;i<nl.length;i++){if(nl[i].href)base=nl[i].href;}function getBase(n){if(n.src&&/tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)){if(/_(src|dev)\.js/g.test(n.src))t.suffix='_src';t.baseURL=n.src.substring(0,n.src.lastIndexOf('/'));if(base&&t.baseURL.indexOf('://')==-1)t.baseURL=base+t.baseURL;return t.baseURL;}return null;};nl=document.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}n=document.getElementsByTagName('head')[0];if(n){nl=n.getElementsByTagName('script');for(i=0;i<nl.length;i++){if(getBase(nl[i]))return;}}return;},is:function(o,t){var n=typeof(o);if(!t)return n!='undefined';if(t=='array'&&(o instanceof Array))return true;return n==t;},each:function(o,cb,s){var n,l;if(!o)return 0;s=s||o;if(typeof(o.length)!='undefined'){for(n=0,l=o.length;n<l;n++){if(cb.call(s,o[n],n,o)===false)return 0;}}else{for(n in o){if(o.hasOwnProperty(n)){if(cb.call(s,o[n],n,o)===false)return 0;}}}return 1;},map:function(a,f){var o=[];tinymce.each(a,function(v){o.push(f(v));});return o;},grep:function(a,f){var o=[];tinymce.each(a,function(v){if(!f||f(v))o.push(v);});return o;},inArray:function(a,v){var i,l;if(a){for(i=0,l=a.length;i<l;i++){if(a[i]===v)return i;}}return-1;},extend:function(o,e){var i,a=arguments;for(i=1;i<a.length;i++){e=a[i];tinymce.each(e,function(v,n){if(typeof(v)!=='undefined')o[n]=v;});}return o;},trim:function(s){return(s?''+s:'').replace(/^\s*|\s*$/g,'');},create:function(s,p){var t=this,sp,ns,cn,scn,c,de=0;s=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);cn=s[3].match(/(^|\.)(\w+)$/i)[2];ns=t.createNS(s[3].replace(/\.\w+$/,''));if(ns[cn])return;if(s[2]=='static'){ns[cn]=p;if(this.onCreate)this.onCreate(s[2],s[3],ns[cn]);return;}if(!p[cn]){p[cn]=function(){};de=1;}ns[cn]=p[cn];t.extend(ns[cn].prototype,p);if(s[5]){sp=t.resolve(s[5]).prototype;scn=s[5].match(/\.(\w+)$/i)[1];c=ns[cn];if(de){ns[cn]=function(){return sp[scn].apply(this,arguments);};}else{ns[cn]=function(){this.parent=sp[scn];return c.apply(this,arguments);};}ns[cn].prototype[cn]=ns[cn];t.each(sp,function(f,n){if(n!=scn)ns[cn].prototype[n]=sp[n];});t.each(p,function(f,n){if(sp[n]){ns[cn].prototype[n]=function(){this.parent=sp[n];return f.apply(this,arguments);};}else{if(n!=cn)ns[cn].prototype[n]=f;}});}t.each(p['static'],function(f,n){ns[cn][n]=f;});if(this.onCreate)this.onCreate(s[2],s[3],ns[cn].prototype);},walk:function(o,f,n,s){s=s||this;if(o){if(n)o=o[n];tinymce.each(o,function(o,i){if(f.call(s,o,i,n)===false)return false;tinymce.walk(o,f,n,s);});}},createNS:function(n,o){var i,v;o=o||window;n=n.split('.');for(i=0;i<n.length;i++){v=n[i];if(!o[v])o[v]={};o=o[v];}return o;},resolve:function(n,o){var i,l;o=o||window;n=n.split('.');for(i=0,l=n.length;i<l;i++){o=o[n[i]];if(!o)break;}return o;},addUnload:function(f,s){var t=this,w=window,unload;f={func:f,scope:s||this};if(!t.unloads){unload=function(){var li=t.unloads,o,n;for(n in li){o=li[n];if(o&&o.func)o.func.call(o.scope);}if(w.detachEvent)w.detachEvent('onunload',unload);else if(w.removeEventListener)w.removeEventListener('unload',unload,false);o=li=w=unload=null;if(window.CollectGarbage)window.CollectGarbage();};if(w.attachEvent)w.attachEvent('onunload',unload);else if(w.addEventListener)w.addEventListener('unload',unload,false);t.unloads=[f];}else t.unloads.push(f);return f;},removeUnload:function(f){var u=this.unloads,r=null;tinymce.each(u,function(o,i){if(o&&o.func==f){u.splice(i,1);r=f;return false;}});return r;}};window.tinymce=tinymce;tinymce._init();tinymce.create('tinymce.util.Dispatcher',{scope:null,listeners:null,Dispatcher:function(s){this.scope=s||this;this.listeners=[];},add:function(cb,s){this.listeners.push({cb:cb,scope:s||this.scope});return cb;},addToTop:function(cb,s){this.listeners.unshift({cb:cb,scope:s||this.scope});return cb;},remove:function(cb){var l=this.listeners,o=null;tinymce.each(l,function(c,i){if(cb==c.cb){o=cb;l.splice(i,1);return false;}});return o;},dispatch:function(){var s,a=arguments;tinymce.each(this.listeners,function(c){return s=c.cb.apply(c.scope,a);});return s;}});(function(){var each=tinymce.each;tinymce.create('tinymce.util.URI',{URI:function(u,s){var t=this,o,a,b;s=t.settings=s||{};if(/^(mailto|news|javascript|about):/i.test(u)||/^\s*#/.test(u)){t.source=u;return;}if(u.indexOf('/')===0&&u.indexOf('//')!==0)u=(s.base_uri?s.base_uri.protocol||'http':'http')+'://mce_host'+u;if(u.indexOf('://')===-1&&u.indexOf('//')!==0)u=(s.base_uri.protocol||'http')+'://mce_host'+t.toAbsPath(s.base_uri.path,u);u=u.replace(/@@/g,'(mce_at)');u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(v,i){var s=u[i];if(s)s=s.replace(/\(mce_at\)/g,'@@');t[v]=s;});if(b=s.base_uri){if(!t.protocol)t.protocol=b.protocol;if(!t.userInfo)t.userInfo=b.userInfo;if(!t.port&&t.host=='mce_host')t.port=b.port;if(!t.host||t.host=='mce_host')t.host=b.host;t.source='';}},setPath:function(p){var t=this;p=/^(.*?)\/?(\w+)?$/.exec(p);t.path=p[0];t.directory=p[1];t.file=p[2];t.source='';t.getURI();},toRelative:function(u){var t=this,o;u=new tinymce.util.URI(u,{base_uri:t});if((u.host!='mce_host'&&t.host!=u.host&&u.host)||t.port!=u.port||t.protocol!=u.protocol)return u.getURI();o=t.toRelPath(t.path,u.path);if(u.query)o+='?'+u.query;if(u.anchor)o+='#'+u.anchor;return o;},toAbsolute:function(u,nh){var u=new tinymce.util.URI(u,{base_uri:this});return u.getURI(this.host==u.host?nh:0);},toRelPath:function(base,path){var items,bp=0,out='',i;base=base.substring(0,base.lastIndexOf('/'));base=base.split('/');items=path.split('/');if(base.length>=items.length){for(i=0;i<base.length;i++){if(i>=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length<items.length){for(i=0;i<items.length;i++){if(i>=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0;i<base.length-(bp-1);i++)out+="../";for(i=bp-1;i<items.length;i++){if(i!=bp-1)out+="/"+items[i];else out+=items[i];}return out;},toAbsPath:function(base,path){var i,nb=0,o=[];base=base.split('/');path=path.split('/');each(base,function(k){if(k)o.push(k);});base=o;for(i=path.length-1,o=[];i>=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i<o.length;i++)v+=(i>0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);t=w.setInterval(function(){if(x.readyState==4||c++>10000){w.clearInterval(t);if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}},10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,DOMUtils:function(d,s){var t=this;t.doc=d;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(function(){t.doc=t.root=null;});},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?window:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,w,h;e=t.get(e);p=t.getPos(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{x:p.x,y:p.y,w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){if(typeof(e)=='string')return this.doc.getElementById(e);return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n;s=t.get(s)||t.doc;if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i<l;i++)o.push(x[i]);return o;}if(t.elmClassPattern.test(pa)){pl=t.elmClassPattern.exec(pa);x=get(s,pl[1]||'*');c=' '+pl[2]+' ';for(i=0,l=x.length;i<l;i++){n=x[i];if(n.className&&(' '+n.className+' ').indexOf(c)!==-1)o.push(n);}return o;}function collect(n){if(!n.mce_save){n.mce_save=1;o.push(n);}};function collectIE(n){if(!n.getAttribute('mce_save')){n.setAttribute('mce_save','1');o.push(n);}};function find(n,f,r){var i,l,nl=get(r,n);for(i=0,l=nl.length;i<l;i++)f(nl[i]);};each(pa.split(','),function(v,i){v=tinymce.trim(v);if(t.elmPattern.test(v)){each(get(s,v),function(n){collect(n);});return;}if(t.elmClassPattern.test(v)){x=t.elmClassPattern.exec(v);each(get(s,x[1]),function(n){if(t.hasClass(n,x[2]))collect(n);});return;}if(!(cs=t.cache[pa])){cs='x=(function(cf, s) {';pl=v.split(' ');each(pl,function(v){var p=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);p[1]=p[1]||'*';cs+='find("'+p[1]+'", function(n) {';if(p[2])cs+='if (n.id !== "'+p[2]+'") return;';if(p[3]){cs+='var c = " " + n.className + " ";';cs+='if (';c='';each(p[3].split('.'),function(v){if(v)c+=(c?'||':'')+'c.indexOf(" '+v+' ") === -1';});cs+=c+') return;';}});cs+='cf(n);';for(i=pl.length-1;i>=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;if(a){for(k in a){if(a.hasOwnProperty(k)&&!is(a[k],'object'))t.setAttrib(e,k,''+a[k]);}if(a.style&&!is(a.style,'string')){each(a.style,function(v,n){t.setStyle(e,n,v);});}}if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'</'+n+'>';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s['-moz-opacity']=s['-khtml-opacity']=v;break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;}s[na]=v||'';if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(s.keep_values){if(v)e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v;break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e)return false;if(!is(dv))dv="";if(/^(src|href|style|coords)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}v=e.getAttribute(n,2);if(!v){switch(n){case'class':v=e.className;break;default:v=e.attributes[n];v=v&&is(v.nodeValue)?v.nodeValue:v;}}switch(n){case'style':v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values)e.setAttribute('mce_style',v);}break;}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0')v='';break;case'hspace':if(v===-1)v='';break;case'tabindex':if(v===32768)v='';break;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v&&v!='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=window.self!=window.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){x-=r.scrollLeft||0;y-=r.scrollTop||0;r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null))+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=this.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;if(!d.createStyleSheet)t.add(t.select('head')[0],'link',{rel:'stylesheet',href:u});else d.createStyleSheet(u);});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x;h=t.processHTML(h);if(isIE){try{e.innerHTML='<br />'+h;e.removeChild(e.firstChild);}catch(ex){x=t.create('div');x.innerHTML='<br />'+h;each(x.childNodes,function(n,i){if(i>1)e.appendChild(n);});}}else e.innerHTML=h;return h;});},processHTML:function(h){var t=this,s=t.settings;if(!s.process_html)return h;if(tinymce.isGecko){h=h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|<em( [^>]+)>/gi,'<$1i$2>');}h=h.replace(/<a( )([^>]+)\/>|<a\/>/gi,'<a$1$2></a>');if(s.keep_values){if(h.indexOf('<script')!==-1){h=h.replace(/<script>/g,'<script type="text/javascript">');h=h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g,'<mce:script$1><!--\n');h=h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g,'\n// --></mce:script>');h=h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g,'<mce:script$1></mce:script>');}h=h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e=document.createElement("div");e.innerHTML=s;return!e.firstChild?s:e.firstChild.nodeValue;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&amp;';case'"':return'&quot;';case'<':return'&lt;';case'>':return'&gt;';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(f&&!(v=f(v)))return;if(/^\.mce/.test(v)||!/^\.[\w\-]+$/.test(v))return;v=v.substring(1);if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(typeof(e)==='string')e=t.doc.getElementById(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;},_pageInit:function(){var e=Event;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded)return;if(isIE&&document.location.protocol!='https:'){document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');DOM.get("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){Event._pageInit();DOM.get("__ie_onload").onreadystatechange=null;}};}else{Event._add(window,'DOMContentLoaded',Event._pageInit,Event);if(isIE||isWebKit){t=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(t);Event._pageInit();}},10);}}}});Event=tinymce.dom.Event;Event._wait();tinymce.addUnload(Event._unload);})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.Element',{Element:function(id,s){var t=this,dom,el;s=s||{};t.id=id;t.dom=dom=s.dom||tinymce.DOM;t.settings=s;if(!tinymce.isIE)el=t.dom.get(t.id);each(['getPos','getRect','getParent','add','setStyle','getStyle','setStyles','setAttrib','setAttribs','getAttrib','addClass','removeClass','hasClass','getOuterHTML','setOuterHTML','remove','show','hide','isHidden','setHTML','get'],function(k){t[k]=function(){var a=arguments,o;if(tinymce.isOpera){a=[id];each(arguments,function(v){a.push(v);});}else Array.prototype.unshift.call(a,el||id);o=dom[k].apply(dom,a);t.update(k);return o;};});},on:function(n,f,s){return tinymce.dom.Event.add(this.id,n,f,s);},getXY:function(){return{x:parseInt(this.getStyle('left')),y:parseInt(this.getStyle('top'))};},getSize:function(){var n=this.dom.get(this.id);return{w:parseInt(this.getStyle('width')||n.clientWidth),h:parseInt(this.getStyle('height')||n.clientHeight)};},moveTo:function(x,y){this.setStyles({left:x,top:y});},moveBy:function(x,y){var p=this.getXY();this.moveTo(p.x+x,p.y+y);},resizeTo:function(w,h){this.setStyles({width:w,height:h});},resizeBy:function(w,h){var s=this.getSize();this.resizeTo(s.w+w,s.h+h);},update:function(k){var t=this,b,dom=t.dom;if(tinymce.isIE6&&t.settings.blocker){k=k||'';if(k.indexOf('get')===0||k.indexOf('has')===0||k.indexOf('is')===0)return;if(k=='remove'){dom.remove(t.blocker);return;}if(!t.blocker){t.blocker=dom.uniqueId();b=dom.add(t.settings.container||dom.getRoot(),'iframe',{id:t.blocker,style:'position:absolute;',frameBorder:0,src:'javascript:""'});dom.setStyle(b,'opacity',0);}else b=dom.get(t.blocker);dom.setStyle(b,'left',t.getStyle('left',1));dom.setStyle(b,'top',t.getStyle('top',1));dom.setStyle(b,'width',t.getStyle('width',1));dom.setStyle(b,'height',t.getStyle('height',1));dom.setStyle(b,'display',t.getStyle('display',1));dom.setStyle(b,'zIndex',parseInt(t.getStyle('zIndex',1)||0)-1);}}});})();(function(){var is=tinymce.is,isIE=tinymce.isIE,each=tinymce.each;tinymce.create('tinymce.dom.Selection',{Selection:function(dom,win,serializer){var t=this;t.dom=dom;t.win=win;t.serializer=serializer;tinymce.addUnload(function(){t.win=null;});},getContent:function(s){var t=this,r=t.getRng(),e=t.dom.create("body"),se=t.getSel(),wb,wa,n;s=s||{};wb=wa='';s.get=true;s.format=s.format||'html';if(s.format=='text')return t.isCollapsed()?'':(r.text||(se.toString?se.toString():''));if(r.cloneContents){n=r.cloneContents();if(n)e.appendChild(n);}else if(is(r.item)||is(r.htmlText))e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;else e.innerHTML=r.toString();if(/^\s/.test(e.innerHTML))wb=' ';if(/\s+$/.test(e.innerHTML))wa=' ';s.getInner=true;return t.isCollapsed()?'':wb+t.serializer.serialize(e,s)+wa;},setContent:function(h,s){var t=this,r=t.getRng(),d;s=s||{format:'html'};s.set=true;h=t.dom.processHTML(h);if(r.insertNode){d=t.win.document;if(tinymce.isGecko&&h.indexOf('<')==-1){r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h+'<span id="__caret">_</span>'));t.select(t.dom.get('__caret'));t.getRng().deleteContents();return;}if(d.queryCommandEnabled('InsertHTML'))return d.execCommand('InsertHTML',false,h);r.deleteContents();r.insertNode(t.getRng().createContextualFragment(h));}else{if(r.item)r.item(0).outerHTML=h;else r.pasteHTML(h);}},getStart:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(1);e=r.parentElement();if(e.nodeName=='BODY')return e.firstChild;return e;}else{e=r.startContainer;if(e.nodeName=='BODY')return e.firstChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getEnd:function(){var t=this,r=t.getRng(),e;if(isIE){if(r.item)return r.item(0);r=r.duplicate();r.collapse(0);e=r.parentElement();if(e.nodeName=='BODY')return e.lastChild;return e;}else{e=r.endContainer;if(e.nodeName=='BODY')return e.lastChild;return t.dom.getParent(e,function(n){return n.nodeType==1;});}},getBookmark:function(si){var t=this,r=t.getRng(),tr,sx,sy,vp=t.dom.getViewPort(t.win),e,sp,bp,le,c=-0xFFFFFF,s,ro=t.dom.getRoot();sx=vp.x;sy=vp.y;if(si=='simple')return{rng:r,scrollX:sx,scrollY:sy};if(isIE){if(r.item){e=r.item(0);each(t.dom.select(e.nodeName),function(n,i){if(e==n){sp=i;return false;}});return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}tr=t.dom.doc.body.createTextRange();tr.moveToElementText(ro);tr.collapse(true);bp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(true);sp=Math.abs(tr.move('character',c));tr=r.duplicate();tr.collapse(false);le=Math.abs(tr.move('character',c))-sp;return{start:sp-bp,length:le,scrollX:sx,scrollY:sy};}e=t.getNode();s=t.getSel();if(!s)return null;if(e&&e.nodeName=='IMG'){return{scrollX:sx,scrollY:sy};}function getPos(r,sn,en){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){if(n==sn)d.start=p;if(n==en){d.end=p;return d;}p+=n.nodeValue?n.nodeValue.length:0;}return null;};if(s.anchorNode==s.focusNode&&s.anchorOffset==s.focusOffset){e=getPos(ro,s.anchorNode,s.focusNode);if(!e)return{scrollX:sx,scrollY:sy};return{start:e.start+s.anchorOffset,end:e.end+s.focusOffset,scrollX:sx,scrollY:sy};}else{e=getPos(ro,r.startContainer,r.endContainer);if(!e)return{scrollX:sx,scrollY:sy};return{start:e.start+r.startOffset,end:e.end+r.endOffset,scrollX:sx,scrollY:sy};}},moveToBookmark:function(b){var t=this,r=t.getRng(),s=t.getSel(),ro=t.dom.getRoot(),sd;function getPos(r,sp,ep){var w=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false),n,p=0,d={};while((n=w.nextNode())!=null){p+=n.nodeValue?n.nodeValue.length:0;if(p>=sp&&!d.startNode){d.startNode=n;d.startOffset=sp-(p-n.nodeValue.length);}if(p>=ep){d.endNode=n;d.endOffset=ep-(p-n.nodeValue.length);return d;}}return null;};if(!b)return false;t.win.scrollTo(b.scrollX,b.scrollY);if(isIE){if(r=b.rng){try{r.select();}catch(ex){}return true;}t.win.focus();if(b.tag){r=ro.createControlRange();each(t.dom.select(b.tag),function(n,i){if(i==b.index)r.addElement(n);});}else{try{if(b.start<0)return true;r=s.createRange();r.moveToElementText(ro);r.collapse(true);r.moveStart('character',b.start);r.moveEnd('character',b.length);}catch(ex2){return true;}}try{r.select();}catch(ex){}return true;}if(!s)return false;if(b.rng){s.removeAllRanges();s.addRange(b.rng);}else{if(is(b.start)&&is(b.end)){try{sd=getPos(ro,b.start,b.end);if(sd){r=t.dom.doc.createRange();r.setStart(sd.startNode,sd.startOffset);r.setEnd(sd.endNode,sd.endOffset);s.removeAllRanges();s.addRange(r);}if(!tinymce.isOpera)t.win.focus();}catch(ex){}}}},select:function(n,c){var t=this,r=t.getRng(),s=t.getSel(),b,fn,ln,d=t.win.document;function first(n){return n?d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode():null;};function last(n){var c,o,w;if(!n)return null;w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while(c=w.nextNode())o=c;return o;};if(isIE){try{b=d.body;if(/^(IMG|TABLE)$/.test(n.nodeName)){r=b.createControlRange();r.addElement(n);}else{r=b.createTextRange();r.moveToElementText(n);}r.select();}catch(ex){}}else{if(c){fn=first(n);ln=last(n);if(fn&&ln){r=d.createRange();r.setStart(fn,0);r.setEnd(ln,ln.nodeValue.length);}else r.selectNode(n);}else r.selectNode(n);t.setRng(r);}return n;},isCollapsed:function(){var t=this,r=t.getRng(),s=t.getSel();if(!r||r.item)return false;return!s||r.boundingWidth==0||s.isCollapsed;},collapse:function(b){var t=this,r=t.getRng(),n;if(r.item){n=r.item(0);r=this.win.document.body.createTextRange();r.moveToElementText(n);}r.collapse(!!b);t.setRng(r);},getSel:function(){var t=this,w=this.win;return w.getSelection?w.getSelection():w.document.selection;},getRng:function(){var t=this,s=t.getSel(),r;try{if(s)r=s.rangeCount>0?s.getRangeAt(0):(s.createRange?s.createRange():t.win.document.createRange());}catch(ex){}if(!r)r=isIE?t.win.document.body.createTextRange():t.win.document.createRange();return r;},setRng:function(r){var s;if(!isIE){s=this.getSel();if(s){s.removeAllRanges();s.addRange(r);}}else{try{r.select();}catch(ex){}}},setNode:function(n){var t=this;t.setContent(t.dom.getOuterHTML(n));return n;},getNode:function(){var t=this,r=t.getRng(),s=t.getSel(),e;if(!isIE){if(!r)return t.dom.getRoot();e=r.commonAncestorContainer;if(!r.collapsed){if(r.startContainer==r.endContainer||(tinymce.isWebKit&&r.startContainer==r.endContainer.parentNode)){if(r.startOffset-r.endOffset<2||tinymce.isWebKit){if(r.startContainer.hasChildNodes())e=r.startContainer.childNodes[r.startOffset];}}}return t.dom.getParent(e,function(n){return n.nodeType==1;});}return r.item?r.item(0):r.parentElement();}});})();(function(){tinymce.create('tinymce.dom.XMLWriter',{node:null,XMLWriter:function(s){function getXML(){var i=document.implementation;if(!i||!i.createDocument){try{return new ActiveXObject('MSXML2.DOMDocument');}catch(ex){}try{return new ActiveXObject('Microsoft.XmlDom');}catch(ex){}}else return i.createDocument('','',null);};this.doc=getXML();this.reset();},reset:function(){var t=this,d=t.doc;if(d.firstChild)d.removeChild(d.firstChild);t.node=d.appendChild(d.createElement("html"));},writeStartElement:function(n){var t=this;t.node=t.node.appendChild(t.doc.createElement(n));},writeAttribute:function(n,v){if(tinymce.isOpera)v=v.replace(/>/g,'|>');this.node.setAttribute(n,v);},writeEndElement:function(){this.node=this.node.parentNode;},writeFullEndElement:function(){var t=this,n=t.node;n.appendChild(t.doc.createTextNode(""));t.node=n.parentNode;},writeText:function(v){if(tinymce.isOpera)v=v.replace(/>/g,'|>');this.node.appendChild(this.doc.createTextNode(v));},writeCDATA:function(v){this.node.appendChild(this.doc.createCDATA(v));},writeComment:function(v){this.node.appendChild(this.doc.createComment(v));},getContent:function(){var h;h=this.doc.xml||new XMLSerializer().serializeToString(this.doc);h=h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,'');h=h.replace(/ ?\/>/g,' />');if(tinymce.isOpera)h=h.replace(/\|>/g,'&gt;');return h;}});})();(function(){var extend=tinymce.extend,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher,isIE=tinymce.isIE;function getIEAtts(n){var o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;};function wildcardToRE(s){return s.replace(/([?+*])/g,'.$1');};tinymce.create('tinymce.dom.Serializer',{Serializer:function(s){var t=this;t.key=0;t.onPreProcess=new Dispatcher(t);t.onPostProcess=new Dispatcher(t);t.writer=new tinymce.dom.XMLWriter();t.settings=s=extend({dom:tinymce.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_$)/,closed:/(br|hr|input|meta|img|link|param)/,entity_encoding:'named',entities:'160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',valid_elements:'*[*]',extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:0,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:'simple',indent_char:'\t',indent_levels:1,remove_linebreaks:1},s);t.dom=s.dom;if(s.fix_list_elements){t.onPreProcess.add(function(se,o){var nl,x,a=['ol','ul'],i,n,p,r=/^(OL|UL)$/,np;function prevNode(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};for(x=0;x<a.length;x++){nl=t.dom.select(a[x],o.node);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=prevNode(n,'LI');if(!np){np=t.dom.create('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}});}if(s.fix_table_elements){t.onPreProcess.add(function(se,o){var ta=[],d=t.dom.doc;each(t.dom.select('table',o.node),function(e){var pa=t.dom.getParent(e,'H1,H2,H3,H4,H5,H6,P'),p=[],i,h;if(pa){t.dom.getParent(e,function(n){if(n!=e)p.push(n.nodeName);});h='';for(i=0;i<p.length;i++)h+='</'+p[i]+'>';h+=t.dom.getOuterHTML(e);for(i=p.length-1;i>=0;i--)h+='<'+p[i]+'>';ta.push(h);e.parentNode.replaceChild(d.createComment('mcetable:'+(ta.length-1)),e);}});t.dom.setHTML(o.node,o.node.innerHTML.replace(/<!--mcetable:([0-9]+)-->/g,function(a,b){return ta[parseInt(b)];}));});}},setEntities:function(s){var t=this,a,i,l={},re='',v;if(t.entityLookup)return;a=s.split(',');for(i=0;i<a.length;i+=2){v=a[i];if(v==34||v==38||v==60||v==62)continue;l[String.fromCharCode(a[i])]=a[i+1];v=parseInt(a[i]).toString(16);re+='\\u'+'0000'.substring(v.length)+v;}if(!re){t.settings.entity_encoding='raw';return;}t.entitiesRE=new RegExp('['+re+']','g');t.entityLookup=l;},setValidChildRules:function(s){this.childRules=null;this.addValidChildRules(s);},addValidChildRules:function(s){var t=this,inst,intr,bloc;if(!s)return;inst='A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';intr='A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';bloc='H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';each(s.split(','),function(s){var p=s.split(/\[|\]/),re;s='';each(p[1].split('|'),function(v){if(s)s+='|';switch(v){case'%itrans':v=intr;break;case'%itrans_na':v=intr.substring(2);break;case'%istrict':v=inst;break;case'%istrict_na':v=inst.substring(2);break;case'%btrans':v=bloc;break;case'%bstrict':v=bloc;break;}s+=v;});re=new RegExp('^('+s.toLowerCase()+')$','i');each(p[0].split('/'),function(s){t.childRules=t.childRules||{};t.childRules[s]=re;});});s='';each(t.childRules,function(v,k){if(s)s+='|';s+=k;});t.parentElementsRE=new RegExp('^('+s.toLowerCase()+')$','i');},setRules:function(s){var t=this;t._setup();t.rules={};t.wildRules=[];t.validElements={};return t.addRules(s);},addRules:function(s){var t=this,dr;if(!s)return;t._setup();each(s.split(','),function(s){var p=s.split(/\[|\]/),tn=p[0].split('/'),ra,at,wat,va=[];if(dr)at=tinymce.extend([],dr.attribs);if(p.length>1){each(p[1].split('|'),function(s){var ar={},i;at=at||[];s=s.replace(/::/g,'~');s=/^([!\-])?([\w*.?~]+|)([=:<])?(.+)?$/.exec(s);s[2]=s[2].replace(/~/g,':');if(s[1]=='!'){ra=ra||[];ra.push(s[2]);}if(s[1]=='-'){for(i=0;i<at.length;i++){if(at[i].name==s[2]){at.splice(i,1);return;}}}switch(s[3]){case'=':ar.defaultVal=s[4]||'';break;case':':ar.forcedVal=s[4];break;case'<':ar.validVals=s[4].split('?');break;}if(/[*.?]/.test(s[2])){wat=wat||[];ar.nameRE=new RegExp('^'+wildcardToRE(s[2])+'$');wat.push(ar);}else{ar.name=s[2];at.push(ar);}va.push(s[2]);});}each(tn,function(s,i){var pr=s.charAt(0),x=1,ru={};if(dr){if(dr.noEmpty)ru.noEmpty=dr.noEmpty;if(dr.fullEnd)ru.fullEnd=dr.fullEnd;if(dr.padd)ru.padd=dr.padd;}switch(pr){case'-':ru.noEmpty=true;break;case'+':ru.fullEnd=true;break;case'#':ru.padd=true;break;default:x=0;}tn[i]=s=s.substring(x);t.validElements[s]=1;if(/[*.?]/.test(tn[0])){ru.nameRE=new RegExp('^'+wildcardToRE(tn[0])+'$');t.wildRules=t.wildRules||{};t.wildRules.push(ru);}else{ru.name=tn[0];if(tn[0]=='@')dr=ru;t.rules[s]=ru;}ru.attribs=at;if(ra)ru.requiredAttribs=ra;if(wat){s='';each(va,function(v){if(s)s+='|';s+='('+wildcardToRE(v)+')';});ru.validAttribsRE=new RegExp('^'+s.toLowerCase()+'$');ru.wildAttribs=wat;}});});s='';each(t.validElements,function(v,k){if(s)s+='|';if(k!='@')s+=k;});t.validElementsRE=new RegExp('^('+wildcardToRE(s.toLowerCase())+')$');},findRule:function(n){var t=this,rl=t.rules,i,r;t._setup();r=rl[n];if(r)return r;rl=t.wildRules;for(i=0;i<rl.length;i++){if(rl[i].nameRE.test(n))return rl[i];}return null;},findAttribRule:function(ru,n){var i,wa=ru.wildAttribs;for(i=0;i<wa.length;i++){if(wa[i].nameRE.test(n))return wa[i];}return null;},serialize:function(n,o){var h,t=this;t._setup();o=o||{};o.format=o.format||'html';t.processObj=o;n=n.cloneNode(true);t.key=''+(parseInt(t.key)+1);if(!o.no_events){o.node=n;t.onPreProcess.dispatch(t,o);}t.writer.reset();t._serializeNode(n,o.getInner);o.content=t.writer.getContent();if(!o.no_events)t.onPostProcess.dispatch(t,o);t._postProcess(o);o.node=null;return tinymce.trim(o.content);},_postProcess:function(o){var t=this,s=t.settings,h=o.content,sc=[],p,l;if(o.format=='html'){p=t._protect({content:h,patterns:[/(<script[^>]*>)(.*?)(<\/script>)/g,/(<style[^>]*>)(.*?)(<\/style>)/g,/(<pre[^>]*>)(.*?)(<\/pre>)/g]});h=p.content;if(s.entity_encoding!=='raw'){if(s.entity_encoding.indexOf('named')!=-1){t.setEntities(s.entities);l=t.entityLookup;h=h.replace(t.entitiesRE,function(a){var v;if(v=l[a])a='&'+v+';';return a;});}if(s.entity_encoding.indexOf('numeric')!=-1){h=h.replace(/[\u007E-\uFFFF]/g,function(a){return'&#'+a.charCodeAt(0)+';';});}}if(o.set)h=h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g,'<p><br /></p>');else h=h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g,'<p>$1</p>');if(!o.set){if(s.remove_linebreaks){h=h.replace(/(<[^>]+>)\s+/g,'$1 ');h=h.replace(/\s+(<\/[^>]+>)/g,' $1');h=h.replace(/<(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,'<$1 $2>');h=h.replace(/<(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,'<$1>');h=h.replace(/\s+<\/(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,'</$1>');}if(s.apply_source_formatting&&s.indent_mode=='simple'){h=h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,'\n<$1$2$3>\n');h=h.replace(/\s*<(p|h[1-6]|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,'\n<$1$2>');h=h.replace(/<\/(p|h[1-6]|div|title|style|pre|script|td|li)>\s*/g,'</$1>\n');h=h.replace(/\n\n/g,'\n');}}h=t._unprotect(h,p);}o.content=h;},_serializeNode:function(n,inn){var t=this,s=t.settings,w=t.writer,hc,el,cn,i,l,a,at,no,v,nn,ru,ar,iv;if(!s.node_filter||s.node_filter(n)){switch(n.nodeType){case 1:if(n.hasAttribute?n.hasAttribute('mce_bogus'):n.getAttribute('mce_bogus'))return;iv=false;hc=n.hasChildNodes();nn=n.getAttribute('mce_name')||n.nodeName.toLowerCase();if(isIE){if(n.scopeName!=='HTML'&&n.scopeName!=='html')nn=n.scopeName+':'+nn;}if(nn.indexOf('mce:')===0)nn=nn.substring(4);if(!t.validElementsRE.test(nn)||(t.invalidElementsRE&&t.invalidElementsRE.test(nn))||inn){iv=true;break;}if(isIE){if(s.fix_content_duplication){if(n.mce_serialized==t.key)return;n.mce_serialized=t.key;}if(nn.charAt(0)=='/')nn=nn.substring(1);}if(t.childRules){if(t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(nn)){iv=true;break;}}t.elementName=nn;}ru=t.findRule(nn);nn=ru.name||nn;if((!hc&&ru.noEmpty)||(isIE&&!nn)){iv=true;break;}if(ru.requiredAttribs){a=ru.requiredAttribs;for(i=a.length-1;i>=0;i--){if(this.dom.getAttrib(n,a[i])!=='')break;}if(i==-1){iv=true;break;}}w.writeStartElement(nn);if(ru.attribs){for(i=0,at=ru.attribs,l=at.length;i<l;i++){a=at[i];v=t._getAttrib(n,a);if(v!==null)w.writeAttribute(a.name,v);}}if(ru.validAttribsRE){at=isIE?getIEAtts(n):n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified){a=no.nodeName.toLowerCase();if(s.invalid_attrs.test(a)||!ru.validAttribsRE.test(a))continue;ar=t.findAttribRule(ru,a);v=t._getAttrib(n,ar,a);if(v!==null)w.writeAttribute(a,v);}}}if(!hc&&ru.padd)w.writeText('\u00a0');break;case 3:if(t.childRules&&t.parentElementsRE.test(t.elementName)){if(!t.childRules[t.elementName].test(n.nodeName))return;}return w.writeText(n.nodeValue);case 4:return w.writeCDATA(n.nodeValue);case 8:return w.writeComment(n.nodeValue);}}else if(n.nodeType==1)hc=n.hasChildNodes();if(hc){cn=n.firstChild;while(cn){t._serializeNode(cn);t.elementName=nn;cn=cn.nextSibling;}}if(!iv){if(hc||!s.closed.test(nn))w.writeFullEndElement();else w.writeEndElement();}},_protect:function(o){o.items=o.items||[];function enc(s){return s.replace(/[\r\n]/g,function(c){if(c==='\n')return'\\n';return'\\r';});};function dec(s){return s.replace(/\\[rn]/g,function(c){if(c==='\\n')return'\n';return'\r';});};each(o.patterns,function(p){o.content=dec(enc(o.content).replace(p,function(x,a,b,c){o.items.push(dec(b));return a+'<!--mce:'+(o.items.length-1)+'-->'+c;}));});return o;},_unprotect:function(h,o){h=h.replace(/\<!--mce:([0-9]+)--\>/g,function(a,b){return o.items[parseInt(b)];});o.items=[];return h;},_setup:function(){var t=this,s=this.settings;if(t.done)return;t.done=1;t.setRules(s.valid_elements);t.addRules(s.extended_valid_elements);t.addValidChildRules(s.valid_child_elements);if(s.invalid_elements)t.invalidElementsRE=new RegExp('^('+wildcardToRE(s.invalid_elements.replace(',','|').toLowerCase())+')$');if(s.attrib_value_filter)t.attribValueFilter=s.attribValueFilter;},_getAttrib:function(n,a,na){var i,v;na=na||a.name;if(a.forcedVal&&(v=a.forcedVal)){if(v==='{$uid}')return this.dom.uniqueId();return v;}v=this.dom.getAttrib(n,na);switch(na){case'rowspan':case'colspan':if(v=='1')v='';break;}if(this.attribValueFilter)v=this.attribValueFilter(na,v,n);if(a.validVals){for(i=a.validVals.length-1;i>=0;i--){if(v==a.validVals[i])break;}if(i==-1)return null;}if(v===''&&typeof(a.defaultVal)!='undefined'){v=a.defaultVal;if(v==='{$uid}')return this.dom.uniqueId();return v;}else{if(na=='class'&&this.processObj.get)v=v.replace(/\bmceItem\w+\b/g,'');}if(v==='')return null;return v;}});})();(function(){var each=tinymce.each;tinymce.create('tinymce.dom.ScriptLoader',{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={};},markDone:function(u){this.lookup[u]={state:2,url:u};},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2)cb.call(s||this);return o;}o={state:0,url:u,func:cb,scope:s||this};if(pr)t.queue.unshift(o);else t.queue.push(o);lo[u]=o;return o;},load:function(u,cb,s){var t=this,o;function loadScript(u){if(tinymce.dom.Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:u,error:t.settings.error,async:false,success:function(co){t.eval(co);}});}else document.write('<script type="text/javascript" src="'+u+'"></script>');};if(!tinymce.is(u,'string')){each(u,function(u){loadScript(u);});if(cb)cb.call(s||t);}else{loadScript(u);if(cb)cb.call(s||t);}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb)cb.call(s||t);each(t.queueCallbacks,function(o){o.func.call(o.scope);});});}else if(cb)t.queueCallbacks.push({func:cb,scope:s||t});},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co);}catch(ex){eval(co,w);}}else w.execScript(co);},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func)o.func.call(o.scope||t);};function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--;}else load(o);});if(l===0&&cb){cb.call(s||t);cb=0;}};function load(o){if(o.state>0)return;o.state=1;tinymce.util.XHR.send({url:o.url,error:t.settings.error,success:function(co){t.eval(co);done(o);allDone();}});};each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o);}else o=lo[u];if(o.state>0)return;if(!tinymce.dom.Event.domLoaded&&!t.settings.strict_mode){var ix,ol='';if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone();});if(tinymce.isIE)ol=' onreadystatechange="';else ol=' onload="';ol+='tinymce.dom.ScriptLoader._onLoad(this,\''+u+'\','+ix+');"';}document.write('<script type="text/javascript" src="'+u+'"'+ol+'></script>');if(!o.func)done(o);}else load(o);});allDone();},'static':{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1;},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=='complete')this._funcs[ix].call(this);}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader();})();(function(){var DOM=tinymce.DOM,is=tinymce.is;tinymce.create('tinymce.ui.Control',{Control:function(id,s){this.id=id;this.settings=s=s||{};this.rendered=false;this.onRender=new tinymce.util.Dispatcher(this);this.classPrefix='';this.scope=s.scope||this;this.disabled=0;this.active=0;},setDisabled:function(s){var e;if(s!=this.disabled){e=DOM.get(this.id);if(e&&this.settings.unavailable_prefix){if(s){this.prevTitle=e.title;e.title=this.settings.unavailable_prefix+": "+e.title;}else e.title=this.prevTitle;}this.setState('Disabled',s);this.setState('Enabled',!s);this.disabled=s;}},isDisabled:function(){return this.disabled;},setActive:function(s){if(s!=this.active){this.setState('Active',s);this.active=s;}},isActive:function(){return this.active;},setState:function(c,s){var n=DOM.get(this.id);c=this.classPrefix+c;if(s)DOM.addClass(n,c);else DOM.removeClass(n,c);},isRendered:function(){return this.rendered;},renderHTML:function(){},renderTo:function(n){DOM.setHTML(n,this.renderHTML());},postRender:function(){var t=this,b;if(is(t.disabled)){b=t.disabled;t.disabled=-1;t.setDisabled(b);}if(is(t.active)){b=t.active;t.active=-1;t.setActive(b);}},destroy:function(){DOM.remove(this.id);}});})();tinymce.create('tinymce.ui.Container:tinymce.ui.Control',{Container:function(id,s){this.parent(id,s);this.controls=[];this.lookup={};},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c;},get:function(n){return this.lookup[n];}});tinymce.create('tinymce.ui.Separator:tinymce.ui.Control',{renderHTML:function(){return tinymce.DOM.createHTML('span',{'class':'mceSeparator'});}});(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control',{MenuItem:function(id,s){this.parent(id,s);this.classPrefix='mceMenuItem';},setSelected:function(s){this.setState('Selected',s);this.selected=s;},isSelected:function(){return this.selected;},postRender:function(){var t=this;t.parent();if(is(t.selected))t.setSelected(t.selected);}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,walk=tinymce.walk;tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem',{Menu:function(id,s){var t=this;t.parent(id,s);t.items={};t.collapsed=false;t.menuCount=0;t.onAddItem=new tinymce.util.Dispatcher(this);},expand:function(d){var t=this;if(d){walk(t,function(o){if(o.expand)o.expand();},'items',t);}t.collapsed=false;},collapse:function(d){var t=this;if(d){walk(t,function(o){if(o.collapse)o.collapse();},'items',t);}t.collapsed=true;},isCollapsed:function(){return this.collapsed;},add:function(o){if(!o.settings)o=new tinymce.ui.MenuItem(o.id||DOM.uniqueId(),o);this.onAddItem.dispatch(this,o);return this.items[o.id]=o;},addSeparator:function(){return this.add({separator:true});},addMenu:function(o){if(!o.collapse)o=this.createMenu(o);this.menuCount++;return this.add(o);},hasMenus:function(){return this.menuCount!==0;},remove:function(o){delete this.items[o.id];},removeAll:function(){var t=this;walk(t,function(o){if(o.removeAll)o.removeAll();o.destroy();},'items',t);t.items={};},createMenu:function(o){var m=new tinymce.ui.Menu(o.id||DOM.uniqueId(),o);m.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return m;}});})();(function(){var is=tinymce.is,DOM=tinymce.DOM,each=tinymce.each,Event=tinymce.dom.Event,Element=tinymce.dom.Element;tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu',{DropMenu:function(id,s){s=s||{};s.container=s.container||document.body;s.offset_x=s.offset_x||0;s.offset_y=s.offset_y||0;s.vp_offset_x=s.vp_offset_x||0;s.vp_offset_y=s.vp_offset_y||0;if(is(s.icons)&&!s.icons)s['class']+=' noIcons';this.parent(id,s);this.onHideMenu=new tinymce.util.Dispatcher(this);this.classPrefix='mceMenu';},createMenu:function(s){var t=this,cs=t.settings,m;s.container=s.container||cs.container;s.parent=t;s.constrain=s.constrain||cs.constrain;s['class']=s['class']||cs['class'];s.vp_offset_x=s.vp_offset_x||cs.vp_offset_x;s.vp_offset_y=s.vp_offset_y||cs.vp_offset_y;m=new tinymce.ui.DropMenu(s.id||DOM.uniqueId(),s);m.onAddItem.add(t.onAddItem.dispatch,t.onAddItem);return m;},update:function(){var t=this,s=t.settings,tb=DOM.get('menu_'+t.id+'_tbl'),co=DOM.get('menu_'+t.id+'_co'),tw,th;tw=s.max_width?Math.min(tb.clientWidth,s.max_width):tb.clientWidth;th=s.max_height?Math.min(tb.clientHeight,s.max_height):tb.clientHeight;if(!DOM.boxModel)t.element.setStyles({width:tw+2,height:th+2});else t.element.setStyles({width:tw,height:th});if(s.max_width)DOM.setStyle(co,'width',tw);if(s.max_height){DOM.setStyle(co,'height',th);if(tb.clientHeight<s.max_height)DOM.setStyle(co,'overflow','hidden');}},showMenu:function(x,y,px){var t=this,s=t.settings,co,vp=DOM.getViewPort(),w,h,mx,my,ot=2,dm,tb;t.collapse(1);if(t.isMenuVisible)return;if(!t.rendered){co=DOM.add(t.settings.container,t.renderNode());each(t.items,function(o){o.postRender();});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});}else co=DOM.get('menu_'+t.id);DOM.setStyles(co,{left:-0xFFFF,top:-0xFFFF});DOM.show(co);t.update();x+=s.offset_x||0;y+=s.offset_y||0;vp.w-=4;vp.h-=4;if(s.constrain){w=co.clientWidth-ot;h=co.clientHeight-ot;mx=vp.x+vp.w;my=vp.y+vp.h;if((x+s.vp_offset_x+w)>mx)x=px?px-w:Math.max(0,(mx-s.vp_offset_x)-w);if((y+s.vp_offset_y+h)>my)y=Math.max(0,(my-s.vp_offset_y)-h);}DOM.setStyles(co,{left:x,top:y});t.element.update();t.isMenuVisible=1;t.mouseClickFunc=Event.add(co,'click',function(e){var m;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))&&!DOM.hasClass(e,'mceMenuItemSub')){m=t.items[e.id];if(m.isDisabled())return;if(m.settings.onclick)m.settings.onclick(e);dm=t;while(dm){if(dm.hideMenu)dm.hideMenu();dm=dm.settings.parent;}return Event.cancel(e);}});if(t.hasMenus()){t.mouseOverFunc=Event.add(co,'mouseover',function(e){var m,r,mi;e=e.target;if(e&&(e=DOM.getParent(e,'TR'))){m=t.items[e.id];if(t.lastMenu)t.lastMenu.collapse(1);if(m.isDisabled())return;if(e&&DOM.hasClass(e,'mceMenuItemSub')){r=DOM.getRect(e);m.showMenu((r.x+r.w-ot),r.y-ot,r.x);t.lastMenu=m;DOM.addClass(DOM.get(m.id).firstChild,'mceMenuItemActive');}}});}},hideMenu:function(c){var t=this,co=DOM.get('menu_'+t.id),e;if(!t.isMenuVisible)return;Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);DOM.hide(co);t.isMenuVisible=0;if(!c)t.collapse(1);if(t.element)t.element.hide();if(e=DOM.get(t.id))DOM.removeClass(e.firstChild,'mceMenuItemActive');t.onHideMenu.dispatch(t);},add:function(o){var t=this,co;o=t.parent(o);if(t.isRendered&&(co=DOM.get('menu_'+t.id)))t._add(DOM.select('tbody',co)[0],o);return o;},collapse:function(d){this.parent(d);this.hideMenu(1);},remove:function(o){DOM.remove(o.id);return this.parent(o);},destroy:function(){var t=this,co=DOM.get('menu_'+t.id);Event.remove(co,'mouseover',t.mouseOverFunc);Event.remove(co,'click',t.mouseClickFunc);if(t.element)t.element.remove();DOM.remove(co);},renderNode:function(){var t=this,s=t.settings,n,tb,co,w;w=DOM.create('div',{id:'menu_'+t.id,'class':s['class'],'style':'position:absolute;left:0;top:0;z-index:150'});co=DOM.add(w,'div',{id:'menu_'+t.id+'_co','class':'mceMenu'+(s['class']?' '+s['class']:'')});t.element=new Element('menu_'+t.id,{blocker:1,container:s.container});if(s.menu_line)DOM.add(co,'span',{'class':'mceMenuLine'});n=DOM.add(co,'table',{id:'menu_'+t.id+'_tbl',border:0,cellPadding:0,cellSpacing:0});tb=DOM.add(n,'tbody');each(t.items,function(o){t._add(tb,o);});t.rendered=true;return w;},_add:function(tb,o){var n,s=o.settings,a,ro,it;if(s.separator){ro=DOM.add(tb,'tr',{id:o.id,'class':'mceMenuItemSeparator'});DOM.add(ro,'td',{'class':'mceMenuItemSeparator'});if(n=ro.previousSibling)DOM.addClass(n,'last');return;}n=ro=DOM.add(tb,'tr',{id:o.id,'class':'mceMenuItem mceMenuItemEnabled'});n=it=DOM.add(n,'td');n=a=DOM.add(n,'a',{href:'javascript:;',onclick:"return false;",onmousedown:'return false;'});DOM.addClass(it,s['class']);DOM.add(n,'span',{'class':'icon'+(s.icon?' '+s.icon:'')});n=DOM.add(n,s.element||'span',{'class':'text',title:o.settings.title},o.settings.title);if(o.settings.style)DOM.setAttrib(n,'style',o.settings.style);if(tb.childNodes.length==1)DOM.addClass(ro,'first');if((n=ro.previousSibling)&&DOM.hasClass(n,'mceMenuItemSeparator'))DOM.addClass(ro,'first');if(o.collapse)DOM.addClass(ro,'mceMenuItemSub');if(n=ro.previousSibling)DOM.removeClass(n,'last');DOM.addClass(ro,'last');}});})();(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.ui.Button:tinymce.ui.Control',{Button:function(id,s){this.parent(id,s);this.classPrefix='mceButton';},renderHTML:function(){var s=this.settings,h='<a id="'+this.id+'" href="javascript:;" class="mceButton mceButtonEnabled '+s['class']+'" onmousedown="return false;" onclick="return false;" title="'+DOM.encode(s.title)+'">';if(s.image)h+='<img class="icon" src="'+s.image+'" /></a>';else h+='<span class="icon '+s['class']+'"></span></a>';return h;},postRender:function(){var t=this,s=t.settings;tinymce.dom.Event.add(t.id,'click',function(e){if(!t.isDisabled())return s.onclick.call(s.scope,e);});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control',{ListBox:function(id,s){var t=this;t.parent(id,s);t.items=[];t.onChange=new Dispatcher(t);t.onPostRender=new Dispatcher(t);t.onAdd=new Dispatcher(t);t.onRenderMenu=new tinymce.util.Dispatcher(this);t.classPrefix='mceListBox';},select:function(v){var t=this,e,fv;if(v!=t.selectedValue){e=DOM.get(t.id+'_text');t.selectedValue=v;each(t.items,function(o){if(o.value==v){DOM.setHTML(e,DOM.encode(o.title));fv=1;return false;}});if(!fv){DOM.setHTML(e,DOM.encode(t.settings.title));DOM.addClass(e,'title');e=0;return;}else DOM.removeClass(e,'title');}e=0;},add:function(n,v,o){var t=this;o=o||{};o=tinymce.extend(o,{title:n,value:v});t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return this.items.length;},renderHTML:function(){var h='',t=this,s=t.settings;h='<table id="'+t.id+'" cellpadding="0" cellspacing="0" class="mceListBox mceListBoxEnabled'+(s['class']?(' '+s['class']):'')+'"><tbody><tr>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_text',href:'javascript:;','class':'text',onclick:"return false;",onmousedown:'return false;'},DOM.encode(t.settings.title))+'</td>';h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'open',onclick:"return false;",onmousedown:'return false;'},'<span></span>')+'</td>';h+='</tr></tbody></table>';return h;},showMenu:function(){var t=this,p1,p2,e=DOM.get(this.id),m;if(t.isDisabled()||t.items.length==0)return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(this.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;if(t.oldID)m.items[t.oldID].setSelected(0);each(t.items,function(o){if(o.value===t.selectedValue){m.items[o.id].setSelected(1);t.oldID=o.id;}});m.showMenu(0,e.clientHeight);Event.add(document,'mousedown',t.hideMenu,t);DOM.addClass(t.id,'mceListBoxSelected');},hideMenu:function(e){var t=this;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){DOM.removeClass(t.id,'mceListBoxSelected');Event.remove(document,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':'mceListBoxMenu noIcons',max_width:150,max_height:150});m.onHideMenu.add(t.hideMenu,t);m.add({title:t.settings.title,'class':'mceMenuItemTitle'}).setDisabled(1);each(t.items,function(o){o.id=DOM.uniqueId();o.onclick=function(){if(t.settings.onselect(o.value)!==false)t.select(o.value);};m.add(o);});t.onRenderMenu.dispatch(t,m);t.menu=m;},postRender:function(){var t=this;Event.add(t.id,'click',t.showMenu,t);if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceListBoxDisabled'))DOM.addClass(t.id,'mceListBoxHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceListBoxDisabled'))DOM.removeClass(t.id,'mceListBoxHover');});}t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,Dispatcher=tinymce.util.Dispatcher;tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox',{NativeListBox:function(id,s){this.parent(id,s);this.classPrefix='mceNativeListBox';},setDisabled:function(s){DOM.get(this.id).disabled=s;},isDisabled:function(){return DOM.get(this.id).disabled;},select:function(v){var e=DOM.get(this.id),ol=e.options;v=''+(v||'');e.selectedIndex=0;each(ol,function(o,i){if(o.value==v){e.selectedIndex=i;return false;}});},add:function(n,v,a){var o,t=this;a=a||{};a.value=v;if(t.isRendered())DOM.add(DOM.get(this.id),'option',a,n);o={title:n,value:v,attribs:a};t.items.push(o);t.onAdd.dispatch(t,o);},getLength:function(){return DOM.get(this.id).options.length-1;},renderHTML:function(){var h,t=this;h=DOM.createHTML('option',{value:''},'-- '+t.settings.title+' --');each(t.items,function(it){h+=DOM.createHTML('option',{value:it.value},it.title);});h=DOM.createHTML('select',{id:t.id,'class':'mceNativeListBox'},h);return h;},postRender:function(){var t=this,ch;t.rendered=true;function onChange(e){var v=e.target.options[e.target.selectedIndex].value;t.onChange.dispatch(t,v);if(t.settings.onselect)t.settings.onselect(v);};Event.add(t.id,'change',onChange);Event.add(t.id,'keydown',function(e){var bf;Event.remove(t.id,'change',ch);bf=Event.add(t.id,'blur',function(){Event.add(t.id,'change',onChange);Event.remove(t.id,'blur',bf);});if(e.keyCode==13||e.keyCode==32){onChange(e);return Event.cancel(e);}});t.onPostRender.dispatch(t,DOM.get(t.id));}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button',{MenuButton:function(id,s){this.parent(id,s);this.onRenderMenu=new tinymce.util.Dispatcher(this);s.menu_container=s.menu_container||document.body;},showMenu:function(){var t=this,p1,p2,e=DOM.get(t.id),m;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}p1=DOM.getPos(t.settings.menu_container);p2=DOM.getPos(e);m=t.menu;m.settings.offset_x=p2.x;m.settings.offset_y=p2.y;m.settings.vp_offset_x=p2.x;m.settings.vp_offset_y=p2.y;m.showMenu(0,e.clientHeight);Event.add(document,'mousedown',t.hideMenu,t);t.setState('Selected',1);},renderMenu:function(){var t=this,m;m=t.settings.control_manager.createDropMenu(t.id+'_menu',{menu_line:1,'class':this.classPrefix+'Menu',icons:t.settings.icons});m.onHideMenu.add(t.hideMenu,t);t.onRenderMenu.dispatch(t,m);t.menu=m;},hideMenu:function(e){var t=this;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceMenu');})){t.setState('Selected',0);Event.remove(document,'mousedown',t.hideMenu,t);if(t.menu)t.menu.hideMenu();}},postRender:function(){var t=this,s=t.settings;Event.add(t.id,'click',function(){if(!t.isDisabled()){if(s.onclick)s.onclick(t.value);t.showMenu();}});}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each;tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton',{SplitButton:function(id,s){this.parent(id,s);this.classPrefix='mceSplitButton';},renderHTML:function(){var h,t=this,s=t.settings,h1;h='<tbody><tr>';if(s.image)h1=DOM.createHTML('img ',{src:s.image,'class':'action '+s['class']});else h1=DOM.createHTML('span',{'class':'action '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_action',href:'javascript:;','class':'action '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h1=DOM.createHTML('span',{'class':'open '+s['class']});h+='<td>'+DOM.createHTML('a',{id:t.id+'_open',href:'javascript:;','class':'open '+s['class'],onclick:"return false;",onmousedown:'return false;',title:s.title},h1)+'</td>';h+='</tr></tbody>';return DOM.createHTML('table',{id:t.id,'class':'mceSplitButton mceSplitButtonEnabled '+s['class'],cellpadding:'0',cellspacing:'0',onmousedown:'return false;',title:s.title},h);},postRender:function(){var t=this,s=t.settings;if(s.onclick){Event.add(t.id+'_action','click',function(){if(!t.isDisabled())s.onclick(t.value);});}Event.add(t.id+'_open','click',t.showMenu,t);if(tinymce.isIE6||!DOM.boxModel){Event.add(t.id,'mouseover',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.addClass(t.id,'mceSplitButtonHover');});Event.add(t.id,'mouseout',function(){if(!DOM.hasClass(t.id,'mceSplitButtonDisabled'))DOM.removeClass(t.id,'mceSplitButtonHover');});}}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,is=tinymce.is,each=tinymce.each;tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton',{ColorSplitButton:function(id,s){var t=this;t.parent(id,s);t.settings=s=tinymce.extend({colors:'000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',grid_width:8,default_color:'#888888'},t.settings);t.value=s.default_color;},showMenu:function(){var t=this,r,p,e;if(t.isDisabled())return;if(!t.isMenuRendered){t.renderMenu();t.isMenuRendered=true;}e=DOM.get(t.id);DOM.show(t.id+'_menu');DOM.addClass(e,'mceSplitButtonSelected');p2=DOM.getPos(e);DOM.setStyles(t.id+'_menu',{left:p2.x,top:p2.y+e.clientHeight,zIndex:150});e=0;Event.add(document,'mousedown',t.hideMenu,t);},hideMenu:function(e){var t=this;if(!e||!DOM.getParent(e.target,function(n){return DOM.hasClass(n,'mceSplitButtonMenu');})){DOM.removeClass(t.id,'mceSplitButtonSelected');Event.remove(document,'mousedown',t.hideMenu,t);DOM.hide(t.id+'_menu');}},renderMenu:function(){var t=this,m,i=0,s=t.settings,n,tb,tr,w;w=DOM.add(s.menu_container,'div',{id:t.id+'_menu','class':s['menu_class']+' '+s['class'],style:'position:absolute;left:0;top:-1000px;'});m=DOM.add(w,'div',{'class':s['class']+' mceSplitButtonMenu'});DOM.add(m,'span',{'class':'mceMenuLine'});n=DOM.add(m,'table',{'class':'mceColorSplitMenu'});tb=DOM.add(n,'tbody');i=0;each(is(s.colors,'array')?s.colors:s.colors.split(','),function(c){c=c.replace(/^#/,'');if(!i--){tr=DOM.add(tb,'tr');i=s.grid_width-1;}n=DOM.add(tr,'td');n=DOM.add(n,'a',{href:'javascript:;',style:{backgroundColor:'#'+c}});Event.add(n,'mousedown',function(){t.setColor('#'+c);});});if(s.more_colors_func){n=DOM.add(tb,'tr');n=DOM.add(n,'td',{colspan:s.grid_width,'class':'morecolors'});n=DOM.add(n,'a',{href:'javascript:;',onclick:'return false;','class':'morecolors'},s.more_colors_title);Event.add(n,'click',function(e){s.more_colors_func.call(s.more_colors_scope||this);return Event.cancel(e);});}DOM.addClass(m,'mceColorSplitMenu');return w;},setColor:function(c){var t=this,p,s=this.settings,co=s.menu_container,po,cp,id=t.id+'_preview';if(!(p=DOM.get(id))){DOM.setStyle(t.id+'_action','position','relative');p=DOM.add(t.id+'_action','div',{id:id,'class':'mceColorPreview'});}p.style.backgroundColor=c;t.value=c;t.hideMenu();s.onselect(c);}});})();tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container',{renderHTML:function(){var t=this,h='',c='mceToolbarEnd',co,dom=tinymce.DOM,s=t.settings;h+=dom.createHTML('td',{'class':'mceToolbarStart'},dom.createHTML('span',null,'<!-- IE -->'));tinymce.each(t.controls,function(c){h+='<td>'+c.renderHTML()+'</td>';});co=t.controls[t.controls.length-1].constructor;if(co===tinymce.ui.Button)c+=' mceToolbarEndButton';else if(co===tinymce.ui.SplitButton)c+=' mceToolbarEndSplitButton';else if(co===tinymce.ui.ListBox)c+=' mceToolbarEndListBox';h+=dom.createHTML('td',{'class':c},dom.createHTML('span',null,'<!-- IE -->'));return dom.createHTML('table',{id:t.id,'class':'mceToolbar'+(s['class']?' '+s['class']:''),cellpadding:'0',cellspacing:'0',align:t.settings.align||''},'<tbody><tr>'+h+'</tr></tbody>');}});(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each;tinymce.create('tinymce.AddOnManager',{items:[],urls:{},lookup:{},onAdd:new Dispatcher(this),get:function(n){return this.lookup[n];},requireLangPack:function(n){var u,s;if(tinymce.EditorManager.settings){u=this.urls[n]+'/langs/'+tinymce.EditorManager.settings.language+'.js';s=tinymce.EditorManager.settings;if(s){if(!tinymce.dom.Event.domLoaded&&!s.strict_mode)tinymce.ScriptLoader.load(u);else tinymce.ScriptLoader.add(u);}}},add:function(id,o){this.items.push(o);this.lookup[id]=o;this.onAdd.dispatch(this,id,o);return o;},load:function(n,u,cb,s){if(u.indexOf('/')!=0&&u.indexOf('://')==-1)u=tinymce.baseURL+'/'+u;this.urls[n]=u.substring(0,u.lastIndexOf('/'));tinymce.ScriptLoader.add(u,cb,s);}});tinymce.PluginManager=new tinymce.AddOnManager();tinymce.ThemeManager=new tinymce.AddOnManager();}());(function(){var each=tinymce.each,extend=tinymce.extend,DOM=tinymce.DOM,Event=tinymce.dom.Event,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager;tinymce.create('static tinymce.EditorManager',{editors:{},i18n:{},activeEditor:null,init:function(s){var t=this,pl,sl=tinymce.ScriptLoader;function execCallback(se,n,s){var f=se[n];if(!f)return;if(tinymce.is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);}return f.apply(s||this,Array.prototype.slice.call(arguments,2));};s=extend({theme:"simple",language:"en",strict_loading_mode:document.contentType=='application/xhtml+xml'},s);t.settings=s;if(!Event.domLoaded&&!s.strict_loading_mode){if(s.language)sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme&&s.theme.charAt(0)!='-')ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');if(s.plugins){pl=s.plugins.split(',');if(tinymce.inArray(pl,'compat2x')!=-1)PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');each(pl,function(v){if(v&&v.charAt(0)!='-'){if(!tinymce.isWebKit&&v=='safari')return;PluginManager.load(v,'plugins/'+v+'/editor_plugin'+tinymce.suffix+'.js');}});}sl.loadQueue();}Event.add(document,'init',function(){var l,co;execCallback(s,'onpageload');if(s.browsers){l=false;each(s.browsers.split(','),function(v){switch(v){case'ie':case'msie':if(tinymce.isIE)l=true;break;case'gecko':if(tinymce.isGecko)l=true;break;case'safari':case'webkit':if(tinymce.isWebKit)l=true;break;case'opera':if(tinymce.isOpera)l=true;break;}});if(!l)return;}switch(s.mode){case"exact":l=s.elements||'';each(l.split(','),function(v){new tinymce.Editor(v,s).render();});break;case"textareas":function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(DOM.select('textarea'),function(v){if(s.editor_deselector&&hasClass(v,s.editor_deselector))return;if(!s.editor_selector||hasClass(v,s.editor_selector))new tinymce.Editor(v.id=(v.id||v.name||(v.id=DOM.uniqueId())),s).render();});break;}if(s.oninit){l=co=0;each(t.editors,function(ed){co++;if(!ed.initialized){ed.onInit.add(function(){l++;if(l==co)execCallback(s,'oninit');});}else l++;if(l==co)execCallback(s,'oninit');});}});},get:function(id){return this.editors[id];},getInstanceById:function(id){return this.get(id);},add:function(e){this.editors[e.id]=e;this._setActive(e);return e;},remove:function(e){var t=this;if(!t.editors[e.id])return null;delete t.editors[e.id];if(t.activeEditor==e){each(t.editors,function(e){t._setActive(e);return false;});}e._destroy();return e;},execCommand:function(c,u,v){var t=this,ed=t.get(v);switch(c){case"mceFocus":ed.focus();return true;case"mceAddEditor":case"mceAddControl":new tinymce.Editor(v,t.settings).render();return true;case"mceAddFrameControl":return true;case"mceRemoveEditor":case"mceRemoveControl":ed.remove();return true;case'mceToggleEditor':if(!ed){t.execCommand('mceAddControl',0,v);return true;}if(ed.isHidden())ed.show();else ed.hide();return true;}if(t.activeEditor)return t.activeEditor.execCommand(c,u,v);return false;},execInstanceCommand:function(id,c,u,v){var ed=this.get(id);if(ed)return ed.execCommand(c,u,v);return false;},triggerSave:function(){each(this.editors,function(e){e.save();});},addI18n:function(p,o){var lo,i18n=this.i18n;if(!tinymce.is(p,'string')){each(p,function(o,lc){each(o,function(o,g){each(o,function(o,k){if(g==='common')i18n[lc+'.'+k]=o;else i18n[lc+'.'+g+'.'+k]=o;});});});}else{each(o,function(o,k){i18n[p+'.'+k]=o;});}},_setActive:function(e){this.selectedInstance=this.activeEditor=e;}});tinymce.documentBaseURL=window.location.href.replace(/[\?#].*$/,'').replace(/[\/\\][^\/]+$/,'');if(!/[\/\\]$/.test(tinymce.documentBaseURL))tinymce.documentBaseURL+='/';tinymce.baseURL=new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);tinymce.EditorManager.baseURI=new tinymce.util.URI(tinymce.baseURL);})();var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,Dispatcher=tinymce.util.Dispatcher;var each=tinymce.each,isGecko=tinymce.isGecko,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit;var is=tinymce.is,ThemeManager=tinymce.ThemeManager,PluginManager=tinymce.PluginManager,EditorManager=tinymce.EditorManager;var inArray=tinymce.inArray,grep=tinymce.grep;tinymce.create('tinymce.Editor',{Editor:function(id,s){var t=this;t.id=t.editorId=id;t.execCommands={};t.queryStateCommands={};t.queryValueCommands={};t.plugins={};each(['onPreInit','onBeforeRenderUI','onPostRender','onInit','onRemove','onActivate','onDeactivate','onClick','onEvent','onMouseUp','onMouseDown','onDblClick','onKeyDown','onKeyUp','onKeyPress','onContextMenu','onSubmit','onReset','onPaste','onPreProcess','onPostProcess','onBeforeSetContent','onBeforeGetContent','onSetContent','onGetContent','onLoadContent','onSaveContent','onNodeChange','onChange','onBeforeExecCommand','onExecCommand','onUndo','onRedo','onVisualAid','onSetProgressState'],function(e){t[e]=new Dispatcher(t);});t.settings=s=extend({id:id,language:'en',docs_language:'en',theme:'simple',skin:'default',delta_width:0,delta_height:0,popup_css:'',plugins:'',document_base_url:tinymce.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:'mceItemTable',visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:'xx-small,x-small,small,medium,large,x-large,xx-large',apply_source_formatting:1,directionality:'ltr',forced_root_block:'p',valid_elements:'@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[type],map[name],area[shape|coords|href|alt|target]',hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,indentation:'30px'},s);t.documentBaseURI=new tinymce.util.URI(s.document_base_url||tinymce.documentBaseURL,{base_uri:tinyMCE.baseURI});t.baseURI=EditorManager.baseURI;t.execCallback('setup',t);},render:function(){var t=this,s=t.settings,id=t.id,sl=tinymce.ScriptLoader;if(!t.getElement())return;if(s.strict_loading_mode){sl.settings.strict_mode=s.strict_loading_mode;tinymce.DOM.settings.strict=1;}if(!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&s.hidden_input&&DOM.getParent(id,'form'))DOM.insertAfter(DOM.create('input',{type:'hidden',name:id}),id);t.windowManager=new tinymce.WindowManager(t);if(s.encoding=='xml'){t.onGetContent.add(function(ed,o){if(o.get)o.content=DOM.encode(o.content);});}if(s.add_form_submit_trigger){t.onSubmit.addToTop(function(){if(t.initialized){t.save();t.isNotDirty=1;}});}Event.add(document,'unload',function(){if(t.initialized&&!t.destroyed&&s.add_unload_trigger)t.save({format:'raw',no_events:true});});tinymce.addUnload(t._destroy,t);if(s.submit_patch){t.onBeforeRenderUI.add(function(){var n=t.getElement().form;if(!n)return;if(n._mceOldSubmit)return;if(!n.submit.nodeType){t.formElement=n;n._mceOldSubmit=n.submit;n.submit=function(){EditorManager.triggerSave();t.isNotDirty=1;return this._mceOldSubmit(this);};}n=null;});}function loadScripts(){sl.add(tinymce.baseURL+'/langs/'+s.language+'.js');if(s.theme.charAt(0)!='-')ThemeManager.load(s.theme,'themes/'+s.theme+'/editor_template'+tinymce.suffix+'.js');each(s.plugins.split(','),function(p){if(p&&p.charAt(0)!='-'){if(!isWebKit&&p=='safari')return;PluginManager.load(p,'plugins/'+p+'/editor_plugin'+tinymce.suffix+'.js');}});sl.loadQueue(function(){if(s.ask){function ask(){t.windowManager.confirm(t.getLang('edit_confirm'),function(s){if(s)t.init();else Event.remove(t.id,'focus',ask);});};Event.add(t.id,'focus',ask);return;}if(!t.removed)t.init();});};if(s.plugins.indexOf('compat2x')!=-1){PluginManager.load('compat2x','plugins/compat2x/editor_plugin'+tinymce.suffix+'.js');sl.loadQueue(loadScripts);}else loadScripts();},init:function(){var n,t=this,s=t.settings,w,h,e=t.getElement(),o,ti;EditorManager.add(t);s.theme=s.theme.replace(/-/,'');o=ThemeManager.get(s.theme);t.theme=new o();if(t.theme.init&&s.init_theme)t.theme.init(t,ThemeManager.urls[s.theme]||tinymce.documentBaseURL.replace(/\/$/,''));each(s.plugins.replace(/\-/g,'').split(','),function(p){var c=PluginManager.get(p),u=PluginManager.urls[p]||tinymce.documentBaseURL.replace(/\/$/,''),po;if(c){po=new c(t,u);t.plugins[p]=po;if(po.init)po.init(t,u);}});s.popup_css=t.baseURI.toAbsolute(s.popup_css||"themes/"+s.theme+"/skins/"+s.skin+"/dialog.css");if(s.popup_css_add)s.popup_css+=','+s.popup_css_add;t.controlManager=new tinymce.ControlManager(t);t.undoManager=new tinymce.UndoManager(t);t.undoManager.onAdd.add(function(um,l){return t.onChange.dispatch(t,l,um);});t.undoManager.onUndo.add(function(um,l){return t.onUndo.dispatch(t,l,um);});t.undoManager.onRedo.add(function(um,l){return t.onRedo.dispatch(t,l,um);});if(s.custom_undo_redo){t.onExecCommand.add(function(ed,cmd){if(cmd!='Undo'&&cmd!='Redo'&&cmd!='mceRepaint')t.undoManager.add();});}t.onExecCommand.add(function(ed,c){if(!/^(FontName|FontSize)$/.test(c))t.nodeChanged();});if(isGecko){function repaint(){t.execCommand('mceRepaint');};t.onUndo.add(repaint);t.onRedo.add(repaint);t.onSetContent.add(repaint);}t.onBeforeRenderUI.dispatch(t,t.controlManager);if(s.render_ui){w=s.width||e.style.width||e.clientWidth;h=s.height||e.style.height||e.clientHeight;t.orgDisplay=e.style.display;if((''+w).indexOf('%')==-1)w=Math.max(parseInt(w)+(o.deltaWidth||0),100);if((''+h).indexOf('%')==-1)h=Math.max(parseInt(h)+(o.deltaHeight||0),100);o=t.theme.renderUI({targetNode:e,width:w,height:h,deltaWidth:s.delta_width,deltaHeight:s.delta_height});t.editorContainer=o.editorContainer;}DOM.setStyles(o.sizeContainer||o.editorContainer,{width:w,height:h});h=(o.iframeHeight||h)+((h+'').indexOf('%')==-1?(o.deltaHeight||0):'');if(h<100)h=100;n=DOM.add(o.iframeContainer,'iframe',{id:s.id+"_ifr",src:'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(s.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(s.id),d=t.getDoc();d.open();d.write(s.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+t.documentBaseURI.getURI()+'" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body id="tinymce" class="mceContentBody"></body></html>');d.close();if(!isIE){try{d.designMode='On';}catch(ex){}}if(isIE)t.getBody().contentEditable=true;t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'<br />');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*<pre.*?>/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='<pre class="mceItemHidden">'+o.content+'</pre>';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^<p>(&nbsp;|#160;|\s)<\/p>$/,'');});}if(isGecko){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(s.content_css.split(','),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this;if(!sf){t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language,i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[this.settings.language+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv){return is(this.settings[n])?this.settings[n]:dv;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||this.getBody();this.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?this.getBody():n,s.isCollapsed(),o);},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(pa.split(','),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(pa.split('+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val);return true;}if(o=t.execCommands[cmd]){s=o.func.call(o.scope,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val);return s;}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val);},queryCommandState:function(c){var t=this,o;if(t._isHidden())return;if(o=t.queryStateCommands[c])return o.func.call(o.scope);o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;return this.getDoc().queryCommandState(c);},queryCommandValue:function(c){var t=this,o;if(t._isHidden())return;if(o=t.queryValueCommands[c])return o.func.call(o.scope);o=t.editorCommands.queryCommandValue(c);if(is(o))return o;return this.getDoc().queryCommandValue(c);},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,s=t.settings,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');DOM.hide(t.getContainer());DOM.setStyle(s.id,'display',t.orgDisplay);t.save();},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},remove:function(){var t=this;t.removed=1;t.hide();DOM.remove(t.getContainer());t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);EditorManager.remove(t);},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;},save:function(o){var t=this,e=t.getElement(),h,f;if(!t.initialized)return;o=o||{};o.save=true;o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'<br mce_bogus="1" />',1);o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o={content:h};t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=this.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK'))return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getDoc(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getDoc(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko){if(t._isHidden()){try{d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())d.execCommand("useCSS",0,true);}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.keyCode==46||e.keyCode==8||e.ctrlKey)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var v,f,el;function find(d){f=DOM.getParent(ed.id,'form'),el=f.elements;if(f){each(f.elements,function(e,i){if(e.id==ed.id){i=i+d;if(i<0||i>el.length)return;el=el[i];}});}return el;};if(e.keyCode===9){v=ed.getParam('tab_focus').split(',');if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'<h'+i+'>']);t.addShortcut('ctrl+7','',['FormatBlock',false,'<p>']);t.addShortcut('ctrl+8','',['FormatBlock',false,'<div>']);t.addShortcut('ctrl+9','',['FormatBlock',false,'<address>']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(o.ctrl!=e.ctrlKey&&(!tinymce.isMac||o.ctrl==e.metaKey))return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_destroy:function(){var t=this;if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':dom.replace(dom.create('span',{style:'text-decoration: underline;'}),n,1);break;case'STRIKE':dom.replace(dom.create('span',{style:'text-decoration: line-through;'}),n,1);break;}});}else if(o.set){each(t.dom.select('table,span',o.node),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')dom.replace(dom.create('u'),n,1);else if(n.style.textDecoration=='line-through')dom.replace(dom.create('strike'),n,1);}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onInit.add(function(){convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,sl,cl,fz,fzn,v,i;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=sl.split(',');if(cl=s.font_size_classes)cl=cl.split(',');t.onPreProcess.add(function(ed,o){if(!s.inline_styles)return;if(o.set){if(tinymce.isWebKit)return;each(t.dom.select('span',o.node),function(n){var f=dom.create('font',{color:dom.toHex(dom.getStyle(n,'color')),face:dom.getStyle(n,'fontFamily')});if(sl){i=inArray(sl,dom.getStyle(n,'fontSize'));if(i!=-1)dom.setAttrib(f,'size',''+(i+1||1));}else if(cl){i=inArray(cl,dom.getAttrib(n,'class'));v=dom.getStyle(n,'fontSize');if(i==-1&&v.indexOf('pt')>0)i=inArray(fz,parseInt(v));if(i==-1)i=inArray(fzn,v);if(i!=-1)dom.setAttrib(f,'size',''+(i+1||1));}if(f.color||f.face||f.size)dom.replace(f,n,1);});}else if(o.get){each(t.dom.select('font',o.node),function(n){var sp=dom.create('span',{style:{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor}});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.replace(sp,n,1);});}});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'</'+d[d.length-1].tag+'>';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='</'+d[i].tag+'>';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,e=ed.dom.getParent(ed.selection.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else ed.getDoc().execCommand('FontName',false,v);},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(isOpera||isWebKit){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return ed.getDoc().queryCommandValue('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(!v)v=ed.getDoc().queryCommandValue('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else dom.setStyle(n,'float',v);this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('<hr />');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(e=t.getSelectedElement())set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;dom.setAttrib(n,'mce_new','');if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p)return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG')return dom.getStyle(n,'float')==v;n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return ed.getDoc().queryCommandState(c);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor;val=ed.settings.forced_root_block?(val||'<p>'):val;t.mceRemoveNode();if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.execCommand('mceInsertContent',false,'tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n;if(n&&n.nodeName=='A')return false;return ed.getDoc().queryCommandState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}else return!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE');return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList();},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,s=t.editor.selection,b=s.getBookmark(),bq,dom=t.editor.dom;function findBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};if(findBQ(s.getStart())){each(t._getSelectedBlocks(findBQ(s.getStart()),findBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE')dom.remove(e,1);});t.editor.selection.moveToBookmark(b);return;}each(t._getSelectedBlocks(findBQ(s.getStart()),findBQ(s.getEnd())),function(e){var n;if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});t.editor.selection.moveToBookmark(b);},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),dom.isBlock);eb=dom.getParent(en||s.getEnd(),dom.isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(dom.isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0?t.index-1:0];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i<t.data.length-1;i++)t.data[i]=t.data[i+1];t.data.length--;t.index=t.data.length;}}if(s.custom_undo_redo_restore_selection)l.bookmark=b=l.bookmark||ed.selection.getBookmark();if(t.index<t.data.length&&t.data[t.index].initial)t.index++;t.data.length=t.index+1;t.data[t.index++]=l;if(l.initial)t.index=0;if(t.data.length==2&&t.data[0].initial)t.data[0].bookmark=b;t.onAdd.dispatch(t,l);ed.isNotDirty=0;return l;},undo:function(){var t=this,ed=t.editor,l=l,i;if(t.typing){t.add();t.typing=0;}if(t.index>0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index<t.data.length-1){l=t.data[++t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onRedo.dispatch(t,l);}return l;},clear:function(){var t=this;t.data=[];t.index=0;t.typing=0;t.add({initial:true});},hasUndo:function(){return this.index!=0||this.typing;},hasRedo:function(){return this.index<this.data.length-1;}});(function(){var Event,isIE,isGecko,isOpera,each,extend;Event=tinymce.dom.Event;isIE=tinymce.isIE;isGecko=tinymce.isGecko;isOpera=tinymce.isOpera;each=tinymce.each;extend=tinymce.extend;tinymce.create('tinymce.ForceBlocks',{ForceBlocks:function(ed){var t=this,s;t.editor=ed;t.dom=ed.dom;t.settings=s=extend({element:'P',forced_root_block:'p',force_p_newlines:true},ed.settings);ed.onPreInit.add(t.setup,t);function padd(ed,o){if(isOpera)o.content=o.content.replace(/(\u00a0|&#160;|&nbsp;)<\/p>/gi,'</p>');o.content=o.content.replace(/<p( )([^>]+)><\/p>|<p( )([^>]+)\/>|<p( )([^>]+)>\s+<\/p>|<p><\/p>|<p\/>|<p>\s+<\/p>/gi,'<p$1$2$3$4$5$6>\u00a0</p>');if(!isIE&&o.set){o.content=o.content.replace(/<p( )([^>]+)>[\s\u00a0]+<\/p>|<p>[\s\u00a0]+<\/p>/gi,'<p$1$2><br /></p>');}else{o.content=o.content.replace(/<p( )([^>]+)>\s*<br \/>\s*<\/p>|<p>\s*<br \/>\s*<\/p>/gi,'<p$1$2>\u00a0</p>');o.content=o.content.replace(/\s*<br \/>\s*<\/p>/gi,'</p>');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=t.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13){s.setContent('<br id="__" /> ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onPreProcess.add(function(ed,o){each(ed.dom.select('br',o.node),function(n){var p=n.parentNode;if(p&&p.nodeName=='p'&&(p.childNodes.length==1||p.lastChild==n))p.replaceChild(ed.getDoc().createTextNode('\u00a0'),n);});});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){var t=this,ed=t.editor,b=ed.getBody(),d=ed.getDoc(),se=ed.selection,s=se.getSel(),r=se.getRng(),si=-2,ei,so,eo,tr,c=-0xFFFFFF;var nx,bl,bp,sp,le,nl=b.childNodes,i;if(e&&e.keyCode==13)return true;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||!t.dom.isBlock(nx)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(t.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=d.getElementsByTagName(t.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){var t=this,ed=t.editor,d=ed.getDoc(),se=t.settings,s=ed.selection.getSel(),r=s.getRangeAt(0),b=d.body;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='<br />';if(isEmpty(aft))aft.innerHTML=isOpera?'&nbsp;':'<br />';if(isOpera){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();r=d.createRange();r.selectNodeContents(aft);r.collapse(1);s.removeAllRanges();s.addRange(r);if(tinymce.isWebKit)ed.getWin().scrollTo(0,ed.dom.getPos(aft).y);else aft.scrollIntoView(0);return false;},backspaceDelete:function(e,bs){var t=this,ed=t.editor,b=ed.getBody(),n,se=ed.selection,r=se.getRng(),sc=r.startContainer,n;if(sc&&ed.dom.isBlock(sc)&&bs){if(sc.childNodes.length==1&&sc.firstChild.nodeName=='BR'){n=sc.previousSibling;if(n){ed.dom.remove(sc);se.select(n,1);se.collapse(0);return Event.cancel(e);}}}function handler(e){e=e.target;if(e&&e.parentNode&&e.nodeName=='BR'&&t.getParentBlock(e)){ed.dom.remove(e);Event.remove(b,'DOMNodeInserted',handler);}};Event._add(b,'DOMNodeInserted',handler);window.setTimeout(function(){Event._remove(b,'DOMNodeInserted',handler);},1);}});})();(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,each=tinymce.each,extend=tinymce.extend;tinymce.create('tinymce.ControlManager',{ControlManager:function(ed,s){var t=this,i;s=s||{};t.editor=ed;t.controls={};t.onAdd=new tinymce.util.Dispatcher(t);t.onPostRender=new tinymce.util.Dispatcher(t);t.prefix=s.prefix||ed.id+'_';t.onPostRender.add(function(){each(t.controls,function(c){c.postRender();});});},get:function(id){return this.controls[this.prefix+id]||this.controls[id];},setActive:function(id,s){var c=null;if(c=this.get(id))c.setActive(s);return c;},setDisabled:function(id,s){var c=null;if(c=this.get(id))c.setDisabled(s);return c;},add:function(c){var t=this;if(c){t.controls[c.id]=c;t.onAdd.dispatch(c,t);}return c;},createControl:function(n){var c,t=this,ed=t.editor;each(ed.plugins,function(p){if(p.createControl){c=p.createControl(n,t);if(c)return false;}});switch(n){case"|":case"separator":return t.createSeparator();}if(!c&&ed.buttons&&(c=ed.buttons[n]))return t.createButton(n,c);return t.add(c);},createDropMenu:function(id,s){var t=this,ed=t.editor,c;s=extend({'class':'mceDropDown'},s);s['class']=s['class']+' '+ed.getParam('skin')+'Skin';id=t.prefix+id;c=t.controls[id]=new tinymce.ui.DropMenu(id,s);c.onAddItem.add(function(c,o){var s=o.settings;s.title=ed.getLang(s.title,s.title);if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}});ed.onRemove.add(function(){c.destroy();});return t.add(c);},createListBox:function(id,s){var t=this,ed=t.editor,cmd,c;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':id,scope:s.scope,control_manager:t},s);id=t.prefix+id;if(ed.settings.use_native_selects)c=new tinymce.ui.NativeListBox(id,s);else c=new tinymce.ui.ListBox(id,s);t.controls[id]=c;if(tinymce.isWebKit){c.onPostRender.add(function(c,n){Event.add(n,'mousedown',function(){ed.bookmark=ed.selection.getBookmark('simple');});Event.add(n,'focus',function(){ed.selection.moveToBookmark(ed.bookmark);ed.bookmark=null;});});}if(c.hideMenu)ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createButton:function(id,s){var t=this,ed=t.editor,o,c;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick&&!s.menu_button){s.onclick=function(){ed.execCommand(s.cmd,s.ui||false,s.value);};}s=extend({title:s.title,'class':id,unavailable_prefix:ed.getLang('unavailable',''),scope:s.scope,control_manager:t},s);id=t.prefix+id;if(s.menu_button){c=new tinymce.ui.MenuButton(id,s);ed.onMouseDown.add(c.hideMenu,c);}else c=new tinymce.ui.Button(id,s);return t.add(c);},createMenuButton:function(id,s){s=s||{};s.menu_button=1;return this.createButton(id,s);},createSplitButton:function(id,s){var t=this,ed=t.editor,cmd,c;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':id,scope:s.scope,control_manager:t},s);id=t.prefix+id;c=t.add(new tinymce.ui.SplitButton(id,s));ed.onMouseDown.add(c.hideMenu,c);return c;},createColorSplitButton:function(id,s){var t=this,ed=t.editor,cmd,c;if(t.get(id))return null;s.title=ed.translate(s.title);s.scope=s.scope||ed;if(!s.onclick){s.onclick=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}if(!s.onselect){s.onselect=function(v){ed.execCommand(s.cmd,s.ui||false,v||s.value);};}s=extend({title:s.title,'class':id,'menu_class':ed.getParam('skin')+'Skin',scope:s.scope,more_colors_title:ed.getLang('more_colors')},s);id=t.prefix+id;c=new tinymce.ui.ColorSplitButton(id,s);ed.onMouseDown.add(c.hideMenu,c);return t.add(c);},createToolbar:function(id,s){var c,t=this;id=t.prefix+id;c=new tinymce.ui.Toolbar(id,s);if(t.get(id))return null;return t.add(c);},createSeparator:function(){return new tinymce.ui.Separator();}});})();(function(){var Dispatcher=tinymce.util.Dispatcher,each=tinymce.each,isIE=tinymce.isIE,isOpera=tinymce.isOpera;tinymce.create('tinymce.WindowManager',{WindowManager:function(ed){var t=this;t.editor=ed;t.onOpen=new Dispatcher(t);t.onClose=new Dispatcher(t);t.params={};t.features={};},open:function(s,p){var t=this,f='',x,y,mo=t.editor.settings.dialog_type=='modal',w,sw,sh,vp=tinymce.DOM.getViewPort();s=s||{};p=p||{};sw=isOpera?vp.w:screen.width;sh=isOpera?vp.h:screen.height;s.name=s.name||'mc_'+new Date().getTime();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240);s.resizable=true;s.left=s.left||parseInt(sw/ 2.0) - (s.width /2.0);s.top=s.top||parseInt(sh/ 2.0) - (s.height /2.0);p.inline=false;p.mce_width=s.width;p.mce_height=s.height;if(mo){if(isIE){s.center=true;s.help=false;s.dialogWidth=s.width+'px';s.dialogHeight=s.height+'px';s.scroll=s.scrollbars||false;}else s.modal=s.alwaysRaised=s.dialog=s.centerscreen=s.dependent=true;}each(s,function(v,k){if(tinymce.is(v,'boolean'))v=v?'yes':'no';if(!/^(name|url)$/.test(k)){if(isIE&&mo)f+=(f?';':'')+k+':'+v;else f+=(f?',':'')+k+'='+v;}});t.features=s;t.params=p;t.onOpen.dispatch(t,s,p);try{if(isIE&&mo){w=1;window.showModalDialog(s.url||s.file,window,f);}else w=window.open(s.url||s.file,s.name,f);}catch(ex){}if(!w)alert(t.editor.getLang('popup_blocked'));},close:function(w){w.close();this.onClose.dispatch(this);},createInstance:function(cl){var a=arguments,i,f=tinymce.resolve(cl),s='';for(i=1;i<a.length;i++)s+=(i>1?',':'')+'a['+i+']';return eval('(new f('+s+'))');},confirm:function(t,cb,s){cb.call(s||this,confirm(this._decode(this.editor.getLang(t,t))));},alert:function(t,cb,s){alert(this._decode(t));if(cb)cb.call(s||this);},_decode:function(s){return tinymce.DOM.decode(s).replace(/\\n/g,'\n');}});}());
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_popup.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_popup.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_popup.js	(revision 1)
@@ -0,0 +1,224 @@
+// Some global instances
+var tinymce = null, tinyMCEPopup, tinyMCE;
+
+tinyMCEPopup = {
+	init : function() {
+		var t = this, w = t.getWin(), ti;
+
+		// Find API
+		tinymce = w.tinymce;
+		tinyMCE = w.tinyMCE;
+		t.editor = tinymce.EditorManager.activeEditor;
+		t.params = t.editor.windowManager.params;
+
+		// Setup local DOM
+		t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document);
+		t.dom.loadCSS(t.editor.settings.popup_css);
+
+		// Setup on init listeners
+		t.listeners = [];
+		t.onInit = {
+			add : function(f, s) {
+				t.listeners.push({func : f, scope : s});
+			}
+		};
+
+		t.isWindow = !t.getWindowArg('mce_inline');
+		t.id = t.getWindowArg('mce_window_id');
+		t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
+	},
+
+	getWin : function() {
+		return window.dialogArguments || opener || parent || top;
+	},
+
+	getWindowArg : function(n, dv) {
+		var v = this.params[n];
+
+		return tinymce.is(v) ? v : dv;
+	},
+
+	getParam : function(n, dv) {
+		return this.editor.getParam(n, dv);
+	},
+
+	getLang : function(n, dv) {
+		return this.editor.getLang(n, dv);
+	},
+
+	execCommand : function(cmd, ui, val, a) {
+		this.restoreSelection();
+		return this.editor.execCommand(cmd, ui, val, a || {skip_focus : 1});
+	},
+
+	resizeToInnerSize : function() {
+		var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh;
+
+		dw = t.getWindowArg('mce_width') - vp.w;
+		dh = t.getWindowArg('mce_height') - vp.h;
+
+		if (t.isWindow)
+			window.resizeBy(dw, dh);
+		else
+			t.editor.windowManager.resizeBy(dw, dh, t.id);
+	},
+
+	executeOnLoad : function(s) {
+		this.onInit.add(function() {
+			eval(s);
+		});
+	},
+
+	storeSelection : function() {
+		this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark('simple');
+	},
+
+	restoreSelection : function() {
+		var t = tinyMCEPopup;
+
+		if (!t.isWindow && tinymce.isIE)
+			t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
+	},
+
+	requireLangPack : function() {
+		var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url');
+
+		if (u)
+			document.write('<script type="text/javascript" src="' + u + '/langs/' + this.editor.settings.language + '_dlg.js' + '"></script>');
+	},
+
+	pickColor : function(e, element_id) {
+		this.execCommand('mceColorPicker', true, {
+			color : document.getElementById(element_id).value,
+			func : function(c) {
+				document.getElementById(element_id).value = c;
+
+				try {
+					document.getElementById(element_id).onchange();
+				} catch (ex) {
+					// Try fire event, ignore errors
+				}
+			}
+		});
+	},
+
+	openBrowser : function(element_id, type, option) {
+		tinyMCEPopup.restoreSelection();
+		this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
+	},
+
+	close : function() {
+		var t = this;
+
+		t.dom = t.dom.doc = null; // Cleanup
+		t.editor.windowManager.close(window, t.id);
+	},
+
+	// Internal functions	
+
+	_restoreSelection : function() {
+		var e = window.event.srcElement;
+
+		if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
+			tinyMCEPopup.restoreSelection();
+	},
+
+/*	_restoreSelection : function() {
+		var e = window.event.srcElement;
+
+		// If user focus a non text input or textarea
+		if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
+			tinyMCEPopup.restoreSelection();
+	},*/
+
+	_onDOMLoaded : function() {
+		var t = this, ti = document.title, bm, h;
+
+		// Translate page
+		h = document.body.innerHTML;
+
+		// Replace a=x with a="x" in IE
+		if (tinymce.isIE)
+			h = h.replace(/ (value|title|alt)=([^\s>]+)/gi, ' $1="$2"');
+
+		document.body.innerHTML = t.editor.translate(h);
+		document.title = ti = t.editor.translate(ti);
+		document.body.style.display = '';
+
+		// Restore selection in IE when focus is placed on a non textarea or input element of the type text
+		if (tinymce.isIE)
+			document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
+
+		t.restoreSelection();
+
+		// Call onInit
+		tinymce.each(t.listeners, function(o) {
+			o.func.call(o.scope, t.editor);
+		});
+
+		t.resizeToInnerSize();
+
+		if (t.isWindow)
+			window.focus();
+		else
+			t.editor.windowManager.setTitle(ti, t.id);
+
+		if (!tinymce.isIE && !t.isWindow) {
+			tinymce.dom.Event._add(document, 'focus', function() {
+				t.editor.windowManager.focus(t.id)
+			});
+		}
+
+		// Patch for accessibility
+		tinymce.each(t.dom.select('select'), function(e) {
+			e.onkeydown = tinyMCEPopup._accessHandler;
+		});
+
+		// Move focus to window
+		window.focus();
+	},
+
+	_accessHandler : function(e) {
+		var e = e || window.event;
+
+		if (e.keyCode == 13 || e.keyCode == 32) {
+			e = e.target || e.srcElement;
+
+			if (e.onchange)
+				e.onchange();
+
+			return tinymce.dom.Event.cancel(e);
+		}
+	},
+
+	_wait : function() {
+		var t = this, ti;
+
+		if (tinymce.isIE && document.location.protocol != 'https:') {
+			// Fake DOMContentLoaded on IE
+			document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
+			document.getElementById("__ie_onload").onreadystatechange = function() {
+				if (this.readyState == "complete") {
+					t._onDOMLoaded();
+					document.getElementById("__ie_onload").onreadystatechange = null; // Prevent leak
+				}
+			};
+		} else {
+			if (tinymce.isIE || tinymce.isWebKit) {
+				ti = setInterval(function() {
+					if (/loaded|complete/.test(document.readyState)) {
+						clearInterval(ti);
+						t._onDOMLoaded();
+					}
+				}, 10);
+			} else {
+				window.addEventListener('DOMContentLoaded', function() {
+					t._onDOMLoaded();
+				}, false);
+			}
+		}
+	}
+};
+
+tinyMCEPopup.init();
+tinyMCEPopup._wait(); // Wait for DOM Content Loaded
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_src.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_src.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/tiny_mce_src.js	(revision 1)
@@ -0,0 +1,9163 @@
+
+/* file:jscripts/tiny_mce/classes/tinymce.js */
+
+var tinymce = {
+	majorVersion : '3',
+	minorVersion : '0',
+	releaseDate : '2008-01-30',
+
+	_init : function() {
+		var t = this, ua = navigator.userAgent, i, nl, n, base;
+
+		// Browser checks
+		t.isOpera = window.opera && opera.buildNumber;
+		t.isWebKit = /WebKit/.test(ua);
+		t.isOldWebKit = t.isWebKit && !window.getSelection().getRangeAt;
+		t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(navigator.appName);
+		t.isIE6 = t.isIE && /MSIE [56]/.test(ua);
+		t.isGecko = !t.isWebKit && /Gecko/.test(ua);
+//		t.isGecko3 = t.isGecko && /(Firefox|Minefield)\/[3-9]/.test(ua);
+		t.isMac = ua.indexOf('Mac') != -1;
+
+		// TinyMCE .NET webcontrol might be setting the values for TinyMCE
+		if (window.tinyMCEPreInit) {
+			t.suffix = tinyMCEPreInit.suffix;
+			t.baseURL = tinyMCEPreInit.base;
+			return;
+		}
+
+		// Get suffix and base
+		t.suffix = '';
+
+		// If base element found, add that infront of baseURL
+		nl = document.getElementsByTagName('base');
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].href)
+				base = nl[i].href;
+		}
+
+		function getBase(n) {
+			if (n.src && /tiny_mce(|_dev|_src|_gzip|_jquery|_prototype).js/.test(n.src)) {
+				if (/_(src|dev)\.js/g.test(n.src))
+					t.suffix = '_src';
+
+				t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
+
+				// If path to script is relative and a base href was found add that one infront
+				if (base && t.baseURL.indexOf('://') == -1)
+					t.baseURL = base + t.baseURL;
+
+				return t.baseURL;
+			}
+
+			return null;
+		};
+
+		// Check document
+		nl = document.getElementsByTagName('script');
+		for (i=0; i<nl.length; i++) {
+			if (getBase(nl[i]))
+				return;
+		}
+
+		// Check head
+		n = document.getElementsByTagName('head')[0];
+		if (n) {
+			nl = n.getElementsByTagName('script');
+			for (i=0; i<nl.length; i++) {
+				if (getBase(nl[i]))
+					return;
+			}
+		}
+
+		return;
+	},
+
+	is : function(o, t) {
+		var n = typeof(o);
+
+		if (!t)
+			return n != 'undefined';
+
+		if (t == 'array' && (o instanceof Array))
+			return true;
+
+		return n == t;
+	},
+
+	// #if !jquery
+
+	each : function(o, cb, s) {
+		var n, l;
+
+		if (!o)
+			return 0;
+
+		s = s || o;
+
+		if (typeof(o.length) != 'undefined') {
+			// Indexed arrays, needed for Safari
+			for (n=0, l = o.length; n<l; n++) {
+				if (cb.call(s, o[n], n, o) === false)
+					return 0;
+			}
+		} else {
+			// Hashtables
+			for (n in o) {
+				if (o.hasOwnProperty(n)) {
+					if (cb.call(s, o[n], n, o) === false)
+						return 0;
+				}
+			}
+		}
+
+		return 1;
+	},
+
+	map : function(a, f) {
+		var o = [];
+
+		tinymce.each(a, function(v) {
+			o.push(f(v));
+		});
+
+		return o;
+	},
+
+	grep : function(a, f) {
+		var o = [];
+
+		tinymce.each(a, function(v) {
+			if (!f || f(v))
+				o.push(v);
+		});
+
+		return o;
+	},
+
+	inArray : function(a, v) {
+		var i, l;
+
+		if (a) {
+			for (i = 0, l = a.length; i < l; i++) {
+				if (a[i] === v)
+					return i;
+			}
+		}
+
+		return -1;
+	},
+
+	extend : function(o, e) {
+		var i, a = arguments;
+
+		for (i=1; i<a.length; i++) {
+			e = a[i];
+
+			tinymce.each(e, function(v, n) {
+				if (typeof(v) !== 'undefined')
+					o[n] = v;
+			});
+		}
+
+		return o;
+	},
+
+	trim : function(s) {
+		return (s ? '' + s : '').replace(/^\s*|\s*$/g, '');
+	},
+
+	// #endif
+
+	create : function(s, p) {
+		var t = this, sp, ns, cn, scn, c, de = 0;
+
+		// Parse : <prefix> <class>:<super class>
+		s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+		cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
+
+		// Create namespace for new class
+		ns = t.createNS(s[3].replace(/\.\w+$/, ''));
+
+		// Class already exists
+		if (ns[cn])
+			return;
+
+		// Make pure static class
+		if (s[2] == 'static') {
+			ns[cn] = p;
+
+			if (this.onCreate)
+				this.onCreate(s[2], s[3], ns[cn]);
+
+			return;
+		}
+
+		// Create default constructor
+		if (!p[cn]) {
+			p[cn] = function() {};
+			de = 1;
+		}
+
+		// Add constructor and methods
+		ns[cn] = p[cn];
+		t.extend(ns[cn].prototype, p);
+
+		// Extend
+		if (s[5]) {
+			sp = t.resolve(s[5]).prototype;
+			scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
+
+			// Extend constructor
+			c = ns[cn];
+			if (de) {
+				// Add passthrough constructor
+				ns[cn] = function() {
+					return sp[scn].apply(this, arguments);
+				};
+			} else {
+				// Add inherit constructor
+				ns[cn] = function() {
+					this.parent = sp[scn];
+					return c.apply(this, arguments);
+				};
+			}
+			ns[cn].prototype[cn] = ns[cn];
+
+			// Add super methods
+			t.each(sp, function(f, n) {
+				if (n != scn)
+					ns[cn].prototype[n] = sp[n];
+			});
+
+			// Add overridden methods
+			t.each(p, function(f, n) {
+				// Extend methods if needed
+				if (sp[n]) {
+					ns[cn].prototype[n] = function() {
+						this.parent = sp[n];
+						return f.apply(this, arguments);
+					};
+				} else {
+					if (n != cn)
+						ns[cn].prototype[n] = f;
+				}
+			});
+		}
+
+		// Add static methods
+		t.each(p['static'], function(f, n) {
+			ns[cn][n] = f;
+		});
+
+		if (this.onCreate)
+			this.onCreate(s[2], s[3], ns[cn].prototype);
+	},
+
+	walk : function(o, f, n, s) {
+		s = s || this;
+
+		if (o) {
+			if (n)
+				o = o[n];
+
+			tinymce.each(o, function(o, i) {
+				if (f.call(s, o, i, n) === false)
+					return false;
+
+				tinymce.walk(o, f, n, s);
+			});
+		}
+	},
+
+	createNS : function(n, o) {
+		var i, v;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i=0; i<n.length; i++) {
+			v = n[i];
+
+			if (!o[v])
+				o[v] = {};
+
+			o = o[v];
+		}
+
+		return o;
+	},
+
+	resolve : function(n, o) {
+		var i, l;
+
+		o = o || window;
+
+		n = n.split('.');
+		for (i=0, l = n.length; i<l; i++) {
+			o = o[n[i]];
+
+			if (!o)
+				break;
+		}
+
+		return o;
+	},
+
+	addUnload : function(f, s) {
+		var t = this, w = window, unload;
+
+		f = {func : f, scope : s || this};
+
+		if (!t.unloads) {
+			unload = function() {
+				var li = t.unloads, o, n;
+
+				// Call unload handlers
+				for (n in li) {
+					o = li[n];
+
+					if (o && o.func)
+						o.func.call(o.scope);
+				}
+
+				// Detach unload function
+				if (w.detachEvent)
+					w.detachEvent('onunload', unload);
+				else if (w.removeEventListener)
+					w.removeEventListener('unload', unload, false);
+
+				// Destroy references
+				o = li = w = unload = null;
+
+				// Run garbarge collector on IE
+				if (window.CollectGarbage)
+					window.CollectGarbage();
+			};
+
+			// Attach unload handler
+			if (w.attachEvent)
+				w.attachEvent('onunload', unload);
+			else if (w.addEventListener)
+				w.addEventListener('unload', unload, false);
+
+			// Setup initial unload handler array
+			t.unloads = [f];
+		} else
+			t.unloads.push(f);
+
+		return f;
+	},
+
+	removeUnload : function(f) {
+		var u = this.unloads, r = null;
+
+		tinymce.each(u, function(o, i) {
+			if (o && o.func == f) {
+				u.splice(i, 1);
+				r = f;
+				return false;
+			}
+		});
+
+		return r;
+	}
+
+	};
+
+// Required for GZip AJAX loading
+window.tinymce = tinymce;
+
+// Initialize the API
+tinymce._init();
+
+/* file:jscripts/tiny_mce/classes/adapter/jquery/adapter.js */
+
+
+/* file:jscripts/tiny_mce/classes/adapter/prototype/adapter.js */
+
+
+/* file:jscripts/tiny_mce/classes/util/Dispatcher.js */
+
+tinymce.create('tinymce.util.Dispatcher', {
+	scope : null,
+	listeners : null,
+
+	Dispatcher : function(s) {
+		this.scope = s || this;
+		this.listeners = [];
+	},
+
+	add : function(cb, s) {
+		this.listeners.push({cb : cb, scope : s || this.scope});
+
+		return cb;
+	},
+
+	addToTop : function(cb, s) {
+		this.listeners.unshift({cb : cb, scope : s || this.scope});
+
+		return cb;
+	},
+
+	remove : function(cb) {
+		var l = this.listeners, o = null;
+
+		tinymce.each(l, function(c, i) {
+			if (cb == c.cb) {
+				o = cb;
+				l.splice(i, 1);
+				return false;
+			}
+		});
+
+		return o;
+	},
+
+	dispatch : function() {
+		var s, a = arguments;
+
+		tinymce.each(this.listeners, function(c) {
+			return s = c.cb.apply(c.scope, a);
+		});
+
+		return s;
+	}
+
+	});
+
+/* file:jscripts/tiny_mce/classes/util/URI.js */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.util.URI', {
+		URI : function(u, s) {
+			var t = this, o, a, b;
+
+			// Default settings
+			s = t.settings = s || {};
+
+			// Strange app protocol or local anchor
+			if (/^(mailto|news|javascript|about):/i.test(u) || /^\s*#/.test(u)) {
+				t.source = u;
+				return;
+			}
+
+			// Absolute path with no host, fake host and protocol
+			if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)
+				u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;
+
+			// Relative path
+			if (u.indexOf('://') === -1 && u.indexOf('//') !== 0)
+				u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);
+
+			// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
+			u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
+			u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);
+			each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {
+				var s = u[i];
+
+				// Zope 3 workaround, they use @@something
+				if (s)
+					s = s.replace(/\(mce_at\)/g, '@@');
+
+				t[v] = s;
+			});
+
+			if (b = s.base_uri) {
+				if (!t.protocol)
+					t.protocol = b.protocol;
+
+				if (!t.userInfo)
+					t.userInfo = b.userInfo;
+
+				if (!t.port && t.host == 'mce_host')
+					t.port = b.port;
+
+				if (!t.host || t.host == 'mce_host')
+					t.host = b.host;
+
+				t.source = '';
+			}
+
+			//t.path = t.path || '/';
+		},
+
+		setPath : function(p) {
+			var t = this;
+
+			p = /^(.*?)\/?(\w+)?$/.exec(p);
+
+			// Update path parts
+			t.path = p[0];
+			t.directory = p[1];
+			t.file = p[2];
+
+			// Rebuild source
+			t.source = '';
+			t.getURI();
+		},
+
+		toRelative : function(u) {
+			var t = this, o;
+
+			u = new tinymce.util.URI(u, {base_uri : t});
+
+			// Not on same domain/port or protocol
+			if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)
+				return u.getURI();
+
+			o = t.toRelPath(t.path, u.path);
+
+			// Add query
+			if (u.query)
+				o += '?' + u.query;
+
+			// Add anchor
+			if (u.anchor)
+				o += '#' + u.anchor;
+
+			return o;
+		},
+	
+		toAbsolute : function(u, nh) {
+			var u = new tinymce.util.URI(u, {base_uri : this});
+
+			return u.getURI(this.host == u.host ? nh : 0);
+		},
+
+		toRelPath : function(base, path) {
+			var items, bp = 0, out = '', i;
+
+			// Split the paths
+			base = base.substring(0, base.lastIndexOf('/'));
+			base = base.split('/');
+			items = path.split('/');
+
+			if (base.length >= items.length) {
+				for (i = 0; i < base.length; i++) {
+					if (i >= items.length || base[i] != items[i]) {
+						bp = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (base.length < items.length) {
+				for (i = 0; i < items.length; i++) {
+					if (i >= base.length || base[i] != items[i]) {
+						bp = i + 1;
+						break;
+					}
+				}
+			}
+
+			if (bp == 1)
+				return path;
+
+			for (i = 0; i < base.length - (bp - 1); i++)
+				out += "../";
+
+			for (i = bp - 1; i < items.length; i++) {
+				if (i != bp - 1)
+					out += "/" + items[i];
+				else
+					out += items[i];
+			}
+
+			return out;
+		},
+
+		toAbsPath : function(base, path) {
+			var i, nb = 0, o = [];
+
+			// Split paths
+			base = base.split('/');
+			path = path.split('/');
+
+			// Remove empty chunks
+			each(base, function(k) {
+				if (k)
+					o.push(k);
+			});
+
+			base = o;
+
+			// Merge relURLParts chunks
+			for (i = path.length - 1, o = []; i >= 0; i--) {
+				// Ignore empty or .
+				if (path[i].length == 0 || path[i] == ".")
+					continue;
+
+				// Is parent
+				if (path[i] == '..') {
+					nb++;
+					continue;
+				}
+
+				// Move up
+				if (nb > 0) {
+					nb--;
+					continue;
+				}
+
+				o.push(path[i]);
+			}
+
+			i = base.length - nb;
+
+			// If /a/b/c or /
+			if (i <= 0)
+				return '/' + o.reverse().join('/');
+
+			return '/' + base.slice(0, i).join('/') + '/' + o.reverse().join('/');
+		},
+
+		getURI : function(nh) {
+			var s, t = this;
+
+			// Rebuild source
+			if (!t.source || nh) {
+				s = '';
+
+				if (!nh) {
+					if (t.protocol)
+						s += t.protocol + '://';
+
+					if (t.userInfo)
+						s += t.userInfo + '@';
+
+					if (t.host)
+						s += t.host;
+
+					if (t.port)
+						s += ':' + t.port;
+				}
+
+				if (t.path)
+					s += t.path;
+
+				if (t.query)
+					s += '?' + t.query;
+
+				if (t.anchor)
+					s += '#' + t.anchor;
+
+				t.source = s;
+			}
+
+			return t.source;
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/util/Cookie.js */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('static tinymce.util.Cookie', {
+		getHash : function(n) {
+			var v = this.get(n), h;
+
+			if (v) {
+				each(v.split('&'), function(v) {
+					v = v.split('=');
+					h = h || {};
+					h[unescape(v[0])] = unescape(v[1]);
+				});
+			}
+
+			return h;
+		},
+
+		setHash : function(n, v, e, p, d, s) {
+			var o = '';
+
+			each(v, function(v, k) {
+				o += (!o ? '' : '&') + escape(k) + '=' + escape(v);
+			});
+
+			this.set(n, o, e, p, d, s);
+		},
+
+		get : function(n) {
+			var c = document.cookie, e, p = n + "=", b;
+
+			// Strict mode
+			if (!c)
+				return;
+
+			b = c.indexOf("; " + p);
+
+			if (b == -1) {
+				b = c.indexOf(p);
+
+				if (b != 0)
+					return null;
+			} else
+				b += 2;
+
+			e = c.indexOf(";", b);
+
+			if (e == -1)
+				e = c.length;
+
+			return unescape(c.substring(b + p.length, e));
+		},
+
+		set : function(n, v, e, p, d, s) {
+			document.cookie = n + "=" + escape(v) +
+				((e) ? "; expires=" + e.toGMTString() : "") +
+				((p) ? "; path=" + escape(p) : "") +
+				((d) ? "; domain=" + d : "") +
+				((s) ? "; secure" : "");
+		},
+
+		remove : function(n, p) {
+			var d = new Date();
+
+			d.setTime(d.getTime() - 1000);
+
+			this.set(n, '', d, p, d);
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/util/JSON.js */
+
+tinymce.create('static tinymce.util.JSON', {
+	serialize : function(o) {
+		var i, v, s = tinymce.util.JSON.serialize, t;
+
+		if (o == null)
+			return 'null';
+
+		t = typeof o;
+
+		if (t == 'string') {
+			v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
+
+			return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g, function(a, b) {
+				i = v.indexOf(b);
+
+				if (i + 1)
+					return '\\' + v.charAt(i + 1);
+
+				a = b.charCodeAt().toString(16);
+
+				return '\\u' + '0000'.substring(a.length) + a;
+			}) + '"';
+		}
+
+		if (t == 'object') {
+			if (o instanceof Array) {
+					for (i=0, v = '['; i<o.length; i++)
+						v += (i > 0 ? ',' : '') + s(o[i]);
+
+					return v + ']';
+				}
+
+				v = '{';
+
+				for (i in o)
+					v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
+
+				return v + '}';
+		}
+
+		return '' + o;
+	},
+
+	parse : function(s) {
+		try {
+			return eval('(' + s + ')');
+		} catch (ex) {
+			// Ignore
+		}
+	}
+
+	});
+
+/* file:jscripts/tiny_mce/classes/util/XHR.js */
+
+tinymce.create('static tinymce.util.XHR', {
+	send : function(o) {
+		var x, t, w = window, c = 0;
+
+		// Default settings
+		o.scope = o.scope || this;
+		o.success_scope = o.success_scope || o.scope;
+		o.error_scope = o.error_scope || o.scope;
+		o.async = o.async === false ? false : true;
+		o.data = o.data || '';
+
+		function get(s) {
+			x = 0;
+
+			try {
+				x = new ActiveXObject(s);
+			} catch (ex) {
+			}
+
+			return x;
+		};
+
+		x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');
+
+		if (x) {
+			if (x.overrideMimeType)
+				x.overrideMimeType(o.content_type);
+
+			x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);
+
+			if (o.content_type)
+				x.setRequestHeader('Content-Type', o.content_type);
+
+			x.send(o.data);
+
+			// Wait for response, onReadyStateChange can not be used since it leaks memory in IE
+			t = w.setInterval(function() {
+				if (x.readyState == 4 || c++ > 10000) {
+					w.clearInterval(t);
+
+					if (o.success && c < 10000 && x.status == 200)
+						o.success.call(o.success_scope, '' + x.responseText, x, o);
+					else if (o.error)
+						o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);
+
+					x = null;
+				}
+			}, 10);
+		}
+
+		}
+});
+
+/* file:jscripts/tiny_mce/classes/util/JSONRequest.js */
+
+(function() {
+	var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;
+
+	tinymce.create('tinymce.util.JSONRequest', {
+		JSONRequest : function(s) {
+			this.settings = extend({
+			}, s);
+			this.count = 0;
+		},
+
+		send : function(o) {
+			var ecb = o.error, scb = o.success;
+
+			o = extend(this.settings, o);
+
+			o.success = function(c, x) {
+				c = JSON.parse(c);
+
+				if (typeof(c) == 'undefined') {
+					c = {
+						error : 'JSON Parse error.'
+					};
+				}
+
+				if (c.error)
+					ecb.call(o.error_scope || o.scope, c.error, x);
+				else
+					scb.call(o.success_scope || o.scope, c.result);
+			};
+
+			o.error = function(ty, x) {
+				ecb.call(o.error_scope || o.scope, ty, x);
+			};
+
+			o.data = JSON.serialize({
+				id : o.id || 'c' + (this.count++),
+				method : o.method,
+				params : o.params
+			});
+
+			XHR.send(o);
+		},
+
+		'static' : {
+			sendRPC : function(o) {
+				return new tinymce.util.JSONRequest().send(o);
+			}
+		}
+
+		});
+}());
+/* file:jscripts/tiny_mce/classes/dom/DOMUtils.js */
+
+(function() {
+	// Shorten names
+	var each = tinymce.each, is = tinymce.is;
+	var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE;
+
+	tinymce.create('tinymce.dom.DOMUtils', {
+		doc : null,
+		root : null,
+		files : null,
+		listeners : {},
+		pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,
+		cache : {},
+		idPattern : /^#[\w]+$/,
+		elmPattern : /^[\w_*]+$/,
+		elmClassPattern : /^([\w_]*)\.([\w_]+)$/,
+
+		DOMUtils : function(d, s) {
+			var t = this;
+
+			t.doc = d;
+			t.files = {};
+			t.cssFlicker = false;
+			t.counter = 0;
+			t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; 
+
+			this.settings = s = tinymce.extend({
+				keep_values : false,
+				hex_colors : 1,
+				process_html : 1
+			}, s);
+
+			// Fix IE6SP2 flicker and check it failed for pre SP2
+			if (tinymce.isIE6) {
+				try {
+					d.execCommand('BackgroundImageCache', false, true);
+				} catch (e) {
+					t.cssFlicker = true;
+				}
+			}
+
+			tinymce.addUnload(function() {
+				t.doc = t.root = null;
+			});
+		},
+
+		getRoot : function() {
+			var t = this, s = t.settings;
+
+			return (s && t.get(s.root_element)) || t.doc.body;
+		},
+
+		getViewPort : function(w) {
+			var d, b;
+
+			w = !w ? window : w;
+			d = w.document;
+			b = this.boxModel ? d.documentElement : d.body;
+
+			// Returns viewport size excluding scrollbars
+			return {
+				x : w.pageXOffset || b.scrollLeft,
+				y : w.pageYOffset || b.scrollTop,
+				w : w.innerWidth || b.clientWidth,
+				h : w.innerHeight || b.clientHeight
+			};
+		},
+
+		getRect : function(e) {
+			var p, t = this, w, h;
+
+			e = t.get(e);
+			p = t.getPos(e);
+			w = t.getStyle(e, 'width');
+			h = t.getStyle(e, 'height');
+
+			// Non pixel value, then force offset/clientWidth
+			if (w.indexOf('px') === -1)
+				w = 0;
+
+			// Non pixel value, then force offset/clientWidth
+			if (h.indexOf('px') === -1)
+				h = 0;
+
+			return {
+				x : p.x,
+				y : p.y,
+				w : parseInt(w) || e.offsetWidth || e.clientWidth,
+				h : parseInt(h) || e.offsetHeight || e.clientHeight
+			};
+		},
+
+		getParent : function(n, f, r) {
+			var na, se = this.settings;
+
+			n = this.get(n);
+
+			if (se.strict_root)
+				r = r || this.getRoot();
+
+			// Wrap node name as func
+			if (is(f, 'string')) {
+				na = f.toUpperCase();
+
+				f = function(n) {
+					var s = false;
+
+					// Any element
+					if (n.nodeType == 1 && na === '*') {
+						s = true;
+						return false;
+					}
+
+					each(na.split(','), function(v) {
+						if (n.nodeType == 1 && ((se.strict && n.nodeName.toUpperCase() == v) || n.nodeName == v)) {
+							s = true;
+							return false; // Break loop
+						}
+					});
+
+					return s;
+				};
+			}
+
+			while (n) {
+				if (n == r)
+					return null;
+
+				if (f(n))
+					return n;
+
+				n = n.parentNode;
+			}
+
+			return null;
+		},
+
+		get : function(e) {
+			if (typeof(e) == 'string')
+				return this.doc.getElementById(e);
+
+			return e;
+		},
+
+		// #if !jquery
+
+		select : function(pa, s) {
+			var t = this, cs, c, pl, o = [], x, i, l, n;
+
+			s = t.get(s) || t.doc;
+
+			if (t.settings.strict) {
+				function get(s, n) {
+					return s.getElementsByTagName(n.toLowerCase());
+				};
+			} else {
+				function get(s, n) {
+					return s.getElementsByTagName(n);
+				};
+			}
+
+			// Simple element pattern. For example: "p" or "*"
+			if (t.elmPattern.test(pa)) {
+				x = get(s, pa);
+
+				for (i = 0, l = x.length; i<l; i++)
+					o.push(x[i]);
+
+				return o;
+			}
+
+			// Simple class pattern. For example: "p.class" or ".class"
+			if (t.elmClassPattern.test(pa)) {
+				pl = t.elmClassPattern.exec(pa);
+				x = get(s, pl[1] || '*');
+				c = ' ' + pl[2] + ' ';
+
+				for (i = 0, l = x.length; i<l; i++) {
+					n = x[i];
+
+					if (n.className && (' ' + n.className + ' ').indexOf(c) !== -1)
+						o.push(n);
+				}
+
+				return o;
+			}
+
+			function collect(n) {
+				if (!n.mce_save) {
+					n.mce_save = 1;
+					o.push(n);
+				}
+			};
+
+			function collectIE(n) {
+				if (!n.getAttribute('mce_save')) {
+					n.setAttribute('mce_save', '1');
+					o.push(n);
+				}
+			};
+
+			function find(n, f, r) {
+				var i, l, nl = get(r, n);
+
+				for (i = 0, l = nl.length; i < l; i++)
+					f(nl[i]);
+			};
+
+			each(pa.split(','), function(v, i) {
+				v = tinymce.trim(v);
+
+				// Simple element pattern, most common in TinyMCE
+				if (t.elmPattern.test(v)) {
+					each(get(s, v), function(n) {
+						collect(n);
+					});
+
+					return;
+				}
+
+				// Simple element pattern with class, fairly common in TinyMCE
+				if (t.elmClassPattern.test(v)) {
+					x = t.elmClassPattern.exec(v);
+
+					each(get(s, x[1]), function(n) {
+						if (t.hasClass(n, x[2]))
+							collect(n);
+					});
+
+					return;
+				}
+
+				if (!(cs = t.cache[pa])) {
+					cs = 'x=(function(cf, s) {';
+					pl = v.split(' ');
+
+					each(pl, function(v) {
+						var p = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i.exec(v);
+
+						// Find elements
+						p[1] = p[1] || '*';
+						cs += 'find("' + p[1] + '", function(n) {';
+
+						// Check id
+						if (p[2])
+							cs += 'if (n.id !== "' + p[2] + '") return;';
+
+						// Check classes
+						if (p[3]) {
+							cs += 'var c = " " + n.className + " ";';
+							cs += 'if (';
+							c = '';
+							each(p[3].split('.'), function(v) {
+								if (v)
+									c += (c ? '||' : '') + 'c.indexOf(" ' + v + ' ") === -1';
+							});
+							cs += c + ') return;';
+						}
+					});
+
+					cs += 'cf(n);';
+
+					for (i = pl.length - 1; i >= 0; i--)
+						cs += '}, ' + (i ? 'n' : 's') + ');';
+
+					cs += '})';
+
+					// Compile CSS pattern function
+					t.cache[pa] = cs = eval(cs);
+				}
+
+				// Run selector function
+				cs(isIE ? collectIE : collect, s);
+			});
+
+			// Cleanup
+			each(o, function(n) {
+				if (isIE)
+					n.removeAttribute('mce_save');
+				else
+					delete n.mce_save;
+			});
+
+			return o;
+		},
+
+		// #endif
+
+		add : function(p, n, a, h, c) {
+			var t = this;
+
+			return this.run(p, function(p) {
+				var e, k;
+
+				e = is(n, 'string') ? t.doc.createElement(n) : n;
+
+				if (a) {
+					for (k in a) {
+						if (a.hasOwnProperty(k) && !is(a[k], 'object'))
+							t.setAttrib(e, k, '' + a[k]);
+					}
+
+					if (a.style && !is(a.style, 'string')) {
+						each(a.style, function(v, n) {
+							t.setStyle(e, n, v);
+						});
+					}
+				}
+
+				if (h) {
+					if (h.nodeType)
+						e.appendChild(h);
+					else
+						t.setHTML(e, h);
+				}
+
+				return !c ? p.appendChild(e) : e;
+			});
+		},
+
+		create : function(n, a, h) {
+			return this.add(this.doc.createElement(n), n, a, h, 1);
+		},
+
+		createHTML : function(n, a, h) {
+			var o = '', t = this, k;
+
+			o += '<' + n;
+
+			for (k in a) {
+				if (a.hasOwnProperty(k))
+					o += ' ' + k + '="' + t.encode(a[k]) + '"';
+			}
+
+			if (tinymce.is(h))
+				return o + '>' + h + '</' + n + '>';
+
+			return o + ' />';
+		},
+
+		remove : function(n, k) {
+			return this.run(n, function(n) {
+				var p;
+
+				p = n.parentNode;
+
+				if (!p)
+					return null;
+
+				if (k) {
+					each (n.childNodes, function(c) {
+						p.insertBefore(c.cloneNode(true), n);
+					});
+				}
+
+				return p.removeChild(n);
+			});
+		},
+
+		// #if !jquery
+
+		setStyle : function(n, na, v) {
+			var t = this;
+
+			return t.run(n, function(e) {
+				var s, i;
+
+				s = e.style;
+
+				// Camelcase it, if needed
+				na = na.replace(/-(\D)/g, function(a, b){
+					return b.toUpperCase();
+				});
+
+				// Default px suffix on these
+				if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))
+					v += 'px';
+
+				switch (na) {
+					case 'opacity':
+						// IE specific opacity
+						if (isIE) {
+							s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";
+
+							if (!n.currentStyle || !n.currentStyle.hasLayout)
+								s.display = 'inline-block';
+						}
+
+						// Fix for older browsers
+						s['-moz-opacity'] = s['-khtml-opacity'] = v;
+						break;
+
+					case 'float':
+						isIE ? s.styleFloat = v : s.cssFloat = v;
+						break;
+				}
+
+				s[na] = v || '';
+
+				// Force update of the style data
+				if (t.settings.update_styles)
+					t.setAttrib(e, 'mce_style');
+			});
+		},
+
+		getStyle : function(n, na, c) {
+			n = this.get(n);
+
+			if (!n)
+				return false;
+
+			// Gecko
+			if (this.doc.defaultView && c) {
+				// Remove camelcase
+				na = na.replace(/[A-Z]/g, function(a){
+					return '-' + a;
+				});
+
+				try {
+					return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);
+				} catch (ex) {
+					// Old safari might fail
+					return null;
+				}
+			}
+
+			// Camelcase it, if needed
+			na = na.replace(/-(\D)/g, function(a, b){
+				return b.toUpperCase();
+			});
+
+			if (na == 'float')
+				na = isIE ? 'styleFloat' : 'cssFloat';
+
+			// IE & Opera
+			if (n.currentStyle && c)
+				return n.currentStyle[na];
+
+			return n.style[na];
+		},
+
+		setStyles : function(e, o) {
+			var t = this, s = t.settings, ol;
+
+			ol = s.update_styles;
+			s.update_styles = 0;
+
+			each(o, function(v, n) {
+				t.setStyle(e, n, v);
+			});
+
+			// Update style info
+			s.update_styles = ol;
+			if (s.update_styles)
+				t.setAttrib(e, s.cssText);
+		},
+
+		setAttrib : function(e, n, v) {
+			var t = this;
+
+			// Strict XML mode
+			if (t.settings.strict)
+				n = n.toLowerCase();
+
+			return this.run(e, function(e) {
+				var s = t.settings;
+
+				switch (n) {
+					case "style":
+						if (s.keep_values) {
+							if (v)
+								e.setAttribute('mce_style', v, 2);
+							else
+								e.removeAttribute('mce_style', 2);
+						}
+
+						e.style.cssText = v;
+						break;
+
+					case "class":
+						e.className = v;
+						break;
+
+					case "src":
+					case "href":
+						if (s.keep_values) {
+							if (s.url_converter)
+								v = s.url_converter.call(s.url_converter_scope || t, v, n, e);
+
+							t.setAttrib(e, 'mce_' + n, v, 2);
+						}
+
+						break;
+				}
+
+				if (is(v) && v !== null && v.length !== 0)
+					e.setAttribute(n, '' + v, 2);
+				else
+					e.removeAttribute(n, 2);
+			});
+		},
+
+		setAttribs : function(e, o) {
+			var t = this;
+
+			return this.run(e, function(e) {
+				each(o, function(v, n) {
+					t.setAttrib(e, n, v);
+				});
+			});
+		},
+
+		// #endif
+
+		getAttrib : function(e, n, dv) {
+			var v, t = this;
+
+			e = t.get(e);
+
+			if (!e)
+				return false;
+
+			if (!is(dv))
+				dv = "";
+
+			// Try the mce variant for these
+			if (/^(src|href|style|coords)$/.test(n)) {
+				v = e.getAttribute("mce_" + n);
+
+				if (v)
+					return v;
+			}
+
+			v = e.getAttribute(n, 2);
+
+			if (!v) {
+				switch (n) {
+					case 'class':
+						v = e.className;
+						break;
+
+					default:
+						v = e.attributes[n];
+						v = v && is(v.nodeValue) ? v.nodeValue : v;
+				}
+			}
+
+			switch (n) {
+				case 'style':
+					v = v || e.style.cssText;
+
+					if (v) {
+						v = t.serializeStyle(t.parseStyle(v));
+
+						if (t.settings.keep_values)
+							e.setAttribute('mce_style', v);
+					}
+
+					break;
+			}
+
+			// Remove Apple and WebKit stuff
+			if (isWebKit && n === "class" && v)
+				v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');
+
+			// Handle IE issues
+			if (isIE) {
+				switch (n) {
+					case 'rowspan':
+					case 'colspan':
+						// IE returns 1 as default value
+						if (v === 1)
+							v = '';
+
+						break;
+
+					case 'size':
+						// IE returns +0 as default value for size
+						if (v === '+0')
+							v = '';
+
+						break;
+
+					case 'hspace':
+						// IE returns -1 as default value
+						if (v === -1)
+							v = '';
+
+						break;
+
+					case 'tabindex':
+						// IE returns 32768 as default value
+						if (v === 32768)
+							v = '';
+
+						break;
+
+					case 'shape':
+						v = v.toLowerCase();
+						break;
+
+					default:
+						// IE has odd anonymous function for event attributes
+						if (n.indexOf('on') === 0 && v)
+							v = ('' + v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/, '$1');
+				}
+			}
+
+			return (v && v != '') ? '' + v : dv;
+		},
+
+		getPos : function(n) {
+			var t = this, x = 0, y = 0, e, d = t.doc, r;
+
+			n = t.get(n);
+
+			// Use getBoundingClientRect on IE, Opera has it but it's not perfect
+			if (n && isIE) {
+				n = n.getBoundingClientRect();
+				e = t.boxModel ? d.documentElement : d.body;
+				x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border
+				x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x;
+				n.top += window.self != window.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset
+
+				return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x};
+			}
+
+			r = n;
+			while (r) {
+				x += r.offsetLeft || 0;
+				y += r.offsetTop || 0;
+
+				r = r.offsetParent;
+			}
+
+			r = n;
+			while (r) {
+				x -= r.scrollLeft || 0;
+				y -= r.scrollTop || 0;
+
+				r = r.parentNode;
+
+				if (r == d.body)
+					break;
+			}
+
+			return {x : x, y : y};
+		},
+
+		parseStyle : function(st) {
+			var t = this, s = t.settings, o = {};
+
+			if (!st)
+				return o;
+
+			function compress(p, s, ot) {
+				var t, r, b, l;
+
+				// Get values and check it it needs compressing
+				t = o[p + '-top' + s];
+				if (!t)
+					return;
+
+				r = o[p + '-right' + s];
+				if (t != r)
+					return;
+
+				b = o[p + '-bottom' + s];
+				if (r != b)
+					return;
+
+				l = o[p + '-left' + s];
+				if (b != l)
+					return;
+
+				// Compress
+				o[ot] = l;
+				delete o[p + '-top' + s];
+				delete o[p + '-right' + s];
+				delete o[p + '-bottom' + s];
+				delete o[p + '-left' + s];
+			};
+
+			function compress2(ta, a, b, c) {
+				var t;
+
+				t = o[a];
+				if (!t)
+					return;
+
+				t = o[b];
+				if (!t)
+					return;
+
+				t = o[c];
+				if (!t)
+					return;
+
+				// Compress
+				o[ta] = o[a] + ' ' + o[b] + ' ' + o[c];
+				delete o[a];
+				delete o[b];
+				delete o[c];
+			};
+
+			each(st.split(';'), function(v) {
+				var sv, ur = [];
+
+				if (v) {
+					v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});
+					v = v.split(':');
+					sv = tinymce.trim(v[1]);
+					sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];});
+
+					sv = sv.replace(/rgb\([^\)]+\)/g, function(v) {
+						return t.toHex(v);
+					});
+
+					if (s.url_converter) {
+						sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {
+							return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null)) + ')';
+						});
+					}
+
+					o[tinymce.trim(v[0]).toLowerCase()] = sv;
+				}
+			});
+
+			compress("border", "", "border");
+			compress("border", "-width", "border-width");
+			compress("border", "-color", "border-color");
+			compress("border", "-style", "border-style");
+			compress("padding", "", "padding");
+			compress("margin", "", "margin");
+			compress2('border', 'border-width', 'border-style', 'border-color');
+
+			if (isIE) {
+				// Remove pointless border
+				if (o.border == 'medium none')
+					o.border = '';
+			}
+
+			return o;
+		},
+
+		serializeStyle : function(o) {
+			var s = '';
+
+			each(o, function(v, k) {
+				if (k && v) {
+					switch (k) {
+						case 'color':
+						case 'background-color':
+							v = v.toLowerCase();
+							break;
+					}
+
+					s += (s ? ' ' : '') + k + ': ' + v + ';';
+				}
+			});
+
+			return s;
+		},
+
+		loadCSS : function(u) {
+			var t = this, d = this.doc;
+
+			if (!u)
+				u = '';
+
+			each(u.split(','), function(u) {
+				if (t.files[u])
+					return;
+
+				t.files[u] = true;
+
+				if (!d.createStyleSheet)
+					t.add(t.select('head')[0], 'link', {rel : 'stylesheet', href : u});
+				else
+					d.createStyleSheet(u);
+			});
+		},
+
+		// #if !jquery
+
+		addClass : function(e, c) {
+			return this.run(e, function(e) {
+				var o;
+
+				if (!c)
+					return 0;
+
+				if (this.hasClass(e, c))
+					return e.className;
+
+				o = this.removeClass(e, c);
+
+				return e.className = (o != '' ? (o + ' ') : '') + c;
+			});
+		},
+
+		removeClass : function(e, c) {
+			var t = this, re;
+
+			return t.run(e, function(e) {
+				var v;
+
+				if (t.hasClass(e, c)) {
+					if (!re)
+						re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");
+
+					v = e.className.replace(re, ' ');
+
+					return e.className = tinymce.trim(v != ' ' ? v : '');
+				}
+
+				return e.className;
+			});
+		},
+
+		hasClass : function(n, c) {
+			n = this.get(n);
+
+			if (!n || !c)
+				return false;
+
+			return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;
+		},
+
+		show : function(e) {
+			return this.setStyle(e, 'display', 'block');
+		},
+
+		hide : function(e) {
+			return this.setStyle(e, 'display', 'none');
+		},
+
+		isHidden : function(e) {
+			e = this.get(e);
+
+			return e.style.display == 'none' || this.getStyle(e, 'display') == 'none';
+		},
+
+		// #endif
+
+		uniqueId : function(p) {
+			return (!p ? 'mce_' : p) + (this.counter++);
+		},
+
+		setHTML : function(e, h) {
+			var t = this;
+
+			return this.run(e, function(e) {
+				var x;
+
+				h = t.processHTML(h);
+
+				if (isIE) {
+					try {
+						// IE will remove comments from the beginning
+						// unless you padd the contents with something
+						e.innerHTML = '<br />' + h;
+						e.removeChild(e.firstChild);
+					} catch (ex) {
+						// IE sometimes produces an unknown runtime error on innerHTML
+						// This seems to fix this issue, don't know why.
+						x = t.create('div');
+						x.innerHTML = '<br />' + h;
+
+						each (x.childNodes, function(n, i) {
+							// Skip the BR
+							if (i > 1)
+								e.appendChild(n);
+						});
+					}
+				} else
+					e.innerHTML = h;
+
+				return h;
+			});
+		},
+
+		processHTML : function(h) {
+			var t = this, s = t.settings;
+
+			if (!s.process_html)
+				return h;
+
+			// Convert strong and em to b and i in FF since it can't handle them
+			if (tinymce.isGecko) {
+				h = h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi, '<$1b$2>');
+				h = h.replace(/<(\/?)em>|<em( [^>]+)>/gi, '<$1i$2>');
+			}
+
+			// Fix some issues
+			h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open
+
+			// Store away src and href in mce_src and mce_href since browsers mess them up
+			if (s.keep_values) {
+				// Wrap scripts in comments for serialization purposes
+				if (h.indexOf('<script') !== -1) {
+					h = h.replace(/<script>/g, '<script type="text/javascript">');
+					h = h.replace(/<script(|[^>]+)>(\s*<!--|\/\/\s*<\[CDATA\[)?[\r\n]*/g, '<mce:script$1><!--\n');
+					h = h.replace(/\s*(\/\/\s*-->|\/\/\s*]]>)?<\/script>/g, '\n// --></mce:script>');
+					h = h.replace(/<mce:script(|[^>]+)><!--\n\/\/ --><\/mce:script>/g, '<mce:script$1></mce:script>');
+				}
+
+				// Process all tags with src, href or style
+				h = h.replace(/<([\w:]+) [^>]*(src|href|style|coords)[^>]*>/gi, function(a, n) {
+					function handle(m, b, c) {
+						var u = c;
+
+						// Tag already got a mce_ version
+						if (a.indexOf('mce_' + b) != -1)
+							return m;
+
+						if (b == 'style') {
+							// Why did I need this one?
+							//if (isIE)
+							//	u = t.serializeStyle(t.parseStyle(u));
+
+							if (s.hex_colors) {
+								u = u.replace(/rgb\([^\)]+\)/g, function(v) {
+									return t.toHex(v);
+								});
+							}
+
+							if (s.url_converter) {
+								u = u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g, function(x, c) {
+									return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)) + ')';
+								});
+							}
+						} else if (b != 'coords') {
+							if (s.url_converter)
+								u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n));
+						}
+
+						return ' ' + b + '="' + c + '" mce_' + b + '="' + u + '"';
+					};
+
+					a = a.replace(/ (src|href|style|coords)=[\"]([^\"]+)[\"]/gi, handle); // W3C
+					a = a.replace(/ (src|href|style|coords)=[\']([^\']+)[\']/gi, handle); // W3C
+
+					return a.replace(/ (src|href|style|coords)=([^\s\"\'>]+)/gi, handle); // IE
+				});
+			}
+
+			return h;
+		},
+
+		getOuterHTML : function(e) {
+			var d;
+
+			e = this.get(e);
+
+			if (!e)
+				return null;
+
+			if (isIE)
+				return e.outerHTML;
+
+			d = (e.ownerDocument || this.doc).createElement("body");
+			d.appendChild(e.cloneNode(true));
+
+			return d.innerHTML;
+		},
+
+		setOuterHTML : function(e, h, d) {
+			var t = this;
+
+			return this.run(e, function(e) {
+				var n, tp;
+
+				e = t.get(e);
+				d = d || e.ownerDocument || t.doc;
+
+				if (isIE && e.nodeType == 1)
+					e.outerHTML = h;
+				else {
+					tp = d.createElement("body");
+					tp.innerHTML = h;
+
+					n = tp.lastChild;
+					while (n) {
+						t.insertAfter(n.cloneNode(true), e);
+						n = n.previousSibling;
+					}
+
+					t.remove(e);
+				}
+			});
+		},
+
+		decode : function(s) {
+			var e = document.createElement("div");
+
+			e.innerHTML = s;
+
+			return !e.firstChild ? s : e.firstChild.nodeValue;
+		},
+
+		encode : function(s) {
+			return s ? ('' + s).replace(/[<>&\"]/g, function (c, b) {
+				switch (c) {
+					case '&':
+						return '&amp;';
+
+					case '"':
+						return '&quot;';
+
+					case '<':
+						return '&lt;';
+
+					case '>':
+						return '&gt;';
+				}
+
+				return c;
+			}) : s;
+		},
+
+		// #if !jquery
+
+		insertAfter : function(n, r) {
+			var t = this;
+
+			r = t.get(r);
+
+			return this.run(n, function(n) {
+				var p, ns;
+
+				p = r.parentNode;
+				ns = r.nextSibling;
+
+				if (ns)
+					p.insertBefore(n, ns);
+				else
+					p.appendChild(n);
+
+				return n;
+			});
+		},
+
+		// #endif
+
+		isBlock : function(n) {
+			if (n.nodeType && n.nodeType !== 1)
+				return false;
+
+			n = n.nodeName || n;
+
+			return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);
+		},
+
+		// #if !jquery
+
+		replace : function(n, o, k) {
+			if (is(o, 'array'))
+				n = n.cloneNode(true);
+
+			return this.run(o, function(o) {
+				if (k) {
+					each(o.childNodes, function(c) {
+						n.appendChild(c.cloneNode(true));
+					});
+				}
+
+				return o.parentNode.replaceChild(n, o);
+			});
+		},
+
+		// #endif
+
+		toHex : function(s) {
+			var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);
+
+			function hex(s) {
+				s = parseInt(s).toString(16);
+
+				return s.length > 1 ? s : '0' + s; // 0 -> 00
+			};
+
+			if (c) {
+				s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);
+
+				return s;
+			}
+
+			return s;
+		},
+
+		getClasses : function() {
+			var t = this, cl = [], i, lo = {}, f = t.settings.class_filter;
+
+			if (t.classes)
+				return t.classes;
+
+			function addClasses(s) {
+				// IE style imports
+				each(s.imports, function(r) {
+					addClasses(r);
+				});
+
+				each(s.cssRules || s.rules, function(r) {
+					// Real type or fake it on IE
+					switch (r.type || 1) {
+						// Rule
+						case 1:
+							if (r.selectorText) {
+								each(r.selectorText.split(','), function(v) {
+									v = v.replace(/^\s*|\s*$|^\s\./g, "");
+
+									if (f && !(v = f(v)))
+										return;
+
+									if (/^\.mce/.test(v) || !/^\.[\w\-]+$/.test(v))
+										return;
+
+									v = v.substring(1);
+									if (!lo[v]) {
+										cl.push({'class' : v});
+										lo[v] = 1;
+									}
+								});
+							}
+							break;
+
+						// Import
+						case 3:
+							addClasses(r.styleSheet);
+							break;
+					}
+				});
+			};
+
+			try {
+				each(t.doc.styleSheets, addClasses);
+			} catch (ex) {
+				// Ignore
+			}
+
+			if (cl.length > 0)
+				t.classes = cl;
+
+			return cl;
+		},
+
+		run : function(e, f, s) {
+			var t = this, o;
+
+			if (typeof(e) === 'string')
+				e = t.doc.getElementById(e);
+
+			if (!e)
+				return false;
+
+			s = s || this;
+			if (!e.nodeType && (e.length || e.length === 0)) {
+				o = [];
+
+				each(e, function(e, i) {
+					if (e) {
+						if (typeof(e) == 'string')
+							e = t.doc.getElementById(e);
+
+						o.push(f.call(s, e, i));
+					}
+				});
+
+				return o;
+			}
+
+			return f.call(s, e);
+		}
+
+		/*
+		walk : function(n, f, s) {
+			var d = this.doc, w;
+
+			if (d.createTreeWalker) {
+				w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
+
+				while ((n = w.nextNode()) != null)
+					f.call(s || this, n);
+			} else
+				tinymce.walk(n, f, 'childNodes', s);
+		}
+		*/
+
+		/*
+		toRGB : function(s) {
+			var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);
+
+			if (c) {
+				// #FFF -> #FFFFFF
+				if (!is(c[3]))
+					c[3] = c[2] = c[1];
+
+				return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";
+			}
+
+			return s;
+		}
+		*/
+
+		});
+
+	// Setup page DOM
+	tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/Event.js */
+
+(function() {
+	// Shorten names
+	var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event;
+
+	tinymce.create('static tinymce.dom.Event', {
+		inits : [],
+		events : [],
+
+		// #if !jquery
+
+		add : function(o, n, f, s) {
+			var cb, t = this, el = t.events, r;
+
+			// Handle array
+			if (o && o instanceof Array) {
+				r = [];
+
+				each(o, function(o) {
+					o = DOM.get(o);
+					r.push(t.add(o, n, f, s));
+				});
+
+				return r;
+			}
+
+			o = DOM.get(o);
+
+			if (!o)
+				return;
+
+			// Setup event callback
+			cb = function(e) {
+				e = e || window.event;
+
+				// Patch in target in IE it's W3C valid
+				if (e && !e.target && isIE)
+					e.target = e.srcElement;
+
+				if (!s)
+					return f(e);
+
+				return f.call(s, e);
+			};
+
+			if (n == 'unload') {
+				tinymce.unloads.unshift({func : cb});
+				return cb;
+			}
+
+			if (n == 'init') {
+				if (t.domLoaded)
+					cb();
+				else
+					t.inits.push(cb);
+
+				return cb;
+			}
+
+			// Store away listener reference
+			el.push({
+				obj : o,
+				name : n,
+				func : f,
+				cfunc : cb,
+				scope : s
+			});
+
+			t._add(o, n, cb);
+
+			return f;
+		},
+
+		remove : function(o, n, f) {
+			var t = this, a = t.events, s = false, r;
+
+			// Handle array
+			if (o && o instanceof Array) {
+				r = [];
+
+				each(o, function(o) {
+					o = DOM.get(o);
+					r.push(t.remove(o, n, f));
+				});
+
+				return r;
+			}
+
+			o = DOM.get(o);
+
+			each(a, function(e, i) {
+				if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) {
+					a.splice(i, 1);
+					t._remove(o, n, e.cfunc);
+					s = true;
+					return false;
+				}
+			});
+
+			return s;
+		},
+
+		// #endif
+
+		cancel : function(e) {
+			if (!e)
+				return false;
+
+			this.stop(e);
+			return this.prevent(e);
+		},
+
+		stop : function(e) {
+			if (e.stopPropagation)
+				e.stopPropagation();
+			else
+				e.cancelBubble = true;
+
+			return false;
+		},
+
+		prevent : function(e) {
+			if (e.preventDefault)
+				e.preventDefault();
+			else
+				e.returnValue = false;
+
+			return false;
+		},
+
+		_unload : function() {
+			var t = Event;
+
+			each(t.events, function(e, i) {
+				t._remove(e.obj, e.name, e.cfunc);
+				e.obj = e.cfunc = null;
+			});
+
+			t.events = [];
+			t = null;
+		},
+
+		_add : function(o, n, f) {
+			if (o.attachEvent)
+				o.attachEvent('on' + n, f);
+			else if (o.addEventListener)
+				o.addEventListener(n, f, false);
+			else
+				o['on' + n] = f;
+		},
+
+		_remove : function(o, n, f) {
+			if (o.detachEvent)
+				o.detachEvent('on' + n, f);
+			else if (o.removeEventListener)
+				o.removeEventListener(n, f, false);
+			else
+				o['on' + n] = null;
+		},
+
+		_pageInit : function() {
+			var e = Event;
+
+			e._remove(window, 'DOMContentLoaded', e._pageInit);
+			e.domLoaded = true;
+
+			each(e.inits, function(c) {
+				c();
+			});
+
+			e.inits = [];
+		},
+
+		_wait : function() {
+			var t;
+
+			// No need since the document is already loaded
+			if (window.tinyMCE_GZ && tinyMCE_GZ.loaded)
+				return;
+
+			if (isIE && document.location.protocol != 'https:') {
+				// Fake DOMContentLoaded on IE
+				document.write('<script id=__ie_onload defer src=\'javascript:""\';><\/script>');
+				DOM.get("__ie_onload").onreadystatechange = function() {
+					if (this.readyState == "complete") {
+						Event._pageInit();
+						DOM.get("__ie_onload").onreadystatechange = null; // Prevent leak
+					}
+				};
+			} else {
+				Event._add(window, 'DOMContentLoaded', Event._pageInit, Event);
+
+				if (isIE || isWebKit) {
+					t = setInterval(function() {
+						if (/loaded|complete/.test(document.readyState)) {
+							clearInterval(t);
+							Event._pageInit();
+						}
+					}, 10);
+				}
+			}
+		}
+
+		});
+
+	// Shorten name
+	Event = tinymce.dom.Event;
+
+	// Dispatch DOM content loaded event for IE and Safari
+	Event._wait();
+	tinymce.addUnload(Event._unload);
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/Element.js */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.dom.Element', {
+		Element : function(id, s) {
+			var t = this, dom, el;
+
+			s = s || {};
+			t.id = id;
+			t.dom = dom = s.dom || tinymce.DOM;
+			t.settings = s;
+
+			// Only IE leaks DOM references, this is a lot faster
+			if (!tinymce.isIE)
+				el = t.dom.get(t.id);
+
+			each([
+				'getPos',
+				'getRect',
+				'getParent',
+				'add',
+				'setStyle',
+				'getStyle',
+				'setStyles',
+				'setAttrib',
+				'setAttribs',
+				'getAttrib',
+				'addClass',
+				'removeClass',
+				'hasClass',
+				'getOuterHTML',
+				'setOuterHTML',
+				'remove',
+				'show',
+				'hide',
+				'isHidden',
+				'setHTML',
+				'get'
+			], function(k) {
+				t[k] = function() {
+					var a = arguments, o;
+
+					// Opera fails
+					if (tinymce.isOpera) {
+						a = [id];
+
+						each(arguments, function(v) {
+							a.push(v);
+						});
+					} else
+						Array.prototype.unshift.call(a, el || id);
+
+					o = dom[k].apply(dom, a);
+					t.update(k);
+
+					return o;
+				};
+			});
+		},
+
+		on : function(n, f, s) {
+			return tinymce.dom.Event.add(this.id, n, f, s);
+		},
+
+		getXY : function() {
+			return {
+				x : parseInt(this.getStyle('left')),
+				y : parseInt(this.getStyle('top'))
+			};
+		},
+
+		getSize : function() {
+			var n = this.dom.get(this.id);
+
+			return {
+				w : parseInt(this.getStyle('width') || n.clientWidth),
+				h : parseInt(this.getStyle('height') || n.clientHeight)
+			};
+		},
+
+		moveTo : function(x, y) {
+			this.setStyles({left : x, top : y});
+		},
+
+		moveBy : function(x, y) {
+			var p = this.getXY();
+
+			this.moveTo(p.x + x, p.y + y);
+		},
+
+		resizeTo : function(w, h) {
+			this.setStyles({width : w, height : h});
+		},
+
+		resizeBy : function(w, h) {
+			var s = this.getSize();
+
+			this.resizeTo(s.w + w, s.h + h);
+		},
+
+		update : function(k) {
+			var t = this, b, dom = t.dom;
+
+			if (tinymce.isIE6 && t.settings.blocker) {
+				k = k || '';
+
+				// Ignore getters
+				if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)
+					return;
+
+				// Remove blocker on remove
+				if (k == 'remove') {
+					dom.remove(t.blocker);
+					return;
+				}
+
+				if (!t.blocker) {
+					t.blocker = dom.uniqueId();
+					b = dom.add(t.settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});
+					dom.setStyle(b, 'opacity', 0);
+				} else
+					b = dom.get(t.blocker);
+
+				dom.setStyle(b, 'left', t.getStyle('left', 1));
+				dom.setStyle(b, 'top', t.getStyle('top', 1));
+				dom.setStyle(b, 'width', t.getStyle('width', 1));
+				dom.setStyle(b, 'height', t.getStyle('height', 1));
+				dom.setStyle(b, 'display', t.getStyle('display', 1));
+				dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1);
+			}
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/Selection.js */
+
+(function() {
+	// Shorten names
+	var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;
+
+	tinymce.create('tinymce.dom.Selection', {
+		Selection : function(dom, win, serializer) {
+			var t = this;
+
+			t.dom = dom;
+			t.win = win;
+			t.serializer = serializer;
+
+			// Prevent leaks
+			tinymce.addUnload(function() {
+				t.win = null;
+			});
+		},
+
+		getContent : function(s) {
+			var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;
+
+			s = s || {};
+			wb = wa = '';
+			s.get = true;
+			s.format = s.format || 'html';
+
+			if (s.format == 'text')
+				return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));
+
+			if (r.cloneContents) {
+				n = r.cloneContents();
+
+				if (n)
+					e.appendChild(n);
+			} else if (is(r.item) || is(r.htmlText))
+				e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
+			else
+				e.innerHTML = r.toString();
+
+			// Keep whitespace before and after
+			if (/^\s/.test(e.innerHTML))
+				wb = ' ';
+
+			if (/\s+$/.test(e.innerHTML))
+				wa = ' ';
+
+			s.getInner = true;
+
+			return t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;
+		},
+
+		setContent : function(h, s) {
+			var t = this, r = t.getRng(), d;
+
+			s = s || {format : 'html'};
+			s.set = true;
+			h = t.dom.processHTML(h);
+
+			if (r.insertNode) {
+				d = t.win.document;
+
+				// Gecko has a bug where if you insert &nbsp; using InsertHTML it will insert a space instead
+				// So we simply check if the input is HTML or text and then insert text using the insertNode method
+				if (tinymce.isGecko && h.indexOf('<') == -1) {
+					r.deleteContents();
+					r.insertNode(t.getRng().createContextualFragment(h + '<span id="__caret">_</span>'));
+					t.select(t.dom.get('__caret'));
+					t.getRng().deleteContents();
+					return;
+				}
+
+				// Use insert HTML if it exists (places cursor after content)
+				if (d.queryCommandEnabled('InsertHTML'))
+					return d.execCommand('InsertHTML', false, h);
+
+				r.deleteContents();
+				r.insertNode(t.getRng().createContextualFragment(h));
+			} else {
+				if (r.item)
+					r.item(0).outerHTML = h;
+				else
+					r.pasteHTML(h);
+			}
+		},
+
+		getStart : function() {
+			var t = this, r = t.getRng(), e;
+
+			if (isIE) {
+				if (r.item)
+					return r.item(0);
+
+				r = r.duplicate();
+				r.collapse(1);
+				e = r.parentElement();
+
+				if (e.nodeName == 'BODY')
+					return e.firstChild;
+
+				return e;
+			} else {
+				e = r.startContainer;
+
+				if (e.nodeName == 'BODY')
+					return e.firstChild;
+
+				return t.dom.getParent(e, function(n) {return n.nodeType == 1;});
+			}
+		},
+
+		getEnd : function() {
+			var t = this, r = t.getRng(), e;
+
+			if (isIE) {
+				if (r.item)
+					return r.item(0);
+
+				r = r.duplicate();
+				r.collapse(0);
+				e = r.parentElement();
+
+				if (e.nodeName == 'BODY')
+					return e.lastChild;
+
+				return e;
+			} else {
+				e = r.endContainer;
+
+				if (e.nodeName == 'BODY')
+					return e.lastChild;
+
+				return t.dom.getParent(e, function(n) {return n.nodeType == 1;});
+			}
+		},
+
+		getBookmark : function(si) {
+			var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot();
+
+			sx = vp.x;
+			sy = vp.y;
+
+			// Simple bookmark fast but not as persistent
+			if (si == 'simple')
+				return {rng : r, scrollX : sx, scrollY : sy};
+
+			// Handle IE
+			if (isIE) {
+				// Control selection
+				if (r.item) {
+					e = r.item(0);
+
+					each(t.dom.select(e.nodeName), function(n, i) {
+						if (e == n) {
+							sp = i;
+							return false;
+						}
+					});
+
+					return {
+						tag : e.nodeName,
+						index : sp,
+						scrollX : sx,
+						scrollY : sy
+					};
+				}
+
+				// Text selection
+				tr = t.dom.doc.body.createTextRange();
+				tr.moveToElementText(ro);
+				tr.collapse(true);
+				bp = Math.abs(tr.move('character', c));
+
+				tr = r.duplicate();
+				tr.collapse(true);
+				sp = Math.abs(tr.move('character', c));
+
+				tr = r.duplicate();
+				tr.collapse(false);
+				le = Math.abs(tr.move('character', c)) - sp;
+
+				return {
+					start : sp - bp,
+					length : le,
+					scrollX : sx,
+					scrollY : sy
+				};
+			}
+
+			// Handle W3C
+			e = t.getNode();
+			s = t.getSel();
+
+			if (!s)
+				return null;
+
+			// Image selection
+			if (e && e.nodeName == 'IMG') {
+				return {
+					scrollX : sx,
+					scrollY : sy
+				};
+			}
+
+			// Text selection
+
+			function getPos(r, sn, en) {
+				var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
+
+				while ((n = w.nextNode()) != null) {
+					if (n == sn)
+						d.start = p;
+
+					if (n == en) {
+						d.end = p;
+						return d;
+					}
+
+					p += n.nodeValue ? n.nodeValue.length : 0;
+				}
+
+				return null;
+			};
+
+			// Caret or selection
+			if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) {
+				e = getPos(ro, s.anchorNode, s.focusNode);
+
+				if (!e)
+					return {scrollX : sx, scrollY : sy};
+
+				return {
+					start : e.start + s.anchorOffset,
+					end : e.end + s.focusOffset,
+					scrollX : sx,
+					scrollY : sy
+				};
+			} else {
+				e = getPos(ro, r.startContainer, r.endContainer);
+
+				if (!e)
+					return {scrollX : sx, scrollY : sy};
+
+				return {
+					start : e.start + r.startOffset,
+					end : e.end + r.endOffset,
+					scrollX : sx,
+					scrollY : sy
+				};
+			}
+		},
+
+		moveToBookmark : function(b) {
+			var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd;
+
+			function getPos(r, sp, ep) {
+				var w = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
+
+				while ((n = w.nextNode()) != null) {
+					p += n.nodeValue ? n.nodeValue.length : 0;
+
+					if (p >= sp && !d.startNode) {
+						d.startNode = n;
+						d.startOffset = sp - (p - n.nodeValue.length);
+					}
+
+					if (p >= ep) {
+						d.endNode = n;
+						d.endOffset = ep - (p - n.nodeValue.length);
+
+						return d;
+					}
+				}
+
+				return null;
+			};
+
+			if (!b)
+				return false;
+
+			t.win.scrollTo(b.scrollX, b.scrollY);
+
+			// Handle explorer
+			if (isIE) {
+				// Handle simple
+				if (r = b.rng) {
+					try {
+						r.select();
+					} catch (ex) {
+						// Ignore
+					}
+
+					return true;
+				}
+
+				t.win.focus();
+
+				// Handle control bookmark
+				if (b.tag) {
+					r = ro.createControlRange();
+
+					each(t.dom.select(b.tag), function(n, i) {
+						if (i == b.index)
+							r.addElement(n);
+					});
+				} else {
+					// Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs
+					try {
+						// Incorrect bookmark
+						if (b.start < 0)
+							return true;
+
+						r = s.createRange();
+						r.moveToElementText(ro);
+						r.collapse(true);
+						r.moveStart('character', b.start);
+						r.moveEnd('character', b.length);
+					} catch (ex2) {
+						return true;
+					}
+				}
+
+				try {
+					r.select();
+				} catch (ex) {
+					// Needed for some odd IE bug #1843306
+				}
+
+				return true;
+			}
+
+			// Handle W3C
+			if (!s)
+				return false;
+
+			// Handle simple
+			if (b.rng) {
+				s.removeAllRanges();
+				s.addRange(b.rng);
+			} else {
+				if (is(b.start) && is(b.end)) {
+					try {
+						sd = getPos(ro, b.start, b.end);
+						if (sd) {
+							r = t.dom.doc.createRange();
+							r.setStart(sd.startNode, sd.startOffset);
+							r.setEnd(sd.endNode, sd.endOffset);
+							s.removeAllRanges();
+							s.addRange(r);
+						}
+
+						if (!tinymce.isOpera)
+							t.win.focus();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			}
+		},
+
+		select : function(n, c) {
+			var t = this, r = t.getRng(), s = t.getSel(), b, fn, ln, d = t.win.document;
+
+			function first(n) {
+				return n ? d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() : null;
+			};
+
+			function last(n) {
+				var c, o, w;
+
+				if (!n)
+					return null;
+
+				w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
+				while (c = w.nextNode())
+					o = c;
+
+				return o;
+			};
+
+			if (isIE) {
+				try {
+					b = d.body;
+
+					if (/^(IMG|TABLE)$/.test(n.nodeName)) {
+						r = b.createControlRange();
+						r.addElement(n);
+					} else {
+						r = b.createTextRange();
+						r.moveToElementText(n);
+					}
+
+					r.select();
+				} catch (ex) {
+					// Throws illigal agrument in IE some times
+				}
+			} else {
+				if (c) {
+					fn = first(n);
+					ln = last(n);
+
+					if (fn && ln) {
+						//console.debug(fn, ln);
+						r = d.createRange();
+						r.setStart(fn, 0);
+						r.setEnd(ln, ln.nodeValue.length);
+					} else
+						r.selectNode(n);
+				} else
+					r.selectNode(n);
+
+				t.setRng(r);
+			}
+
+			return n;
+		},
+
+		isCollapsed : function() {
+			var t = this, r = t.getRng(), s = t.getSel();
+
+			if (!r || r.item)
+				return false;
+
+			return !s || r.boundingWidth == 0 || s.isCollapsed;
+		},
+
+		collapse : function(b) {
+			var t = this, r = t.getRng(), n;
+
+			// Control range on IE
+			if (r.item) {
+				n = r.item(0);
+				r = this.win.document.body.createTextRange();
+				r.moveToElementText(n);
+			}
+
+			r.collapse(!!b);
+			t.setRng(r);
+		},
+
+		getSel : function() {
+			var t = this, w = this.win;
+
+			return w.getSelection ? w.getSelection() : w.document.selection;
+		},
+
+		getRng : function() {
+			var t = this, s = t.getSel(), r;
+
+			try {
+				if (s)
+					r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange());
+			} catch (ex) {
+				// IE throws unspecified error here if TinyMCE is placed in a frame/iframe
+			}
+
+			// No range found then create an empty one
+			// This can occur when the editor is placed in a hidden container element on Gecko
+			// Or on IE when there was an exception
+			if (!r)
+				r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange();
+
+			return r;
+		},
+
+		setRng : function(r) {
+			var s;
+
+			if (!isIE) {
+				s = this.getSel();
+
+				if (s) {
+					s.removeAllRanges();
+					s.addRange(r);
+				}
+			} else {
+				try {
+					r.select();
+				} catch (ex) {
+					// Needed for some odd IE bug #1843306
+				}
+			}
+		},
+
+		setNode : function(n) {
+			var t = this;
+
+			t.setContent(t.dom.getOuterHTML(n));
+
+			return n;
+		},
+
+		getNode : function() {
+			var t = this, r = t.getRng(), s = t.getSel(), e;
+
+			if (!isIE) {
+				// Range maybe lost after the editor is made visible again
+				if (!r)
+					return t.dom.getRoot();
+
+				e = r.commonAncestorContainer;
+
+				// Handle selection a image or other control like element such as anchors
+				if (!r.collapsed) {
+					if (r.startContainer == r.endContainer || (tinymce.isWebKit && r.startContainer == r.endContainer.parentNode)) {
+						if (r.startOffset - r.endOffset < 2 || tinymce.isWebKit) {
+							if (r.startContainer.hasChildNodes())
+								e = r.startContainer.childNodes[r.startOffset];
+						}
+					}
+				}
+
+				return t.dom.getParent(e, function(n) {
+					return n.nodeType == 1;
+				});
+			}
+
+			return r.item ? r.item(0) : r.parentElement();
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/XMLWriter.js */
+
+(function() {
+	tinymce.create('tinymce.dom.XMLWriter', {
+		node : null,
+
+		XMLWriter : function(s) {
+			// Get XML document
+			function getXML() {
+				var i = document.implementation;
+
+				if (!i || !i.createDocument) {
+					// Try IE objects
+					try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {}
+					try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {}
+				} else
+					return i.createDocument('', '', null);
+			};
+
+			this.doc = getXML();
+			this.reset();
+		},
+
+		reset : function() {
+			var t = this, d = t.doc;
+
+			if (d.firstChild)
+				d.removeChild(d.firstChild);
+
+			t.node = d.appendChild(d.createElement("html"));
+		},
+
+		writeStartElement : function(n) {
+			var t = this;
+
+			t.node = t.node.appendChild(t.doc.createElement(n));
+		},
+
+		writeAttribute : function(n, v) {
+			// Since Opera doesn't escape > into &gt; we need to do it our self
+			if (tinymce.isOpera)
+				v = v.replace(/>/g, '|>');
+
+			this.node.setAttribute(n, v);
+		},
+
+		writeEndElement : function() {
+			this.node = this.node.parentNode;
+		},
+
+		writeFullEndElement : function() {
+			var t = this, n = t.node;
+
+			n.appendChild(t.doc.createTextNode(""));
+			t.node = n.parentNode;
+		},
+
+		writeText : function(v) {
+			// Since Opera doesn't escape > into &gt; we need to do it our self
+			if (tinymce.isOpera)
+				v = v.replace(/>/g, '|>');
+
+			this.node.appendChild(this.doc.createTextNode(v));
+		},
+
+		writeCDATA : function(v) {
+			this.node.appendChild(this.doc.createCDATA(v));
+		},
+
+		writeComment : function(v) {
+			this.node.appendChild(this.doc.createComment(v));
+		},
+
+		getContent : function() {
+			var h;
+
+			h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);
+			h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, '');
+			h = h.replace(/ ?\/>/g, ' />');
+
+			// Since Opera doesn't escape > into &gt; we need to do it our self to normalize the output for all browsers
+			if (tinymce.isOpera)
+				h = h.replace(/\|>/g, '&gt;');
+
+			return h;
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/Serializer.js */
+
+(function() {
+	// Shorten names
+	var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE;
+
+	// Returns only attribites that have values not all attributes in IE
+	function getIEAtts(n) {
+		var o = [];
+
+		// Object will throw exception in IE
+		if (n.nodeName == 'OBJECT')
+			return n.attributes;
+
+		n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) {
+			o.push({specified : 1, nodeName : b});
+		});
+
+		return o;
+	};
+
+	function wildcardToRE(s) {
+		return s.replace(/([?+*])/g, '.$1');
+	};
+
+	tinymce.create('tinymce.dom.Serializer', {
+		Serializer : function(s) {
+			var t = this;
+
+			t.key = 0;
+			t.onPreProcess = new Dispatcher(t);
+			t.onPostProcess = new Dispatcher(t);
+			t.writer = new tinymce.dom.XMLWriter();
+
+			// Default settings
+			t.settings = s = extend({
+				dom : tinymce.DOM,
+				valid_nodes : 0,
+				node_filter : 0,
+				attr_filter : 0,
+				invalid_attrs : /^(mce_|_moz_$)/,
+				closed : /(br|hr|input|meta|img|link|param)/,
+				entity_encoding : 'named',
+				entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',
+				valid_elements : '*[*]',
+				extended_valid_elements : 0,
+				valid_child_elements : 0,
+				invalid_elements : 0,
+				fix_table_elements : 0,
+				fix_list_elements : true,
+				fix_content_duplication : true,
+				convert_fonts_to_spans : false,
+				font_size_classes : 0,
+				font_size_style_values : 0,
+				apply_source_formatting : 0,
+				indent_mode : 'simple',
+				indent_char : '\t',
+				indent_levels : 1,
+				remove_linebreaks : 1
+			}, s);
+
+			t.dom = s.dom;
+
+			if (s.fix_list_elements) {
+				t.onPreProcess.add(function(se, o) {
+					var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;
+
+					function prevNode(e, n) {
+						var a = n.split(','), i;
+
+						while ((e = e.previousSibling) != null) {
+							for (i=0; i<a.length; i++) {
+								if (e.nodeName == a[i])
+									return e;
+							}
+						}
+
+						return null;
+					};
+
+					for (x=0; x<a.length; x++) {
+						nl = t.dom.select(a[x], o.node);
+
+						for (i=0; i<nl.length; i++) {
+							n = nl[i];
+							p = n.parentNode;
+
+							if (r.test(p.nodeName)) {
+								np = prevNode(n, 'LI');
+
+								if (!np) {
+									np = t.dom.create('li');
+									np.innerHTML = '&nbsp;';
+									np.appendChild(n);
+									p.insertBefore(np, p.firstChild);
+								} else
+									np.appendChild(n);
+							}
+						}
+					}
+				});
+			}
+
+			if (s.fix_table_elements) {
+				t.onPreProcess.add(function(se, o) {
+					var ta = [], d = t.dom.doc;
+
+					// Build list of HTML chunks and replace tables with comment placeholders
+					each(t.dom.select('table', o.node), function(e) {
+						var pa = t.dom.getParent(e, 'H1,H2,H3,H4,H5,H6,P'), p = [], i, h;
+
+						if (pa) {
+							t.dom.getParent(e, function(n) {
+								if (n != e)
+									p.push(n.nodeName);
+							});
+
+							h = '';
+
+							for (i = 0; i < p.length; i++)
+								h += '</' + p[i]+ '>';
+
+							h += t.dom.getOuterHTML(e);
+
+							for (i = p.length - 1; i >= 0; i--)
+								h += '<' + p[i]+ '>';
+
+							ta.push(h);
+							e.parentNode.replaceChild(d.createComment('mcetable:' + (ta.length - 1)), e);
+						}
+					});
+
+					// Replace table placeholders with end parents + table + start parents HTML code
+					t.dom.setHTML(o.node, o.node.innerHTML.replace(/<!--mcetable:([0-9]+)-->/g, function(a, b) {
+						return ta[parseInt(b)];
+					}));
+				});
+			}
+		},
+
+		setEntities : function(s) {
+			var t = this, a, i, l = {}, re = '', v;
+
+			// No need to setup more than once
+			if (t.entityLookup)
+				return;
+
+			// Build regex and lookup array
+			a = s.split(',');
+			for (i = 0; i < a.length; i += 2) {
+				v = a[i];
+
+				// Don't add default &amp; &quot; etc.
+				if (v == 34 || v == 38 || v == 60 || v == 62)
+					continue;
+
+				l[String.fromCharCode(a[i])] = a[i + 1];
+
+				v = parseInt(a[i]).toString(16);
+				re += '\\u' + '0000'.substring(v.length) + v;
+			}
+
+			if (!re) {
+				t.settings.entity_encoding = 'raw';
+				return;
+			}
+
+			t.entitiesRE = new RegExp('[' + re + ']', 'g');
+			t.entityLookup = l;
+		},
+
+		setValidChildRules : function(s) {
+			this.childRules = null;
+			this.addValidChildRules(s);
+		},
+
+		addValidChildRules : function(s) {
+			var t = this, inst, intr, bloc;
+
+			if (!s)
+				return;
+
+			inst = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment';
+			intr = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment';
+			bloc = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP';
+
+			each(s.split(','), function(s) {
+				var p = s.split(/\[|\]/), re;
+
+				s = '';
+				each(p[1].split('|'), function(v) {
+					if (s)
+						s += '|';
+
+					switch (v) {
+						case '%itrans':
+							v = intr;
+							break;
+
+						case '%itrans_na':
+							v = intr.substring(2);
+							break;
+
+						case '%istrict':
+							v = inst;
+							break;
+
+						case '%istrict_na':
+							v = inst.substring(2);
+							break;
+
+						case '%btrans':
+							v = bloc;
+							break;
+
+						case '%bstrict':
+							v = bloc;
+							break;
+					}
+
+					s += v;
+				});
+				re = new RegExp('^(' + s.toLowerCase() + ')$', 'i');
+
+				each(p[0].split('/'), function(s) {
+					t.childRules = t.childRules || {};
+					t.childRules[s] = re;
+				});
+			});
+
+			// Build regex
+			s = '';
+			each(t.childRules, function(v, k) {
+				if (s)
+					s += '|';
+
+				s += k;
+			});
+
+			t.parentElementsRE = new RegExp('^(' + s.toLowerCase() + ')$', 'i');
+
+			/*console.debug(t.parentElementsRE.toString());
+			each(t.childRules, function(v) {
+				console.debug(v.toString());
+			});*/
+		},
+
+		setRules : function(s) {
+			var t = this;
+
+			t._setup();
+			t.rules = {};
+			t.wildRules = [];
+			t.validElements = {};
+
+			return t.addRules(s);
+		},
+
+		addRules : function(s) {
+			var t = this, dr;
+
+			if (!s)
+				return;
+
+			t._setup();
+
+			each(s.split(','), function(s) {
+				var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = [];
+
+				// Extend with default rules
+				if (dr)
+					at = tinymce.extend([], dr.attribs);
+
+				// Parse attributes
+				if (p.length > 1) {
+					each(p[1].split('|'), function(s) {
+						var ar = {}, i;
+
+						at = at || [];
+
+						// Parse attribute rule
+						s = s.replace(/::/g, '~');
+						s = /^([!\-])?([\w*.?~]+|)([=:<])?(.+)?$/.exec(s);
+						s[2] = s[2].replace(/~/g, ':');
+
+						// Add required attributes
+						if (s[1] == '!') {
+							ra = ra || [];
+							ra.push(s[2]);
+						}
+
+						// Remove inherited attributes
+						if (s[1] == '-') {
+							for (i = 0; i <at.length; i++) {
+								if (at[i].name == s[2]) {
+									at.splice(i, 1);
+									return;
+								}
+							}
+						}
+
+						switch (s[3]) {
+							// Add default attrib values
+							case '=':
+								ar.defaultVal = s[4] || '';
+								break;
+
+							// Add forced attrib values
+							case ':':
+								ar.forcedVal = s[4];
+								break;
+
+							// Add validation values
+							case '<':
+								ar.validVals = s[4].split('?');
+								break;
+						}
+
+						if (/[*.?]/.test(s[2])) {
+							wat = wat || [];
+							ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$');
+							wat.push(ar);
+						} else {
+							ar.name = s[2];
+							at.push(ar);
+						}
+
+						va.push(s[2]);
+					});
+				}
+
+				// Handle element names
+				each(tn, function(s, i) {
+					var pr = s.charAt(0), x = 1, ru = {};
+
+					// Extend with default rule data
+					if (dr) {
+						if (dr.noEmpty)
+							ru.noEmpty = dr.noEmpty;
+
+						if (dr.fullEnd)
+							ru.fullEnd = dr.fullEnd;
+
+						if (dr.padd)
+							ru.padd = dr.padd;
+					}
+
+					// Handle prefixes
+					switch (pr) {
+						case '-':
+							ru.noEmpty = true;
+							break;
+
+						case '+':
+							ru.fullEnd = true;
+							break;
+
+						case '#':
+							ru.padd = true;
+							break;
+
+						default:
+							x = 0;
+					}
+
+					tn[i] = s = s.substring(x);
+					t.validElements[s] = 1;
+
+					// Add element name or element regex
+					if (/[*.?]/.test(tn[0])) {
+						ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$');
+						t.wildRules = t.wildRules || {};
+						t.wildRules.push(ru);
+					} else {
+						ru.name = tn[0];
+
+						// Store away default rule
+						if (tn[0] == '@')
+							dr = ru;
+
+						t.rules[s] = ru;
+					}
+
+					ru.attribs = at;
+
+					if (ra)
+						ru.requiredAttribs = ra;
+
+					if (wat) {
+						// Build valid attributes regexp
+						s = '';
+						each(va, function(v) {
+							if (s)
+								s += '|';
+
+							s += '(' + wildcardToRE(v) + ')';
+						});
+						ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$');
+						ru.wildAttribs = wat;
+					}
+				});
+			});
+
+			// Build valid elements regexp
+			s = '';
+			each(t.validElements, function(v, k) {
+				if (s)
+					s += '|';
+
+				if (k != '@')
+				s += k;
+			});
+			t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$');
+
+			//console.debug(t.validElementsRE.toString());
+			//console.dir(t.rules);
+			//console.dir(t.wildRules);
+		},
+
+		findRule : function(n) {
+			var t = this, rl = t.rules, i, r;
+
+			t._setup();
+
+			// Exact match
+			r = rl[n];
+			if (r)
+				return r;
+
+			// Try wildcards
+			rl = t.wildRules;
+			for (i = 0; i < rl.length; i++) {
+				if (rl[i].nameRE.test(n))
+					return rl[i];
+			}
+
+			return null;
+		},
+
+		findAttribRule : function(ru, n) {
+			var i, wa = ru.wildAttribs;
+
+			for (i = 0; i < wa.length; i++) {
+				if (wa[i].nameRE.test(n))
+					return wa[i];
+			}
+
+			return null;
+		},
+
+		serialize : function(n, o) {
+			var h, t = this;
+
+			t._setup();
+			o = o || {};
+			o.format = o.format || 'html';
+			t.processObj = o;
+			n = n.cloneNode(true);
+			t.key = '' + (parseInt(t.key) + 1);
+
+			// Pre process
+			if (!o.no_events) {
+				o.node = n;
+				t.onPreProcess.dispatch(t, o);
+			}
+
+			// Serialize HTML DOM into a string
+			t.writer.reset();
+			t._serializeNode(n, o.getInner);
+
+			// Post process
+			o.content = t.writer.getContent();
+
+			if (!o.no_events)
+				t.onPostProcess.dispatch(t, o);
+
+			t._postProcess(o);
+			o.node = null;
+
+			return tinymce.trim(o.content);
+		},
+
+		// Internal functions
+
+		_postProcess : function(o) {
+			var t = this, s = t.settings, h = o.content, sc = [], p, l;
+
+			if (o.format == 'html') {
+				// Protect some elements
+				p = t._protect({
+					content : h,
+					patterns : [
+						/(<script[^>]*>)(.*?)(<\/script>)/g,
+						/(<style[^>]*>)(.*?)(<\/style>)/g,
+						/(<pre[^>]*>)(.*?)(<\/pre>)/g
+					]
+				});
+
+				h = p.content;
+
+				// Entity encode
+				if (s.entity_encoding !== 'raw') {
+					if (s.entity_encoding.indexOf('named') != -1) {
+						t.setEntities(s.entities);
+						l = t.entityLookup;
+
+						h = h.replace(t.entitiesRE, function(a) {
+							var v;
+
+							if (v = l[a])
+								a = '&' + v + ';';
+
+							return a;
+						});
+					}
+
+					if (s.entity_encoding.indexOf('numeric') != -1) {
+						h = h.replace(/[\u007E-\uFFFF]/g, function(a) {
+							return '&#' + a.charCodeAt(0) + ';';
+						});
+					}
+				}
+
+				// Use BR instead of &nbsp; padded P elements inside editor and use <p>&nbsp;</p> outside editor
+				if (o.set)
+					h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>');
+				else
+					h = h.replace(/<p>\s+(&nbsp;|&#160;|\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');
+
+				// Since Gecko and Safari keeps whitespace in the DOM we need to
+				// remove it inorder to match other browsers. But I think Gecko and Safari is right.
+				// This process is only done when getting contents out from the editor.
+				if (!o.set) {
+					if (s.remove_linebreaks) {
+						h = h.replace(/(<[^>]+>)\s+/g, '$1 ');
+						h = h.replace(/\s+(<\/[^>]+>)/g, ' $1');
+						h = h.replace(/<(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start
+						h = h.replace(/<(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start
+						h = h.replace(/\s+<\/(p|h[1-6]|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end
+					}
+
+					// Simple indentation
+					if (s.apply_source_formatting && s.indent_mode == 'simple') {
+						// Add line breaks before and after block elements
+						h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n');
+						h = h.replace(/\s*<(p|h[1-6]|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>');
+						h = h.replace(/<\/(p|h[1-6]|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n');
+						h = h.replace(/\n\n/g, '\n');
+					}
+				}
+
+				h = t._unprotect(h, p);
+			}
+
+			o.content = h;
+		},
+
+		_serializeNode : function(n, inn) {
+			var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv;
+
+			if (!s.node_filter || s.node_filter(n)) {
+				switch (n.nodeType) {
+					case 1: // Element
+						if (n.hasAttribute ? n.hasAttribute('mce_bogus') : n.getAttribute('mce_bogus'))
+							return;
+
+						iv = false;
+						hc = n.hasChildNodes();
+						nn = n.getAttribute('mce_name') || n.nodeName.toLowerCase();
+
+						// Add correct prefix on IE
+						if (isIE) {
+							if (n.scopeName !== 'HTML' && n.scopeName !== 'html')
+								nn = n.scopeName + ':' + nn;
+						}
+
+						// Remove mce prefix on IE needed for the abbr element
+						if (nn.indexOf('mce:') === 0)
+							nn = nn.substring(4);
+
+						// Check if valid
+						if (!t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inn) {
+							iv = true;
+							break;
+						}
+
+						if (isIE) {
+							// Fix IE content duplication (DOM can have multiple copies of the same node)
+							if (s.fix_content_duplication) {
+								if (n.mce_serialized == t.key)
+									return;
+
+								n.mce_serialized = t.key;
+							}
+
+							// IE sometimes adds a / infront of the node name
+							if (nn.charAt(0) == '/')
+								nn = nn.substring(1);
+						}
+
+						// Check if valid child
+						if (t.childRules) {
+							if (t.parentElementsRE.test(t.elementName)) {
+								if (!t.childRules[t.elementName].test(nn)) {
+									iv = true;
+									break;
+								}
+							}
+
+							t.elementName = nn;
+						}
+
+						ru = t.findRule(nn);
+						nn = ru.name || nn;
+
+						// Skip empty nodes or empty node name in IE
+						if ((!hc && ru.noEmpty) || (isIE && !nn)) {
+							iv = true;
+							break;
+						}
+
+						// Check required
+						if (ru.requiredAttribs) {
+							a = ru.requiredAttribs;
+
+							for (i = a.length - 1; i >= 0; i--) {
+								if (this.dom.getAttrib(n, a[i]) !== '')
+									break;
+							}
+
+							// None of the required was there
+							if (i == -1) {
+								iv = true;
+								break;
+							}
+						}
+
+						w.writeStartElement(nn);
+
+						// Add ordered attributes
+						if (ru.attribs) {
+							for (i=0, at = ru.attribs, l = at.length; i<l; i++) {
+								a = at[i];
+								v = t._getAttrib(n, a);
+
+								if (v !== null)
+									w.writeAttribute(a.name, v);
+							}
+						}
+
+						// Add wild attributes
+						if (ru.validAttribsRE) {
+							at = isIE ? getIEAtts(n) : n.attributes;
+							for (i=at.length-1; i>-1; i--) {
+								no = at[i];
+
+								if (no.specified) {
+									a = no.nodeName.toLowerCase();
+
+									if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a))
+										continue;
+
+									ar = t.findAttribRule(ru, a);
+									v = t._getAttrib(n, ar, a);
+
+									if (v !== null)
+										w.writeAttribute(a, v);
+								}
+							}
+						}
+
+						// Padd empty nodes with a &nbsp;
+						if (!hc && ru.padd)
+							w.writeText('\u00a0');
+
+						break;
+
+					case 3: // Text
+						// Check if valid child
+						if (t.childRules && t.parentElementsRE.test(t.elementName)) {
+							if (!t.childRules[t.elementName].test(n.nodeName))
+								return;
+						}
+
+						return w.writeText(n.nodeValue);
+
+					case 4: // CDATA
+						return w.writeCDATA(n.nodeValue);
+
+					case 8: // Comment
+						return w.writeComment(n.nodeValue);
+				}
+			} else if (n.nodeType == 1)
+				hc = n.hasChildNodes();
+
+			if (hc) {
+				cn = n.firstChild;
+
+				while (cn) {
+					t._serializeNode(cn);
+					t.elementName = nn;
+					cn = cn.nextSibling;
+				}
+			}
+
+			// Write element end
+			if (!iv) {
+				if (hc || !s.closed.test(nn))
+					w.writeFullEndElement();
+				else
+					w.writeEndElement();
+			}
+		},
+
+		_protect : function(o) {
+			o.items = o.items || [];
+
+			function enc(s) {
+				return s.replace(/[\r\n]/g, function(c) {
+					if (c === '\n')
+						return '\\n';
+
+					return '\\r';
+				});
+			};
+
+			function dec(s) {
+				return s.replace(/\\[rn]/g, function(c) {
+					if (c === '\\n')
+						return '\n';
+
+					return '\r';
+				});
+			};
+
+			each(o.patterns, function(p) {
+				o.content = dec(enc(o.content).replace(p, function(x, a, b, c) {
+					o.items.push(dec(b));
+					return a + '<!--mce:' + (o.items.length - 1) + '-->' + c;
+				}));
+			});
+
+			return o;
+		},
+
+		_unprotect : function(h, o) {
+			h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) {
+				return o.items[parseInt(b)];
+			});
+
+			o.items = [];
+
+			return h;
+		},
+
+		_setup : function() {
+			var t = this, s = this.settings;
+
+			if (t.done)
+				return;
+
+			t.done = 1;
+
+			t.setRules(s.valid_elements);
+			t.addRules(s.extended_valid_elements);
+			t.addValidChildRules(s.valid_child_elements);
+
+			if (s.invalid_elements)
+				t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(',', '|').toLowerCase()) + ')$');
+
+			if (s.attrib_value_filter)
+				t.attribValueFilter = s.attribValueFilter;
+		},
+
+		_getAttrib : function(n, a, na) {
+			var i, v;
+
+			na = na || a.name;
+
+			if (a.forcedVal && (v = a.forcedVal)) {
+				if (v === '{$uid}')
+					return this.dom.uniqueId();
+
+				return v;
+			}
+
+			v = this.dom.getAttrib(n, na);
+
+			switch (na) {
+				case 'rowspan':
+				case 'colspan':
+					// Whats the point? Remove usless attribute value
+					if (v == '1')
+						v = '';
+
+					break;
+			}
+
+			if (this.attribValueFilter)
+				v = this.attribValueFilter(na, v, n);
+
+			if (a.validVals) {
+				for (i = a.validVals.length - 1; i >= 0; i--) {
+					if (v == a.validVals[i])
+						break;
+				}
+
+				if (i == -1)
+					return null;
+			}
+
+			if (v === '' && typeof(a.defaultVal) != 'undefined') {
+				v = a.defaultVal;
+
+				if (v === '{$uid}')
+					return this.dom.uniqueId();
+
+				return v;
+			} else {
+				// Remove internal mceItemXX classes when content is extracted from editor
+				if (na == 'class' && this.processObj.get)
+					v = v.replace(/\bmceItem\w+\b/g, '');
+			}
+
+			if (v === '')
+				return null;
+
+
+			return v;
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/dom/ScriptLoader.js */
+
+(function() {
+	var each = tinymce.each;
+
+	tinymce.create('tinymce.dom.ScriptLoader', {
+		ScriptLoader : function(s) {
+			this.settings = s || {};
+			this.queue = [];
+			this.lookup = {};
+		},
+
+		markDone : function(u) {
+			this.lookup[u] = {state : 2, url : u};
+		},
+
+		add : function(u, cb, s, pr) {
+			var t = this, lo = t.lookup, o;
+
+			if (o = lo[u]) {
+				// Is loaded fire callback
+				if (cb && o.state == 2)
+					cb.call(s || this);
+
+				return o;
+			}
+
+			o = {state : 0, url : u, func : cb, scope : s || this};
+
+			if (pr)
+				t.queue.unshift(o);
+			else
+				t.queue.push(o);
+
+			lo[u] = o;
+
+			return o;
+		},
+
+		load : function(u, cb, s) {
+			var t = this, o;
+
+			function loadScript(u) {
+				if (tinymce.dom.Event.domLoaded || t.settings.strict_mode) {
+					tinymce.util.XHR.send({
+						url : u,
+						error : t.settings.error,
+						async : false,
+						success : function(co) {
+							t.eval(co);
+						}
+					});
+				} else
+					document.write('<script type="text/javascript" src="' + u + '"></script>');
+			};
+
+			if (!tinymce.is(u, 'string')) {
+				each(u, function(u) {
+					loadScript(u);
+				});
+
+				if (cb)
+					cb.call(s || t);
+			} else {
+				loadScript(u);
+
+				if (cb)
+					cb.call(s || t);
+			}
+		},
+
+		loadQueue : function(cb, s) {
+			var t = this;
+
+			if (!t.queueLoading) {
+				t.queueLoading = 1;
+				t.queueCallbacks = [];
+
+				t.loadScripts(t.queue, function() {
+					t.queueLoading = 0;
+
+					if (cb)
+						cb.call(s || t);
+
+					each(t.queueCallbacks, function(o) {
+						o.func.call(o.scope);
+					});
+				});
+			} else if (cb)
+				t.queueCallbacks.push({func : cb, scope : s || t});
+		},
+
+		eval : function(co) {
+			var w = window;
+
+			// Evaluate script
+			if (!w.execScript) {
+				try {
+					eval.call(w, co);
+				} catch (ex) {
+					eval(co, w); // Firefox 3.0a8
+				}
+			} else
+				w.execScript(co); // IE
+		},
+
+		loadScripts : function(sc, cb, s) {
+			var t = this, lo = t.lookup;
+
+			function done(o) {
+				o.state = 2; // Has been loaded
+
+				// Run callback
+				if (o.func)
+					o.func.call(o.scope || t);
+			};
+
+			function allDone() {
+				var l;
+
+				// Check if all files are loaded
+				l = sc.length;
+				each(sc, function(o) {
+					o = lo[o.url];
+
+					if (o.state === 2) {// It has finished loading
+						done(o);
+						l--;
+					} else
+						load(o);
+				});
+
+				// They are all loaded
+				if (l === 0 && cb) {
+					cb.call(s || t);
+					cb = 0;
+				}
+			};
+
+			function load(o) {
+				if (o.state > 0)
+					return;
+
+				o.state = 1; // Is loading
+
+				tinymce.util.XHR.send({
+					url : o.url,
+					error : t.settings.error,
+					success : function(co) {
+						t.eval(co);
+						done(o);
+						allDone();
+					}
+				});
+			};
+
+			each(sc, function(o) {
+				var u = o.url;
+
+				// Add to queue if needed
+				if (!lo[u]) {
+					lo[u] = o;
+					t.queue.push(o);
+				} else
+					o = lo[u];
+
+				// Is already loading or has been loaded
+				if (o.state > 0)
+					return;
+
+				if (!tinymce.dom.Event.domLoaded && !t.settings.strict_mode) {
+					var ix, ol = '';
+
+					// Add onload events
+					if (cb || o.func) {
+						o.state = 1; // Is loading
+
+						ix = tinymce.dom.ScriptLoader._addOnLoad(function() {
+							done(o);
+							allDone();
+						});
+
+						if (tinymce.isIE)
+							ol = ' onreadystatechange="';
+						else
+							ol = ' onload="';
+
+						ol += 'tinymce.dom.ScriptLoader._onLoad(this,\'' + u + '\',' + ix + ');"';
+					}
+
+					document.write('<script type="text/javascript" src="' + u + '"' + ol + '></script>');
+
+					if (!o.func)
+						done(o);
+				} else
+					load(o);
+			});
+
+			allDone();
+		},
+
+		// Static methods
+		'static' : {
+			_addOnLoad : function(f) {
+				var t = this;
+
+				t._funcs = t._funcs || [];
+				t._funcs.push(f);
+
+				return t._funcs.length - 1;
+			},
+
+			_onLoad : function(e, u, ix) {
+				if (!tinymce.isIE || e.readyState == 'complete')
+					this._funcs[ix].call(this);
+			}
+		}
+
+		});
+
+	// Global script loader
+	tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/Control.js */
+
+(function() {
+	// Shorten class names
+	var DOM = tinymce.DOM, is = tinymce.is;
+
+	tinymce.create('tinymce.ui.Control', {
+		Control : function(id, s) {
+			this.id = id;
+			this.settings = s = s || {};
+			this.rendered = false;
+			this.onRender = new tinymce.util.Dispatcher(this);
+			this.classPrefix = '';
+			this.scope = s.scope || this;
+			this.disabled = 0;
+			this.active = 0;
+		},
+
+		setDisabled : function(s) {
+			var e;
+
+			if (s != this.disabled) {
+				e = DOM.get(this.id);
+
+				// Add accessibility title for unavailable actions
+				if (e && this.settings.unavailable_prefix) {
+					if (s) {
+						this.prevTitle = e.title;
+						e.title = this.settings.unavailable_prefix + ": " + e.title;
+					} else
+						e.title = this.prevTitle;
+				}
+
+				this.setState('Disabled', s);
+				this.setState('Enabled', !s);
+				this.disabled = s;
+			}
+		},
+
+		isDisabled : function() {
+			return this.disabled;
+		},
+
+		setActive : function(s) {
+			if (s != this.active) {
+				this.setState('Active', s);
+				this.active = s;
+			}
+		},
+
+		isActive : function() {
+			return this.active;
+		},
+
+		setState : function(c, s) {
+			var n = DOM.get(this.id);
+
+			c = this.classPrefix + c;
+
+			if (s)
+				DOM.addClass(n, c);
+			else
+				DOM.removeClass(n, c);
+		},
+
+		isRendered : function() {
+			return this.rendered;
+		},
+
+		renderHTML : function() {
+		},
+
+		renderTo : function(n) {
+			DOM.setHTML(n, this.renderHTML());
+		},
+
+		postRender : function() {
+			var t = this, b;
+
+			// Set pending states
+			if (is(t.disabled)) {
+				b = t.disabled;
+				t.disabled = -1;
+				t.setDisabled(b);
+			}
+
+			if (is(t.active)) {
+				b = t.active;
+				t.active = -1;
+				t.setActive(b);
+			}
+		},
+
+		destroy : function() {
+			DOM.remove(this.id);
+		}
+
+		});
+})();
+/* file:jscripts/tiny_mce/classes/ui/Container.js */
+
+tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {
+	Container : function(id, s) {
+		this.parent(id, s);
+		this.controls = [];
+		this.lookup = {};
+	},
+
+	add : function(c) {
+		this.lookup[c.id] = c;
+		this.controls.push(c);
+
+		return c;
+	},
+
+	get : function(n) {
+		return this.lookup[n];
+	}
+
+	});
+
+
+/* file:jscripts/tiny_mce/classes/ui/Separator.js */
+
+tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {
+	renderHTML : function() {
+		return tinymce.DOM.createHTML('span', {'class' : 'mceSeparator'});
+	}
+
+	});
+
+/* file:jscripts/tiny_mce/classes/ui/MenuItem.js */
+
+(function() {
+	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
+
+	tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {
+		MenuItem : function(id, s) {
+			this.parent(id, s);
+			this.classPrefix = 'mceMenuItem';
+		},
+
+		setSelected : function(s) {
+			this.setState('Selected', s);
+			this.selected = s;
+		},
+
+		isSelected : function() {
+			return this.selected;
+		},
+
+		postRender : function() {
+			var t = this;
+			
+			t.parent();
+
+			// Set pending state
+			if (is(t.selected))
+				t.setSelected(t.selected);
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/Menu.js */
+
+(function() {
+	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;
+
+	tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {
+		Menu : function(id, s) {
+			var t = this;
+
+			t.parent(id, s);
+			t.items = {};
+			t.collapsed = false;
+			t.menuCount = 0;
+			t.onAddItem = new tinymce.util.Dispatcher(this);
+		},
+
+		expand : function(d) {
+			var t = this;
+
+			if (d) {
+				walk(t, function(o) {
+					if (o.expand)
+						o.expand();
+				}, 'items', t);
+			}
+
+			t.collapsed = false;
+		},
+
+		collapse : function(d) {
+			var t = this;
+
+			if (d) {
+				walk(t, function(o) {
+					if (o.collapse)
+						o.collapse();
+				}, 'items', t);
+			}
+
+			t.collapsed = true;
+		},
+
+		isCollapsed : function() {
+			return this.collapsed;
+		},
+
+		add : function(o) {
+			if (!o.settings)
+				o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);
+
+			this.onAddItem.dispatch(this, o);
+
+			return this.items[o.id] = o;
+		},
+
+		addSeparator : function() {
+			return this.add({separator : true});
+		},
+
+		addMenu : function(o) {
+			if (!o.collapse)
+				o = this.createMenu(o);
+
+			this.menuCount++;
+
+			return this.add(o);
+		},
+
+		hasMenus : function() {
+			return this.menuCount !== 0;
+		},
+
+		remove : function(o) {
+			delete this.items[o.id];
+		},
+
+		removeAll : function() {
+			var t = this;
+
+			walk(t, function(o) {
+				if (o.removeAll)
+					o.removeAll();
+
+				o.destroy();
+			}, 'items', t);
+
+			t.items = {};
+		},
+
+		createMenu : function(o) {
+			var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);
+
+			m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);
+
+			return m;
+		}
+
+		});
+})();
+/* file:jscripts/tiny_mce/classes/ui/DropMenu.js */
+
+(function() {
+	var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;
+
+	tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {
+		DropMenu : function(id, s) {
+			s = s || {};
+			s.container = s.container || document.body;
+			s.offset_x = s.offset_x || 0;
+			s.offset_y = s.offset_y || 0;
+			s.vp_offset_x = s.vp_offset_x || 0;
+			s.vp_offset_y = s.vp_offset_y || 0;
+
+			if (is(s.icons) && !s.icons)
+				s['class'] += ' noIcons';
+
+			this.parent(id, s);
+			this.onHideMenu = new tinymce.util.Dispatcher(this);
+			this.classPrefix = 'mceMenu';
+		},
+
+		createMenu : function(s) {
+			var t = this, cs = t.settings, m;
+
+			s.container = s.container || cs.container;
+			s.parent = t;
+			s.constrain = s.constrain || cs.constrain;
+			s['class'] = s['class'] || cs['class'];
+			s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;
+			s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;
+			m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);
+
+			m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);
+
+			return m;
+		},
+
+		update : function() {
+			var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;
+
+			tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;
+			th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;
+
+			if (!DOM.boxModel)
+				t.element.setStyles({width : tw + 2, height : th + 2});
+			else
+				t.element.setStyles({width : tw, height : th});
+
+			if (s.max_width)
+				DOM.setStyle(co, 'width', tw);
+
+			if (s.max_height) {
+				DOM.setStyle(co, 'height', th);
+
+				if (tb.clientHeight < s.max_height)
+					DOM.setStyle(co, 'overflow', 'hidden');
+			}
+		},
+
+		showMenu : function(x, y, px) {
+			var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb;
+
+			t.collapse(1);
+
+			if (t.isMenuVisible)
+				return;
+
+			if (!t.rendered) {
+				co = DOM.add(t.settings.container, t.renderNode());
+
+				each(t.items, function(o) {
+					o.postRender();
+				});
+
+				t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
+			} else
+				co = DOM.get('menu_' + t.id);
+
+			DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});
+			DOM.show(co);
+			t.update();
+
+			x += s.offset_x || 0;
+			y += s.offset_y || 0;
+			vp.w -= 4;
+			vp.h -= 4;
+
+			// Move inside viewport if not submenu
+			if (s.constrain) {
+				w = co.clientWidth - ot;
+				h = co.clientHeight - ot;
+				mx = vp.x + vp.w;
+				my = vp.y + vp.h;
+
+				if ((x + s.vp_offset_x + w) > mx)
+					x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);
+
+				if ((y + s.vp_offset_y + h) > my)
+					y = Math.max(0, (my - s.vp_offset_y) - h);
+			}
+
+			DOM.setStyles(co, {left : x , top : y});
+			t.element.update();
+
+			t.isMenuVisible = 1;
+			t.mouseClickFunc = Event.add(co, 'click', function(e) {
+				var m;
+
+				e = e.target;
+
+				if (e && (e = DOM.getParent(e, 'TR')) && !DOM.hasClass(e, 'mceMenuItemSub')) {
+					m = t.items[e.id];
+
+					if (m.isDisabled())
+						return;
+
+					if (m.settings.onclick)
+						m.settings.onclick(e);
+
+					dm = t;
+
+					while (dm) {
+						if (dm.hideMenu)
+							dm.hideMenu();
+
+						dm = dm.settings.parent;
+					}
+
+					return Event.cancel(e); // Cancel to fix onbeforeunload problem
+				}
+			});
+
+			if (t.hasMenus()) {
+				t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {
+					var m, r, mi;
+
+					e = e.target;
+					if (e && (e = DOM.getParent(e, 'TR'))) {
+						m = t.items[e.id];
+
+						if (t.lastMenu)
+							t.lastMenu.collapse(1);
+
+						if (m.isDisabled())
+							return;
+
+						if (e && DOM.hasClass(e, 'mceMenuItemSub')) {
+							//p = DOM.getPos(s.container);
+							r = DOM.getRect(e);
+							m.showMenu((r.x + r.w - ot), r.y - ot, r.x);
+							t.lastMenu = m;
+							DOM.addClass(DOM.get(m.id).firstChild, 'mceMenuItemActive');
+						}
+					}
+				});
+			}
+		},
+
+		hideMenu : function(c) {
+			var t = this, co = DOM.get('menu_' + t.id), e;
+
+			if (!t.isMenuVisible)
+				return;
+
+			Event.remove(co, 'mouseover', t.mouseOverFunc);
+			Event.remove(co, 'click', t.mouseClickFunc);
+			DOM.hide(co);
+			t.isMenuVisible = 0;
+
+			if (!c)
+				t.collapse(1);
+
+			if (t.element)
+				t.element.hide();
+
+			if (e = DOM.get(t.id))
+				DOM.removeClass(e.firstChild, 'mceMenuItemActive');
+
+			t.onHideMenu.dispatch(t);
+		},
+
+		add : function(o) {
+			var t = this, co;
+
+			o = t.parent(o);
+
+			if (t.isRendered && (co = DOM.get('menu_' + t.id)))
+				t._add(DOM.select('tbody', co)[0], o);
+
+			return o;
+		},
+
+		collapse : function(d) {
+			this.parent(d);
+			this.hideMenu(1);
+		},
+
+		remove : function(o) {
+			DOM.remove(o.id);
+
+			return this.parent(o);
+		},
+
+		destroy : function() {
+			var t = this, co = DOM.get('menu_' + t.id);
+
+			Event.remove(co, 'mouseover', t.mouseOverFunc);
+			Event.remove(co, 'click', t.mouseClickFunc);
+
+			if (t.element)
+				t.element.remove();
+
+			DOM.remove(co);
+		},
+
+		renderNode : function() {
+			var t = this, s = t.settings, n, tb, co, w;
+
+			w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:150'});
+			co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenu' + (s['class'] ? ' ' + s['class'] : '')});
+			t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});
+
+			if (s.menu_line)
+				DOM.add(co, 'span', {'class' : 'mceMenuLine'});
+
+//			n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});
+			n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});
+			tb = DOM.add(n, 'tbody');
+
+			each(t.items, function(o) {
+				t._add(tb, o);
+			});
+
+			t.rendered = true;
+
+			return w;
+		},
+
+		// Internal functions
+
+		_add : function(tb, o) {
+			var n, s = o.settings, a, ro, it;
+
+			if (s.separator) {
+				ro = DOM.add(tb, 'tr', {id : o.id, 'class' : 'mceMenuItemSeparator'});
+				DOM.add(ro, 'td', {'class' : 'mceMenuItemSeparator'});
+
+				if (n = ro.previousSibling)
+					DOM.addClass(n, 'last');
+
+				return;
+			}
+
+			n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : 'mceMenuItem mceMenuItemEnabled'});
+			n = it = DOM.add(n, 'td');
+			n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});
+
+			DOM.addClass(it, s['class']);
+//			n = DOM.add(n, 'span', {'class' : 'item'});
+			DOM.add(n, 'span', {'class' : 'icon' + (s.icon ? ' ' + s.icon : '')});
+			n = DOM.add(n, s.element || 'span', {'class' : 'text', title : o.settings.title}, o.settings.title);
+
+			if (o.settings.style)
+				DOM.setAttrib(n, 'style', o.settings.style);
+
+			if (tb.childNodes.length == 1)
+				DOM.addClass(ro, 'first');
+
+			if ((n = ro.previousSibling) && DOM.hasClass(n, 'mceMenuItemSeparator'))
+				DOM.addClass(ro, 'first');
+
+			if (o.collapse)
+				DOM.addClass(ro, 'mceMenuItemSub');
+
+			if (n = ro.previousSibling)
+				DOM.removeClass(n, 'last');
+
+			DOM.addClass(ro, 'last');
+		}
+
+		});
+})();
+/* file:jscripts/tiny_mce/classes/ui/Button.js */
+
+(function() {
+	var DOM = tinymce.DOM;
+
+	tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {
+		Button : function(id, s) {
+			this.parent(id, s);
+			this.classPrefix = 'mceButton';
+		},
+
+		renderHTML : function() {
+			var s = this.settings, h = '<a id="' + this.id + '" href="javascript:;" class="mceButton mceButtonEnabled ' + s['class'] + '" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">';
+
+			if (s.image)
+				h += '<img class="icon" src="' + s.image + '" /></a>';
+			else
+				h += '<span class="icon ' + s['class'] + '"></span></a>';
+
+			return h;
+		},
+
+		postRender : function() {
+			var t = this, s = t.settings;
+
+			tinymce.dom.Event.add(t.id, 'click', function(e) {
+				if (!t.isDisabled())
+					return s.onclick.call(s.scope, e);
+			});
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/ListBox.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
+
+	tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {
+		ListBox : function(id, s) {
+			var t = this;
+
+			t.parent(id, s);
+			t.items = [];
+			t.onChange = new Dispatcher(t);
+			t.onPostRender = new Dispatcher(t);
+			t.onAdd = new Dispatcher(t);
+			t.onRenderMenu = new tinymce.util.Dispatcher(this);
+			t.classPrefix = 'mceListBox';
+		},
+
+		select : function(v) {
+			var t = this, e, fv;
+
+			// Do we need to do something?
+			if (v != t.selectedValue) {
+				e = DOM.get(t.id + '_text');
+				t.selectedValue = v;
+
+				// Find item
+				each(t.items, function(o) {
+					if (o.value == v) {
+						DOM.setHTML(e, DOM.encode(o.title));
+						fv = 1;
+						return false;
+					}
+				});
+
+				// If no item was found then present title
+				if (!fv) {
+					DOM.setHTML(e, DOM.encode(t.settings.title));
+					DOM.addClass(e, 'title');
+					e = 0;
+					return;
+				} else
+					DOM.removeClass(e, 'title');
+			}
+
+			e = 0;
+		},
+
+		add : function(n, v, o) {
+			var t = this;
+
+			o = o || {};
+			o = tinymce.extend(o, {
+				title : n,
+				value : v
+			});
+
+			t.items.push(o);
+			t.onAdd.dispatch(t, o);
+		},
+
+		getLength : function() {
+			return this.items.length;
+		},
+
+		renderHTML : function() {
+			var h = '', t = this, s = t.settings;
+
+			h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="mceListBox mceListBoxEnabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';
+			h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'text', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';
+			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'open', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>';
+			h += '</tr></tbody></table>';
+
+			return h;
+		},
+
+		showMenu : function() {
+			var t = this, p1, p2, e = DOM.get(this.id), m;
+
+			if (t.isDisabled() || t.items.length == 0)
+				return;
+
+			if (!t.isMenuRendered) {
+				t.renderMenu();
+				t.isMenuRendered = true;
+			}
+
+			p1 = DOM.getPos(this.settings.menu_container);
+			p2 = DOM.getPos(e);
+
+			m = t.menu;
+			m.settings.offset_x = p2.x;
+			m.settings.offset_y = p2.y;
+
+			// Select in menu
+			if (t.oldID)
+				m.items[t.oldID].setSelected(0);
+
+			each(t.items, function(o) {
+				if (o.value === t.selectedValue) {
+					m.items[o.id].setSelected(1);
+					t.oldID = o.id;
+				}
+			});
+
+			m.showMenu(0, e.clientHeight);
+
+			Event.add(document, 'mousedown', t.hideMenu, t);
+			DOM.addClass(t.id, 'mceListBoxSelected');
+		},
+
+		hideMenu : function(e) {
+			var t = this;
+
+			if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceMenu');})) {
+				DOM.removeClass(t.id, 'mceListBoxSelected');
+				Event.remove(document, 'mousedown', t.hideMenu, t);
+
+				if (t.menu)
+					t.menu.hideMenu();
+			}
+		},
+
+		renderMenu : function() {
+			var t = this, m;
+
+			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
+				menu_line : 1,
+				'class' : 'mceListBoxMenu noIcons',
+				max_width : 150,
+				max_height : 150
+			});
+
+			m.onHideMenu.add(t.hideMenu, t);
+
+			m.add({
+				title : t.settings.title,
+				'class' : 'mceMenuItemTitle'
+			}).setDisabled(1);
+
+			each(t.items, function(o) {
+				o.id = DOM.uniqueId();
+				o.onclick = function() {
+					if (t.settings.onselect(o.value) !== false)
+						t.select(o.value); // Must be runned after
+				};
+
+				m.add(o);
+			});
+
+			t.onRenderMenu.dispatch(t, m);
+			t.menu = m;
+		},
+
+		postRender : function() {
+			var t = this;
+
+			Event.add(t.id, 'click', t.showMenu, t);
+
+			// Old IE doesn't have hover on all elements
+			if (tinymce.isIE6 || !DOM.boxModel) {
+				Event.add(t.id, 'mouseover', function() {
+					if (!DOM.hasClass(t.id, 'mceListBoxDisabled'))
+						DOM.addClass(t.id, 'mceListBoxHover');
+				});
+
+				Event.add(t.id, 'mouseout', function() {
+					if (!DOM.hasClass(t.id, 'mceListBoxDisabled'))
+						DOM.removeClass(t.id, 'mceListBoxHover');
+				});
+			}
+
+			t.onPostRender.dispatch(t, DOM.get(t.id));
+		}
+
+		});
+})();
+/* file:jscripts/tiny_mce/classes/ui/NativeListBox.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;
+
+	tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {
+		NativeListBox : function(id, s) {
+			this.parent(id, s);
+			this.classPrefix = 'mceNativeListBox';
+		},
+
+		setDisabled : function(s) {
+			DOM.get(this.id).disabled = s;
+		},
+
+		isDisabled : function() {
+			return DOM.get(this.id).disabled;
+		},
+
+		select : function(v) {
+			var e = DOM.get(this.id), ol = e.options;
+
+			v = '' + (v || '');
+
+			e.selectedIndex = 0;
+			each(ol, function(o, i) {
+				if (o.value == v) {
+					e.selectedIndex = i;
+					return false;
+				}
+			});
+		},
+
+		add : function(n, v, a) {
+			var o, t = this;
+
+			a = a || {};
+			a.value = v;
+
+			if (t.isRendered())
+				DOM.add(DOM.get(this.id), 'option', a, n);
+
+			o = {
+				title : n,
+				value : v,
+				attribs : a
+			};
+
+			t.items.push(o);
+			t.onAdd.dispatch(t, o);
+		},
+
+		getLength : function() {
+			return DOM.get(this.id).options.length - 1;
+		},
+
+		renderHTML : function() {
+			var h, t = this;
+
+			h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');
+
+			each(t.items, function(it) {
+				h += DOM.createHTML('option', {value : it.value}, it.title);
+			});
+
+			h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h);
+
+			return h;
+		},
+
+		postRender : function() {
+			var t = this, ch;
+
+			t.rendered = true;
+
+			function onChange(e) {
+				var v = e.target.options[e.target.selectedIndex].value;
+
+				t.onChange.dispatch(t, v);
+
+				if (t.settings.onselect)
+					t.settings.onselect(v);
+			};
+
+			Event.add(t.id, 'change', onChange);
+
+			// Accessibility keyhandler
+			Event.add(t.id, 'keydown', function(e) {
+				var bf;
+
+				Event.remove(t.id, 'change', ch);
+
+				bf = Event.add(t.id, 'blur', function() {
+					Event.add(t.id, 'change', onChange);
+					Event.remove(t.id, 'blur', bf);
+				});
+
+				if (e.keyCode == 13 || e.keyCode == 32) {
+					onChange(e);
+					return Event.cancel(e);
+				}
+			});
+
+			t.onPostRender.dispatch(t, DOM.get(t.id));
+		}
+
+		});
+})();
+/* file:jscripts/tiny_mce/classes/ui/MenuButton.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
+
+	tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {
+		MenuButton : function(id, s) {
+			this.parent(id, s);
+			this.onRenderMenu = new tinymce.util.Dispatcher(this);
+			s.menu_container = s.menu_container || document.body;
+		},
+
+		showMenu : function() {
+			var t = this, p1, p2, e = DOM.get(t.id), m;
+
+			if (t.isDisabled())
+				return;
+
+			if (!t.isMenuRendered) {
+				t.renderMenu();
+				t.isMenuRendered = true;
+			}
+
+			p1 = DOM.getPos(t.settings.menu_container);
+			p2 = DOM.getPos(e);
+
+			m = t.menu;
+			m.settings.offset_x = p2.x;
+			m.settings.offset_y = p2.y;
+			m.settings.vp_offset_x = p2.x;
+			m.settings.vp_offset_y = p2.y;
+			m.showMenu(0, e.clientHeight);
+
+			Event.add(document, 'mousedown', t.hideMenu, t);
+			t.setState('Selected', 1);
+		},
+
+		renderMenu : function() {
+			var t = this, m;
+
+			m = t.settings.control_manager.createDropMenu(t.id + '_menu', {
+				menu_line : 1,
+				'class' : this.classPrefix + 'Menu',
+				icons : t.settings.icons
+			});
+
+			m.onHideMenu.add(t.hideMenu, t);
+
+			t.onRenderMenu.dispatch(t, m);
+			t.menu = m;
+		},
+
+		hideMenu : function(e) {
+			var t = this;
+
+			if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceMenu');})) {
+				t.setState('Selected', 0);
+				Event.remove(document, 'mousedown', t.hideMenu, t);
+				if (t.menu)
+					t.menu.hideMenu();
+			}
+		},
+
+		postRender : function() {
+			var t = this, s = t.settings;
+
+			Event.add(t.id, 'click', function() {
+				if (!t.isDisabled()) {
+					if (s.onclick)
+						s.onclick(t.value);
+
+					t.showMenu();
+				}
+			});
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/SplitButton.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;
+
+	tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {
+		SplitButton : function(id, s) {
+			this.parent(id, s);
+			this.classPrefix = 'mceSplitButton';
+		},
+
+		renderHTML : function() {
+			var h, t = this, s = t.settings, h1;
+
+			h = '<tbody><tr>';
+
+			if (s.image)
+				h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'action ' + s['class']});
+			else
+				h1 = DOM.createHTML('span', {'class' : 'action ' + s['class']});
+
+			h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'action ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
+	
+			h1 = DOM.createHTML('span', {'class' : 'open ' + s['class']});
+			h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'open ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';
+
+			h += '</tr></tbody>';
+
+			return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);
+		},
+
+		postRender : function() {
+			var t = this, s = t.settings;
+
+			if (s.onclick) {
+				Event.add(t.id + '_action', 'click', function() {
+					if (!t.isDisabled())
+						s.onclick(t.value);
+				});
+			}
+
+			Event.add(t.id + '_open', 'click', t.showMenu, t);
+
+			// Old IE doesn't have hover on all elements
+			if (tinymce.isIE6 || !DOM.boxModel) {
+				Event.add(t.id, 'mouseover', function() {
+					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
+						DOM.addClass(t.id, 'mceSplitButtonHover');
+				});
+
+				Event.add(t.id, 'mouseout', function() {
+					if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))
+						DOM.removeClass(t.id, 'mceSplitButtonHover');
+				});
+			}
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/ColorSplitButton.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;
+
+	tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {
+		ColorSplitButton : function(id, s) {
+			var t = this;
+
+			t.parent(id, s);
+
+			t.settings = s = tinymce.extend({
+				colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',
+				grid_width : 8,
+				default_color : '#888888'
+			}, t.settings);
+
+			t.value = s.default_color;
+		},
+
+		showMenu : function() {
+			var t = this, r, p, e;
+
+			if (t.isDisabled())
+				return;
+
+			if (!t.isMenuRendered) {
+				t.renderMenu();
+				t.isMenuRendered = true;
+			}
+
+			e = DOM.get(t.id);
+			DOM.show(t.id + '_menu');
+			DOM.addClass(e, 'mceSplitButtonSelected');
+			p2 = DOM.getPos(e);
+			DOM.setStyles(t.id + '_menu', {
+				left : p2.x,
+				top : p2.y + e.clientHeight,
+				zIndex : 150
+			});
+			e = 0;
+
+			Event.add(document, 'mousedown', t.hideMenu, t);
+		},
+
+		hideMenu : function(e) {
+			var t = this;
+
+			if (!e || !DOM.getParent(e.target, function(n) {return DOM.hasClass(n, 'mceSplitButtonMenu');})) {
+				DOM.removeClass(t.id, 'mceSplitButtonSelected');
+				Event.remove(document, 'mousedown', t.hideMenu, t);
+				DOM.hide(t.id + '_menu');
+			}
+		},
+
+		renderMenu : function() {
+			var t = this, m, i = 0, s = t.settings, n, tb, tr, w;
+
+			w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});
+			m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});
+			DOM.add(m, 'span', {'class' : 'mceMenuLine'});
+
+			n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'});
+			tb = DOM.add(n, 'tbody');
+
+			// Generate color grid
+			i = 0;
+			each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {
+				c = c.replace(/^#/, '');
+
+				if (!i--) {
+					tr = DOM.add(tb, 'tr');
+					i = s.grid_width - 1;
+				}
+
+				n = DOM.add(tr, 'td');
+
+				n = DOM.add(n, 'a', {
+					href : 'javascript:;',
+					style : {
+						backgroundColor : '#' + c
+					}
+				});
+
+				Event.add(n, 'mousedown', function() {
+					t.setColor('#' + c);
+				});
+			});
+
+			if (s.more_colors_func) {
+				n = DOM.add(tb, 'tr');
+				n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'morecolors'});
+				n = DOM.add(n, 'a', {href : 'javascript:;', onclick : 'return false;', 'class' : 'morecolors'}, s.more_colors_title);
+
+				Event.add(n, 'click', function(e) {
+					s.more_colors_func.call(s.more_colors_scope || this);
+					return Event.cancel(e); // Cancel to fix onbeforeunload problem
+				});
+			}
+
+			DOM.addClass(m, 'mceColorSplitMenu');
+
+			return w;
+		},
+
+		setColor : function(c) {
+			var t = this, p, s = this.settings, co = s.menu_container, po, cp, id = t.id + '_preview';
+
+			if (!(p = DOM.get(id))) {
+				DOM.setStyle(t.id + '_action', 'position', 'relative');
+				p = DOM.add(t.id + '_action', 'div', {id : id, 'class' : 'mceColorPreview'});
+			}
+
+			p.style.backgroundColor = c;
+
+			t.value = c;
+			t.hideMenu();
+			s.onselect(c);
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/ui/Toolbar.js */
+
+tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
+	renderHTML : function() {
+		var t = this, h = '', c = 'mceToolbarEnd', co, dom = tinymce.DOM, s = t.settings;
+
+		h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));
+
+		tinymce.each(t.controls, function(c) {
+			h += '<td>' + c.renderHTML() + '</td>';
+		});
+
+		co = t.controls[t.controls.length - 1].constructor;
+
+		if (co === tinymce.ui.Button)
+			c += ' mceToolbarEndButton';
+		else if (co === tinymce.ui.SplitButton)
+			c += ' mceToolbarEndSplitButton';
+		else if (co === tinymce.ui.ListBox)
+			c += ' mceToolbarEndListBox';
+
+		h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));
+
+		return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');
+	}
+
+	});
+
+/* file:jscripts/tiny_mce/classes/AddOnManager.js */
+
+(function() {
+	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;
+
+	tinymce.create('tinymce.AddOnManager', {
+		items : [],
+		urls : {},
+		lookup : {},
+		onAdd : new Dispatcher(this),
+
+		get : function(n) {
+			return this.lookup[n];
+		},
+
+		requireLangPack : function(n) {
+			var u, s;
+
+			if (tinymce.EditorManager.settings) {
+				u = this.urls[n] + '/langs/' + tinymce.EditorManager.settings.language + '.js';
+				s = tinymce.EditorManager.settings;
+
+				if (s) {
+					if (!tinymce.dom.Event.domLoaded && !s.strict_mode)
+						tinymce.ScriptLoader.load(u);
+					else
+						tinymce.ScriptLoader.add(u);
+				}
+			}
+		},
+
+		add : function(id, o) {
+			this.items.push(o);
+			this.lookup[id] = o;
+			this.onAdd.dispatch(this, id, o);
+
+			return o;
+		},
+
+		load : function(n, u, cb, s) {
+			if (u.indexOf('/') != 0 && u.indexOf('://') == -1)
+				u = tinymce.baseURL + '/' +  u;
+
+			this.urls[n] = u.substring(0, u.lastIndexOf('/'));
+			tinymce.ScriptLoader.add(u, cb, s);
+		}
+
+		});
+
+	// Create plugin and theme managers
+	tinymce.PluginManager = new tinymce.AddOnManager();
+	tinymce.ThemeManager = new tinymce.AddOnManager();
+}());
+/* file:jscripts/tiny_mce/classes/EditorManager.js */
+
+(function() {
+	// Shorten names
+	var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager;
+
+	tinymce.create('static tinymce.EditorManager', {
+		editors : {},
+		i18n : {},
+		activeEditor : null,
+
+		init : function(s) {
+			var t = this, pl, sl = tinymce.ScriptLoader;
+
+			function execCallback(se, n, s) {
+				var f = se[n];
+
+				if (!f)
+					return;
+
+				if (tinymce.is(f, 'string')) {
+					s = f.replace(/\.\w+$/, '');
+					s = s ? tinymce.resolve(s) : 0;
+					f = tinymce.resolve(f);
+				}
+
+				return f.apply(s || this, Array.prototype.slice.call(arguments, 2));
+			};
+
+			s = extend({
+				theme : "simple",
+				language : "en",
+				strict_loading_mode : document.contentType == 'application/xhtml+xml'
+			}, s);
+
+			t.settings = s;
+
+			// If page not loaded and strict mode isn't enabled then load them
+			if (!Event.domLoaded && !s.strict_loading_mode) {
+				// Load language
+				if (s.language)
+					sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
+
+				// Load theme
+				if (s.theme && s.theme.charAt(0) != '-')
+					ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
+
+				// Load plugins
+				if (s.plugins) {
+					pl = s.plugins.split(',');
+
+					// Load compat2x first
+					if (tinymce.inArray(pl, 'compat2x') != -1)
+						PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js');
+
+					// Load rest if plugins
+					each(pl, function(v) {
+						if (v && v.charAt(0) != '-') {
+							// Skip safari plugin for other browsers
+							if (!tinymce.isWebKit && v == 'safari')
+								return;
+
+							PluginManager.load(v, 'plugins/' + v + '/editor_plugin' + tinymce.suffix + '.js');
+						}
+					});
+				}
+
+				sl.loadQueue();
+			}
+
+			// Legacy call
+			Event.add(document, 'init', function() {
+				var l, co;
+
+				execCallback(s, 'onpageload');
+
+				// Verify that it's a valid browser
+				if (s.browsers) {
+					l = false;
+
+					each(s.browsers.split(','), function(v) {
+						switch (v) {
+							case 'ie':
+							case 'msie':
+								if (tinymce.isIE)
+									l = true;
+								break;
+
+							case 'gecko':
+								if (tinymce.isGecko)
+									l = true;
+								break;
+
+							case 'safari':
+							case 'webkit':
+								if (tinymce.isWebKit)
+									l = true;
+								break;
+
+							case 'opera':
+								if (tinymce.isOpera)
+									l = true;
+
+								break;
+						}
+					});
+
+					// Not a valid one
+					if (!l)
+						return;
+				}
+
+				switch (s.mode) {
+					case "exact":
+						l = s.elements || '';
+						each(l.split(','), function(v) {
+							new tinymce.Editor(v, s).render();
+						});
+						break;
+
+					case "textareas":
+						function hasClass(n, c) {
+							return new RegExp('\\b' + c + '\\b', 'g').test(n.className);
+						};
+
+						each(DOM.select('textarea'), function(v) {
+							if (s.editor_deselector && hasClass(v, s.editor_deselector))
+								return;
+
+							if (!s.editor_selector || hasClass(v, s.editor_selector))
+								new tinymce.Editor(v.id = (v.id || v.name || (v.id = DOM.uniqueId())), s).render();
+						});
+						break;
+				}
+
+				// Call onInit when all editors are initialized
+				if (s.oninit) {
+					l = co = 0;
+
+					each (t.editors, function(ed) {
+						co++;
+
+						if (!ed.initialized) {
+							// Wait for it
+							ed.onInit.add(function() {
+								l++;
+
+								// All done
+								if (l == co)
+									execCallback(s, 'oninit');
+							});
+						} else
+							l++;
+
+						// All done
+						if (l == co)
+							execCallback(s, 'oninit');					
+					});
+				}
+			});
+		},
+
+		get : function(id) {
+			return this.editors[id];
+		},
+
+		getInstanceById : function(id) {
+			return this.get(id);
+		},
+
+		add : function(e) {
+			this.editors[e.id] = e;
+			this._setActive(e);
+
+			return e;
+		},
+
+		remove : function(e) {
+			var t = this;
+
+			// Not in the collection
+			if (!t.editors[e.id])
+				return null;
+
+			delete t.editors[e.id];
+
+			// Select another editor since the active one was removed
+			if (t.activeEditor == e) {
+				each(t.editors, function(e) {
+					t._setActive(e);
+					return false; // Break
+				});
+			}
+
+			e._destroy();
+
+			return e;
+		},
+
+		execCommand : function(c, u, v) {
+			var t = this, ed = t.get(v);
+
+			// Manager commands
+			switch (c) {
+				case "mceFocus":
+					ed.focus();
+					return true;
+
+				case "mceAddEditor":
+				case "mceAddControl":
+					new tinymce.Editor(v, t.settings).render();
+					return true;
+
+				case "mceAddFrameControl":
+					// TODO: Implement this
+					return true;
+
+				case "mceRemoveEditor":
+				case "mceRemoveControl":
+					ed.remove();
+					return true;
+
+				case 'mceToggleEditor':
+					if (!ed) {
+						t.execCommand('mceAddControl', 0, v);
+						return true;
+					}
+
+					if (ed.isHidden())
+						ed.show();
+					else
+						ed.hide();
+
+					return true;
+			}
+
+			// Run command on active editor
+			if (t.activeEditor)
+				return t.activeEditor.execCommand(c, u, v);
+
+			return false;
+		},
+
+		execInstanceCommand : function(id, c, u, v) {
+			var ed = this.get(id);
+
+			if (ed)
+				return ed.execCommand(c, u, v);
+
+			return false;
+		},
+
+		triggerSave : function() {
+			each(this.editors, function(e) {
+				e.save();
+			});
+		},
+
+		addI18n : function(p, o) {
+			var lo, i18n = this.i18n;
+
+			if (!tinymce.is(p, 'string')) {
+				each(p, function(o, lc) {
+					each(o, function(o, g) {
+						each(o, function(o, k) {
+							if (g === 'common')
+								i18n[lc + '.' + k] = o;
+							else
+								i18n[lc + '.' + g + '.' + k] = o;
+						});
+					});
+				});
+			} else {
+				each(o, function(o, k) {
+					i18n[p + '.' + k] = o;
+				});
+			}
+		},
+
+		// Private methods
+
+		_setActive : function(e) {
+			this.selectedInstance = this.activeEditor = e;
+		}
+
+		});
+
+	// Setup some URLs where the editor API is located and where the document is
+	tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+	if (!/[\/\\]$/.test(tinymce.documentBaseURL))
+		tinymce.documentBaseURL += '/';
+
+	tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);
+	tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL);
+})();
+
+// Short for editor manager window.tinyMCE is needed when TinyMCE gets loaded though a XHR call
+var tinyMCE = window.tinyMCE = tinymce.EditorManager;
+
+/* file:jscripts/tiny_mce/classes/Editor.js */
+
+(function() {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher;
+	var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit;
+	var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager;
+	var inArray = tinymce.inArray, grep = tinymce.grep;
+
+	tinymce.create('tinymce.Editor', {
+		Editor : function(id, s) {
+			var t = this;
+
+			t.id = t.editorId = id;
+			t.execCommands = {};
+			t.queryStateCommands = {};
+			t.queryValueCommands = {};
+			t.plugins = {};
+
+			// Add events to the editor
+			each([
+				'onPreInit',
+				'onBeforeRenderUI',
+				'onPostRender',
+				'onInit',
+				'onRemove',
+				'onActivate',
+				'onDeactivate',
+				'onClick',
+				'onEvent',
+				'onMouseUp',
+				'onMouseDown',
+				'onDblClick',
+				'onKeyDown',
+				'onKeyUp',
+				'onKeyPress',
+				'onContextMenu',
+				'onSubmit',
+				'onReset',
+				'onPaste',
+				'onPreProcess',
+				'onPostProcess',
+				'onBeforeSetContent',
+				'onBeforeGetContent',
+				'onSetContent',
+				'onGetContent',
+				'onLoadContent',
+				'onSaveContent',
+				'onNodeChange',
+				'onChange',
+				'onBeforeExecCommand',
+				'onExecCommand',
+				'onUndo',
+				'onRedo',
+				'onVisualAid',
+				'onSetProgressState'
+			], function(e) {
+				t[e] = new Dispatcher(t);
+			});
+
+			// Default editor config
+			t.settings = s = extend({
+				id : id,
+				language : 'en',
+				docs_language : 'en',
+				theme : 'simple',
+				skin : 'default',
+				delta_width : 0,
+				delta_height : 0,
+				popup_css : '',
+				plugins : '',
+				document_base_url : tinymce.documentBaseURL,
+				add_form_submit_trigger : 1,
+				submit_patch : 1,
+				add_unload_trigger : 1,
+				convert_urls : 1,
+				relative_urls : 1,
+				remove_script_host : 1,
+				table_inline_editing : 0,
+				object_resizing : 1,
+				cleanup : 1,
+				accessibility_focus : 1,
+				custom_shortcuts : 1,
+				custom_undo_redo_keyboard_shortcuts : 1,
+				custom_undo_redo_restore_selection : 1,
+				custom_undo_redo : 1,
+				doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
+				visual_table_class : 'mceItemTable',
+				visual : 1,
+				inline_styles : true,
+				convert_fonts_to_spans : true,
+				font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
+				apply_source_formatting : 1,
+				directionality : 'ltr',
+				forced_root_block : 'p',
+				valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p[align],-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],script[type],map[name],area[shape|coords|href|alt|target]',
+				hidden_input : 1,
+				padd_empty_editor : 1,
+				render_ui : 1,
+				init_theme : 1,
+				indentation : '30px'
+			}, s);
+
+			// Setup URIs
+			t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {
+				base_uri : tinyMCE.baseURI
+			});
+			t.baseURI = EditorManager.baseURI;
+
+			// Call setup
+			t.execCallback('setup', t);
+		},
+
+		render : function() {
+			var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;
+
+			// Element not found, then skip initialization
+			if (!t.getElement())
+				return;
+
+			if (s.strict_loading_mode) {
+				sl.settings.strict_mode = s.strict_loading_mode;
+				tinymce.DOM.settings.strict = 1;
+			}
+
+			// Add hidden input for non input elements inside form elements
+			if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))
+				DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);
+
+			t.windowManager = new tinymce.WindowManager(t);
+
+			if (s.encoding == 'xml') {
+				t.onGetContent.add(function(ed, o) {
+					if (o.get)
+						o.content = DOM.encode(o.content);
+				});
+			}
+
+			if (s.add_form_submit_trigger) {
+				t.onSubmit.addToTop(function() {
+					if (t.initialized) {
+						t.save();
+						t.isNotDirty = 1;
+					}
+				});
+			}
+
+			Event.add(document, 'unload', function() {
+				if (t.initialized && !t.destroyed && s.add_unload_trigger)
+					t.save({format : 'raw', no_events : true});
+			});
+
+			tinymce.addUnload(t._destroy, t);
+
+			if (s.submit_patch) {
+				t.onBeforeRenderUI.add(function() {
+					var n = t.getElement().form;
+
+					if (!n)
+						return;
+
+					// Already patched
+					if (n._mceOldSubmit)
+						return;
+
+					// Check page uses id="submit" or name="submit" for it's submit button
+					if (!n.submit.nodeType) {
+						t.formElement = n;
+						n._mceOldSubmit = n.submit;
+						n.submit = function() {
+							// Save all instances
+							EditorManager.triggerSave();
+							t.isNotDirty = 1;
+
+							return this._mceOldSubmit(this);
+						};
+					}
+
+					n = null;
+				});
+			}
+
+			// Load scripts
+			function loadScripts() {
+				sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');
+
+				if (s.theme.charAt(0) != '-')
+					ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');
+
+				each(s.plugins.split(','), function(p) {
+					if (p && p.charAt(0) != '-') {
+						// Skip safari plugin for other browsers
+						if (!isWebKit && p == 'safari')
+							return;
+
+						PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js');
+					}
+				});
+
+				// Init when que is loaded
+				sl.loadQueue(function() {
+					if (s.ask) {
+						function ask() {
+							t.windowManager.confirm(t.getLang('edit_confirm'), function(s) {
+								if (s)
+									t.init();
+								else
+									Event.remove(t.id, 'focus', ask);
+							});
+						};
+
+						Event.add(t.id, 'focus', ask);
+						return;
+					}
+
+					if (!t.removed)
+						t.init();
+				});
+			};
+
+			// Load compat2x first
+			if (s.plugins.indexOf('compat2x') != -1) {
+				PluginManager.load('compat2x', 'plugins/compat2x/editor_plugin' + tinymce.suffix + '.js');
+				sl.loadQueue(loadScripts);
+			} else
+				loadScripts();
+		},
+
+		init : function() {
+			var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti;
+
+			EditorManager.add(t);
+
+			// Create theme
+			s.theme = s.theme.replace(/-/, '');
+			o = ThemeManager.get(s.theme);
+			t.theme = new o();
+
+			if (t.theme.init && s.init_theme)
+				t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));
+
+			// Create all plugins
+			each(s.plugins.replace(/\-/g, '').split(','), function(p) {
+				var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;
+
+				if (c) {
+					po = new c(t, u);
+
+					t.plugins[p] = po;
+
+					if (po.init)
+						po.init(t, u);
+				}
+			});
+
+			// Setup popup CSS path(s)
+			s.popup_css = t.baseURI.toAbsolute(s.popup_css || "themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");
+
+			if (s.popup_css_add)
+				s.popup_css += ',' + s.popup_css_add;
+
+			// Setup control factory
+			t.controlManager = new tinymce.ControlManager(t);
+			t.undoManager = new tinymce.UndoManager(t);
+
+			// Pass through
+			t.undoManager.onAdd.add(function(um, l) {
+				return t.onChange.dispatch(t, l, um);
+			});
+
+			t.undoManager.onUndo.add(function(um, l) {
+				return t.onUndo.dispatch(t, l, um);
+			});
+
+			t.undoManager.onRedo.add(function(um, l) {
+				return t.onRedo.dispatch(t, l, um);
+			});
+
+			if (s.custom_undo_redo) {
+				t.onExecCommand.add(function(ed, cmd) {
+					if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint')
+						t.undoManager.add();
+				});
+			}
+
+			t.onExecCommand.add(function(ed, c) {
+				// Don't refresh the select lists until caret move
+				if (!/^(FontName|FontSize)$/.test(c))
+					t.nodeChanged();
+			});
+
+			// Remove ghost selections on images and tables in Gecko
+			if (isGecko) {
+				function repaint() {
+					t.execCommand('mceRepaint');
+				};
+
+				t.onUndo.add(repaint);
+				t.onRedo.add(repaint);
+				t.onSetContent.add(repaint);
+			}
+
+			// Enables users to override the control factory
+			t.onBeforeRenderUI.dispatch(t, t.controlManager);
+
+			// Measure box
+			if (s.render_ui) {
+				w = s.width || e.style.width || e.clientWidth;
+				h = s.height || e.style.height || e.clientHeight;
+				t.orgDisplay = e.style.display;
+
+				if (('' + w).indexOf('%') == -1)
+					w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);
+
+				if (('' + h).indexOf('%') == -1)
+					h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);
+
+				// Render UI
+				o = t.theme.renderUI({
+					targetNode : e,
+					width : w,
+					height : h,
+					deltaWidth : s.delta_width,
+					deltaHeight : s.delta_height
+				});
+
+				t.editorContainer = o.editorContainer;
+			}
+
+			
+			// Resize editor
+			DOM.setStyles(o.sizeContainer || o.editorContainer, {
+				width : w,
+				height : h
+			});
+
+			h = (o.iframeHeight || h) + ((h + '').indexOf('%') == -1 ? (o.deltaHeight || 0) : '');
+			if (h < 100)
+				h = 100;
+
+			// Create iframe
+			n = DOM.add(o.iframeContainer, 'iframe', {
+				id : s.id + "_ifr",
+				src : 'javascript:""', // Workaround for HTTPS warning in IE6/7
+				frameBorder : '0',
+				style : {
+					width : '100%',
+					height : h
+				}
+			});
+
+			t.contentAreaContainer = o.iframeContainer;
+			DOM.get(o.editorContainer).style.display = t.orgDisplay;
+			DOM.get(s.id).style.display = 'none';
+
+			// Safari 2.x requires us to wait for the load event and load a real HTML doc
+			if (tinymce.isOldWebKit) {
+				Event.add(n, 'load', t.setupIframe, t);
+				n.src = tinymce.baseURL + '/plugins/safari/blank.htm';
+			} else {
+				t.setupIframe();
+				e = n = o = null; // Cleanup
+			}
+		},
+
+		setupIframe : function() {
+			var t = this, s = t.settings, e = DOM.get(s.id), d = t.getDoc();
+
+			// Setup body
+			d.open();
+			d.write(s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + t.documentBaseURI.getURI() + '" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body id="tinymce" class="mceContentBody"></body></html>');
+			d.close();
+
+			// Design mode needs to be added here Ctrl+A will fail otherwise
+			if (!isIE) {
+				try {
+					d.designMode = 'On';
+				} catch (ex) {
+					// Will fail on Gecko if the editor is placed in an hidden container element
+					// The design mode will be set ones the editor is focused
+				}
+			}
+
+			// IE needs to use contentEditable or it will display non secure items for HTTPS
+			if (isIE)
+				t.getBody().contentEditable = true;
+
+			// Setup objects
+			t.dom = new tinymce.DOM.DOMUtils(t.getDoc(), {
+				keep_values : true,
+				url_converter : t.convertURL,
+				url_converter_scope : t,
+				hex_colors : s.force_hex_style_colors,
+				class_filter : s.class_filter,
+				update_styles : 1
+			});
+
+			t.serializer = new tinymce.dom.Serializer({
+				entity_encoding : s.entity_encoding,
+				entities : s.entities,
+				valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,
+				extended_valid_elements : s.extended_valid_elements,
+				valid_child_elements : s.valid_child_elements,
+				invalid_elements : s.invalid_elements,
+				fix_table_elements : s.fix_table_elements,
+				fix_list_elements : s.fix_list_elements,
+				fix_content_duplication : s.fix_content_duplication,
+				convert_fonts_to_spans : s.convert_fonts_to_spans,
+				font_size_classes  : s.font_size_classes,
+				font_size_style_values : s.font_size_style_values,
+				apply_source_formatting : s.apply_source_formatting,
+				remove_linebreaks : s.remove_linebreaks,
+				dom : t.dom
+			});
+
+			t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);
+			t.forceBlocks = new tinymce.ForceBlocks(t, {
+				forced_root_block : s.forced_root_block
+			});
+			t.editorCommands = new tinymce.EditorCommands(t);
+
+			// Pass through
+			t.serializer.onPreProcess.add(function(se, o) {
+				return t.onPreProcess.dispatch(t, o, se);
+			});
+
+			t.serializer.onPostProcess.add(function(se, o) {
+				return t.onPostProcess.dispatch(t, o, se);
+			});
+
+			t.onPreInit.dispatch(t);
+
+			if (!s.gecko_spellcheck)
+				t.getBody().spellcheck = 0;
+
+			t._addEvents();
+
+			t.controlManager.onPostRender.dispatch(t, t.controlManager);
+			t.onPostRender.dispatch(t);
+
+			if (s.directionality)
+				t.getBody().dir = s.directionality;
+
+			if (s.nowrap)
+				t.getBody().style.whiteSpace = "nowrap";
+
+			if (s.auto_resize)
+				t.onNodeChange.add(t.resizeToContent, t);
+
+			if (s.handle_node_change_callback) {
+				t.onNodeChange.add(function(ed, cm, n) {
+					t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());
+				});
+			}
+
+			if (s.save_callback) {
+				t.onSaveContent.add(function(ed, o) {
+					var h = t.execCallback('save_callback', t.id, o.content, t.getBody());
+
+					if (h)
+						o.content = h;
+				});
+			}
+
+			if (s.onchange_callback) {
+				t.onChange.add(function(ed, l) {
+					t.execCallback('onchange_callback', t, l);
+				});
+			}
+
+			if (s.convert_newlines_to_brs) {
+				t.onBeforeSetContent.add(function(ed, o) {
+					if (o.initial)
+						o.content = o.content.replace(/\r?\n/g, '<br />');
+				});
+			}
+
+			if (s.fix_nesting && isIE) {
+				t.onBeforeSetContent.add(function(ed, o) {
+					o.content = t._fixNesting(o.content);
+				});
+			}
+
+			if (s.preformatted) {
+				t.onPostProcess.add(function(ed, o) {
+					o.content = o.content.replace(/^\s*<pre.*?>/, '');
+					o.content = o.content.replace(/<\/pre>\s*$/, '');
+
+					if (o.set)
+						o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';
+				});
+			}
+
+			if (s.verify_css_classes) {
+				t.serializer.attribValueFilter = function(n, v) {
+					var s, cl;
+
+					if (n == 'class') {
+						// Build regexp for classes
+						if (!t.classesRE) {
+							cl = t.dom.getClasses();
+
+							if (cl.length > 0) {
+								s = '';
+
+								each (cl, function(o) {
+									s += (s ? '|' : '') + o['class'];
+								});
+
+								t.classesRE = new RegExp('(' + s + ')', 'gi');
+							}
+						}
+
+						return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';
+					}
+
+					return v;
+				};
+			}
+
+			if (s.convert_fonts_to_spans)
+				t._convertFonts();
+
+			if (s.inline_styles)
+				t._convertInlineElements();
+
+			if (s.cleanup_callback) {
+				t.onBeforeSetContent.add(function(ed, o) {
+					o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
+				});
+
+				t.onPreProcess.add(function(ed, o) {
+					if (o.set)
+						t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);
+
+					if (o.get)
+						t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);
+				});
+
+				t.onPostProcess.add(function(ed, o) {
+					if (o.set)
+						o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);
+
+					if (o.get)						
+						o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);
+				});
+			}
+
+			if (s.save_callback) {
+				t.onGetContent.add(function(ed, o) {
+					if (o.save)
+						o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());
+				});
+			}
+
+			if (s.handle_event_callback) {
+				t.onEvent.add(function(ed, e, o) {
+					if (t.execCallback('handle_event_callback', e, ed, o) === false)
+						Event.cancel(e);
+				});
+			}
+
+			t.onSetContent.add(function() {
+				// Safari needs some time, it will crash the browser when a link is created otherwise
+				// I think this crash issue is resolved in the latest 3.0.4
+				//window.setTimeout(function() {
+					t.addVisual(t.getBody());
+				//}, 1);
+			});
+
+			// Remove empty contents
+			if (s.padd_empty_editor) {
+				t.onPostProcess.add(function(ed, o) {
+					o.content = o.content.replace(/^<p>(&nbsp;|#160;|\s)<\/p>$/, '');
+				});
+			}
+
+			if (isGecko) {
+				try {
+					// Design mode must be set here once again to fix a bug where
+					// Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again
+					d.designMode = 'Off';
+					d.designMode = 'On';
+				} catch (ex) {
+					// Will fail on Gecko if the editor is placed in an hidden container element
+					// The design mode will be set ones the editor is focused
+				}
+			}
+
+			// A small timeout was needed since firefox will remove. Bug: #1838304
+			setTimeout(function () {
+				if (t.removed)
+					return;
+
+				t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')});
+				t.startContent = t.getContent({format : 'raw'});
+				t.undoManager.add({initial : true});
+				t.initialized = true;
+
+				t.onInit.dispatch(t);
+				t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());
+				t.execCallback('init_instance_callback', t);
+				t.focus(true);
+				t.nodeChanged({initial : 1});
+
+				// Load specified content CSS last
+				if (s.content_css) {
+					tinymce.each(s.content_css.split(','), function(u) {
+						t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));
+					});
+				}
+
+				// Handle auto focus
+				if (s.auto_focus) {
+					setTimeout(function () {
+						var ed = EditorManager.get(s.auto_focus);
+
+						ed.selection.select(ed.getBody(), 1);
+						ed.selection.collapse(1);
+						ed.getWin().focus();
+					}, 100);
+				}
+			}, 1);
+	
+			e = null;
+		},
+
+		
+		focus : function(sf) {
+			var oed, t = this;
+
+			if (!sf) {
+				t.getWin().focus();
+
+							}
+
+			if (EditorManager.activeEditor != t) {
+				if ((oed = EditorManager.activeEditor) != null)
+					oed.onDeactivate.dispatch(oed, t);
+
+				t.onActivate.dispatch(t, oed);
+			}
+
+			EditorManager._setActive(t);
+		},
+
+		execCallback : function(n) {
+			var t = this, f = t.settings[n], s;
+
+			if (!f)
+				return;
+
+			// Look through lookup
+			if (t.callbackLookup && (s = t.callbackLookup[n])) {
+				f = s.func;
+				s = s.scope;
+			}
+
+			if (is(f, 'string')) {
+				s = f.replace(/\.\w+$/, '');
+				s = s ? tinymce.resolve(s) : 0;
+				f = tinymce.resolve(f);
+				t.callbackLookup = t.callbackLookup || {};
+				t.callbackLookup[n] = {func : f, scope : s};
+			}
+
+			return f.apply(s || t, Array.prototype.slice.call(arguments, 1));
+		},
+
+		translate : function(s) {
+			var c = this.settings.language, i18n = EditorManager.i18n;
+
+			if (!s)
+				return '';
+
+			return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {
+				return i18n[c + '.' + b] || '{#' + b + '}';
+			});
+		},
+
+		getLang : function(n, dv) {
+			return EditorManager.i18n[this.settings.language + '.' + n] || (is(dv) ? dv : '{#' + n + '}');
+		},
+
+		getParam : function(n, dv) {
+			return is(this.settings[n]) ? this.settings[n] : dv;
+		},
+
+		nodeChanged : function(o) {
+			var t = this, s = t.selection, n = s.getNode() || this.getBody();
+
+			this.onNodeChange.dispatch(
+				t,
+				o ? o.controlManager || t.controlManager : t.controlManager,
+				isIE && n.ownerDocument != t.getDoc() ? this.getBody() : n, // Fix for IE initial state
+				s.isCollapsed(),
+				o
+			);
+		},
+
+		addButton : function(n, s) {
+			var t = this;
+
+			t.buttons = t.buttons || {};
+			t.buttons[n] = s;
+		},
+
+		addCommand : function(n, f, s) {
+			this.execCommands[n] = {func : f, scope : s || this};
+		},
+
+		addQueryStateHandler : function(n, f, s) {
+			this.queryStateCommands[n] = {func : f, scope : s || this};
+		},
+
+		addQueryValueHandler : function(n, f, s) {
+			this.queryValueCommands[n] = {func : f, scope : s || this};
+		},
+
+		addShortcut : function(pa, desc, cmd_func, sc) {
+			var t = this, c;
+
+			if (!t.settings.custom_shortcuts)
+				return false;
+
+			t.shortcuts = t.shortcuts || {};
+
+			if (is(cmd_func, 'string')) {
+				c = cmd_func;
+
+				cmd_func = function() {
+					t.execCommand(c, false, null);
+				};
+			}
+
+			if (is(cmd_func, 'object')) {
+				c = cmd_func;
+
+				cmd_func = function() {
+					t.execCommand(c[0], c[1], c[2]);
+				};
+			}
+
+			each(pa.split(','), function(pa) {
+				var o = {
+					func : cmd_func,
+					scope : sc || this,
+					desc : desc,
+					alt : false,
+					ctrl : false,
+					shift : false
+				};
+
+				each(pa.split('+'), function(v) {
+					switch (v) {
+						case 'alt':
+						case 'ctrl':
+						case 'shift':
+							o[v] = true;
+							break;
+
+						default:
+							o.charCode = v.charCodeAt(0);
+							o.keyCode = v.toUpperCase().charCodeAt(0);
+					}
+				});
+
+				t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;
+			});
+
+			return true;
+		},
+
+		execCommand : function(cmd, ui, val, a) {
+			var t = this, s = 0, o;
+
+			if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))
+				t.focus();
+
+			o = {};
+			t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o);
+			if (o.terminate)
+				return false;
+
+			// Comamnd callback
+			if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {
+				t.onExecCommand.dispatch(t, cmd, ui, val);
+				return true;
+			}
+
+			// Registred commands
+			if (o = t.execCommands[cmd]) {
+				s = o.func.call(o.scope, ui, val);
+				t.onExecCommand.dispatch(t, cmd, ui, val);
+				return s;
+			}
+
+			// Plugin commands
+			each(t.plugins, function(p) {
+				if (p.execCommand && p.execCommand(cmd, ui, val)) {
+					t.onExecCommand.dispatch(t, cmd, ui, val);
+					s = 1;
+					return false;
+				}
+			});
+
+			if (s)
+				return true;
+
+			// Theme commands
+			if (t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {
+				t.onExecCommand.dispatch(t, cmd, ui, val);
+				return true;
+			}
+
+			// Editor commands
+			if (t.editorCommands.execCommand(cmd, ui, val)) {
+				t.onExecCommand.dispatch(t, cmd, ui, val);
+				return true;
+			}
+
+			// Browser commands
+			t.getDoc().execCommand(cmd, ui, val);
+			t.onExecCommand.dispatch(t, cmd, ui, val);
+		},
+
+		queryCommandState : function(c) {
+			var t = this, o;
+
+			// Is hidden then return undefined
+			if (t._isHidden())
+				return;
+
+			// Registred commands
+			if (o = t.queryStateCommands[c])
+				return o.func.call(o.scope);
+
+			// Registred commands
+			o = t.editorCommands.queryCommandState(c);
+			if (o !== -1)
+				return o;
+
+			// Browser commands
+			return this.getDoc().queryCommandState(c);
+		},
+
+		queryCommandValue : function(c) {
+			var t = this, o;
+
+			// Is hidden then return undefined
+			if (t._isHidden())
+				return;
+
+			// Registred commands
+			if (o = t.queryValueCommands[c])
+				return o.func.call(o.scope);
+
+			// Registred commands
+			o = t.editorCommands.queryCommandValue(c);
+			if (is(o))
+				return o;
+
+			// Browser commands
+			return this.getDoc().queryCommandValue(c);
+		},
+
+		show : function() {
+			var t = this;
+
+			DOM.show(t.getContainer());
+			DOM.hide(t.id);
+			t.load();
+		},
+
+		hide : function() {
+			var t = this, s = t.settings, d = t.getDoc();
+
+			// Fixed bug where IE has a blinking cursor left from the editor
+			if (isIE && d)
+				d.execCommand('SelectAll');
+
+			DOM.hide(t.getContainer());
+			DOM.setStyle(s.id, 'display', t.orgDisplay);
+			t.save();
+		},
+
+		isHidden : function() {
+			return !DOM.isHidden(this.id);
+		},
+
+		setProgressState : function(b, ti, o) {
+			this.onSetProgressState.dispatch(this, b, ti, o);
+
+			return b;
+		},
+
+		remove : function() {
+			var t = this;
+
+			t.removed = 1; // Cancels post remove event execution
+			t.hide();
+			DOM.remove(t.getContainer());
+
+			t.execCallback('remove_instance_callback', t);
+			t.onRemove.dispatch(t);
+
+			EditorManager.remove(t);
+		},
+
+		resizeToContent : function() {
+			var t = this;
+
+			DOM.setStyle(t.id + "_ifr", 'height', t.getBody().scrollHeight);
+		},
+
+		load : function(o) {
+			var t = this, e = t.getElement(), h;
+
+			o = o || {};
+			o.load = true;
+
+			h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);
+			o.element = e;
+
+			if (!o.no_events)
+				t.onLoadContent.dispatch(t, o);
+
+			o.element = e = null;
+
+			return h;
+		},
+
+		save : function(o) {
+			var t = this, e = t.getElement(), h, f;
+
+			if (!t.initialized)
+				return;
+
+			o = o || {};
+			o.save = true;
+
+			o.element = e;
+			h = o.content = t.getContent(o);
+
+			if (!o.no_events)
+				t.onSaveContent.dispatch(t, o);
+
+			h = o.content;
+
+			if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {
+				e.innerHTML = h;
+
+				// Update hidden form element
+				if (f = DOM.getParent(t.id, 'form')) {
+					each(f.elements, function(e) {
+						if (e.name == t.id) {
+							e.value = h;
+							return false;
+						}
+					});
+				}
+			} else
+				e.value = h;
+
+			o.element = e = null;
+
+			return h;
+		},
+
+		setContent : function(h, o) {
+			var t = this;
+
+			o = o || {};
+			o.format = o.format || 'html';
+			o.set = true;
+			o.content = h;
+
+			if (!o.no_events)
+				t.onBeforeSetContent.dispatch(t, o);
+
+			// Padd empty content in Gecko and Safari. Commands will otherwise fail on the content
+			// It will also be impossible to place the caret in the editor unless there is a BR element present
+			if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) {
+				o.content = t.dom.setHTML(t.getBody(), '<br mce_bogus="1" />', 1);
+				o.format = 'raw';
+			}
+
+			o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content));
+
+			if (o.format != 'raw' && t.settings.cleanup) {
+				o.getInner = true;
+				o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o));
+			}
+
+			if (!o.no_events)
+				t.onSetContent.dispatch(t, o);
+
+			return o.content;
+		},
+
+		getContent : function(o) {
+			var t = this, h;
+
+			o = o || {};
+			o.format = o.format || 'html';
+			o.get = true;
+
+			if (!o.no_events)
+				t.onBeforeGetContent.dispatch(t, o);
+
+			if (o.format != 'raw' && t.settings.cleanup) {
+				o.getInner = true;
+				h = t.serializer.serialize(t.getBody(), o);
+			} else
+				h = t.getBody().innerHTML;
+
+			h = h.replace(/^\s*|\s*$/g, '');
+			o = {content : h};
+			t.onGetContent.dispatch(t, o);
+
+			return o.content;
+		},
+
+		isDirty : function() {
+			var t = this;
+
+			return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty;
+		},
+
+		getContainer : function() {
+			var t = this;
+
+			if (!t.container)
+				t.container = DOM.get(t.editorContainer || t.id + '_parent');
+
+			return t.container;
+		},
+
+		getContentAreaContainer : function() {
+			return this.contentAreaContainer;
+		},
+
+		getElement : function() {
+			return DOM.get(this.settings.content_element || this.id);
+		},
+
+		getWin : function() {
+			var t = this, e;
+
+			if (!t.contentWindow) {
+				e = DOM.get(t.id + "_ifr");
+
+				if (e)
+					t.contentWindow = e.contentWindow;
+			}
+
+			return t.contentWindow;
+		},
+
+		getDoc : function() {
+			var t = this, w;
+
+			if (!t.contentDocument) {
+				w = this.getWin();
+
+				if (w)
+					t.contentDocument = w.document;
+			}
+
+			return t.contentDocument;
+		},
+
+		getBody : function() {
+			return this.bodyElement || this.getDoc().body;
+		},
+
+		convertURL : function(u, n, e) {
+			var t = this, s = t.settings;
+
+			// Use callback instead
+			if (s.urlconverter_callback)
+				return t.execCallback('urlconverter_callback', u, e, true, n);
+
+			// Don't convert link href since thats the CSS files that gets loaded into the editor
+			if (!s.convert_urls || (e && e.nodeName == 'LINK'))
+				return u;
+
+			// Convert to relative
+			if (s.relative_urls)
+				return t.documentBaseURI.toRelative(u);
+
+			// Convert to absolute
+			u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);
+
+			return u;
+		},
+
+		addVisual : function(e) {
+			var t = this, s = t.settings;
+
+			e = e || t.getBody();
+
+			if (!is(t.hasVisual))
+				t.hasVisual = s.visual;
+
+			each(t.dom.select('table,a', e), function(e) {
+				var v;
+
+				switch (e.nodeName) {
+					case 'TABLE':
+						v = t.dom.getAttrib(e, 'border');
+
+						if (!v || v == '0') {
+							if (t.hasVisual)
+								t.dom.addClass(e, s.visual_table_class);
+							else
+								t.dom.removeClass(e, s.visual_table_class);
+						}
+
+						return;
+
+					case 'A':
+						v = t.dom.getAttrib(e, 'name');
+
+						if (v) {
+							if (t.hasVisual)
+								t.dom.addClass(e, 'mceItemAnchor');
+							else
+								t.dom.removeClass(e, 'mceItemAnchor');
+						}
+
+						return;
+				}
+			});
+
+			t.onVisualAid.dispatch(t, e, t.hasVisual);
+		},
+
+		// Internal functions
+
+		_addEvents : function() {
+			// 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset
+			var t = this, i, s = t.settings, lo = {
+				mouseup : 'onMouseUp',
+				mousedown : 'onMouseDown',
+				click : 'onClick',
+				keyup : 'onKeyUp',
+				keydown : 'onKeyDown',
+				keypress : 'onKeyPress',
+				submit : 'onSubmit',
+				reset : 'onReset',
+				contextmenu : 'onContextMenu',
+				dblclick : 'onDblClick',
+				paste : 'onPaste' // Doesn't work in all browsers yet
+			};
+
+			function eventHandler(e, o) {
+				var ty = e.type;
+
+				// Don't fire events when it's removed
+				if (t.removed)
+					return;
+
+				// Generic event handler
+				if (t.onEvent.dispatch(t, e, o) !== false) {
+					// Specific event handler
+					t[lo[e.fakeType || e.type]].dispatch(t, e, o);
+				}
+			};
+
+			// Add DOM events
+			each(lo, function(v, k) {
+				switch (k) {
+					case 'contextmenu':
+						if (tinymce.isOpera) {
+							// Fake contextmenu on Opera
+							Event.add(t.getDoc(), 'mousedown', function(e) {
+								if (e.ctrlKey) {
+									e.fakeType = 'contextmenu';
+									eventHandler(e);
+								}
+							});
+						} else
+							Event.add(t.getDoc(), k, eventHandler);
+						break;
+
+					case 'paste':
+						Event.add(t.getBody(), k, function(e) {
+							var tx, h, el, r;
+
+							// Get plain text data
+							if (e.clipboardData)
+								tx = e.clipboardData.getData('text/plain');
+							else if (tinymce.isIE)
+								tx = t.getWin().clipboardData.getData('Text');
+
+							// Get HTML data
+							/*if (tinymce.isIE) {
+								el = DOM.add(document.body, 'div', {style : 'visibility:hidden;overflow:hidden;position:absolute;width:1px;height:1px'});
+								r = document.body.createTextRange();
+								r.moveToElementText(el);
+								r.execCommand('Paste');
+								h = el.innerHTML;
+								DOM.remove(el);
+							}*/
+
+							eventHandler(e, {text : tx, html : h});
+						});
+						break;
+
+					case 'submit':
+					case 'reset':
+						Event.add(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);
+						break;
+
+					default:
+						Event.add(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);
+				}
+			});
+
+			Event.add(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {
+				t.focus(true);
+			});
+
+			// Fixes bug where a specified document_base_uri could result in broken images
+			// This will also fix drag drop of images in Gecko
+			if (tinymce.isGecko) {
+				// Convert all images to absolute URLs
+/*				t.onSetContent.add(function(ed, o) {
+					each(ed.dom.select('img'), function(e) {
+						var v;
+
+						if (v = e.getAttribute('mce_src'))
+							e.src = t.documentBaseURI.toAbsolute(v);
+					})
+				});*/
+
+				Event.add(t.getDoc(), 'DOMNodeInserted', function(e) {
+					var v;
+
+					e = e.target;
+
+					if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('mce_src')))
+						e.src = t.documentBaseURI.toAbsolute(v);
+				});
+			}
+
+			// Set various midas options in Gecko
+			if (isGecko) {
+				function setOpts() {
+					var t = this, d = t.getDoc(), s = t.settings;
+
+					if (isGecko) {
+						if (t._isHidden()) {
+							try {
+								d.designMode = 'On';
+							} catch (ex) {
+								// Fails if it's hidden
+							}
+						}
+
+						try {
+							// Try new Gecko method
+							d.execCommand("styleWithCSS", 0, false);
+						} catch (ex) {
+							// Use old method
+							if (!t._isHidden())
+								d.execCommand("useCSS", 0, true);
+						}
+
+						if (!s.table_inline_editing)
+							try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}
+
+						if (!s.object_resizing)
+							try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}
+					}
+				};
+
+				t.onBeforeExecCommand.add(setOpts);
+				t.onMouseDown.add(setOpts);
+			}
+
+			// Add node change handlers
+			t.onMouseUp.add(t.nodeChanged);
+			t.onClick.add(t.nodeChanged);
+			t.onKeyUp.add(function(ed, e) {
+				if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.keyCode == 46 || e.keyCode == 8 || e.ctrlKey)
+					t.nodeChanged();
+			});
+
+			// Add reset handler
+			t.onReset.add(function() {
+				t.setContent(t.startContent, {format : 'raw'});
+			});
+
+			if (t.getParam('tab_focus')) {
+				function tabCancel(ed, e) {
+					if (e.keyCode === 9)
+						return Event.cancel(e);
+				};
+
+				function tabHandler(ed, e) {
+					var v, f, el;
+
+					function find(d) {
+						f = DOM.getParent(ed.id, 'form'), el = f.elements;
+
+						if (f) {
+							each(f.elements, function(e, i) {
+								if (e.id == ed.id) {
+									i = i + d;
+
+									if (i < 0 || i > el.length)
+										return;
+
+									el = el[i];
+								}
+							});
+						}
+
+						return el;
+					};
+
+					if (e.keyCode === 9) {
+						v = ed.getParam('tab_focus').split(',');
+
+						if (v.length == 1) {
+							v[1] = v[0];
+							v[0] = ':prev';
+						}
+
+						// Find element to focus
+						if (e.shiftKey) {
+							if (v[0] == ':prev')
+								el = find(-1);
+							else
+								el = DOM.get(v[0]);
+						} else {
+							if (v[1] == ':next')
+								el = find(1);
+							else
+								el = DOM.get(v[1]);
+						}
+
+						if (el) {
+							if (ed = EditorManager.get(el.id || el.name))
+								ed.focus();
+							else
+								window.setTimeout(function() {window.focus();el.focus();}, 10);
+
+							return Event.cancel(e);
+						}
+					}
+				};
+
+				t.onKeyUp.add(tabCancel);
+
+				if (isGecko) {
+					t.onKeyPress.add(tabHandler);
+					t.onKeyDown.add(tabCancel);
+				} else
+					t.onKeyDown.add(tabHandler);
+			}
+
+			// Add shortcuts
+			if (s.custom_shortcuts) {
+				if (s.custom_undo_redo_keyboard_shortcuts) {
+					t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');
+					t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');
+				}
+
+				// Add default shortcuts for gecko
+				if (isGecko) {
+					t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');
+					t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');
+					t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');
+				}
+
+				// BlockFormat shortcuts keys
+				for (i=1; i<=6; i++)
+					t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, '<h' + i + '>']);
+
+				t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']);
+				t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);
+				t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);
+
+				function find(e) {
+					var v = null;
+
+					if (!e.altKey && !e.ctrlKey && !e.metaKey)
+						return v;
+
+					each(t.shortcuts, function(o) {
+						if (o.ctrl != e.ctrlKey && (!tinymce.isMac || o.ctrl == e.metaKey))
+							return;
+
+						if (o.alt != e.altKey)
+							return;
+
+						if (o.shift != e.shiftKey)
+							return;
+
+						if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {
+							v = o;
+							return false;
+						}
+					});
+
+					return v;
+				};
+
+				t.onKeyUp.add(function(ed, e) {
+					var o = find(e);
+
+					if (o)
+						return Event.cancel(e);
+				});
+
+				t.onKeyPress.add(function(ed, e) {
+					var o = find(e);
+
+					if (o)
+						return Event.cancel(e);
+				});
+
+				t.onKeyDown.add(function(ed, e) {
+					var o = find(e);
+
+					if (o) {
+						o.func.call(o.scope);
+						return Event.cancel(e);
+					}
+				});
+			}
+
+			if (tinymce.isIE) {
+				// Fix so resize will only update the width and height attributes not the styles of an image
+				// It will also block mceItemNoResize items
+				Event.add(t.getDoc(), 'controlselect', function(e) {
+					var re = t.resizeInfo, cb;
+
+					e = e.target;
+
+					if (re)
+						Event.remove(re.node, re.ev, re.cb);
+
+					if (!t.dom.hasClass(e, 'mceItemNoResize')) {
+						ev = 'resizeend';
+						cb = Event.add(e, ev, function(e) {
+							var v;
+
+							e = e.target;
+
+							if (v = t.dom.getStyle(e, 'width')) {
+								t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));
+								t.dom.setStyle(e, 'width', '');
+							}
+
+							if (v = t.dom.getStyle(e, 'height')) {
+								t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));
+								t.dom.setStyle(e, 'height', '');
+							}
+						});
+					} else {
+						ev = 'resizestart';
+						cb = Event.add(e, 'resizestart', Event.cancel, Event);
+					}
+
+					re = t.resizeInfo = {
+						node : e,
+						ev : ev,
+						cb : cb
+					};
+				});
+
+				t.onKeyDown.add(function(ed, e) {
+					switch (e.keyCode) {
+						case 8:
+							// Fix IE control + backspace browser bug
+							if (t.selection.getRng().item) {
+								t.selection.getRng().item(0).removeNode();
+								return Event.cancel(e);
+							}
+					}
+				});
+			}
+
+			if (tinymce.isOpera) {
+				t.onClick.add(function(ed, e) {
+					Event.prevent(e);
+				});
+			}
+
+			// Add custom undo/redo handlers
+			if (s.custom_undo_redo) {
+				function addUndo() {
+					t.undoManager.typing = 0;
+					t.undoManager.add();
+				};
+
+				// Add undo level on editor blur
+				if (tinymce.isIE) {
+					Event.add(t.getWin(), 'blur', function(e) {
+						var n;
+
+						// Check added for fullscreen bug
+						if (t.selection) {
+							n = t.selection.getNode();
+
+							// Add undo level is selection was lost to another document
+							if (!t.removed && n.ownerDocument && n.ownerDocument != t.getDoc())
+								addUndo();
+						}
+					});
+				} else {
+					Event.add(t.getDoc(), 'blur', function() {
+						if (t.selection && !t.removed)
+							addUndo();
+					});
+				}
+
+				t.onMouseDown.add(addUndo);
+
+				t.onKeyUp.add(function(ed, e) {
+					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) {
+						t.undoManager.typing = 0;
+						t.undoManager.add();
+					}
+				});
+
+				t.onKeyDown.add(function(ed, e) {
+					// Is caracter positon keys
+					if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) {
+						if (t.undoManager.typing) {
+							t.undoManager.add();
+							t.undoManager.typing = 0;
+						}
+
+						return;
+					}
+
+					if (!t.undoManager.typing) {
+						t.undoManager.add();
+						t.undoManager.typing = 1;
+					}
+				});
+			}
+		},
+
+		_destroy : function() {
+			var t = this;
+
+			if (t.formElement) {
+				t.formElement.submit = t.formElement._mceOldSubmit;
+				t.formElement._mceOldSubmit = null;
+			}
+
+			t.contentAreaContainer = t.formElement = t.container = t.contentDocument = t.contentWindow = null;
+
+			if (t.selection)
+				t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;
+
+			t.destroyed = 1;
+		},
+
+		_convertInlineElements : function() {
+			var t = this, s = t.settings, dom = t.dom;
+
+			function convert(ed, o) {
+				if (!s.inline_styles)
+					return;
+
+				if (o.get) {
+					each(t.dom.select('table,u,strike', o.node), function(n) {
+						switch (n.nodeName) {
+							case 'TABLE':
+								if (v = dom.getAttrib(n, 'height')) {
+									dom.setStyle(n, 'height', v);
+									dom.setAttrib(n, 'height', '');
+								}
+								break;
+
+							case 'U':
+								dom.replace(dom.create('span', {style : 'text-decoration: underline;'}), n, 1);
+								break;
+
+							case 'STRIKE':
+								dom.replace(dom.create('span', {style : 'text-decoration: line-through;'}), n, 1);
+								break;
+						}
+					});
+				} else if (o.set) {
+					each(t.dom.select('table,span', o.node), function(n) {
+						if (n.nodeName == 'TABLE') {
+							if (v = dom.getStyle(n, 'height'))
+								dom.setAttrib(n, 'height', v.replace(/[^0-9%]+/g, ''));
+						} else {
+							// Convert spans to elements
+							if (n.style.textDecoration == 'underline')
+								dom.replace(dom.create('u'), n, 1);
+							else if (n.style.textDecoration == 'line-through')
+								dom.replace(dom.create('strike'), n, 1);
+						}
+					});
+				}
+			};
+
+			t.onPreProcess.add(convert);
+
+			if (!s.cleanup_on_startup) {
+				t.onInit.add(function() {
+					convert(t, {node : t.getBody(), set : 1});
+				});
+			}
+		},
+
+		_convertFonts : function() {
+			var t = this, s = t.settings, dom = t.dom, sl, cl, fz, fzn, v, i;
+
+			// Font pt values and font size names
+			fz = [8, 10, 12, 14, 18, 24, 36];
+			fzn = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large'];
+
+			if (sl = s.font_size_style_values)
+				sl = sl.split(',');
+
+			if (cl = s.font_size_classes)
+				cl = cl.split(',');
+
+			t.onPreProcess.add(function(ed, o) {
+				if (!s.inline_styles)
+					return;
+
+				if (o.set) {
+					// Convert spans to fonts on non WebKit browsers
+					if (tinymce.isWebKit)
+						return;
+
+					each(t.dom.select('span', o.node), function(n) {
+						var f = dom.create('font', {
+							color : dom.toHex(dom.getStyle(n, 'color')),
+							face : dom.getStyle(n, 'fontFamily')
+						});
+
+						if (sl) {
+							i = inArray(sl, dom.getStyle(n, 'fontSize'));
+
+							if (i != -1)
+								dom.setAttrib(f, 'size', '' + (i + 1 || 1));
+						} else if (cl) {
+							i = inArray(cl, dom.getAttrib(n, 'class'));
+
+							v = dom.getStyle(n, 'fontSize');
+
+							if (i == -1 && v.indexOf('pt') > 0)
+								i = inArray(fz, parseInt(v));
+
+							if (i == -1)
+								i = inArray(fzn, v);
+
+							if (i != -1)
+								dom.setAttrib(f, 'size', '' + (i + 1 || 1));
+						}
+
+						if (f.color || f.face || f.size)
+							dom.replace(f, n, 1);
+					});
+				} else if (o.get) {
+					each(t.dom.select('font', o.node), function(n) {
+						var sp = dom.create('span', {
+							style : {
+								fontFamily : dom.getAttrib(n, 'face'),
+								color : dom.getAttrib(n, 'color'),
+								backgroundColor : n.style.backgroundColor
+							}
+						});
+
+						if (n.size) {
+							if (sl)
+								dom.setStyle(sp, 'fontSize', sl[parseInt(n.size) - 1]);
+							else
+								dom.setAttrib(sp, 'class', cl[parseInt(n.size) - 1]);
+						}
+
+						dom.replace(sp, n, 1);
+					});
+				}
+			});
+		},
+
+		_isHidden : function() {
+			var s;
+
+			if (!isGecko)
+				return 0;
+
+			// Weird, wheres that cursor selection?
+			s = this.selection.getSel();
+			return (!s || !s.rangeCount || s.rangeCount == 0);
+		},
+
+		_fixNesting : function(s) {
+			var d = [], i;
+
+			s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) {
+				var e;
+
+				// Handle end element
+				if (b === '/') {
+					if (!d.length)
+						return '';
+
+					if (c !== d[d.length - 1].tag) {
+						for (i=d.length - 1; i>=0; i--) {
+							if (d[i].tag === c) {
+								d[i].close = 1;
+								break;
+							}
+						}
+
+						return '';
+					} else {
+						d.pop();
+
+						if (d.length && d[d.length - 1].close) {
+							a = a + '</' + d[d.length - 1].tag + '>';
+							d.pop();
+						}
+					}
+				} else {
+					// Ignore these
+					if (/^(br|hr|input|meta|img|link|param)$/i.test(c))
+						return a;
+
+					// Ignore closed ones
+					if (/\/>$/.test(a))
+						return a;
+
+					d.push({tag : c}); // Push start element
+				}
+
+				return a;
+			});
+
+			// End all open tags
+			for (i=d.length - 1; i>=0; i--)
+				s += '</' + d[i].tag + '>';
+
+			return s;
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/EditorCommands.js */
+
+(function() {
+	var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit;
+
+	tinymce.create('tinymce.EditorCommands', {
+		EditorCommands : function(ed) {
+			this.editor = ed;
+		},
+
+		execCommand : function(cmd, ui, val) {
+			var t = this, ed = t.editor, f;
+
+			switch (cmd) {
+				case 'Cut':
+				case 'Copy':
+				case 'Paste':
+					try {
+						ed.getDoc().execCommand(cmd, ui, val);
+					} catch (ex) {
+						if (isGecko) {
+							ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) {
+								if (s)
+									window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal');
+							});
+						} else
+							ed.windowManager.alert(ed.getLang('clipboard_no_support'));
+					}
+
+					return true;
+
+				// Ignore these
+				case 'mceResetDesignMode':
+				case 'mceBeginUndoLevel':
+					return true;
+
+				// Ignore these
+				case 'unlink':
+					t.UnLink();
+					return true;
+
+				// Bundle these together
+				case 'JustifyLeft':
+				case 'JustifyCenter':
+				case 'JustifyRight':
+				case 'JustifyFull':
+					t.mceJustify(cmd, cmd.substring(7).toLowerCase());
+					return true;
+
+				case 'mceEndUndoLevel':
+				case 'mceAddUndoLevel':
+					ed.undoManager.add();
+					return true;
+
+				default:
+					f = this[cmd];
+
+					if (f) {
+						f.call(this, ui, val);
+						return true;
+					}
+			}
+
+			return false;
+		},
+
+		Indent : function() {
+			var ed = this.editor, d = ed.dom, s = ed.selection, e, iv, iu;
+
+			// Setup indent level
+			iv = ed.settings.indentation;
+			iu = /[a-z%]+$/i.exec(iv);
+			iv = parseInt(iv);
+
+			if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) {
+				each(this._getSelectedBlocks(), function(e) {
+					d.setStyle(e, 'paddingLeft', (parseInt(e.style.paddingLeft || 0) + iv) + iu);
+				});
+
+				return;
+			}
+
+			ed.getDoc().execCommand('Indent', false, null);
+
+			if (isIE) {
+				d.getParent(s.getNode(), function(n) {
+					if (n.nodeName == 'BLOCKQUOTE') {
+						n.dir = n.style.cssText = '';
+					}
+				});
+			}
+		},
+
+		Outdent : function() {
+			var ed = this.editor, d = ed.dom, s = ed.selection, e, v, iv, iu;
+
+			// Setup indent level
+			iv = ed.settings.indentation;
+			iu = /[a-z%]+$/i.exec(iv);
+			iv = parseInt(iv);
+
+			if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) {
+				each(this._getSelectedBlocks(), function(e) {
+					v = Math.max(0, parseInt(e.style.paddingLeft || 0) - iv);
+					d.setStyle(e, 'paddingLeft', v ? v + iu : '');
+				});
+
+				return;
+			}
+
+			ed.getDoc().execCommand('Outdent', false, null);
+		},
+
+		mceSetAttribute : function(u, v) {
+			var ed = this.editor, d = ed.dom, e;
+
+			if (e = d.getParent(ed.selection.getNode(), d.isBlock))
+				d.setAttrib(e, v.name, v.value);
+		},
+
+		mceSetContent : function(u, v) {
+			this.editor.setContent(v);
+		},
+
+		mceToggleVisualAid : function() {
+			var ed = this.editor;
+
+			ed.hasVisual = !ed.hasVisual;
+			ed.addVisual();
+		},
+
+		mceReplaceContent : function(u, v) {
+			var s = this.editor.selection;
+
+			s.setContent(v.replace(/\{\$selection\}/g, s.getContent({format : 'text'})));
+		},
+
+		mceInsertLink : function(u, v) {
+			var ed = this.editor, e = ed.dom.getParent(ed.selection.getNode(), 'A');
+
+			if (tinymce.is(v, 'string'))
+				v = {href : v};
+
+			function set(e) {
+				each(v, function(v, k) {
+					ed.dom.setAttrib(e, k, v);
+				});
+			};
+
+			if (!e) {
+				ed.execCommand('CreateLink', false, 'javascript:mctmp(0);');
+				each(ed.dom.select('a'), function(e) {
+					if (e.href == 'javascript:mctmp(0);')
+						set(e);
+				});
+			} else {
+				if (v.href)
+					set(e);
+				else
+					ed.dom.remove(e, 1);
+			}
+		},
+
+		UnLink : function() {
+			var ed = this.editor, s = ed.selection;
+
+			if (s.isCollapsed())
+				s.select(s.getNode());
+
+			ed.getDoc().execCommand('unlink', false, null);
+			s.collapse(0);
+		},
+
+		FontName : function(u, v) {
+			var t = this, ed = t.editor, s = ed.selection, e;
+
+			if (!v) {
+				if (s.isCollapsed())
+					s.select(s.getNode());
+
+				t.RemoveFormat();
+			} else
+				ed.getDoc().execCommand('FontName', false, v);
+		},
+
+		queryCommandValue : function(c) {
+			var f = this['queryValue' + c];
+
+			if (f)
+				return f.call(this, c);
+
+			return false;
+		},
+
+		queryCommandState : function(cmd) {
+			var f;
+
+			switch (cmd) {
+				// Bundle these together
+				case 'JustifyLeft':
+				case 'JustifyCenter':
+				case 'JustifyRight':
+				case 'JustifyFull':
+					return this.queryStateJustify(cmd, cmd.substring(7).toLowerCase());
+
+				default:
+					if (f = this['queryState' + cmd])
+						return f.call(this, cmd);
+			}
+
+			return -1;
+		},
+
+		queryValueFontSize : function() {
+			var ed = this.editor, v = 0, p;
+
+			if (isOpera || isWebKit) {
+				if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT'))
+					v = p.size;
+
+				return v;
+			}
+
+			return ed.getDoc().queryCommandValue('FontSize');
+		},
+
+		queryValueFontName : function() {
+			var ed = this.editor, v = 0, p;
+
+			if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT'))
+				v = p.face;
+
+			if (!v)
+				v = ed.getDoc().queryCommandValue('FontName');
+
+			return v;
+		},
+
+		mceJustify : function(c, v) {
+			var ed = this.editor, se = ed.selection, n = se.getNode(), nn = n.nodeName, bl, nb, dom = ed.dom, rm;
+
+			if (ed.settings.inline_styles && this.queryStateJustify(c, v))
+				rm = 1;
+
+			bl = dom.getParent(n, ed.dom.isBlock);
+
+			if (nn == 'IMG') {
+				if (v == 'full')
+					return;
+
+				if (rm) {
+					dom.setStyle(n, 'float', '');
+					this.mceRepaint();
+					return;
+				}
+
+				if (v == 'center') {
+					if (!bl || bl.childNodes.length > 1) {
+						nb = dom.create('p');
+						nb.appendChild(n.cloneNode(false));
+
+						if (bl)
+							dom.insertAfter(nb, bl);
+						else
+							dom.insertAfter(nb, n);
+
+						dom.remove(n);
+						n = nb.firstChild;
+						bl = nb;
+					}
+
+					dom.setStyle(bl, 'textAlign', v);
+					dom.setStyle(n, 'float', '');
+				} else
+					dom.setStyle(n, 'float', v);
+
+				this.mceRepaint();
+				return;
+			}
+
+			// Handle the alignment outselfs, less quirks in all browsers
+			if (ed.settings.inline_styles && ed.settings.forced_root_block) {
+				if (rm)
+					v = '';
+
+				each(this._getSelectedBlocks(dom.getParent(se.getStart(), dom.isBlock), dom.getParent(se.getEnd(), dom.isBlock)), function(e) {
+					dom.setAttrib(e, 'align', '');
+					dom.setStyle(e, 'textAlign', v == 'full' ? 'justify' : v);
+				});
+
+				return;
+			} else if (!rm)
+				ed.getDoc().execCommand(c, false, null);
+
+			if (ed.settings.inline_styles) {
+				if (rm) {
+					dom.getParent(ed.selection.getNode(), function(n) {
+						if (n.style && n.style.textAlign)
+							dom.setStyle(n, 'textAlign', '');
+					});
+
+					return;
+				}
+
+				each(dom.select('*'), function(n) {
+					var v = n.align;
+
+					if (v) {
+						if (v == 'full')
+							v = 'justify';
+
+						dom.setStyle(n, 'textAlign', v);
+						dom.setAttrib(n, 'align', '');
+					}
+				});
+			}
+		},
+
+		mceSetCSSClass : function(u, v) {
+			this.mceSetStyleInfo(0, {command : 'setattrib', name : 'class', value : v});
+		},
+
+		getSelectedElement : function() {
+			var t = this, ed = t.editor, dom = ed.dom, se = ed.selection, r = se.getRng(), r1, r2, sc, ec, so, eo, e, sp, ep, re;
+
+			if (se.isCollapsed() || r.item)
+				return se.getNode();
+
+			// Setup regexp
+			re = ed.settings.merge_styles_invalid_parents;
+			if (tinymce.is(re, 'string'))
+				re = new RegExp(re, 'i');
+
+			if (isIE) {
+				r1 = r.duplicate();
+				r1.collapse(true);
+				sc = r1.parentElement();
+
+				r2 = r.duplicate();
+				r2.collapse(false);
+				ec = r2.parentElement();
+
+				if (sc != ec) {
+					r1.move('character', 1);
+					sc = r1.parentElement();
+				}
+
+				if (sc == ec) {
+					r1 = r.duplicate();
+					r1.moveToElementText(sc);
+
+					if (r1.compareEndPoints('StartToStart', r) == 0 && r1.compareEndPoints('EndToEnd', r) == 0)
+						return re && re.test(sc.nodeName) ? null : sc;
+				}
+			} else {
+				function getParent(n) {
+					return dom.getParent(n, function(n) {return n.nodeType == 1;});
+				};
+
+				sc = r.startContainer;
+				ec = r.endContainer;
+				so = r.startOffset;
+				eo = r.endOffset;
+
+				if (!r.collapsed) {
+					if (sc == ec) {
+						if (so - eo < 2) {
+							if (sc.hasChildNodes()) {
+								sp = sc.childNodes[so];
+								return re && re.test(sp.nodeName) ? null : sp;
+							}
+						}
+					}
+				}
+
+				if (sc.nodeType != 3 || ec.nodeType != 3)
+					return null;
+
+				if (so == 0) {
+					sp = getParent(sc);
+
+					if (sp && sp.firstChild != sc)
+						sp = null;
+				}
+
+				if (so == sc.nodeValue.length) {
+					e = sc.nextSibling;
+
+					if (e && e.nodeType == 1)
+						sp = sc.nextSibling;
+				}
+
+				if (eo == 0) {
+					e = ec.previousSibling;
+
+					if (e && e.nodeType == 1)
+						ep = e;
+				}
+
+				if (eo == ec.nodeValue.length) {
+					ep = getParent(ec);
+
+					if (ep && ep.lastChild != ec)
+						ep = null;
+				}
+
+				// Same element
+				if (sp == ep)
+					return re && sp && re.test(sp.nodeName) ? null : sp;
+			}
+
+			return null;
+		},
+
+		InsertHorizontalRule : function() {
+			// Fix for Gecko <hr size="1" /> issue and IE bug rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
+			if (isGecko || isIE)
+				this.editor.selection.setContent('<hr />');
+			else
+				this.editor.getDoc().execCommand('InsertHorizontalRule', false, '');
+		},
+
+		RemoveFormat : function() {
+			var t = this, ed = t.editor, s = ed.selection, b;
+
+			// Safari breaks tables
+			if (isWebKit)
+				s.setContent(s.getContent({format : 'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g, ''), {format : 'raw'});
+			else
+				ed.getDoc().execCommand('RemoveFormat', false, null);
+
+			t.mceSetStyleInfo(0, {command : 'removeformat'});
+			ed.addVisual();
+		},
+
+		mceSetStyleInfo : function(u, v) {
+			var t = this, ed = t.editor, d = ed.getDoc(), dom = ed.dom, e, b, s = ed.selection, nn = v.wrapper || 'span', b = s.getBookmark(), re;
+
+			function set(n, e) {
+				if (n.nodeType == 1) {
+					switch (v.command) {
+						case 'setattrib':
+							return dom.setAttrib(n, v.name, v.value);
+
+						case 'setstyle':
+							return dom.setStyle(n, v.name, v.value);
+
+						case 'removeformat':
+							return dom.setAttrib(n, 'class', '');
+					}
+				}
+			};
+
+			// Setup regexp
+			re = ed.settings.merge_styles_invalid_parents;
+			if (tinymce.is(re, 'string'))
+				re = new RegExp(re, 'i');
+
+			// Set style info on selected element
+			if (e = t.getSelectedElement())
+				set(e, 1);
+			else {
+				// Generate wrappers and set styles on them
+				d.execCommand('FontName', false, '__');
+				each(isWebKit ? dom.select('span') : dom.select('font'), function(n) {
+					var sp, e;
+
+					if (dom.getAttrib(n, 'face') == '__' || n.style.fontFamily === '__') {
+						sp = dom.create(nn, {mce_new : '1'});
+
+						set(sp);
+
+						each (n.childNodes, function(n) {
+							sp.appendChild(n.cloneNode(true));
+						});
+
+						dom.replace(sp, n);
+					}
+				});
+			}
+
+			// Remove wrappers inside new ones
+			each(dom.select(nn).reverse(), function(n) {
+				var p = n.parentNode;
+
+				dom.setAttrib(n, 'mce_new', '');
+
+				// Check if it's an old span in a new wrapper
+				if (!dom.getAttrib(n, 'mce_new')) {
+					// Find new wrapper
+					p = dom.getParent(n, function(n) {
+						return n.nodeType == 1 && dom.getAttrib(n, 'mce_new');
+					});
+
+					if (p)
+						dom.remove(n, 1);
+				}
+			});
+
+			// Merge wrappers with parent wrappers
+			each(dom.select(nn).reverse(), function(n) {
+				var p = n.parentNode;
+
+				if (!p)
+					return;
+
+				// Has parent of the same type and only child
+				if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1)
+					return dom.remove(p, 1);
+
+				// Has parent that is more suitable to have the class and only child
+				if (n.nodeType == 1 && (!re || !re.test(p.nodeName)) && p.childNodes.length == 1) {
+					set(p); // Set style info on parent instead
+					dom.setAttrib(n, 'class', '');
+				}
+			});
+
+			// Remove empty wrappers
+			each(dom.select(nn).reverse(), function(n) {
+				if (!dom.getAttrib(n, 'class') && !dom.getAttrib(n, 'style'))
+					return dom.remove(n, 1);
+			});
+
+			s.moveToBookmark(b);
+		},
+
+		queryStateJustify : function(c, v) {
+			var ed = this.editor, n = ed.selection.getNode(), dom = ed.dom;
+
+			if (n && n.nodeName == 'IMG')
+				return dom.getStyle(n, 'float') == v;
+
+			n = dom.getParent(ed.selection.getStart(), function(n) {
+				return n.nodeType == 1 && n.style.textAlign;
+			});
+
+			if (v == 'full')
+				v = 'justify';
+
+			if (ed.settings.inline_styles)
+				return (n && n.style.textAlign == v);
+
+			return ed.getDoc().queryCommandState(c);
+		},
+
+		HiliteColor : function(ui, val) {
+			var t = this, ed = t.editor, d = ed.getDoc();
+
+			function set(s) {
+				if (!isGecko)
+					return;
+
+				try {
+					// Try new Gecko method
+					d.execCommand("styleWithCSS", 0, s);
+				} catch (ex) {
+					// Use old
+					d.execCommand("useCSS", 0, !s);
+				}
+			};
+
+			if (isGecko || isOpera) {
+				set(true);
+				d.execCommand('hilitecolor', false, val);
+				set(false);
+			} else
+				d.execCommand('BackColor', false, val);
+		},
+
+		Undo : function() {
+			var ed = this.editor;
+
+			if (ed.settings.custom_undo_redo) {
+				ed.undoManager.undo();
+				ed.nodeChanged();
+			} else
+				ed.getDoc().execCommand('Undo', false, null);
+		},
+
+		Redo : function() {
+			var ed = this.editor;
+
+			if (ed.settings.custom_undo_redo) {
+				ed.undoManager.redo();
+				ed.nodeChanged();
+			} else
+				ed.getDoc().execCommand('Redo', false, null);
+		},
+
+		FormatBlock : function(ui, val) {
+			var t = this, ed = t.editor;
+
+			val = ed.settings.forced_root_block ? (val || '<p>') : val;
+			t.mceRemoveNode();
+
+			if (val.indexOf('<') == -1)
+				val = '<' + val + '>';
+
+			if (tinymce.isGecko)
+				val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1');
+
+			ed.getDoc().execCommand('FormatBlock', false, val);
+		},
+
+		mceCleanup : function() {
+			var ed = this.editor, s = ed.selection, b = s.getBookmark();
+			ed.setContent(ed.getContent());
+			s.moveToBookmark(b);
+		},
+
+		mceRemoveNode : function(ui, val) {
+			var ed = this.editor, s = ed.selection, b, n = val || s.getNode();
+
+			// Make sure that the body node isn't removed
+			if (n == ed.getBody())
+				return;
+
+			b = s.getBookmark();
+			ed.dom.remove(n, 1);
+			s.moveToBookmark(b);
+			ed.nodeChanged();
+		},
+
+		mceSelectNodeDepth : function(ui, val) {
+			var ed = this.editor, s = ed.selection, c = 0;
+
+			ed.dom.getParent(s.getNode(), function(n) {
+				if (n.nodeType == 1 && c++ == val) {
+					s.select(n);
+					ed.nodeChanged();
+					return false;
+				}
+			}, ed.getBody());
+		},
+
+		mceSelectNode : function(u, v) {
+			this.editor.selection.select(v);
+		},
+
+		mceInsertContent : function(ui, val) {
+			this.editor.selection.setContent(val);
+		},
+
+		mceInsertRawHTML : function(ui, val) {
+			var ed = this.editor;
+
+			ed.execCommand('mceInsertContent', false, 'tiny_mce_marker');
+			ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val));
+		},
+
+		mceRepaint : function() {
+			var s, b, e = this.editor;
+
+			if (tinymce.isGecko) {
+				try {
+					s = e.selection;
+					b = s.getBookmark(true);
+
+					if (s.getSel())
+						s.getSel().selectAllChildren(e.getBody());
+
+					s.collapse(true);
+					s.moveToBookmark(b);
+				} catch (ex) {
+					// Ignore
+				}
+			}
+		},
+
+		queryStateUnderline : function() {
+			var ed = this.editor, n;
+
+			if (n && n.nodeName == 'A')
+				return false;
+
+			return ed.getDoc().queryCommandState('Underline');
+		},
+
+		queryStateOutdent : function() {
+			var ed = this.editor, n;
+
+			if (ed.settings.inline_styles) {
+				if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)
+					return true;
+
+				if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)
+					return true;
+			} else
+				return !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE');
+
+			return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList();
+		},
+
+		queryStateInsertUnorderedList : function() {
+			return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL');
+		},
+
+		queryStateInsertOrderedList : function() {
+			return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL');
+		},
+
+		queryStatemceBlockQuote : function() {
+			return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';});
+		},
+
+		mceBlockQuote : function() {
+			var t = this, s = t.editor.selection, b = s.getBookmark(), bq, dom = t.editor.dom;
+
+			function findBQ(e) {
+				return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';});
+			};
+
+			// Remove blockquote(s)
+			if (findBQ(s.getStart())) {
+				each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) {
+					// Found BQ lets remove it
+					if (e.nodeName == 'BLOCKQUOTE')
+						dom.remove(e, 1);
+				});
+
+				t.editor.selection.moveToBookmark(b);
+				return;
+			}
+
+			each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) {
+				var n;
+
+				// Found existing BQ add to this one
+				if (e.nodeName == 'BLOCKQUOTE' && !bq) {
+					bq = e;
+					return;
+				}
+
+				// No BQ found, create one
+				if (!bq) {
+					bq = dom.create('blockquote');
+					e.parentNode.insertBefore(bq, e);
+				}
+
+				// Add children from existing BQ
+				if (e.nodeName == 'BLOCKQUOTE' && bq) {
+					n = e.firstChild;
+
+					while (n) {
+						bq.appendChild(n.cloneNode(true));
+						n = n.nextSibling;
+					}
+
+					dom.remove(e);
+
+					return;
+				}
+
+				// Add non BQ element to BQ
+				bq.appendChild(dom.remove(e));
+			});
+
+			t.editor.selection.moveToBookmark(b);
+		},
+
+		_getSelectedBlocks : function(st, en) {
+			var ed = this.editor, dom = ed.dom, s = ed.selection, sb, eb, n, bl = [];
+
+			sb = dom.getParent(st || s.getStart(), dom.isBlock);
+			eb = dom.getParent(en || s.getEnd(), dom.isBlock);
+
+			if (sb)
+				bl.push(sb);
+
+			if (sb && eb && sb != eb) {
+				n = sb;
+
+				while ((n = n.nextSibling) && n != eb) {
+					if (dom.isBlock(n))
+						bl.push(n);
+				}
+			}
+
+			if (eb && sb != eb)
+				bl.push(eb);
+
+			return bl;
+		}
+	});
+})();
+
+
+/* file:jscripts/tiny_mce/classes/UndoManager.js */
+
+tinymce.create('tinymce.UndoManager', {
+	index : 0,
+	data : null,
+	typing : 0,
+
+	UndoManager : function(ed) {
+		var t = this, Dispatcher = tinymce.util.Dispatcher;
+
+		t.editor = ed;
+		t.data = [];
+		t.onAdd = new Dispatcher(this);
+		t.onUndo = new Dispatcher(this);
+		t.onRedo = new Dispatcher(this);
+	},
+
+	add : function(l) {
+		var t = this, i, ed = t.editor, b, s = ed.settings, la;
+
+		l = l || {};
+		l.content = l.content || ed.getContent({format : 'raw', no_events : 1});
+
+		// Add undo level if needed
+		l.content = l.content.replace(/^\s*|\s*$/g, '');
+		la = t.data[t.index > 0 ? t.index - 1 : 0];
+		if (!l.initial && la && l.content == la.content)
+			return null;
+
+		// Time to compress
+		if (s.custom_undo_redo_levels) {
+			if (t.data.length > s.custom_undo_redo_levels) {
+				for (i = 0; i < t.data.length - 1; i++)
+					t.data[i] = t.data[i + 1];
+
+				t.data.length--;
+				t.index = t.data.length;
+			}
+		}
+
+		if (s.custom_undo_redo_restore_selection)
+			l.bookmark = b = l.bookmark || ed.selection.getBookmark();
+
+		if (t.index < t.data.length && t.data[t.index].initial)
+			t.index++;
+
+		// Add level
+		t.data.length = t.index + 1;
+		t.data[t.index++] = l;
+
+		if (l.initial)
+			t.index = 0;
+
+		// Set initial bookmark use first real undo level
+		if (t.data.length == 2 && t.data[0].initial)
+			t.data[0].bookmark = b;
+
+		t.onAdd.dispatch(t, l);
+		ed.isNotDirty = 0;
+
+		//console.dir(t.data);
+
+		return l;
+	},
+
+	undo : function() {
+		var t = this, ed = t.editor, l = l, i;
+
+		if (t.typing) {
+			t.add();
+			t.typing = 0;
+		}
+
+		if (t.index > 0) {
+			// If undo on last index then take snapshot
+			if (t.index == t.data.length && t.index > 1) {
+				i = t.index;
+				t.typing = 0;
+
+				if (!t.add())
+					t.index = i;
+
+				--t.index;
+			}
+
+			l = t.data[--t.index];
+			ed.setContent(l.content, {format : 'raw'});
+			ed.selection.moveToBookmark(l.bookmark);
+
+			t.onUndo.dispatch(t, l);
+		}
+
+		return l;
+	},
+
+	redo : function() {
+		var t = this, ed = t.editor, l = null;
+
+		if (t.index < t.data.length - 1) {
+			l = t.data[++t.index];
+			ed.setContent(l.content, {format : 'raw'});
+			ed.selection.moveToBookmark(l.bookmark);
+
+			t.onRedo.dispatch(t, l);
+		}
+
+		return l;
+	},
+
+	clear : function() {
+		var t = this;
+
+		t.data = [];
+		t.index = 0;
+		t.typing = 0;
+		t.add({initial : true});
+	},
+
+	hasUndo : function() {
+		return this.index != 0 || this.typing;
+	},
+
+	hasRedo : function() {
+		return this.index < this.data.length - 1;
+	}
+
+	});
+/* file:jscripts/tiny_mce/classes/ForceBlocks.js */
+
+(function() {
+	// Shorten names
+	var Event, isIE, isGecko, isOpera, each, extend;
+
+	Event = tinymce.dom.Event;
+	isIE = tinymce.isIE;
+	isGecko = tinymce.isGecko;
+	isOpera = tinymce.isOpera;
+	each = tinymce.each;
+	extend = tinymce.extend;
+
+	tinymce.create('tinymce.ForceBlocks', {
+		ForceBlocks : function(ed) {
+			var t = this, s;
+
+			t.editor = ed;
+			t.dom = ed.dom;
+
+			// Default settings
+			t.settings = s = extend({
+				element : 'P',
+				forced_root_block : 'p',
+				force_p_newlines : true
+			}, ed.settings);
+
+			ed.onPreInit.add(t.setup, t);
+
+			function padd(ed, o) {
+				if (isOpera)
+					o.content = o.content.replace(/(\u00a0|&#160;|&nbsp;)<\/p>/gi, '</p>');
+
+				o.content = o.content.replace(/<p( )([^>]+)><\/p>|<p( )([^>]+)\/>|<p( )([^>]+)>\s+<\/p>|<p><\/p>|<p\/>|<p>\s+<\/p>/gi, '<p$1$2$3$4$5$6>\u00a0</p>');
+
+				if (!isIE && o.set) {
+					// Use &nbsp; instead of BR in padded paragraphs
+					o.content = o.content.replace(/<p( )([^>]+)>[\s\u00a0]+<\/p>|<p>[\s\u00a0]+<\/p>/gi, '<p$1$2><br /></p>');
+				} else {
+					o.content = o.content.replace(/<p( )([^>]+)>\s*<br \/>\s*<\/p>|<p>\s*<br \/>\s*<\/p>/gi, '<p$1$2>\u00a0</p>');
+					o.content = o.content.replace(/\s*<br \/>\s*<\/p>/gi, '</p>');
+				}
+			};
+
+			ed.onBeforeSetContent.add(padd);
+			ed.onPostProcess.add(padd);
+
+			if (s.forced_root_block) {
+				ed.onInit.add(t.forceRoots, t);
+				ed.onSetContent.add(t.forceRoots, t);
+				ed.onBeforeGetContent.add(t.forceRoots, t);
+			}
+		},
+
+		setup : function() {
+			var t = this, ed = t.editor, s = t.settings;
+
+			// Force root blocks when typing and when getting output
+			if (s.forced_root_block) {
+				ed.onKeyUp.add(t.forceRoots, t);
+				ed.onPreProcess.add(t.forceRoots, t);
+			}
+
+			if (s.force_br_newlines) {
+				// Force IE to produce BRs on enter
+				if (isIE) {
+					ed.onKeyPress.add(function(ed, e) {
+						var n, s = ed.selection;
+
+						if (e.keyCode == 13) {
+							s.setContent('<br id="__" /> ', {format : 'raw'});
+							n = ed.dom.get('__');
+							n.removeAttribute('id');
+							s.select(n);
+							s.collapse();
+							return Event.cancel(e);
+						}
+					});
+				}
+
+				return;
+			}
+
+			if (!isIE && s.force_p_newlines) {
+				ed.onPreProcess.add(function(ed, o) {
+					each(ed.dom.select('br', o.node), function(n) {
+						var p = n.parentNode;
+
+						// Replace <p><br /></p> with <p>&nbsp;</p>
+						if (p && p.nodeName == 'p' && (p.childNodes.length == 1 || p.lastChild == n))
+							p.replaceChild(ed.getDoc().createTextNode('\u00a0'), n);
+					});
+				});
+
+				ed.onKeyPress.add(function(ed, e) {
+					if (e.keyCode == 13 && !e.shiftKey) {
+						if (!t.insertPara(e))
+							Event.cancel(e);
+					}
+				});
+
+				if (isGecko) {
+					ed.onKeyDown.add(function(ed, e) {
+						if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey)
+							t.backspaceDelete(e, e.keyCode == 8);
+					});
+				}
+			}
+		},
+
+		find : function(n, t, s) {
+			var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, false), c = -1;
+
+			while (n = w.nextNode()) {
+				c++;
+
+				// Index by node
+				if (t == 0 && n == s)
+					return c;
+
+				// Node by index
+				if (t == 1 && c == s)
+					return n;
+			}
+
+			return -1;
+		},
+
+		forceRoots : function(ed, e) {
+			var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;
+			var nx, bl, bp, sp, le, nl = b.childNodes, i;
+
+			// Fix for bug #1863847
+			if (e && e.keyCode == 13)
+				return true;
+
+			// Wrap non blocks into blocks
+			for (i = nl.length - 1; i >= 0; i--) {
+				nx = nl[i];
+
+				// Is text or non block element
+				if (nx.nodeType == 3 || !t.dom.isBlock(nx)) {
+					if (!bl) {
+						// Create new block but ignore whitespace
+						if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {
+							// Store selection
+							if (si == -2 && r) {
+								if (!isIE) {
+									so = r.startOffset;
+									eo = r.endOffset;
+									si = t.find(b, 0, r.startContainer);
+									ei = t.find(b, 0, r.endContainer);
+								} else {
+									tr = d.body.createTextRange();
+									tr.moveToElementText(b);
+									tr.collapse(1);
+									bp = tr.move('character', c) * -1;
+
+									tr = r.duplicate();
+									tr.collapse(1);
+									sp = tr.move('character', c) * -1;
+
+									tr = r.duplicate();
+									tr.collapse(0);
+									le = (tr.move('character', c) * -1) - sp;
+
+									si = sp - bp;
+									ei = le;
+								}
+							}
+
+							bl = ed.dom.create(t.settings.forced_root_block);
+							bl.appendChild(nx.cloneNode(1));
+							nx.parentNode.replaceChild(bl, nx);
+						}
+					} else {
+						if (bl.hasChildNodes())
+							bl.insertBefore(nx, bl.firstChild);
+						else
+							bl.appendChild(nx);
+					}
+				} else
+					bl = null; // Time to create new block
+			}
+
+			// Restore selection
+			if (si != -2) {
+				if (!isIE) {
+					bl = d.getElementsByTagName(t.settings.element)[0];
+					r = d.createRange();
+
+					// Select last location or generated block
+					if (si != -1)
+						r.setStart(t.find(b, 1, si), so);
+					else
+						r.setStart(bl, 0);
+
+					// Select last location or generated block
+					if (ei != -1)
+						r.setEnd(t.find(b, 1, ei), eo);
+					else
+						r.setEnd(bl, 0);
+
+					if (s) {
+						s.removeAllRanges();
+						s.addRange(r);
+					}
+				} else {
+					try {
+						r = s.createRange();
+						r.moveToElementText(b);
+						r.collapse(1);
+						r.moveStart('character', si);
+						r.moveEnd('character', ei);
+						r.select();
+					} catch (ex) {
+						// Ignore
+					}
+				}
+			}
+		},
+
+		getParentBlock : function(n) {
+			var d = this.dom;
+
+			return d.getParent(n, d.isBlock);
+		},
+
+		insertPara : function(e) {
+			var t = this, ed = t.editor, d = ed.getDoc(), se = t.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body;
+			var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n;
+
+			function isEmpty(n) {
+				n = n.innerHTML;
+				n = n.replace(/<(img|hr|table)/gi, '-'); // Keep these convert them to - chars
+				n = n.replace(/<[^>]+>/g, ''); // Remove all tags
+
+				return n.replace(/[ \t\r\n]+/g, '') == '';
+			};
+
+			// If root blocks are forced then use Operas default behavior since it's really good
+// Removed due to bug: #1853816
+//			if (se.forced_root_block && isOpera)
+//				return true;
+
+			// Setup before range
+			rb = d.createRange();
+
+			// If is before the first block element and in body, then move it into first block element
+			rb.setStart(s.anchorNode, s.anchorOffset);
+			rb.collapse(true);
+
+			// Setup after range
+			ra = d.createRange();
+
+			// If is before the first block element and in body, then move it into first block element
+			ra.setStart(s.focusNode, s.focusOffset);
+			ra.collapse(true);
+
+			// Setup start/end points
+			dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;
+			sn = dir ? s.anchorNode : s.focusNode;
+			so = dir ? s.anchorOffset : s.focusOffset;
+			en = dir ? s.focusNode : s.anchorNode;
+			eo = dir ? s.focusOffset : s.anchorOffset;
+
+			// If the caret is in an invalid location in FF we need to move it into the first block
+			if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {
+				sn = en = sn.firstChild;
+				so = eo = 0;
+				rb = d.createRange();
+				rb.setStart(sn, 0);
+				ra = d.createRange();
+				ra.setStart(en, 0);
+			}
+
+			// Never use body as start or end node
+			sn = sn.nodeName == "BODY" ? sn.firstChild : sn;
+			en = en.nodeName == "BODY" ? en.firstChild : en;
+
+			// Get start and end blocks
+			sb = t.getParentBlock(sn);
+			eb = t.getParentBlock(en);
+			bn = sb ? sb.nodeName : se.element; // Get block name to create
+
+			// Return inside list use default browser behavior
+			if (t.dom.getParent(sb, function(n) { return /OL|UL|PRE/.test(n.nodeName); }))
+				return true;
+
+			// If caption or absolute layers then always generate new blocks within
+			if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(sb.style.position))) {
+				bn = se.element;
+				sb = null;
+			}
+
+			// If caption or absolute layers then always generate new blocks within
+			if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(eb.style.position))) {
+				bn = se.element;
+				eb = null;
+			}
+
+			// Use P instead
+			if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(sb.style.cssFloat))) {
+				bn = se.element;
+				sb = eb = null;
+			}
+
+			// Setup new before and after blocks
+			bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);
+			aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);
+
+			// Remove id from after clone
+			aft.removeAttribute('id');
+
+			// Is header and cursor is at the end, then force paragraph under
+			if (/^(H[1-6])$/.test(bn) && sn.nodeValue && so == sn.nodeValue.length)
+				aft = ed.dom.create(se.element);
+
+			// Find start chop node
+			n = sc = sn;
+			do {
+				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
+					break;
+
+				sc = n;
+			} while ((n = n.previousSibling ? n.previousSibling : n.parentNode));
+
+			// Find end chop node
+			n = ec = en;
+			do {
+				if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
+					break;
+
+				ec = n;
+			} while ((n = n.nextSibling ? n.nextSibling : n.parentNode));
+
+			// Place first chop part into before block element
+			if (sc.nodeName == bn)
+				rb.setStart(sc, 0);
+			else
+				rb.setStartBefore(sc);
+
+			rb.setEnd(sn, so);
+			bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
+
+			// Place secnd chop part within new block element
+			try {
+				ra.setEndAfter(ec);
+			} catch(ex) {
+				//console.debug(s.focusNode, s.focusOffset);
+			}
+
+			ra.setStart(en, eo);
+			aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
+
+			// Create range around everything
+			r = d.createRange();
+			if (!sc.previousSibling && sc.parentNode.nodeName == bn) {
+				r.setStartBefore(sc.parentNode);
+			} else {
+				if (rb.startContainer.nodeName == bn && rb.startOffset == 0)
+					r.setStartBefore(rb.startContainer);
+				else
+					r.setStart(rb.startContainer, rb.startOffset);
+			}
+
+			if (!ec.nextSibling && ec.parentNode.nodeName == bn)
+				r.setEndAfter(ec.parentNode);
+			else
+				r.setEnd(ra.endContainer, ra.endOffset);
+
+			// Delete and replace it with new block elements
+			r.deleteContents();
+
+			// Never wrap blocks in blocks
+			if (bef.firstChild && bef.firstChild.nodeName == bn)
+				bef.innerHTML = bef.firstChild.innerHTML;
+
+			if (aft.firstChild && aft.firstChild.nodeName == bn)
+				aft.innerHTML = aft.firstChild.innerHTML;
+
+			// Padd empty blocks
+			if (isEmpty(bef))
+				bef.innerHTML = '<br />';
+
+			if (isEmpty(aft))
+				aft.innerHTML = isOpera ? '&nbsp;' : '<br />'; // Extra space for Opera so that the caret can move there
+
+			// Opera needs this one backwards
+			if (isOpera) {
+				r.insertNode(bef);
+				r.insertNode(aft);
+			} else {
+				r.insertNode(aft);
+				r.insertNode(bef);
+			}
+
+			// Normalize
+			aft.normalize();
+			bef.normalize();
+
+			// Move cursor and scroll into view
+			r = d.createRange();
+			r.selectNodeContents(aft);
+			r.collapse(1);
+			s.removeAllRanges();
+			s.addRange(r);
+
+			// Safari bug fix, http://bugs.webkit.org/show_bug.cgi?id=16117
+			if (tinymce.isWebKit)
+				ed.getWin().scrollTo(0, ed.dom.getPos(aft).y);
+			else
+				aft.scrollIntoView(0);
+
+			return false;
+		},
+
+		backspaceDelete : function(e, bs) {
+			var t = this, ed = t.editor, b = ed.getBody(), n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n;
+
+			// The caret sometimes gets stuck in Gecko if you delete empty paragraphs
+			// This workaround removes the element by hand and moves the caret to the previous element
+			if (sc && ed.dom.isBlock(sc) && bs) {
+				if (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR') {
+					n = sc.previousSibling;
+					if (n) { 
+						ed.dom.remove(sc);
+						se.select(n, 1);
+						se.collapse(0);
+						return Event.cancel(e);
+					}
+				}
+			}
+
+			// Gecko generates BR elements here and there, we don't like those so lets remove them
+			function handler(e) {
+				e = e.target;
+
+				// A new BR was created in a block element, remove it
+				if (e && e.parentNode && e.nodeName == 'BR' && t.getParentBlock(e)) {
+					ed.dom.remove(e);
+					Event.remove(b, 'DOMNodeInserted', handler);
+				}
+			};
+
+			// Listen for new nodes
+			Event._add(b, 'DOMNodeInserted', handler);
+
+			// Remove listener
+			window.setTimeout(function() {
+				Event._remove(b, 'DOMNodeInserted', handler);
+			}, 1);
+		}
+	});
+})();
+
+/* file:jscripts/tiny_mce/classes/ControlManager.js */
+
+(function() {
+	// Shorten names
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;
+
+	tinymce.create('tinymce.ControlManager', {
+		ControlManager : function(ed, s) {
+			var t = this, i;
+
+			s = s || {};
+			t.editor = ed;
+			t.controls = {};
+			t.onAdd = new tinymce.util.Dispatcher(t);
+			t.onPostRender = new tinymce.util.Dispatcher(t);
+			t.prefix = s.prefix || ed.id + '_';
+
+			t.onPostRender.add(function() {
+				each(t.controls, function(c) {
+					c.postRender();
+				});
+			});
+		},
+
+		get : function(id) {
+			return this.controls[this.prefix + id] || this.controls[id];
+		},
+
+		setActive : function(id, s) {
+			var c = null;
+
+			if (c = this.get(id))
+				c.setActive(s);
+
+			return c;
+		},
+
+		setDisabled : function(id, s) {
+			var c = null;
+
+			if (c = this.get(id))
+				c.setDisabled(s);
+
+			return c;
+		},
+
+		add : function(c) {
+			var t = this;
+
+			if (c) {
+				t.controls[c.id] = c;
+				t.onAdd.dispatch(c, t);
+			}
+
+			return c;
+		},
+
+		createControl : function(n) {
+			var c, t = this, ed = t.editor;
+
+			each(ed.plugins, function(p) {
+				if (p.createControl) {
+					c = p.createControl(n, t);
+
+					if (c)
+						return false;
+				}
+			});
+
+			switch (n) {
+				case "|":
+				case "separator":
+					return t.createSeparator();
+			}
+
+			if (!c && ed.buttons && (c = ed.buttons[n]))
+				return t.createButton(n, c);
+
+			return t.add(c);
+		},
+
+		createDropMenu : function(id, s) {
+			var t = this, ed = t.editor, c;
+
+			s = extend({
+				'class' : 'mceDropDown'
+			}, s);
+
+			s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';
+
+			id = t.prefix + id;
+			c = t.controls[id] = new tinymce.ui.DropMenu(id, s);
+			c.onAddItem.add(function(c, o) {
+				var s = o.settings;
+
+				s.title = ed.getLang(s.title, s.title);
+
+				if (!s.onclick) {
+					s.onclick = function(v) {
+						ed.execCommand(s.cmd, s.ui || false, v || s.value);
+					};
+				}
+			});
+
+			ed.onRemove.add(function() {
+				c.destroy();
+			});
+
+			return t.add(c);
+		},
+
+		createListBox : function(id, s) {
+			var t = this, ed = t.editor, cmd, c;
+
+			if (t.get(id))
+				return null;
+
+			s.title = ed.translate(s.title);
+			s.scope = s.scope || ed;
+
+			if (!s.onselect) {
+				s.onselect = function(v) {
+					ed.execCommand(s.cmd, s.ui || false, v || s.value);
+				};
+			}
+
+			s = extend({
+				title : s.title,
+				'class' : id,
+				scope : s.scope,
+				control_manager : t
+			}, s);
+
+			id = t.prefix + id;
+
+			if (ed.settings.use_native_selects)
+				c = new tinymce.ui.NativeListBox(id, s);
+			else
+				c = new tinymce.ui.ListBox(id, s);
+
+			t.controls[id] = c;
+
+			// Fix focus problem in Safari
+			if (tinymce.isWebKit) {
+				c.onPostRender.add(function(c, n) {
+					// Store bookmark on mousedown
+					Event.add(n, 'mousedown', function() {
+						ed.bookmark = ed.selection.getBookmark('simple');
+					});
+
+					// Restore on focus, since it might be lost
+					Event.add(n, 'focus', function() {
+						ed.selection.moveToBookmark(ed.bookmark);
+						ed.bookmark = null;
+					});
+				});
+			}
+
+			if (c.hideMenu)
+				ed.onMouseDown.add(c.hideMenu, c);
+
+			return t.add(c);
+		},
+
+		createButton : function(id, s) {
+			var t = this, ed = t.editor, o, c;
+
+			if (t.get(id))
+				return null;
+
+			s.title = ed.translate(s.title);
+			s.scope = s.scope || ed;
+
+			if (!s.onclick && !s.menu_button) {
+				s.onclick = function() {
+					ed.execCommand(s.cmd, s.ui || false, s.value);
+				};
+			}
+
+			s = extend({
+				title : s.title,
+				'class' : id,
+				unavailable_prefix : ed.getLang('unavailable', ''),
+				scope : s.scope,
+				control_manager : t
+			}, s);
+
+			id = t.prefix + id;
+
+			if (s.menu_button) {
+				c = new tinymce.ui.MenuButton(id, s);
+				ed.onMouseDown.add(c.hideMenu, c);
+			} else
+				c = new tinymce.ui.Button(id, s);
+
+			return t.add(c);
+		},
+
+		createMenuButton : function(id, s) {
+			s = s || {};
+			s.menu_button = 1;
+
+			return this.createButton(id, s);
+		},
+
+		createSplitButton : function(id, s) {
+			var t = this, ed = t.editor, cmd, c;
+
+			if (t.get(id))
+				return null;
+
+			s.title = ed.translate(s.title);
+			s.scope = s.scope || ed;
+
+			if (!s.onclick) {
+				s.onclick = function(v) {
+					ed.execCommand(s.cmd, s.ui || false, v || s.value);
+				};
+			}
+
+			if (!s.onselect) {
+				s.onselect = function(v) {
+					ed.execCommand(s.cmd, s.ui || false, v || s.value);
+				};
+			}
+
+			s = extend({
+				title : s.title,
+				'class' : id,
+				scope : s.scope,
+				control_manager : t
+			}, s);
+
+			id = t.prefix + id;
+			c = t.add(new tinymce.ui.SplitButton(id, s));
+			ed.onMouseDown.add(c.hideMenu, c);
+
+			return c;
+		},
+
+		createColorSplitButton : function(id, s) {
+			var t = this, ed = t.editor, cmd, c;
+
+			if (t.get(id))
+				return null;
+
+			s.title = ed.translate(s.title);
+			s.scope = s.scope || ed;
+
+			if (!s.onclick) {
+				s.onclick = function(v) {
+					ed.execCommand(s.cmd, s.ui || false, v || s.value);
+				};
+			}
+
+			if (!s.onselect) {
+				s.onselect = function(v) {
+					ed.execCommand(s.cmd, s.ui || false, v || s.value);
+				};
+			}
+
+			s = extend({
+				title : s.title,
+				'class' : id,
+				'menu_class' : ed.getParam('skin') + 'Skin',
+				scope : s.scope,
+				more_colors_title : ed.getLang('more_colors')
+			}, s);
+
+			id = t.prefix + id;
+			c = new tinymce.ui.ColorSplitButton(id, s);
+			ed.onMouseDown.add(c.hideMenu, c);
+
+			return t.add(c);
+		},
+
+		createToolbar : function(id, s) {
+			var c, t = this;
+
+			id = t.prefix + id;
+			c = new tinymce.ui.Toolbar(id, s);
+
+			if (t.get(id))
+				return null;
+
+			return t.add(c);
+		},
+
+		createSeparator : function() {
+			return new tinymce.ui.Separator();
+		}
+
+		});
+})();
+
+/* file:jscripts/tiny_mce/classes/WindowManager.js */
+
+(function() {
+	var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;
+
+	tinymce.create('tinymce.WindowManager', {
+		WindowManager : function(ed) {
+			var t = this;
+
+			t.editor = ed;
+			t.onOpen = new Dispatcher(t);
+			t.onClose = new Dispatcher(t);
+			t.params = {};
+			t.features = {};
+		},
+
+		open : function(s, p) {
+			var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort();
+
+			// Default some options
+			s = s || {};
+			p = p || {};
+			sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window
+			sh = isOpera ? vp.h : screen.height;
+			s.name = s.name || 'mc_' + new Date().getTime();
+			s.width = parseInt(s.width || 320);
+			s.height = parseInt(s.height || 240);
+			s.resizable = true;
+			s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);
+			s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);
+			p.inline = false;
+			p.mce_width = s.width;
+			p.mce_height = s.height;
+
+			if (mo) {
+				if (isIE) {
+					s.center = true;
+					s.help = false;
+					s.dialogWidth = s.width + 'px';
+					s.dialogHeight = s.height + 'px';
+					s.scroll = s.scrollbars || false;
+				} else
+					s.modal = s.alwaysRaised = s.dialog = s.centerscreen = s.dependent = true;
+			}
+
+			// Build features string
+			each(s, function(v, k) {
+				if (tinymce.is(v, 'boolean'))
+					v = v ? 'yes' : 'no';
+
+				if (!/^(name|url)$/.test(k)) {
+					if (isIE && mo)
+						f += (f ? ';' : '') + k + ':' + v;
+					else
+						f += (f ? ',' : '') + k + '=' + v;
+				}
+			});
+
+			t.features = s;
+			t.params = p;
+			t.onOpen.dispatch(t, s, p);
+
+			try {
+				if (isIE && mo) {
+					w = 1;
+					window.showModalDialog(s.url || s.file, window, f);
+				} else
+					w = window.open(s.url || s.file, s.name, f);
+			} catch (ex) {
+				// Ignore
+			}
+
+			if (!w)
+				alert(t.editor.getLang('popup_blocked'));
+		},
+
+		close : function(w) {
+			w.close();
+			this.onClose.dispatch(this);
+		},
+
+		createInstance : function(cl) {
+			var a = arguments, i, f = tinymce.resolve(cl), s = '';
+
+			// Is there a better way to dynamically create
+			// a class with a dynamic number of arguments
+			for (i=1; i<a.length; i++)
+				s += (i > 1 ? ',' : '') + 'a[' + i + ']';
+
+			return eval('(new f(' + s + '))');
+		},
+
+		confirm : function(t, cb, s) {
+			cb.call(s || this, confirm(this._decode(this.editor.getLang(t, t))));
+		},
+
+		alert : function(t, cb, s) {
+			alert(this._decode(t));
+
+			if (cb)
+				cb.call(s || this);
+		},
+
+		// Internal functions
+
+		_decode : function(s) {
+			return tinymce.DOM.decode(s).replace(/\\n/g, '\n');
+		}
+
+		});
+}());
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/editable_selects.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/editable_selects.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/editable_selects.js	(revision 1)
@@ -0,0 +1,61 @@
+/**
+ * $Id: editable_selects.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Makes select boxes editable.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_EditableSelects = {
+	editSelectElm : null,
+
+	init : function() {
+		var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+				o = new Option('(value)', '__mce_add_custom__');
+
+				o.className = 'mceAddSelectValue';
+
+				nl[i].options[nl[i].options.length] = o;
+				nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
+			}
+		}
+	},
+
+	onChangeEditableSelect : function(e) {
+		var d = document, ne, se = window.event ? window.event.srcElement : e.target;
+
+		if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+			ne = d.createElement("input");
+			ne.id = se.id + "_custom";
+			ne.name = se.name + "_custom";
+			ne.type = "text";
+
+			ne.style.width = se.offsetWidth + 'px';
+			se.parentNode.insertBefore(ne, se);
+			se.style.display = 'none';
+			ne.focus();
+			ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+			TinyMCE_EditableSelects.editSelectElm = se;
+		}
+	},
+
+	onBlurEditableSelectInput : function() {
+		var se = TinyMCE_EditableSelects.editSelectElm;
+
+		if (se) {
+			if (se.previousSibling.value != '') {
+				addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+				selectByValue(document.forms[0], se.id, se.previousSibling.value);
+			} else
+				selectByValue(document.forms[0], se.id, '');
+
+			se.style.display = 'inline';
+			se.parentNode.removeChild(se.previousSibling);
+			TinyMCE_EditableSelects.editSelectElm = null;
+		}
+	}
+};
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/form_utils.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/form_utils.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/form_utils.js	(revision 1)
@@ -0,0 +1,193 @@
+/**
+ * $Id: form_utils.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Various form utilitiy functions.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+
+function getColorPickerHTML(id, target_form_element) {
+	var h = "";
+
+	h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
+	h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
+
+	return h;
+}
+
+function updateColor(img_id, form_element_id) {
+	document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+	var img = document.getElementById(id);
+	var lnk = document.getElementById(id + "_link");
+
+	if (lnk) {
+		if (state) {
+			lnk.setAttribute("realhref", lnk.getAttribute("href"));
+			lnk.removeAttribute("href");
+			tinyMCEPopup.dom.addClass(img, 'disabled');
+		} else {
+			lnk.setAttribute("href", lnk.getAttribute("realhref"));
+			tinyMCEPopup.dom.removeClass(img, 'disabled');
+		}
+	}
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+	var option = prefix + "_" + type + "_browser_callback", cb, html;
+
+	cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
+
+	if (!cb)
+		return "";
+
+	html = "";
+	html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
+	html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"></span></a>';
+
+	return html;
+}
+
+function openBrowser(img_id, target_form_element, type, option) {
+	var img = document.getElementById(img_id);
+
+	if (img.className != "mceButtonDisabled")
+		tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+	if (!form_obj || !form_obj.elements[field_name])
+		return;
+
+	var sel = form_obj.elements[field_name];
+
+	var found = false;
+	for (var i=0; i<sel.options.length; i++) {
+		var option = sel.options[i];
+
+		if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+			option.selected = true;
+			found = true;
+		} else
+			option.selected = false;
+	}
+
+	if (!found && add_custom && value != '') {
+		var option = new Option(value, value);
+		option.selected = true;
+		sel.options[sel.options.length] = option;
+		sel.selectedIndex = sel.options.length - 1;
+	}
+
+	return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+	var elm = form_obj.elements[field_name];
+
+	if (elm == null || elm.options == null)
+		return "";
+
+	return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+	var s = form_obj.elements[field_name];
+	var o = new Option(name, value);
+	s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+	// Setup class droplist
+	var styleSelectElm = document.getElementById(list_id);
+	var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
+	styles = tinyMCEPopup.getParam(specific_option, styles);
+
+	if (styles) {
+		var stylesAr = styles.split(';');
+
+		for (var i=0; i<stylesAr.length; i++) {
+			if (stylesAr != "") {
+				var key, value;
+
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
+
+				styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+			}
+		}
+	} else {
+		tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
+			styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
+		});
+	}
+}
+
+function isVisible(element_id) {
+	var elm = document.getElementById(element_id);
+
+	return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return "rgb(" + r + "," + g + "," + b + ")";
+	}
+
+	return col;
+}
+
+function trimSize(size) {
+	return size.replace(new RegExp('[^0-9%]', 'gi'), '');
+}
+
+function getCSSSize(size) {
+	size = trimSize(size);
+
+	if (size == "")
+		return "";
+
+	return size.indexOf('%') != -1 ? size : size + "px";
+}
+
+function getStyle(elm, attrib, style) {
+	var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
+
+	if (val != '')
+		return '' + val;
+
+	if (typeof(style) == 'undefined')
+		style = attrib;
+
+	return tinyMCEPopup.dom.getStyle(elm, style);
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mclayer.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mclayer.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mclayer.js	(revision 1)
@@ -0,0 +1,210 @@
+/**
+ * $Id: mclayer.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+	this.id = id;
+	this.settings = new Array();
+	this.blockerElement = null;
+	this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+	this.events = false;
+	this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+	moveRelativeTo : function(re, p, a) {
+		var rep = this.getAbsPosition(re);
+		var w = parseInt(re.offsetWidth);
+		var h = parseInt(re.offsetHeight);
+		var x, y;
+
+		switch (p) {
+			case "tl":
+				break;
+
+			case "tr":
+				x = rep.absLeft + w;
+				y = rep.absTop;
+				break;
+
+			case "bl":
+				break;
+
+			case "br":
+				break;
+		}
+
+		this.moveTo(x, y);
+	},
+
+	moveBy : function(dx, dy) {
+		var e = this.getElement();
+		var x = parseInt(e.style.left);
+		var y = parseInt(e.style.top);
+
+		e.style.left = (x + dx) + "px";
+		e.style.top = (y + dy) + "px";
+
+		this.updateBlocker();
+	},
+
+	moveTo : function(x, y) {
+		var e = this.getElement();
+
+		e.style.left = x + "px";
+		e.style.top = y + "px";
+
+		this.updateBlocker();
+	},
+
+	show : function() {
+		MCLayer.visibleLayer = this;
+
+		this.getElement().style.display = 'block';
+		this.updateBlocker();
+	},
+
+	hide : function() {
+		this.getElement().style.display = 'none';
+		this.updateBlocker();
+	},
+
+	setAutoHide : function(s, cb) {
+		this.autoHideCallback = cb;
+		this.registerEventHandlers();
+	},
+
+	getElement : function() {
+		return document.getElementById(this.id);
+	},
+
+	updateBlocker : function() {
+		if (!this.isMSIE)
+			return;
+
+		var e = this.getElement();
+		var b = this.getBlocker();
+		var x = this.parseInt(e.style.left);
+		var y = this.parseInt(e.style.top);
+		var w = this.parseInt(e.offsetWidth);
+		var h = this.parseInt(e.offsetHeight);
+
+		b.style.left = x + 'px';
+		b.style.top = y + 'px';
+		b.style.width = w + 'px';
+		b.style.height = h + 'px';
+		b.style.display = e.style.display;
+	},
+
+	getBlocker : function() {
+		if (!this.blockerElement) {
+			var d = document, b = d.createElement("iframe");
+
+			b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+			b.src = 'javascript:false;';
+			b.frameBorder = '0';
+			b.scrolling = 'no';
+
+			d.body.appendChild(b);
+			this.blockerElement = b;
+		}
+
+		return this.blockerElement;
+	},
+
+	getAbsPosition : function(n) {
+		var p = {absLeft : 0, absTop : 0};
+
+		while (n) {
+			p.absLeft += n.offsetLeft;
+			p.absTop += n.offsetTop;
+			n = n.offsetParent;
+		}
+
+		return p;
+	},
+
+	registerEventHandlers : function() {
+		if (!this.events) {
+			var d = document;
+
+			this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+			this.events = true;
+		}
+	},
+
+	addEvent : function(o, n, h) {
+		if (o.attachEvent)
+			o.attachEvent("on" + n, h);
+		else
+			o.addEventListener(n, h, false);
+	},
+
+	onMouseDown : function(e) {
+		e = typeof(e) == "undefined" ? window.event : e;
+		var b = document.body;
+		var l = MCLayer.visibleLayer;
+
+		if (l) {
+			var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+			var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+			var el = l.getElement();
+			var x = parseInt(el.style.left);
+			var y = parseInt(el.style.top);
+			var w = parseInt(el.offsetWidth);
+			var h = parseInt(el.offsetHeight);
+
+			if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+				MCLayer.visibleLayer = null;
+
+				if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+					return true;
+
+				l.hide();
+			}
+		}
+	},
+
+	addCSSClass : function(e, c) {
+		this.removeCSSClass(e, c);
+		var a = this.explode(' ', e.className);
+		a[a.length] = c;
+		e.className = a.join(' ');
+	},
+
+	removeCSSClass : function(e, c) {
+		var a = this.explode(' ', e.className), i;
+
+		for (i=0; i<a.length; i++) {
+			if (a[i] == c)
+				a[i] = '';
+		}
+
+		e.className = a.join(' ');
+	},
+
+	explode : function(d, s) {
+		var ar = s.split(d);
+		var oar = new Array();
+
+		for (var i = 0; i<ar.length; i++) {
+			if (ar[i] != "")
+				oar[oar.length] = ar[i];
+		}
+
+		return oar;
+	},
+
+	parseInt : function(s) {
+		if (s == null || s == '')
+			return 0;
+
+		return parseInt(s);
+	}
+}
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mctabs.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mctabs.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/mctabs.js	(revision 1)
@@ -0,0 +1,74 @@
+/**
+ * $Id: mctabs.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Moxiecode DHTML Tabs script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCTabs() {
+	this.settings = new Array();
+};
+
+MCTabs.prototype.init = function(settings) {
+	this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+	var value = null;
+
+	value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+	// Fix bool values
+	if (value == "true" || value == "false")
+		return (value == "true");
+
+	return value;
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {
+	var panelElm = document.getElementById(panel_id);
+	var panelContainerElm = panelElm ? panelElm.parentNode : null;
+	var tabElm = document.getElementById(tab_id);
+	var tabContainerElm = tabElm ? tabElm.parentNode : null;
+	var selectionClass = this.getParam('selection_class', 'current');
+
+	if (tabElm && tabContainerElm) {
+		var nodes = tabContainerElm.childNodes;
+
+		// Hide all other tabs
+		for (var i=0; i<nodes.length; i++) {
+			if (nodes[i].nodeName == "LI")
+				nodes[i].className = '';
+		}
+
+		// Show selected tab
+		tabElm.className = 'current';
+	}
+
+	if (panelElm && panelContainerElm) {
+		var nodes = panelContainerElm.childNodes;
+
+		// Hide all other panels
+		for (var i=0; i<nodes.length; i++) {
+			if (nodes[i].nodeName == "DIV")
+				nodes[i].className = 'panel';
+		}
+
+		// Show selected panel
+		panelElm.className = 'current';
+	}
+};
+
+MCTabs.prototype.getAnchor = function() {
+	var pos, url = document.location.href;
+
+	if ((pos = url.lastIndexOf('#')) != -1)
+		return url.substring(pos + 1);
+
+	return "";
+};
+
+// Global instance
+var mcTabs = new MCTabs();
Index: /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/validate.js
===================================================================
--- /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/validate.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/plugins/tinymce/jscripts/tiny_mce/utils/validate.js	(revision 1)
@@ -0,0 +1,219 @@
+/**
+ * $Id: validate.js 520 2008-01-07 16:30:32Z spocke $
+ *
+ * Various form validation methods.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+/**
+	// String validation:
+
+	if (!Validator.isEmail('myemail'))
+		alert('Invalid email.');
+
+	// Form validation:
+
+	var f = document.forms['myform'];
+
+	if (!Validator.isEmail(f.myemail))
+		alert('Invalid email.');
+*/
+
+var Validator = {
+	isEmail : function(s) {
+		return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+	},
+
+	isAbsUrl : function(s) {
+		return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
+	},
+
+	isSize : function(s) {
+		return this.test(s, '^[0-9]+(px|%)?$');
+	},
+
+	isId : function(s) {
+		return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
+	},
+
+	isEmpty : function(s) {
+		var nl, i;
+
+		if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
+			return true;
+
+		if (s.type == 'checkbox' && !s.checked)
+			return true;
+
+		if (s.type == 'radio') {
+			for (i=0, nl = s.form.elements; i<nl.length; i++) {
+				if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
+					return false;
+			}
+
+			return true;
+		}
+
+		return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
+	},
+
+	isNumber : function(s, d) {
+		return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
+	},
+
+	test : function(s, p) {
+		s = s.nodeType == 1 ? s.value : s;
+
+		return s == '' || new RegExp(p).test(s);
+	}
+};
+
+var AutoValidator = {
+	settings : {
+		id_cls : 'id',
+		int_cls : 'int',
+		url_cls : 'url',
+		number_cls : 'number',
+		email_cls : 'email',
+		size_cls : 'size',
+		required_cls : 'required',
+		invalid_cls : 'invalid',
+		min_cls : 'min',
+		max_cls : 'max'
+	},
+
+	init : function(s) {
+		var n;
+
+		for (n in s)
+			this.settings[n] = s[n];
+	},
+
+	validate : function(f) {
+		var i, nl, s = this.settings, c = 0;
+
+		nl = this.tags(f, 'label');
+		for (i=0; i<nl.length; i++)
+			this.removeClass(nl[i], s.invalid_cls);
+
+		c += this.validateElms(f, 'input');
+		c += this.validateElms(f, 'select');
+		c += this.validateElms(f, 'textarea');
+
+		return c == 3;
+	},
+
+	invalidate : function(n) {
+		this.mark(n.form, n);
+	},
+
+	reset : function(e) {
+		var t = new Array('label', 'input', 'select', 'textarea');
+		var i, j, nl, s = this.settings;
+
+		if (e == null)
+			return;
+
+		for (i=0; i<t.length; i++) {
+			nl = this.tags(e.form ? e.form : e, t[i]);
+			for (j=0; j<nl.length; j++)
+				this.removeClass(nl[j], s.invalid_cls);
+		}
+	},
+
+	validateElms : function(f, e) {
+		var nl, i, n, s = this.settings, st = true, va = Validator, v;
+
+		nl = this.tags(f, e);
+		for (i=0; i<nl.length; i++) {
+			n = nl[i];
+
+			this.removeClass(n, s.invalid_cls);
+
+			if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.size_cls) && !va.isSize(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.id_cls) && !va.isId(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.min_cls, true)) {
+				v = this.getNum(n, s.min_cls);
+
+				if (isNaN(v) || parseInt(n.value) < parseInt(v))
+					st = this.mark(f, n);
+			}
+
+			if (this.hasClass(n, s.max_cls, true)) {
+				v = this.getNum(n, s.max_cls);
+
+				if (isNaN(v) || parseInt(n.value) > parseInt(v))
+					st = this.mark(f, n);
+			}
+		}
+
+		return st;
+	},
+
+	hasClass : function(n, c, d) {
+		return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
+	},
+
+	getNum : function(n, c) {
+		c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
+		c = c.replace(/[^0-9]/g, '');
+
+		return c;
+	},
+
+	addClass : function(n, c, b) {
+		var o = this.removeClass(n, c);
+		n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+	},
+
+	removeClass : function(n, c) {
+		c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
+		return n.className = c != ' ' ? c : '';
+	},
+
+	tags : function(f, s) {
+		return f.getElementsByTagName(s);
+	},
+
+	mark : function(f, n) {
+		var s = this.settings;
+
+		this.addClass(n, s.invalid_cls);
+		this.markLabels(f, n, s.invalid_cls);
+
+		return false;
+	},
+
+	markLabels : function(f, n, ic) {
+		var nl, i;
+
+		nl = this.tags(f, "label");
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
+				this.addClass(nl[i], ic);
+		}
+
+		return null;
+	}
+};
Index: /branches/rsr.v5.1.dev/web/app/run/01_functions.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/01_functions.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/01_functions.php	(revision 1)
@@ -0,0 +1,15 @@
+<?php
+
+  function _redirect($env, $url, $message, $wait = 1)
+  { $env->e = "redirect";
+    $env->out["redirect"] = array();
+    $env->out["redirect"]["url"] = str_replace("&amp;", "&", $url);
+    $env->out["redirect"]["message"] = $message;
+    $env->out["redirect"]["wait"] = $wait;
+  }
+
+  function debug($content)
+  { echo "<pre class=\"debug\">\n".htmlentities(print_r($content, true))."</pre>\n";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/02_punbb.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/02_punbb.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/02_punbb.php	(revision 1)
@@ -0,0 +1,11 @@
+<?php
+
+  if(true || ($_GET[$env->param("e")] !== "down" && $_GET[$env->param("e")] !== "m3u"))
+  { define("PUN_ROOT", $env->path("punbb"));
+    require_once $env->path("punbb").'include/common.php';
+    require_once $env->path("punbb")."include/parser.php";
+  }
+  $env->pun_user = $pun_user;
+  $env->db = $db;
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/03_data.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/03_data.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/03_data.php	(revision 1)
@@ -0,0 +1,10 @@
+<?php
+
+  if(!$env->erreur)
+  { require $env->path("app")."data/sql.php";
+    require $env->path("app")."data/data.php";
+    $env->data = new data(new sql($env->db, $env->bdd["prefix_code"], $env->bdd["prefix"]), $env);
+    $env->data->load_modules($env->path("app")."data/modules/", true);
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/04_env.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/04_env.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/04_env.php	(revision 1)
@@ -0,0 +1,16 @@
+<?php
+
+  if(!$env->erreur) :
+
+  $env->e = "";
+  $env->message = "";
+  $env->erreur = "";
+  $env->out = array();
+
+  if($env->set_config($env->data->config()) === false) $env->erreur = "Impossible de lire la configuration en base";
+
+  $env->start = isset($_GET[$env->param("start")]) ? $_GET[$env->param("start")] : 0;
+
+  endif;
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/05_identification.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/05_identification.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/05_identification.php	(revision 1)
@@ -0,0 +1,41 @@
+<?php
+
+  if(!$env->erreur) :
+
+  if($_GET[$env->param("login")])
+  { if($_GET[$env->param("login")] === "in") _login($env);
+    elseif($_GET[$env->param("login")] === "out") _logout($env);
+  }
+
+  $env->pun_user["is_super_admin"] = $env->data->is_super_admin($env->pun_user["id"]);
+
+  endif;
+
+  function _login($env)
+  { if(isset($_POST['form_sent']))
+    { if($env->pun_user['is_guest'])
+      { if($env->data->pun_login_ok(trim($_POST['req_username']), trim($_POST['req_password']), $env->db))
+        { _redirect
+          ( $env,
+            isset($_GET["from"]) ? urldecode($_GET["from"]) : $env->url(array("e" => "accueil")),
+            "Vous &ecirc;tes maintenant identifi&eacute; en tant que ".$_POST['req_username']
+          );
+        }
+        else $env->message =
+         "Vous avez oubli&eacute; votre mot de passe ?"
+        ." Cliquez <a href=\"".$env->path("punbb")."login.php?action=forget\">ici</a> pour en obtenir un nouveau.";
+      }
+      else $env->message = "Vous &ecirc;tes d&eacute;j&agrave; identifi&eacute;";
+    }
+  }
+
+  function _logout($env)
+  { $env->data->pun_logout($env->pun_user, $env->db);
+    _redirect
+    ( $env,
+      $env->url(array("e" => "")),
+      "Vous n'&ecirc;tes plus identifi&eacute; sur le site"
+    );
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/06_route.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/06_route.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/06_route.php	(revision 1)
@@ -0,0 +1,47 @@
+<?php
+
+  if($env->e !== "redirect" && !$env->erreur)
+  {
+
+    $env->e = "";
+    $env->mod_path = "";
+
+    if($_SERVER["SCRIPT_NAME"])
+    { $v_path = explode("/", $_SERVER["SCRIPT_NAME"]);
+
+      if(count($v_path) > 1)
+      { switch($v_path[count($v_path) - 2])
+        { case "punbb":
+            $env->e = "forum";
+            $env->mod_path = "";
+            break;
+          default:
+        }
+      }
+      if(!$env->e)
+      { define('PUN_QUIET_VISIT', 1);
+        switch($v_path[count($v_path) - 1])
+        { case "index.php":
+          case "download.php":
+          case "backend.php":
+            $env->e = $_GET[$env->param("e")] ? $_GET[$env->param("e")] : "edito";
+            $env->mod_path = "";
+            break;
+          case "post_request.php":
+            require $env->path("app")."data/str_tab.php";
+            $env->str_tab = new str_tab();
+            $env->request = $env->str_tab->request_tab($_POST["post_request"]);
+            $env->e = isset($env->request["function"]) ? $env->request["function"] : "";
+            $env->DATA = isset($env->request["DATA"]) ? $env->request["DATA"] : array();
+            $env->mod_path = "post_request/";
+            $env->reponse = array();
+            break;
+          default:
+        }
+      }
+    }
+
+  }
+  if($env->erreur) $env->e = "erreur";
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/07_mods.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/07_mods.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/07_mods.php	(revision 1)
@@ -0,0 +1,25 @@
+<?php
+
+  if($env->e !== "redirect" && !$env->erreur)
+  {
+
+    do
+    { if($env->next_e)
+      { $env->e = $env->next_e;
+        $env->next_e = "";
+      }
+      if($env->e !== "redirect")
+      { if($env->e)
+        { if(file_exists($env->path("app")."mods/".$env->mod_path.$env->prefix.$env->e.".php"))
+          { require_once $env->path("app")."mods/".$env->mod_path.$env->prefix.$env->e.".php";
+          }
+          if(function_exists($env->prefix.$env->e)) eval($env->prefix.$env->e."(\$env);");
+        }
+      }
+    }
+    while(!$env->erreur && $env->e !== "redirect" && $env->next_e);
+
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/app/run/08_pre_out.php
===================================================================
--- /branches/rsr.v5.1.dev/web/app/run/08_pre_out.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/app/run/08_pre_out.php	(revision 1)
@@ -0,0 +1,100 @@
+<?php
+
+  if(!$env->erreur)
+  { if($env->e == "forum" || strpos($_SERVER["SCRIPT_NAME"], "index.php") !== false)
+    {
+      # ----------------------------------------------------------------------------------------
+      #                                                                                    blocs
+      #
+
+      if(($env->out["emplacements"] = $env->data->box_emplacements()) === false)
+      { $env->erreur = "Impossible de lire les emplacements";
+      }
+
+      if(($env->out["blocs"] = $env->data->boxes(0, null, true)) === false)
+      { $env->erreur = "Impossible de lire les blocs";
+      }
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                                spotlight
+      #
+
+      if(($env->out["spotlight"] = $env->data->spotlight()) === false)
+      { $env->out["spotlight"] = array();
+      }
+
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                       artistes au hasard
+      #
+
+      if(($env->out["artistes_au_hasard"] = $env->data->artistes_au_hasard(12)) === false)
+      { $env->out["artistes_au_hasard"] = array();
+      }
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                      total des downloads
+      #
+
+      if(($env->out["nb_downloads"] = $env->data->nb_downloads(true)) === false)
+      { $env->out["nb_downloads"] = 0;
+      }
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                               navigation
+      #
+
+      require $env->out_file("utils.php");
+      if(($env->out["menu_top"] = $env->data->all_menus(array("Nav"))) === false)
+      { $env->out["menu_top"] = array();
+      }
+
+      # ----------------------------------------------------------------------------------------
+      #                                                               derniers messages du forum
+      #
+
+      if(($env->out["messages_forum"] = $env->data->forum_last_messages(7)) === false)
+      { $env->out["messages_forum"] = array();
+      }
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                                     news
+      #
+
+      $path = array("root", "news");
+      $depth = 1;
+      if(($env->out["b_categories"] = $env->data->all_news_categories()) !== false)
+      { if(($env->out["b_news"] = $env->data->news($path, 0, $depth, true, 2)) !== false)
+        { 
+        }
+        else $env->erreur .= "<br>Impossible de lire la liste des news";
+      }
+      else $env->erreur .= "<br>Impossible de lire la liste des categories de news";
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                          derniers albums
+      #
+
+//      if(($env->out["last_albums"] = $env->data->albums(0, 2, "date_publication", "DESC")) !== false)
+      if(($env->out["last_albums"] = $env->data->albums(0, 1, "rand()", "", "#--albums.actif=1")) !== false)
+      {
+      }
+      else $env->erreur .= "<br>Impossible de lire les derniers albums";
+
+      # ----------------------------------------------------------------------------------------
+      #                                                                                  charset
+      #
+
+//      header('Content-Type: text/html; charset=iso-8859-1');
+      header('Content-Type: text/html; charset=utf-8');
+
+    }
+  }
+  else
+  { $env->out["spotlight"] = array();
+    $env->out["artistes_au_hasard"] = array();
+    $env->out["nb_downloads"] = 0;
+    $env->out["menu_top"] = array();
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/backend.php
===================================================================
--- /branches/rsr.v5.1.dev/web/backend.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/backend.php	(revision 1)
@@ -0,0 +1,20 @@
+<?php
+
+  require "pathes.php";
+
+  # chargement de l'environnement
+  require RSR_APP_PATH."env.php";
+  $env = new env(RSR_CONFIG_FILE);
+
+  # traitement de la requÃšte
+  $_GET[$env->param("action")] = $_GET[$env->param("e")];
+  $_GET[$env->param("e")] = "backend";
+  require $env->path("app")."main.php";
+
+  # affichage
+  if
+  ( $_GET[$env->param("format")] &&
+    $env->out_file_exists("backend/".$_GET[$env->param("format")].".php")
+  ) require $env->out_file("backend/".$_GET[$env->param("format")].".php");
+
+?>
Index: /branches/rsr.v5.1.dev/web/config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/config.php	(revision 1)
@@ -0,0 +1,43 @@
+<?php
+
+  # --------------------------------------------------------------
+  #                                                        chemins
+  #
+
+  # chemin absolu a partir de la racine du site
+  $this->PATHES["web"] = "[web_path]";
+
+  # chemin relatifs par rapport a $this->PATHES["web"] (ci-dessus)
+  $this->PATHES["app"] = $path_prefix.RSR_APP_PATH;
+  $this->PATHES["out"] = $this->path("app")."out/dist/";
+  $this->PATHES["uploads"] = $path_prefix."uploads/";
+
+  # --------------------------------------------------------------
+  #                                                base de donnees
+  #
+
+  # sgbd : "mysql", "mysqli", "pgsql" ou "sqlite"
+  $this->bdd["sgbd"] = "[db_type]";
+
+  # parametres de connection
+  $this->bdd["host"] = "[db_host]";
+  $this->bdd["base"] = "[db_base]";
+  $this->bdd["prefix"] = "[db_prefix]";
+  $this->bdd["user"] = "[db_user]";
+  $this->bdd["password"] = "[db_password]";
+
+  # --------------------------------------------------------------
+  #                                                         divers
+  #
+
+  # le nom du site
+  $this->CONFIG["site_name"] = "[site_name]";
+
+  # le nombre maximum des listes sur le site
+  # pour l'affichage des news en page d'accueil ou les listes
+  # des editos, des spotlights (...) dans la partie admin.
+  # au-dela de cette limite, les listes seront presentees sur
+  # plusieur pages
+  $this->CONFIG["max_list"] = 10;
+
+?>
Index: /branches/rsr.v5.1.dev/web/download.php
===================================================================
--- /branches/rsr.v5.1.dev/web/download.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/download.php	(revision 1)
@@ -0,0 +1,20 @@
+<?php
+
+  require "pathes.php";
+
+  # chargement de l'environnement
+  require RSR_APP_PATH."env.php";
+  $env = new env(RSR_CONFIG_FILE);
+
+  # traitement de la requÃšte
+  require $env->path("app")."main.php";
+
+  # affichage
+
+  if($env->message) echo $env->message;
+  elseif($env->erreur) echo $env->erreur;
+  elseif($env->out_file_exists("content/".$env->prefix.$env->e.".php"))
+  { require $env->out_file("content/".$env->prefix.$env->e.".php");
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/index.php	(revision 1)
@@ -0,0 +1,15 @@
+<?php
+
+  require "pathes.php";
+
+  # chargement de l'environnement
+  require RSR_APP_PATH."env.php";
+  $env = new env(RSR_CONFIG_FILE);
+
+  # traitement de la requÃšte
+  require $env->path("app")."main.php";
+
+  # affichage
+  if($env->out_file_exists("index.php")) require $env->out_file("index.php");
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/app/01_utils.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/app/01_utils.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/app/01_utils.php	(revision 1)
@@ -0,0 +1,15 @@
+<?php
+
+  function _redirect($env, $url, $message, $wait = 1)
+  { $env->e = "redirect";
+    $env->out["redirect"] = array();
+    $env->out["redirect"]["url"] = $url;
+    $env->out["redirect"]["message"] = $message;
+    $env->out["redirect"]["wait"] = $wait;
+  }
+
+  function debug($TAB)
+  { echo "<pre class=\"debug\">\n".htmlentities(print_r($TAB, true))."</pre>\n";
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/app/02_pre.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/app/02_pre.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/app/02_pre.php	(revision 1)
@@ -0,0 +1,5 @@
+<?php
+
+  header('Content-Type: text/html; charset=iso-8859-1');
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/config.xml
===================================================================
--- /branches/rsr.v5.1.dev/web/install/config.xml	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/config.xml	(revision 1)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<config>
+
+  <pathes>
+    <install>../</install>
+  </pathes>
+
+  <prefix>e_</prefix>
+
+  <params>
+    <e>e</e>
+    <action>a</action>
+    <next>next</next>
+  </params>
+
+  <config>
+  </config>
+
+</config>
Index: /branches/rsr.v5.1.dev/web/install/dist/config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/config.php	(revision 1)
@@ -0,0 +1,43 @@
+<?php
+
+  # --------------------------------------------------------------
+  #                                                        chemins
+  #
+
+  # chemin absolu a partir de la racine du site
+  $this->PATHES["web"] = "[web_path]";
+
+  # chemin relatifs par rapport a $this->PATHES["web"] (ci-dessus)
+  $this->PATHES["app"] = $path_prefix.RSR_APP_PATH;
+  $this->PATHES["out"] = $this->path("app")."out/dist/";
+  $this->PATHES["uploads"] = $path_prefix."uploads/";
+
+  # --------------------------------------------------------------
+  #                                                base de donnees
+  #
+
+  # sgbd : "mysql", "mysqli", "pgsql" ou "sqlite"
+  $this->bdd["sgbd"] = "[db_type]";
+
+  # parametres de connection
+  $this->bdd["host"] = "[db_host]";
+  $this->bdd["base"] = "[db_base]";
+  $this->bdd["prefix"] = "[db_prefix]";
+  $this->bdd["user"] = "[db_user]";
+  $this->bdd["password"] = "[db_password]";
+
+  # --------------------------------------------------------------
+  #                                                         divers
+  #
+
+  # le nom du site
+  $this->CONFIG["site_name"] = "[site_name]";
+
+  # le nombre maximum des listes sur le site
+  # pour l'affichage des news en page d'accueil ou les listes
+  # des editos, des spotlights (...) dans la partie admin.
+  # au-dela de cette limite, les listes seront presentees sur
+  # plusieur pages
+  $this->CONFIG["max_list"] = 10;
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/dist/pathes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/pathes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/pathes.php	(revision 1)
@@ -0,0 +1,6 @@
+<?php
+
+  define("RSR_APP_PATH", "app/");
+  define("RSR_CONFIG_FILE", "[config_file]");
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/dist/sql/champs_content.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/sql/champs_content.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/sql/champs_content.txt	(revision 1)
@@ -0,0 +1,3 @@
+[site_name]
+[email_admin]
+[pun_url]
Index: /branches/rsr.v5.1.dev/web/install/dist/sql/content.sql
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/sql/content.sql	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/sql/content.sql	(revision 1)
@@ -0,0 +1,258 @@
+INSERT INTO `[prefix]boxes` (`id`, `nom`, `emplacement`, `titre`, `fichier`, `contenu`, `auteur_creation`, `date_creation`, `auteur_modification`, `date_modification`, `date_publication`, `public`, `ordre`) VALUES
+(141, 'navigation', NULL, '', 'navigation.php', '<p>Affiche le menu principal dans l''ent&ecirc;te du site.</p>\r\n<p>Les &eacute;l&eacute;ments du menu sont &eacute;ditables dans l''administration du site, menu :</p>\r\n<p><strong>Contenus</strong> &gt; <strong>menus</strong></p>', 186, '2009-08-30 21:48:09', 186, '2011-11-12 16:14:42', '2009-09-05 23:35:21', 1, 0),
+(150, 'accueil_forum', 'accueil_gauche', 'Forum : derniers messages', 'accueil_forum.php', '<p>Ce bloc affiche des liens vers les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:08:59', 186, '2011-11-12 15:56:53', '2009-09-06 19:10:21', 1, 3),
+(127, 'spotlight', 'accueil_gauche', 'Spotlight', 'spotlight.php', '<p>Ce bloc affiche le dernier spotlight, &eacute;dit&eacute; dans l''administration :</p>\r\n<p><strong>La redaction</strong> &gt; <strong>spotlights</strong></p>', 186, '2009-08-10 10:26:40', 186, '2011-11-12 16:05:10', '2009-09-06 17:16:40', 0, 2),
+(126, 'playlists_accueil', 'accueil_petite_gauche', 'Playlists', 'playlists.php', '', 186, '2009-08-09 23:15:00', 186, '2010-08-05 01:48:25', '2009-09-06 19:45:23', 1, 1),
+(142, 'edito', 'accueil_gauche', 'Edito', 'edito.php', '<p>Affiche le dernier &eacute;dito.</p>\r\n<p>Pour l''&eacute;dition des &eacute;ditos, menu :</p>\r\n<p><strong>La redaction</strong> &gt; <strong>&eacute;ditos</strong></p>', 186, '2009-09-01 19:49:18', 186, '2011-11-12 16:12:08', '2009-09-06 17:16:14', 1, 1),
+(151, 'playlists_interne', 'interne_gauche', 'Playlists', 'playlists.php', '', 186, '2009-09-06 19:45:02', 186, '2010-08-05 01:48:15', '2009-09-06 19:45:58', 1, 2),
+(124, 'identification', NULL, '', 'login.php', '', 186, '2009-08-09 22:16:57', 186, '2009-09-05 23:39:50', '2009-09-05 23:39:50', 1, 1),
+(130, 'nous_y_etions', 'accueil_petite_droite', 'Nous y Ã©tions', 'nous_y_etions.php', '<p>Ce bloc affiche un lien vers un sujet au hasard pris dans une section du forum. RSR utilise ce bloc pour faire un lien vers son forum des &eacute;v&eacute;nements pass&eacute;s.</p>\r\n<p>Avant d''utiliser ce bloc, modifiez le fichier <strong>data/modules/data_forum.php</strong> pour y renseigner l''identifiant du forum li&eacute; (variable <em>$forum_id</em>, ligne. 37).</p>\r\n<p>pour trouver l''identifiant d''un forum, rendez-vous avec votre navigateur sur le forum en question et regardez son URL, qui devrait se terminer par :</p>\r\n<p><em>viewforum.php?id=<strong>XX</strong></em></p>\r\n<p><em><strong>XX</strong></em> : identifiant du forum &agrave; modifier dans <strong>data/modules/data_forum.php</strong></p>', 186, '2009-08-10 11:49:58', 186, '2011-11-12 17:07:52', '2009-09-06 19:07:21', 0, 2),
+(140, 'artistes_au_hasard', 'accueil_droite_haut', 'Artistes au hasard', 'artistes_au_hasard.php', '', 186, '2009-08-30 21:44:32', 186, '2011-11-12 15:25:33', '2009-09-06 17:16:26', 0, 1),
+(143, 'news', 'accueil_droite_bas', 'Les autres news', 'news.php', '', 186, '2009-09-01 19:57:51', 186, '2010-08-05 01:48:55', '2009-09-06 17:16:52', 1, 2),
+(152, 'forum_interne', 'interne_gauche', 'Forum', 'accueil_forum.php', '<p>Ce bloc affiche les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:46:30', 186, '2011-11-12 15:52:34', '2009-09-06 19:48:57', 0, 4),
+(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://wiki.rsr.free.fr/wiki">le wiki</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
+(128, 'administration', NULL, 'Administration', 'admin.php', '', 186, '2009-08-10 10:27:12', 186, '2009-09-06 00:13:40', '2009-09-06 00:13:40', 1, 4),
+(155, '', 'interne_gauche', 'News', 'menu_news.php', '<p>Affiche les 2 derni&egrave;res news et un menu pour acc&eacute;der aux autres news.</p>', 186, '2010-01-15 22:39:32', 186, '2011-11-12 16:10:38', NULL, 1, 1),
+(156, 'last_news', 'accueil_droite_bas', 'News', 'last_news.php', '<p>Ce bloc affiche une news au hazard parmis les 5 derni&egrave;res.</p>', 186, '2010-04-06 15:58:29', 186, '2011-11-12 16:07:40', NULL, 1, 1),
+(157, 'last_albums', 'interne_gauche', 'Album au hasard', 'last_albums.php', '<p>Ce bloc affiche un album au hazard.</p>', 186, '2010-04-06 17:19:27', 186, '2011-11-12 15:56:10', NULL, 1, 3),
+(158, '', 'accueil_droite_bas', 'Soutenir notre action', 'soutenir.php', '<p>Ce bloc affiche un bouton de don PayPal et, &eacute;ventuellement, un lien vers une boutique de vente en ligne.</p>\r\n<p>Avant d''utiliser ce bloc, rendez-vous dans l''administration du site, menu :</p>\r\n<p><strong>G&eacute;n&eacute;ral</strong> &gt; <strong>dons et achats</strong></p>\r\n<p>Pour y renseigner votre identifiant s&eacute;curis&eacute; PayPal et/ou le lien vers la boutique en ligne.</p>', 3, '2010-08-03 13:05:44', 186, '2011-11-12 15:54:58', NULL, 0, 3),
+(159, '', 'accueil_droite_haut', 'Administrer le site', '', '<p>Les blocs affich&eacute;s sur cette page sont des exemples d''utilisation.</p>\r\n<p>Identifiez-vous avec votre compte admin et suivez le lien <a title="administration du site" href="index.php?e=set_config">admin</a> pour vous rendre dans l''administration du site et commencer &agrave; &eacute;diter les blocs, les contenus, les comptes artistes...</p>\r\n<p>&nbsp;</p>', 186, '2010-08-04 13:54:50', 186, '2011-11-12 22:17:47', NULL, 1, 0),
+(161, '', 'accueil_gauche', 'En images', 'flickr.php', '<p>Ce bloc affiche 4 images prises au hazard sur un compte Flickr.</p>\r\n<p>Avant d''utiliser ce bloc, modifiez le fichier</p>\r\n<p><strong>boxes/flickr.php</strong></p>\r\n<p>du template pour y indiquer vos informations de connexion sur l''API Flickr.</p>', 186, '2010-08-05 15:19:23', 186, '2011-11-12 15:50:41', NULL, 0, 4);
+# --
+INSERT INTO `[prefix]categories` (`id`, `nom`, `titre`, `icone`, `description`, `contenu`, `ordre`) VALUES
+(4, 'artistes', NULL, NULL, NULL, NULL, 0),
+(5, 'presentation', NULL, NULL, NULL, NULL, 0),
+(7, 'menus', NULL, NULL, NULL, NULL, 0),
+(22, 'Nav', 'menu top', NULL, NULL, '', 0),
+(30, '', 'Accueil', NULL, NULL, 'index.php?e=edito', 0),
+(29, '', 'Forum', NULL, NULL, 'punbb', 2),
+(33, '', 'Le son', NULL, NULL, '', 1),
+(38, '', 'Les artistes', NULL, NULL, 'index.php?e=artistes', 1),
+(40, '', 'Rechercher...', NULL, NULL, 'index.php?e=rechercher', 2),
+(63, '74', NULL, NULL, NULL, '', 0),
+(1, 'editos', 'Editos', NULL, NULL, NULL, 0),
+(2, 'news', NULL, NULL, NULL, NULL, 0),
+(0, 'root', NULL, NULL, NULL, NULL, 0),
+(6, 'news', NULL, NULL, NULL, NULL, 0),
+(3, 'spotlights', 'Spotlights', NULL, NULL, NULL, 0),
+(79, 'boxes', NULL, NULL, NULL, NULL, 0),
+(80, 'accueil_left', 'accueil - colonne de gauche', NULL, NULL, NULL, 0),
+(81, 'accueil_right', 'accueil - colonne de droite', NULL, NULL, NULL, 0),
+(82, '64', NULL, NULL, NULL, '', 0),
+(83, 'pages', NULL, NULL, NULL, NULL, 0),
+(85, 'links', NULL, NULL, NULL, NULL, 0),
+(93, 'interne_left', 'pages internes - colonne de gauche', NULL, NULL, NULL, 0),
+(94, 'accueil_small_left', 'accueil - petite colonne gauche', NULL, NULL, NULL, 0),
+(95, 'accueil_small_right', 'accueil - petite colonne droite', NULL, NULL, NULL, 0),
+(99, '54', NULL, NULL, NULL, '', 0),
+(100, '3', NULL, NULL, NULL, '', 0),
+(101, '73', NULL, NULL, NULL, '', 0),
+(102, '34', NULL, NULL, NULL, '', 0);
+# --
+INSERT INTO `[prefix]categories_tree` (`parent`, `child`) VALUES
+(0, 1),
+(0, 2),
+(0, 3),
+(0, 4),
+(0, 7),
+(0, 79),
+(0, 83),
+(0, 85),
+(4, 5),
+(4, 6),
+(6, 82),
+(6, 99),
+(6, 100),
+(6, 101),
+(6, 102),
+(7, 22),
+(22, 29),
+(22, 30),
+(22, 33),
+(33, 38),
+(33, 40),
+(79, 80),
+(79, 81),
+(79, 93),
+(79, 94),
+(79, 95);
+# --
+INSERT INTO `[prefix]configuration` (`key`, `value`) VALUES
+('site_name', '[site_name]'),
+('email_contact', '[email_admin]'),
+('out', 'app/out/dist/'),
+('max_list', '10'),
+('identifiant_paypal', ''),
+('lien_boutique', '');
+# --
+INSERT INTO `[prefix]contenus` (`id`, `nom`, `categorie`, `titre`, `description`, `contenu`, `auteur_creation`, `date_creation`, `auteur_modification`, `date_modification`, `date_publication`, `public`, `ordre`) VALUES
+(919, '', 1, 'Nouvelle installation', '', '<p>Bienvenue sur votre installation de rsr v.5.</p>\r\n<p>Pensez &agrave; effacer le dossier <strong>install</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Bonnes publications !</p>', 186, '2011-09-04 15:03:09', 186, '2011-11-12 22:07:24', '2011-09-04 00:00:00', 1, NULL);
+
+# --
+INSERT INTO `[prefix]formats` (`id`, `nom`, `content_type`) VALUES
+(1, 'ogg', 'audio/ogg'),
+(2, 'mp3', 'audio/mpeg'),
+(3, 'rar', 'application/x-rar-compressed'),
+(4, 'zip', 'application/x-zip'),
+(5, 'jpg', 'image/jpeg'),
+(6, 'pdf', 'application/pdf'),
+(7, 'avi', 'video/avi'),
+(8, 'gz', 'application/x-gzip'),
+(9, 'wav', 'audio/wav');
+# --
+INSERT INTO `[prefix]licences` (`id`, `nom`, `lien`, `icone`) VALUES
+(1, 'Creative Commons by-nc-nd 2.0', 'http://creativecommons.org/licenses/by-nc-nd/2.0/', 'icons/licences/cc.by.nc.nd.png'),
+(2, 'Creative Commons by-nc-nd 2.5', 'http://creativecommons.org/licenses/by-nc-nd/2.5/', 'icons/licences/cc.by.nc.nd.png'),
+(3, 'Creative Commons by-nc-sa 2.0', 'http://creativecommons.org/licenses/by-nc-sa/2.0/', 'icons/licences/cc.by.nc.sa.png'),
+(4, 'Creative Commons by-nc-sa 2.5', 'http://creativecommons.org/licenses/by-nc-sa/2.5/', 'icons/licences/cc.by.nc.sa.png'),
+(5, 'Creative Commons by-nc 2.0', 'http://creativecommons.org/licenses/by-nc/2.0/', 'icons/licences/cc.by.nc.png'),
+(6, 'Creative Commons by-nc 2.5', 'http://creativecommons.org/licenses/by-nc/2.5/', 'icons/licences/cc.by.nc.png'),
+(7, 'Creative Commons by-nd 2.0', 'http://creativecommons.org/licenses/by-nd/2.0/', 'icons/licences/cc.by.nd.png'),
+(8, 'Creative Commons by-nd 2.5', 'http://creativecommons.org/licenses/by-nd/2.5/', 'icons/licences/cc.by.nd.png'),
+(9, 'Creative Commons by-sa 2.0', 'http://creativecommons.org/licenses/by-sa/2.0/', 'icons/licences/cc.by.sa.png'),
+(10, 'Creative Commons by-sa 2.5', 'http://creativecommons.org/licenses/by-sa/2.5/', 'icons/licences/cc.by.sa.png'),
+(11, 'Creative Commons by 2.0', 'http://creativecommons.org/licenses/by/2.0/', 'icons/licences/cc.by.png'),
+(12, 'Creative Commons by 2.5', 'http://creativecommons.org/licenses/by/2.5/', 'icons/licences/cc.by.png'),
+(13, 'Licence Art Libre', 'http://artlibre.org/licence/lal/', ''),
+(14, 'Licence C Reaction', 'http://morne.free.fr/Necktar7/creactionfr.htm', ''),
+(15, 'Domaine Public', '', ''),
+(16, 'Licence GNU GPL (GNUArt)', 'http://gnuart.org/francais/gnugpl.html', '');
+# --
+INSERT INTO `[prefix]pun_config` (`conf_name`, `conf_value`) VALUES
+('o_cur_version', '1.2.10'),
+('o_cur_version_fr', '1.2.10'),
+('o_board_title', 'Forums'),
+('o_board_desc', NULL),
+('o_server_timezone', '0'),
+('o_time_format', 'H:i:s'),
+('o_date_format', 'd-m-Y'),
+('o_timeout_visit', '600'),
+('o_timeout_online', '300'),
+('o_redirect_delay', '1'),
+('o_show_version', '1'),
+('o_show_user_info', '1'),
+('o_show_post_count', '1'),
+('o_smilies', '1'),
+('o_smilies_sig', '0'),
+('o_make_links', '1'),
+('o_default_lang', 'French'),
+('o_default_style', 'Rsr'),
+('o_default_user_group', '4'),
+('o_topic_review', '15'),
+('o_disp_topics_default', '30'),
+('o_disp_posts_default', '25'),
+('o_indent_num_spaces', '4'),
+('o_quickpost', '1'),
+('o_users_online', '1'),
+('o_censoring', '0'),
+('o_ranks', '1'),
+('o_show_dot', '0'),
+('o_quickjump', '1'),
+('o_gzip', '0'),
+('o_additional_navlinks', NULL),
+('o_report_method', '2'),
+('o_regs_report', '1'),
+('o_mailing_list', '[email_admin]'),
+('o_avatars', '1'),
+('o_avatars_dir', 'img/avatars'),
+('o_avatars_width', '128'),
+('o_avatars_height', '128'),
+('o_avatars_size', '25000'),
+('o_search_all_forums', '1'),
+('o_base_url', '[pun_url]'),
+('o_admin_email', '[email_admin]'),
+('o_webmaster_email', '[email_admin]'),
+('o_subscriptions', '1'),
+('o_smtp_host', NULL),
+('o_smtp_user', NULL),
+('o_smtp_pass', NULL),
+('o_regs_allow', '1'),
+('o_regs_verify', '0'),
+('o_announcement', '0'),
+('o_announcement_message', 'Saisissez votre annonce ici.'),
+('o_regs_captchabox', '1'),
+('o_guest_post_captchabox', '0'),
+('o_rules', '0'),
+('o_rules_message', 'Saisissez vos rÃšgles d''utilisation ici.'),
+('o_maintenance', '0'),
+('o_maintenance_message', 'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Nous vous prions de bien vouloir nous excuser pour cette gÃšne. Veuillez essayer Ã  nouveau d''ici quelques minutes.<br />\n<br />\nRevolution Sound Records'),
+('p_mod_edit_users', '1'),
+('p_mod_rename_users', '0'),
+('p_mod_change_passwords', '0'),
+('p_mod_ban_users', '0'),
+('p_message_bbcode', '1'),
+('p_message_img_tag', '1'),
+('p_message_all_caps', '1'),
+('p_subject_all_caps', '0'),
+('p_sig_all_caps', '0'),
+('p_sig_bbcode', '1'),
+('p_sig_img_tag', '1'),
+('p_sig_length', '400'),
+('p_sig_lines', '4'),
+('p_allow_banned_email', '1'),
+('p_allow_dupe_email', '0'),
+('p_force_guest_email', '1');
+# --
+INSERT INTO `[prefix]pun_forum_perms` (`group_id`, `forum_id`, `read_forum`, `post_replies`, `post_topics`) VALUES
+(3, 48, 0, 0, 0),
+(4, 48, 0, 0, 0),
+(5, 48, 0, 0, 0),
+(6, 48, 0, 0, 0),
+(3, 75, 0, 0, 0),
+(4, 75, 0, 0, 0),
+(5, 75, 0, 0, 0),
+(6, 75, 0, 0, 0),
+(3, 77, 0, 0, 0),
+(4, 77, 0, 0, 0),
+(5, 77, 0, 0, 0),
+(6, 77, 0, 0, 0),
+(3, 78, 0, 0, 0),
+(4, 78, 0, 0, 0),
+(5, 78, 0, 0, 0),
+(6, 78, 0, 0, 0),
+(3, 79, 0, 0, 0),
+(4, 79, 0, 0, 0),
+(5, 79, 0, 0, 0),
+(6, 79, 0, 0, 0),
+(3, 80, 0, 0, 0),
+(4, 80, 0, 0, 0),
+(5, 80, 0, 0, 0),
+(6, 80, 0, 0, 0);
+# --
+INSERT INTO `[prefix]pun_groups` (`g_id`, `g_title`, `g_user_title`, `g_read_board`, `g_post_replies`, `g_post_topics`, `g_post_polls`, `g_edit_posts`, `g_delete_posts`, `g_delete_topics`, `g_set_title`, `g_search`, `g_search_users`, `g_edit_subjects_interval`, `g_post_flood`, `g_search_flood`) VALUES
+(1, 'Admin', 'Admin', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
+(2, 'ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
+(3, 'Touriste', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0),
+(4, 'Membres', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30),
+(5, 'Artiste', 'Artiste', 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 10, 10),
+(6, '100 eme Membre', '100 eme Membre', 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30);
+# --
+INSERT INTO `[prefix]pun_online` (`user_id`, `ident`, `logged`, `idle`) VALUES
+(1, '192.168.10.13', 1321118546, 0);
+# --
+INSERT INTO `[prefix]pun_ranks` (`id`, `rank`, `min_posts`) VALUES
+(1, 'Apprenti posteur', 0),
+(3, 'Posteur', 100),
+(4, 'Posteur chef', 200),
+(5, 'Serial posteur', 300),
+(7, 'Les doigts greffÃ©s au clavier', 1000);
+# --
+INSERT INTO `[prefix]pun_smilies` (`id`, `image`, `text`, `disp_position`) VALUES
+(45, 'canon.gif', ':top:', 0),
+(10, 'big_smile.png', ':D', 0),
+(11, 'cool.png', ':cool:', 0),
+(21, 'hmm.png', ':/', 0),
+(24, 'mad.png', ':mad2:', 0),
+(25, 'neutral.png', ':|', 0),
+(26, 'roll.png', ':roll:', 0),
+(29, 'sad.png', ':(', 3),
+(31, 'smile.png', ':)', 4),
+(33, 'tongue.png', ':p', 6),
+(35, 'wink.png', ';)', 7),
+(37, 'yikes.png', ':d', 0),
+(56, 'whaouh6na.gif', 'whaou', 0),
+(87, 'terminator.png', ':terminator:', 0);
+# --
+INSERT INTO `[prefix]pun_users` (`id`, `group_id`, `username`, `password`, `email`, `title`, `realname`, `url`, `jabber`, `icq`, `msn`, `aim`, `yahoo`, `location`, `use_avatar`, `signature`, `disp_topics`, `disp_posts`, `email_setting`, `save_pass`, `notify_with_post`, `show_smilies`, `show_img`, `show_img_sig`, `show_avatars`, `show_sig`, `timezone`, `language`, `style`, `num_posts`, `last_post`, `registered`, `registration_ip`, `last_visit`, `admin_note`, `activate_string`, `activate_key`) VALUES
+(186, 1, 'admin', '90f1b3c6cf62b05606b215265803f553e22bc657', '[email_admin]', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 1, 1, 0, 1, 1, 1, 1, 1, 0, 'French', 'Rsr', 1382, 1321043538, 1156702867, '82.243.194.97', 1321118443, NULL, NULL, NULL),
+(1, 3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 1, 1, 0, 1, 1, 1, 1, 1, 0, 'English', 'Oxygen', 0, NULL, 0, '0.0.0.0', 0, NULL, NULL, NULL);
Index: /branches/rsr.v5.1.dev/web/install/dist/sql/init.sql
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/sql/init.sql	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/sql/init.sql	(revision 1)
@@ -0,0 +1,1 @@
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
Index: /branches/rsr.v5.1.dev/web/install/dist/sql/raz.sql
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/sql/raz.sql	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/sql/raz.sql	(revision 1)
@@ -0,0 +1,71 @@
+DROP TABLE IF EXISTS `[prefix]albums`;
+# --
+DROP TABLE IF EXISTS `[prefix]artistes`;
+# --
+DROP TABLE IF EXISTS `[prefix]artistes_admins`;
+# --
+DROP TABLE IF EXISTS `[prefix]boxes`;
+# --
+DROP TABLE IF EXISTS `[prefix]categories`;
+# --
+DROP TABLE IF EXISTS `[prefix]categories_tree`;
+# --
+DROP TABLE IF EXISTS `[prefix]concerts`;
+# --
+DROP TABLE IF EXISTS `[prefix]configuration`;
+# --
+DROP TABLE IF EXISTS `[prefix]contenus`;
+# --
+DROP TABLE IF EXISTS `[prefix]downloads`;
+# --
+DROP TABLE IF EXISTS `[prefix]download_urls`;
+# --
+DROP TABLE IF EXISTS `[prefix]formats`;
+# --
+DROP TABLE IF EXISTS `[prefix]licences`;
+# --
+DROP TABLE IF EXISTS `[prefix]playlists`;
+# --
+DROP TABLE IF EXISTS `[prefix]playlis[prefix]download`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_bans`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_categories`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_censoring`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_config`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_forums`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_forum_perms`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_groups`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_online`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_posts`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_ranks`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_reports`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_search_cache`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_search_matches`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_search_words`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_smilies`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_subscriptions`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_topics`;
+# --
+DROP TABLE IF EXISTS `[prefix]pun_users`;
+# --
+DROP TABLE IF EXISTS `[prefix]super_admins`;
+# --
+DROP TABLE IF EXISTS `[prefix]thumbs`;
+# --
+DROP TABLE IF EXISTS `[prefix]videos`;
Index: /branches/rsr.v5.1.dev/web/install/dist/sql/tables.sql
===================================================================
--- /branches/rsr.v5.1.dev/web/install/dist/sql/tables.sql	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/dist/sql/tables.sql	(revision 1)
@@ -0,0 +1,425 @@
+CREATE TABLE IF NOT EXISTS `[prefix]albums` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id_artiste` int(11) NOT NULL,
+  `titre` varchar(255) DEFAULT NULL,
+  `image` varchar(255) NOT NULL,
+  `description` text,
+  `url` varchar(255) DEFAULT NULL,
+  `format` int(11) DEFAULT NULL,
+  `taille` int(11) DEFAULT NULL,
+  `date_creation` date DEFAULT NULL,
+  `date_publication` date DEFAULT NULL,
+  `compteur` int(11) NOT NULL DEFAULT '0',
+  `actif` tinyint(4) NOT NULL DEFAULT '1',
+  `ordre` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]artistes` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(255) DEFAULT NULL,
+  `presentation` text,
+  `style` varchar(255) DEFAULT NULL,
+  `image` varchar(255) DEFAULT NULL,
+  `pays` varchar(255) DEFAULT NULL,
+  `site` varchar(255) DEFAULT NULL,
+  `email_contact` varchar(255) DEFAULT NULL,
+  `hide_email` tinyint(4) NOT NULL DEFAULT '1',
+  `contact_form` tinyint(4) NOT NULL DEFAULT '1',
+  `identifiant_paypal` varchar(255) DEFAULT NULL,
+  `lien_boutique` varchar(255) DEFAULT NULL,
+  `pun_forum` int(11) DEFAULT NULL,
+  `pun_user` int(11) DEFAULT NULL,
+  `compteur` int(11) NOT NULL DEFAULT '0',
+  `lien_facebook` varchar(255) DEFAULT NULL,
+  `lien_flickr` varchar(255) DEFAULT NULL,
+  `lien_twitter` varchar(255) DEFAULT NULL,
+  `lien_youtube` varchar(255) DEFAULT NULL,
+  `dossier_personnel` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]artistes_admins` (
+  `id_artiste` int(11) NOT NULL,
+  `pun_user` int(11) NOT NULL,
+  PRIMARY KEY (`id_artiste`,`pun_user`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]boxes` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(64) DEFAULT NULL,
+  `emplacement` varchar(255) DEFAULT NULL,
+  `titre` varchar(255) DEFAULT NULL,
+  `fichier` varchar(255) DEFAULT NULL,
+  `contenu` text,
+  `auteur_creation` int(11) DEFAULT NULL,
+  `date_creation` datetime DEFAULT NULL,
+  `auteur_modification` int(11) DEFAULT NULL,
+  `date_modification` datetime DEFAULT NULL,
+  `date_publication` datetime DEFAULT NULL,
+  `public` tinyint(4) DEFAULT NULL,
+  `ordre` int(11) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=162 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]categories` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(64) DEFAULT NULL,
+  `titre` varchar(255) DEFAULT NULL,
+  `icone` varchar(255) DEFAULT NULL,
+  `description` text,
+  `contenu` text,
+  `ordre` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]categories_tree` (
+  `parent` int(11) NOT NULL,
+  `child` int(11) NOT NULL,
+  PRIMARY KEY (`parent`,`child`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]concerts` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id_artiste` int(11) DEFAULT NULL,
+  `nom` varchar(255) DEFAULT NULL,
+  `date` datetime DEFAULT NULL,
+  `lieu` varchar(255) DEFAULT NULL,
+  `paf` int(11) DEFAULT NULL,
+  `description` text,
+  `pun_forum` int(11) DEFAULT NULL,
+  `affiche` varchar(255) DEFAULT NULL,
+  `flyer` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]configuration` (
+  `key` varchar(255) NOT NULL,
+  `value` text NOT NULL,
+  PRIMARY KEY (`key`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]contenus` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(64) DEFAULT NULL,
+  `categorie` int(11) DEFAULT NULL,
+  `titre` varchar(255) DEFAULT NULL,
+  `description` text,
+  `contenu` text,
+  `auteur_creation` int(11) DEFAULT NULL,
+  `date_creation` datetime DEFAULT NULL,
+  `auteur_modification` int(11) DEFAULT NULL,
+  `date_modification` datetime DEFAULT NULL,
+  `date_publication` datetime DEFAULT NULL,
+  `public` tinyint(4) DEFAULT NULL,
+  `ordre` int(11) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=935 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]downloads` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id_artiste` int(11) DEFAULT NULL,
+  `id_album` int(11) DEFAULT NULL,
+  `id_licence` int(11) DEFAULT NULL,
+  `nom` varchar(255) DEFAULT NULL,
+  `date_creation` date DEFAULT NULL,
+  `style` varchar(255) DEFAULT NULL,
+  `description` text,
+  `ordre` int(11) DEFAULT NULL,
+  `actif` tinyint(4) NOT NULL DEFAULT '1',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]download_urls` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id_download` int(11) DEFAULT NULL,
+  `id_format` int(11) DEFAULT NULL,
+  `qualite` int(11) DEFAULT NULL,
+  `url` varchar(255) DEFAULT NULL,
+  `taille` int(11) DEFAULT NULL,
+  `date_publication` date DEFAULT NULL,
+  `compteur` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]formats` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(32) DEFAULT NULL,
+  `content_type` varchar(64) NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]licences` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `nom` varchar(255) NOT NULL DEFAULT '',
+  `lien` varchar(255) NOT NULL DEFAULT '',
+  `icone` varchar(255) NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]playlists` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `pun_user` int(11) NOT NULL,
+  `titre` varchar(255) NOT NULL,
+  `description` text NOT NULL,
+  `creation` datetime NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]playlist_download` (
+  `id` int(11) NOT NULL,
+  `id_download` int(11) NOT NULL,
+  PRIMARY KEY (`id`,`id_download`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_bans` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `username` varchar(200) DEFAULT NULL,
+  `ip` varchar(255) DEFAULT NULL,
+  `email` varchar(50) DEFAULT NULL,
+  `message` varchar(255) DEFAULT NULL,
+  `expire` int(10) unsigned DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_categories` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `cat_name` varchar(80) NOT NULL DEFAULT 'New Category',
+  `disp_position` int(10) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_censoring` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `search_for` varchar(60) NOT NULL DEFAULT '',
+  `replace_with` varchar(60) NOT NULL DEFAULT '',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_config` (
+  `conf_name` varchar(255) NOT NULL DEFAULT '',
+  `conf_value` text,
+  PRIMARY KEY (`conf_name`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_forums` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `forum_name` varchar(80) NOT NULL DEFAULT 'New forum',
+  `forum_desc` text,
+  `redirect_url` varchar(100) DEFAULT NULL,
+  `moderators` text,
+  `num_topics` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `num_posts` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `last_post` int(10) unsigned DEFAULT NULL,
+  `last_post_id` int(10) unsigned DEFAULT NULL,
+  `last_poster` varchar(200) DEFAULT NULL,
+  `sort_by` tinyint(1) NOT NULL DEFAULT '0',
+  `disp_position` int(10) NOT NULL DEFAULT '0',
+  `cat_id` int(10) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_forum_perms` (
+  `group_id` int(10) NOT NULL DEFAULT '0',
+  `forum_id` int(10) NOT NULL DEFAULT '0',
+  `read_forum` tinyint(1) NOT NULL DEFAULT '1',
+  `post_replies` tinyint(1) NOT NULL DEFAULT '1',
+  `post_topics` tinyint(1) NOT NULL DEFAULT '1',
+  PRIMARY KEY (`group_id`,`forum_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_groups` (
+  `g_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `g_title` varchar(50) NOT NULL DEFAULT '',
+  `g_user_title` varchar(50) DEFAULT NULL,
+  `g_read_board` tinyint(1) NOT NULL DEFAULT '1',
+  `g_post_replies` tinyint(1) NOT NULL DEFAULT '1',
+  `g_post_topics` tinyint(1) NOT NULL DEFAULT '1',
+  `g_post_polls` tinyint(1) NOT NULL DEFAULT '1',
+  `g_edit_posts` tinyint(1) NOT NULL DEFAULT '1',
+  `g_delete_posts` tinyint(1) NOT NULL DEFAULT '1',
+  `g_delete_topics` tinyint(1) NOT NULL DEFAULT '1',
+  `g_set_title` tinyint(1) NOT NULL DEFAULT '1',
+  `g_search` tinyint(1) NOT NULL DEFAULT '1',
+  `g_search_users` tinyint(1) NOT NULL DEFAULT '1',
+  `g_edit_subjects_interval` smallint(6) NOT NULL DEFAULT '300',
+  `g_post_flood` smallint(6) NOT NULL DEFAULT '30',
+  `g_search_flood` smallint(6) NOT NULL DEFAULT '30',
+  PRIMARY KEY (`g_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_online` (
+  `user_id` int(10) unsigned NOT NULL DEFAULT '1',
+  `ident` varchar(200) NOT NULL DEFAULT '',
+  `logged` int(10) unsigned NOT NULL DEFAULT '0',
+  `idle` tinyint(1) NOT NULL DEFAULT '0',
+  KEY `pun_online_user_id_idx` (`user_id`)
+) ENGINE=MEMORY DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_posts` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `poster` varchar(200) NOT NULL DEFAULT '',
+  `poster_id` int(10) unsigned NOT NULL DEFAULT '1',
+  `poster_ip` varchar(15) DEFAULT NULL,
+  `poster_email` varchar(50) DEFAULT NULL,
+  `message` text NOT NULL,
+  `hide_smilies` tinyint(1) NOT NULL DEFAULT '0',
+  `posted` int(10) unsigned NOT NULL DEFAULT '0',
+  `edited` int(10) unsigned DEFAULT NULL,
+  `edited_by` varchar(200) DEFAULT NULL,
+  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`),
+  KEY `pun_posts_topic_id_idx` (`topic_id`),
+  KEY `pun_posts_multi_idx` (`poster_id`,`topic_id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21233 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_ranks` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `rank` varchar(50) NOT NULL DEFAULT '',
+  `min_posts` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_reports` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `post_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `reported_by` int(10) unsigned NOT NULL DEFAULT '0',
+  `created` int(10) unsigned NOT NULL DEFAULT '0',
+  `message` text NOT NULL,
+  `zapped` int(10) unsigned DEFAULT NULL,
+  `zapped_by` int(10) unsigned DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `pun_reports_zapped_idx` (`zapped`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_cache` (
+  `id` int(10) unsigned NOT NULL DEFAULT '0',
+  `ident` varchar(200) NOT NULL DEFAULT '',
+  `search_data` text NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `pun_search_cache_ident_idx` (`ident`(8))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_matches` (
+  `post_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `word_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `subject_match` tinyint(1) NOT NULL DEFAULT '0',
+  KEY `pun_search_matches_word_id_idx` (`word_id`),
+  KEY `pun_search_matches_post_id_idx` (`post_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_words` (
+  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
+  `word` varchar(20) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
+  PRIMARY KEY (`word`),
+  KEY `pun_search_words_id_idx` (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_smilies` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `image` varchar(60) NOT NULL DEFAULT '',
+  `text` varchar(60) NOT NULL DEFAULT '',
+  `disp_position` int(10) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=89 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_subscriptions` (
+  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`user_id`,`topic_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_topics` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `poster` varchar(200) NOT NULL DEFAULT '',
+  `subject` varchar(255) NOT NULL DEFAULT '',
+  `posted` int(10) unsigned NOT NULL DEFAULT '0',
+  `last_post` int(10) unsigned NOT NULL DEFAULT '0',
+  `last_post_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `last_poster` varchar(200) DEFAULT NULL,
+  `num_views` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `num_replies` mediumint(8) unsigned NOT NULL DEFAULT '0',
+  `closed` tinyint(1) NOT NULL DEFAULT '0',
+  `sticky` tinyint(1) NOT NULL DEFAULT '0',
+  `moved_to` int(10) unsigned DEFAULT NULL,
+  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`),
+  KEY `pun_topics_forum_id_idx` (`forum_id`),
+  KEY `pun_topics_moved_to_idx` (`moved_to`)
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2441 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_users` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `group_id` int(10) unsigned NOT NULL DEFAULT '4',
+  `username` varchar(200) NOT NULL DEFAULT '',
+  `password` varchar(40) NOT NULL DEFAULT '',
+  `email` varchar(50) NOT NULL DEFAULT '',
+  `title` varchar(50) DEFAULT NULL,
+  `realname` varchar(40) DEFAULT NULL,
+  `url` varchar(100) DEFAULT NULL,
+  `jabber` varchar(75) DEFAULT NULL,
+  `icq` varchar(12) DEFAULT NULL,
+  `msn` varchar(50) DEFAULT NULL,
+  `aim` varchar(30) DEFAULT NULL,
+  `yahoo` varchar(30) DEFAULT NULL,
+  `location` varchar(30) DEFAULT NULL,
+  `use_avatar` tinyint(1) NOT NULL DEFAULT '0',
+  `signature` text,
+  `disp_topics` tinyint(3) unsigned DEFAULT NULL,
+  `disp_posts` tinyint(3) unsigned DEFAULT NULL,
+  `email_setting` tinyint(1) NOT NULL DEFAULT '1',
+  `save_pass` tinyint(1) NOT NULL DEFAULT '1',
+  `notify_with_post` tinyint(1) NOT NULL DEFAULT '0',
+  `show_smilies` tinyint(1) NOT NULL DEFAULT '1',
+  `show_img` tinyint(1) NOT NULL DEFAULT '1',
+  `show_img_sig` tinyint(1) NOT NULL DEFAULT '1',
+  `show_avatars` tinyint(1) NOT NULL DEFAULT '1',
+  `show_sig` tinyint(1) NOT NULL DEFAULT '1',
+  `timezone` float NOT NULL DEFAULT '0',
+  `language` varchar(25) NOT NULL DEFAULT 'English',
+  `style` varchar(25) NOT NULL DEFAULT 'Oxygen',
+  `num_posts` int(10) unsigned NOT NULL DEFAULT '0',
+  `last_post` int(10) unsigned DEFAULT NULL,
+  `registered` int(10) unsigned NOT NULL DEFAULT '0',
+  `registration_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0',
+  `last_visit` int(10) unsigned NOT NULL DEFAULT '0',
+  `admin_note` varchar(30) DEFAULT NULL,
+  `activate_string` varchar(50) DEFAULT NULL,
+  `activate_key` varchar(8) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `pun_users_registered_idx` (`registered`),
+  KEY `pun_users_username_idx` (`username`(8))
+) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1559 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]super_admins` (
+  `id_pun_user` int(11) NOT NULL,
+  PRIMARY KEY (`id_pun_user`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]thumbs` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `src` varchar(255) NOT NULL DEFAULT '',
+  `src_width` int(11) NOT NULL DEFAULT '0',
+  `src_height` int(11) NOT NULL DEFAULT '0',
+  `max_width` int(11) NOT NULL DEFAULT '0',
+  `max_height` int(11) NOT NULL DEFAULT '0',
+  `thumb_file` varchar(255) NOT NULL,
+  `thumb_width` int(11) NOT NULL DEFAULT '0',
+  `thumb_height` int(11) NOT NULL DEFAULT '0',
+  `creation_date` datetime NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]videos` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id_artiste` int(11) DEFAULT NULL,
+  `titre` varchar(255) DEFAULT NULL,
+  `description` text,
+  `url` varchar(255) DEFAULT NULL,
+  `id_licence` int(11) DEFAULT NULL,
+  `date_creation` date DEFAULT NULL,
+  `date_publication` date DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Index: /branches/rsr.v5.1.dev/web/install/env.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/env.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/env.php	(revision 1)
@@ -0,0 +1,103 @@
+<?php
+
+  class env
+  {
+    public $config_file;
+    public $PATHES;
+    public $PARAMS;
+    public $CONFIG;
+    public $prefix;
+    public $base_url;
+    public $bdd;
+    public $acces;
+    public $DEFAULT_ALLOW;
+
+    function __construct($config_file)
+    { $this->config_file = $config_file;
+      if(file_exists($config_file))
+      { $config = simplexml_load_file($config_file);
+        foreach($config->pathes[0] as $path_name => $path_value)
+        { $this->PATHES[$path_name] = utf8_decode($path_value);
+        }
+        $this->PARAMS = array();
+        foreach($config->params[0] as $code_param => $get_param)
+        { $this->PARAMS[$code_param] = utf8_decode($get_param);
+        }
+        $this->CONFIG = array();
+        foreach($config->config[0] as $config_param => $config_value)
+        { $this->CONFIG[$config_param] = utf8_decode($config_value);
+        }
+        $this->init_base_url();
+        $this->acces = array();
+        $this->prefix = utf8_decode($config->prefix);
+        $this->DEFAULT_ALLOW = false;
+      }
+      else
+      { echo "[erreur] config : impossible de trouver le fichier de configuration pour l'installation";
+        exit();
+      }
+    }
+
+    function set_config($config)
+    { if(is_array($config))
+      { foreach($config as $key => $value) $this->CONFIG[$key] = $value;
+        return true;
+      }
+      return false;
+    }
+
+    function init_base_url()
+    { $_params = $_SERVER["QUERY_STRING"];
+      $v_params = explode("&", $_params);
+      $this->base_url = $_SERVER["SCRIPT_NAME"]."?";
+      $FIRST = true;
+      foreach($v_params as $param)
+      { $key = strpos($param, "=") === false ? $param : substr($param, 0, strpos($param, "="));
+        if(!$this->is_a_param($key))
+        { if(!$FIRST) $this->base_url .= "&";
+          else $FIRST = false;
+          $this->base_url .= $param;
+        }
+      }
+    }
+
+    function is_a_param($key)
+    { foreach($this->PARAMS as $_key => $_value) if(strcmp($key, $_value) == 0) return true;
+      return false;
+    }
+
+    function path($name) { return $this->PATHES[$name]; }
+    function param($name) { return $this->PARAMS[$name]; }
+    function config($name) { return $this->CONFIG[$name]; }
+
+    function url($_params)
+    { $url = $this->base_url;
+      foreach($_params as $key => $value)
+      { $url .= strcmp(substr($url, -1, 1), "?") == 0 ? "" : "&";
+        $url .= $this->param($key)."=".$value;
+      }
+      return $url;
+    }
+
+    function action_ok($action)
+    { return
+      ( isset($this->acces["actions"][$action]) ?
+         $this->acces["actions"][$action][$this->user["statut"]]
+        :($this->DEFAULT_ALLOW ? true : false)
+      );
+	 }
+
+    function interface_ok($interface)
+    { return
+      ( isset($this->acces["interfaces"][$interface]) ?
+         $this->acces["interfaces"][$interface][$this->user["statut"]]
+        :($this->DEFAULT_ALLOW ? true : false)
+      );
+    }
+
+    function out_file_exists($file) { return file_exists("out/".$file); }
+    function out_file($file) { return "out/".$file; }
+
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/index.php	(revision 1)
@@ -0,0 +1,13 @@
+<?php
+
+  # chargement de l'environnement
+  require "env.php";
+  $env = new env("config.xml");
+
+  # traitement de la requÃšte
+  require "main.php";
+
+  # affichage
+  require "out/index.php";
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/main.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/main.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/main.php	(revision 1)
@@ -0,0 +1,46 @@
+<?php
+
+  function default_e() { return "accueil"; }
+
+  $env->message = "";
+  $env->erreur = "";
+  $env->out = array();
+  $env->DEFAULT_ALLOW = true;
+
+  if($dh = opendir("app/"))
+  { $files = array();
+    while(($file = readdir($dh)) !== false) $files[] = $file;
+    closedir($dh);
+    if($files)
+    { sort($files);
+      foreach($files as $file)
+      { if(!is_dir("app/".$file) && strcmp(substr($file, -4), ".php") == 0) require "app/".$file;
+      }
+    }
+  }
+
+  if(!$env->erreur)
+  { do
+    { if($env->next_e)
+      { $_GET[$env->param("e")] = $env->next_e;
+        $env->next_e = "";
+      }
+      if($env->e !== "redirect")
+      { $env->e = isset($_GET[$env->param("e")]) ? $_GET[$env->param("e")] : default_e(); 
+        if($env->e)
+        { if($env->action_ok($env->e))
+          { if(file_exists("mods/".$env->prefix.$env->e.".php"))
+            { require_once "mods/".$env->prefix.$env->e.".php";
+            }
+            if(function_exists($env->prefix.$env->e)) eval($env->prefix.$env->e."(\$env);");
+          }
+	       else $env->erreur = "Vous n'avez pas le statut necessaire pour effectuer cette op&eacute;ration.";
+        }
+      }
+    }
+    while(!$env->erreur && $env->e !== "redirect" && $env->next_e);
+  }
+
+  if($env->erreur) $env->e = "erreur";
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/mods/e_accueil.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/mods/e_accueil.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/mods/e_accueil.php	(revision 1)
@@ -0,0 +1,7 @@
+<?php
+
+  function e_accueil($env)
+  {
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/mods/e_install.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/mods/e_install.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/mods/e_install.php	(revision 1)
@@ -0,0 +1,203 @@
+<?php
+
+  function e_install($env)
+  { if($_POST)
+    {
+      if(!$env->message) write_pathes_file($env);
+      if(!$env->message) write_config_file($env);
+      if(!$env->message) init_db($env);
+      if(!$env->message) install_db($env);
+      if(!$env->message) clear_pun_cache($env);
+      if(!$env->message)
+      { _redirect
+        ( $env,
+          "../index.php",
+          "Le site a &eacute;t&eacute; install&eacute;"
+        ); 
+      }
+    }
+  }
+
+  function write_pathes_file($env)
+  { if(!is_dir("../pathes.php") && is_writable("../pathes.php"))
+    { if(($pathes_content = @file_get_contents("dist/pathes.php")) !== false) 
+      { if($h_pathes = fopen("../pathes.php", 'w'))
+        { if
+          ( fwrite
+            ( $h_pathes,
+              str_replace
+              ( array("[config_file]"),
+                array($_POST["config_file"]),
+                $pathes_content
+              )
+            )
+          )
+          {
+          }
+          else $env->message .= "<br/>impossible d'&eacute;crire dans <b>pathes.php</b>";
+          fclose($h_pathes);
+        }
+        else $env->message .= "<br/>impossible d'&eacute;crire dans <b>pathes.php</b>";
+      }
+      else $env->message .=
+       "<br/>impossible de lire le fichier <b>install/dist/pathes.php</b>"
+      ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+    }
+    else $env->message .= "<br/>le fichier <b>pathes.php</b> n'est pas accessible en &eacute;criture";
+  }
+
+  function write_config_file($env)
+  { if(!is_dir("../config.php") && is_writable("../config.php"))
+    { if(($config_content = @file_get_contents("dist/config.php")) !== false) 
+      { if($h_config = fopen("../config.php", 'w'))
+        { $web_path = "";
+          $v_path = explode("/", $_SERVER["SCRIPT_NAME"]);
+          for($i = 0; $i < (count($v_path) - 2); $i++) $web_path .= $v_path[$i]."/";
+          if
+          ( fwrite
+            ( $h_config,
+              str_replace
+              ( array
+                ( "[db_type]",
+                  "[db_host]",
+                  "[db_base]",
+                  "[db_user]",
+                  "[db_password]",
+                  "[db_prefix]",
+                  "[web_path]",
+                  "[site_name]"
+                ),
+                array
+                ( $_POST["db_type"],
+                  $_POST["db_hote"],
+                  $_POST["db_base"],
+                  $_POST["db_user"],
+                  $_POST["db_password"],
+                  $_POST["db_prefix"],
+                  $web_path,
+                  $_POST["site_name"]
+                ),
+                $config_content
+              )
+            )
+          )
+          {
+          }
+          else $env->message .= "<br/>impossible d'&eacute;crire dans <b>config.php</b>";
+          fclose($h_config);
+        }
+        else $env->message .= "<br/>impossible d'&eacute;crire dans <b>config.php</b>";
+      }
+      else $env->message .=
+       "<br/>impossible de lire le fichier <b>install/dist/config.php</b>"
+      ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+    }
+    else $env->message .= "<br/>le fichier <b>config.php</b> n'est pas accessible en &eacute;criture";
+  }
+
+  function init_db($env)
+  { switch($_POST["db_type"])
+    { case 'mysql':
+        require "../punbb/include/dblayer/mysql.php";
+        break;
+      case 'mysqli':
+        require PUN_ROOT.'include/dblayer/mysqli.php';
+        break;
+      case 'pgsql':
+        require PUN_ROOT.'include/dblayer/pgsql.php';
+        break;
+      case 'sqlite':
+        require PUN_ROOT.'include/dblayer/sqlite.php';
+        break;
+      default:
+        $env->message = "<b>'".$_POST["db_type"]."'</b> n'est pas un type de base de donnÃ©es valable.";
+        break;
+    }
+    if(!$env->message)
+    { $env->db = new DBLayer($_POST["db_host"], $_POST["db_user"], $_POST["db_password"], $_POST["db_base"], $_POST["db_prefix"], false);
+      require "../app/data/sql.php";
+      require "../app/data/data.php";
+      $env->data = new data(new sql($env->db, "#--", $_POST["db_prefix"]), $env);
+    }
+  }
+
+  function install_db($env)
+  { try
+    { if(($sql = file_get_contents("dist/sql/init.sql")) !== false)
+      { if($sql) try
+        { $env->data->sql->query($sql);
+          if(($sql = file_get_contents("dist/sql/raz.sql")) !== false)
+          { if($sql) try
+            { $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
+              $v_sql = explode("# --", $sql);
+              foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
+              if(($sql = file_get_contents("dist/sql/tables.sql")) !== false)
+              { if($sql) try
+                { $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
+                  $v_sql = explode("# --", $sql);
+                  foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
+                  if(($sql = file_get_contents("dist/sql/content.sql")) !== false)
+                  { if($sql) try
+                    { $punbb_url = "http://".$_SERVER["SERVER_NAME"];
+                      $v_path = explode("/", $_SERVER["SCRIPT_NAME"]);
+                      $path = "";
+                      for($i = 1; $i < (count($v_path) - 2); $i++) $path .= "/".$v_path[$i];
+                      $punbb_url .= $path."/punbb";
+                      $sql = str_replace
+                      ( array
+                        ( "[prefix]",
+                          "[site_name]",
+                          "[email_admin]",
+                          "[pun_url]"
+                        ),
+                        array
+                        ( $_POST["db_prefix"],
+                          $_POST["site_name"],
+                          $_POST["email_admin"],
+                          $punbb_url
+                        ),
+                        $sql
+                      );
+                      $v_sql = explode("# --", $sql);
+                      foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
+                    }
+                    catch(Exception $_e)
+                    { $env->message =
+                       "Impossible d'executer les requetes du fichier content.sql<br/>"
+                      ."erreur sur la requete: ".$_sql;
+                      return;
+                    }
+                  }
+                  else $env->message .=
+                   "<br/>impossible de lire le fichier <b>install/dist/sql/content.sql</b>"
+                  ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+                }
+                catch(Exception $_e) { $env->message = "Impossible d'executer les requetes du fichier tables.sql"; return; }
+              }
+              else $env->message .=
+               "<br/>impossible de lire le fichier <b>install/dist/sql/tables.sql</b>"
+              ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+            }
+            catch(Exception $_e) { $env->message = "Impossible d'executer les requetes du fichier raz.sql"; return; }
+          }
+          else $env->message .=
+           "<br/>impossible de lire le fichier <b>install/dist/sql/raz.sql</b>"
+          ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+        }
+        catch(Exception $_e) { $env->message = "Impossible d'executer les requetes du fichier init.sql"; return; }
+      }
+      else $env->message .=
+       "<br/>impossible de lire le fichier <b>install/dist/sql/init.sql</b>"
+      ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
+    }
+    catch(Exception $_e) { $env->message .= "<br/>impossible d'acc&eacute;der &agrave; la base de donn&eacute;es"; }
+  }
+
+  function clear_pun_cache()
+  { if(is_dir("../punbb/cache/") && ($dh = opendir("../punbb/cache/")))
+    { while(($file = readdir($dh)) !== false) if(strpos($file, "cache_") === 0 && $file !== "cache_smilies.php") @unlink("../punbb/cache/".$file);
+      closedir($dh);
+    }
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/out/content/e_accueil.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/content/e_accueil.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/content/e_accueil.php	(revision 1)
@@ -0,0 +1,8 @@
+<h2>Bienvenue sur l'installation du site</h2>
+<p>
+Ces pages vont vous permettre d'installer le site.<br />
+Une fois l'installation termin&eacute;e, vous pourrez supprimer le dossier <b>install</b>.
+</p>
+<p>
+<a href="<?= $env->url(array("e" => "check")) ?>">Commencer l'installation</a>
+</p>
Index: /branches/rsr.v5.1.dev/web/install/out/content/e_check.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/content/e_check.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/content/e_check.php	(revision 1)
@@ -0,0 +1,83 @@
+<p>Avant de commencer l'installation, v&eacute;rifiez la version de Php et les droits en &eacute;criture.</p>
+<h2>Version de Php</h2>
+<?php
+
+  $php_version = phpversion();
+  $PHP_OK = substr($php_version, 0, 1) == "5";
+
+?>
+<p>Version install&eacute;e sur ce serveur :
+<font class="<?= $PHP_OK ? "ok" : "warn" ?>"><?= $php_version ?></font></p>
+<?php if($PHP_OK) : ?>
+<p>Le site peut fonctionner avec cette version de Php.</p>
+<?php else : ?>
+<p>Le site ne fonctionnera pas avec version de Php. Il faut au minimum la version 5.</p>
+<?php endif; ?>
+<h2>Droits en ecriture</h2>
+<p>
+Les fichiers et dossiers suivants doivent &ecirc;tre accessibles en &eacute;criture :
+</p>
+<table class="list">
+  <tr>
+    <td>pathes.php</td>
+    <td>
+    <?php if(is_writable("../pathes.php")): ?>
+      <font class="ok">modifiable</font> 
+    <?php else : ?>
+      <font class="warn">non modifiable</font>
+    <?php endif; ?>
+    </td>
+  </tr>
+  <tr>
+    <td>config.php</td>
+    <td>
+    <?php if(is_writable("../config.php")): ?>
+      <font class="ok">modifiable</font> 
+    <?php else : ?>
+      <font class="warn">non modifiable</font>
+    <?php endif; ?>
+    </td>
+  </tr>
+  <tr>
+    <td>punbb/cache/</td>
+    <td>
+    <?php if(is_writable("../punbb/cache/")): ?>
+      <font class="ok">modifiable</font> 
+    <?php else : ?>
+      <font class="warn">non modifiable</font>
+    <?php endif; ?>
+    </td>
+  </tr>
+  <tr>
+    <td>uploads/categories/</td>
+    <td>
+    <?php if(is_writable("../uploads/categories/")): ?>
+      <font class="ok">modifiable</font> 
+    <?php else : ?>
+      <font class="warn">non modifiable</font>
+    <?php endif; ?>
+    </td>
+  </tr>
+  <tr>
+    <td>uploads/artistes/</td>
+    <td>
+    <?php if(is_writable("../uploads/artistes/")): ?>
+      <font class="ok">modifiable</font> 
+    <?php else : ?>
+      <font class="warn">non modifiable</font>
+    <?php endif; ?>
+    </td>
+  </tr>
+</table>
+<br />
+<p>Une fois le site install&eacute;, vous pourrez enlever les droits en &eacute;criture sur les fichiers
+<b>pathes.php</b> et <b>config.php</b>.
+</p>
+<h2>Continuer</h2>
+<p>
+Si la version de Php et les acc&egrave;s en &eacute;criture sont corrects, vous pouvez
+<a href="<?= $env->url(array("e" => "install")) ?>">continuer</a>.
+</p>
+<p>
+<a href="<?= $env->url(array("e" => "check")) ?>">Rechargez la page</a> pour v&eacute;rifier &agrave; nouveau
+</p>
Index: /branches/rsr.v5.1.dev/web/install/out/content/e_erreur.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/content/e_erreur.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/content/e_erreur.php	(revision 1)
@@ -0,0 +1,3 @@
+<div class="erreur">
+  <?= $env->erreur ?>
+</div>
Index: /branches/rsr.v5.1.dev/web/install/out/content/e_install.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/content/e_install.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/content/e_install.php	(revision 1)
@@ -0,0 +1,73 @@
+<form name="install_form" action="<?= $env->url(array("e" => "install")) ?>" method="post">
+  <h2>La base de donn&eacute;es</h2>
+  <p>
+    Indiquez les param&egrave;tres de la base dans laquelle
+    les tables seront ajout&eacute;es :
+  </p>
+  <table class="admin">
+    <tr>
+      <th>type de base :</th>
+      <td>
+        <select name="db_type">
+          <option value="mysql"<?= $_POST["db_type"] == "mysql" ? " selected" : "" ?>>mysql</option>
+          <option value="mysqli"<?= $_POST["db_type"] == "mysqli" ? " selected" : "" ?>>mysqli</option>
+          <option value="pgsql"<?= $_POST["db_type"] == "pgsql" ? " selected" : "" ?>>pgsql</option>
+          <option value="sqlite"<?= $_POST["db_type"] == "sqlite" ? " selected" : "" ?>>sqlite</option>
+        </select>
+      </td>
+    </tr>
+    <tr>
+      <th>hote</th>
+      <td><input type="text" name="db_hote" value="<?= $_POST["db_hote"] ?>" /></td>
+    </tr>
+    <tr>
+      <th>base</th>
+      <td><input type="text" name="db_base" value="<?= $_POST["db_base"] ?>" /></td>
+    </tr>
+    <tr>
+      <th>user</th>
+      <td><input type="text" name="db_user" value="<?= $_POST["db_user"] ?>" /></td>
+    </tr>
+    <tr>
+      <th>password</th>
+      <td><input type="password" name="db_password" /></td>
+    </tr>
+    <tr>
+      <th>prefixe de table</th>
+      <td><input type="text" name="db_prefix" value="<?= $_POST["db_prefix"] ?>" /></td>
+    </tr>
+  </table>
+  <h2>Configuration</h2>
+  <table class="admin">
+    <tr>
+      <th>nom du site</th>
+      <td><input type="text" name="site_name" value="<?= $_POST["site_name"] ?>" /></td>
+    </tr>
+    <tr>
+      <th>email de l'administrateur</th>
+      <td><input type="text" name="email_admin" value="<?= $_POST["email_admin"] ?>" /></td>
+    </tr>
+  </table>
+  <p>
+    Par default, la configuration sera enregistr&eacute;e dans le fichier <b>config.php</b>
+  </p>
+  <p>
+    Vous pouvez pr&eacute;ciser un autre nom, &eacute;ventuellement dans un autre dossier :
+  </p>
+  <table class="admin">
+    <tr>
+      <th>fichier de configuration</th>
+      <td><input type="text" name="config_file" value="<?= $_POST["config_file"] ? $_POST["config_file"] : "config.php"?>" /></td>
+    </tr>
+  </table>  
+  <p>
+    Si vous indiquez un chemin commen&ccedil;ant par un slash (/) le chemin sera absolu, dans le syst&egrave;me de fichiers. Sinon,
+    il sera relatif au dossier dans lequel vous avez upload&eacute; les fichiers du site.
+  </p>
+
+  <table class="admin">
+    <tr>
+      <td align="right"><input type="submit" value="installer" /></td>
+    </tr>
+  </table>
+</form>
Index: /branches/rsr.v5.1.dev/web/install/out/content/e_redirect.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/content/e_redirect.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/content/e_redirect.php	(revision 1)
@@ -0,0 +1,15 @@
+<div class="redirect_message">
+<?= $env->out["redirect"]["message"] ?>
+<br><br><br>
+---------------------------------------------------<br>
+Vous allez &ecirc;tre redirig&eacute; vers <a href="<?= $env->out["redirect"]["url"] ?>"><?= $env->out["redirect"]["url"] ?></a>
+dans <?= $env->out["redirect"]["wait"] ?> secondes.<br>
+(cliquez sur le lien si la redirection ne se fait pas)
+
+</div>
+<script type="text/javascript">
+
+  setTimeout("js_redirect('<?= $env->out["redirect"]["url"] ?>')", 1000 * <?= $env->out["redirect"]["wait"] ?>);
+  function js_redirect(redirect_url) { document.location = redirect_url; }
+
+</script>
Index: /branches/rsr.v5.1.dev/web/install/out/css/admin.css
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/css/admin.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/css/admin.css	(revision 1)
@@ -0,0 +1,29 @@
+table.admin
+{ width: 100%;
+}
+
+table.admin input[type=text], table.admin input[type=password], table.admin input[type=checkbox]
+{ border: solid 1px #000000;
+  background-color: #555555;
+  color: #ffffff;
+}
+
+table.admin th
+{ font-weight: normal;
+  color: #c0c0c0;
+  font-weight: bold;
+  padding: 3px;
+  vertical-align: top;
+  text-align: right;
+}
+
+table.admin td
+{ font-weight: normal;
+  color: #c0c0c0;
+  padding: 3px;
+}
+
+table.admin td .info
+{ font-size: 11px;
+  padding: 3px;
+}
Index: /branches/rsr.v5.1.dev/web/install/out/css/content.css
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/css/content.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/css/content.css	(revision 1)
@@ -0,0 +1,43 @@
+a
+{ text-decoration: none;
+  color: #F6B620;
+}
+
+a:hover
+{ text-decoration: underline;
+}
+
+h2
+{ border-bottom: solid 1px #333333;
+  margin-top: 50px;
+}
+
+h3
+{
+}
+
+h4
+{
+}
+
+p
+{ text-align: justify;
+  margin: 5px 0px 10px 0px;
+}
+
+ul
+{ margin: 5px 10px 10px 30px;
+}
+
+ul li
+{ text-align: justify;
+}
+
+th
+{
+}
+
+.current
+{ font-weight: bold;
+  font-size: 1.1em;
+}
Index: /branches/rsr.v5.1.dev/web/install/out/css/content/e_check.css
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/css/content/e_check.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/css/content/e_check.css	(revision 1)
@@ -0,0 +1,13 @@
+.warn
+{ font-weight: bold;
+  color: #ba0000;
+}
+
+.ok
+{ font-weight: bold;
+  color: #2cab00;
+}
+
+table.list td
+{ padding: 0 20px 0 20px;
+}
Index: /branches/rsr.v5.1.dev/web/install/out/css/messages.css
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/css/messages.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/css/messages.css	(revision 1)
@@ -0,0 +1,37 @@
+.message
+{ margin: 5px 100px 15px 50px;
+  background-color: #e0ddcc;
+  border: solid 1px #555555;
+  padding: 10px;
+  text-align: center;
+  color: #333333;
+}
+
+.erreur
+{ margin: 50px 100px 50px 100px;
+  background-color: #333333;
+  border: solid 1px #b52222;
+  padding: 20px;
+}
+
+.erreur span
+{ display: block;
+  font-size: 14px;
+  font-weight: bold;
+  margin-bottom: 20px;
+  text-align: center;
+}
+
+.redirect_message
+{ margin: 50px 100px 50px 100px;
+  border: solid 1px #c0c0c0;
+  padding: 20px;
+}
+
+.redirect_message span
+{ display: block;
+  font-size: 14px;
+  font-weight: bold;
+  margin-bottom: 20px;
+  text-align: center;
+}
Index: /branches/rsr.v5.1.dev/web/install/out/css/style.css
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/css/style.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/css/style.css	(revision 1)
@@ -0,0 +1,69 @@
+@import url("header.css");
+@import url("content.css");
+@import url("messages.css");
+@import url("admin.css");
+
+*
+{ margin: 0;
+  padding: 0;
+}
+
+html
+{ height: 100%;
+}
+
+body
+{ text-align: center;
+  height: 100%;
+  font: normal 80% Verdana, Helvetica, Arial, sans-serif;
+  background-color: #1f1f1f;
+  color: #c0c0c0;
+}
+
+pre, div { text-align: left; }
+
+.content
+{ margin-left: auto;
+  margin-right: auto;
+  width: 1016px;
+}
+
+#header
+{ border-bottom: solid 1px #555555;
+}
+
+#header .content
+{
+}
+
+#main_content
+{
+}
+
+#main_content .content
+{
+}
+
+#colonne
+{ float: left;
+  padding: 5px 5px 30px 11px;
+  width: 184px;
+  
+}
+
+#middle
+{ float: left;
+  width: 794px;
+  padding: 5px 11px 30px 11px;
+}
+
+#footer
+{ border-top: solid 1px #555555;
+}
+
+.clear
+{ clear: both;
+  font-size: 0px;
+  line-height: 0px;
+  height: 0px;
+}
Index: /branches/rsr.v5.1.dev/web/install/out/head/content/default.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/head/content/default.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/head/content/default.php	(revision 1)
@@ -0,0 +1,1 @@
+<title>Installation</title>
Index: /branches/rsr.v5.1.dev/web/install/out/head/head.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/head/head.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/head/head.php	(revision 1)
@@ -0,0 +1,25 @@
+    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+<?php if($env->out_file_exists("css/style.css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/style.css") ?>">
+<?php endif; ?>
+<?php if($env->out_file_exists("css/content/".$env->prefix.$env->e.".css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/content/".$env->prefix.$env->e.".css") ?>" />
+<?php elseif($env->out_file_exists("css/content/default.css")) : ?>
+    <link rel="stylesheet" type="text/css" href="<?= $env->out_file("css/content/default.css") ?>" />
+<?php endif; ?>
+<?php if($env->out_file_exists("js/script.js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/script.js") ?>"></script>
+<?php endif; ?>
+<?php if($env->out_file_exists("js/content/".$env->prefix.$env->e.".js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/content/".$env->prefix.$env->e.".js") ?>"></script>
+<?php elseif($env->out_file_exists("js/content/default.js")) : ?>
+    <script type="text/javascript" src="<?= $env->out_file("js/content/default.js") ?>"></script>
+<?php endif; ?>
+<?php
+
+  if($env->out_file_exists("head/content/".$env->prefix.$env->e.".php"))
+  { require $env->out_file("head/content/".$env->prefix.$env->e.".php");
+  }
+  elseif($env->out_file_exists("head/content/default.php")) require $env->out_file("head/content/default.php");
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/out/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/index.php	(revision 1)
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+<?php require $env->out_file("head/head.php"); ?>
+  </head>
+  <body>
+
+    <div id="page">
+
+      <div id="header">
+        <div class="content">
+<?php require $env->out_file("views/header.php"); ?>
+        </div>
+      </div>
+
+      <div id="main_content">
+        <div class="content">
+
+          <div id="colonne">
+<?php require $env->out_file("views/colonne.php"); ?>
+          </div>
+
+          <div id="middle">
+
+<?php
+
+  if($env->message) echo "<div class=\"message\">".$env->message."</div>\n";
+  if($env->out_file_exists("content/".$env->prefix.$env->e.".php"))
+  { require $env->out_file("content/".$env->prefix.$env->e.".php");
+  }
+
+?>
+
+          </div>
+          <div class="clear"><!-- --></div>
+
+        </div>
+      </div>
+
+      <div id="footer">
+        <div class="content">
+<?php require $env->out_file("views/footer.php"); ?>
+        </div>
+      </div>
+
+    </div>
+
+    </div>
+  </body>
+</html>
Index: /branches/rsr.v5.1.dev/web/install/out/utils.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/utils.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/utils.php	(revision 1)
@@ -0,0 +1,165 @@
+<?php
+
+  function navig($current, $total, $max, $base_url, $start_param, $legende = null)
+  { $navig = "";
+    if($total > $max)
+    { if(isset($legende))
+	  { $navig .=
+	     $legende." ".($current + 1)." &agrave; "
+	    .(($current + $max) > $total ? $total : $current + $max)
+		." sur ".$total." - aller &agrave; la ";
+	  }
+	  $get_params = array();
+      if(($q = strpos($base_url, "?")) !== false)
+	  { $v_query = explode("&", substr($base_url, $q + 1));
+        $base_url = substr($base_url, 0, $q);
+        foreach($v_query as $query)
+        { if($query)
+		  { $v = explode("=", $query);
+            $get_params[$v[0]] = $v[1];
+          }
+        }
+  	  }
+      if(isset($get_params[$start_param])) unset($get_params[$start_param]);
+      $base_url .= "?";
+      foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
+	  $nb_pages = ceil($total / $max);
+	  $navig .=
+	   "page : "
+	  ."<select onchange=\"document.location=this.options[this.selectedIndex].value;\">\n";
+      $np = 1;
+      $ni = 0;
+      while($ni < $total)
+	  { $navig .=
+         "  <option value=\"".$base_url.$start_param."=".$ni."\"".($current >= $ni && $current <= $ni ? " SELECTED" : "").">"
+		.$np
+		."</option>\n";
+        $np++;
+        $ni += $max;
+	  }
+      $navig .=
+	   "</select>\n";
+      if($current >= $max)
+	  { $navig .=
+          "&nbsp;&nbsp;<a href=\"".$base_url.$start_param."=".($current - $max)."\">&lt;&lt;</a>\n";
+	  }
+      if($current < $total - $max)
+	  { $navig .=
+          "&nbsp;&nbsp;<a href=\"".$base_url.$start_param."=".($current + $max)."\">&gt;&gt;</a>\n";
+	  }
+	}
+//	elseif(isset($legende)) $navig .= $total." ".$legende;
+    return $navig;
+  }
+
+  function order_link($env, $text, $order_by, $base_url)
+  { $get_params = array();
+    if(($q = strpos($base_url, "?")) !== false)
+	{ $v_query = explode("&", substr($base_url, $q + 1));
+      $base_url = substr($base_url, 0, $q);
+      foreach($v_query as $query)
+      { if($query)
+	    { $v = explode("=", $query);
+          $get_params[$v[0]] = $v[1];
+        }
+      }
+    }
+    if(isset($get_params[$env->param("order_by")])) unset($get_params[$env->param("order_by")]);
+    if(isset($get_params[$env->param("order")])) unset($get_params[$env->param("order")]);
+    $base_url .= "?";
+    foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
+    if(substr($base_url, -1) === "&") $base_url = substr($base_url, 0, -1);
+    $order_params = "";
+    $order_img = "";
+	if($order_by === $env->order_by)
+    { if($env->order === "ASC")
+      { $order_params = $env->param("order_by")."=".$order_by."&".$env->param("order")."=DESC";
+        $order_img = "<img src=\"icons/asc.gif\" >";
+	  }
+      elseif($env->order === "DESC")
+	  { $order_img = "<img src=\"icons/desc.gif\" >";
+	  }
+	}
+	else
+	{ $order_params = $env->param("order_by")."=".$order_by."&".$env->param("order")."=ASC";
+	}
+    return "<a href=\"".$base_url.($order_params ? "&".$order_params : "")."\">".$text."</a>&nbsp;".$order_img;
+  }
+
+  function is_date($date)
+  { return ereg("^[0-9][0-9][0-9][0-9]-[0-9]{1,2}-[0-9]{1,2}$", $date);
+  }
+
+  function is_num($num)
+  { $num = str_replace(array(",", " "), array(".", ""), $num);
+    $v_num = explode(".", $num);
+    if(count($v_num) > 2) return false;
+    $OK = true;
+	for($n = 0; $n < count($v_num) && $OK; $n++) $OK = ereg("^[0-9]+$", $v_num[$n]);
+    return $OK ? $num : false;
+  }
+
+  function date_texte($moment)
+  { $moment = explode("-", $moment);
+    return jour_semaine($moment[0], $moment[1], $moment[2])." ".(0 + $moment[0])." ".mois(0 + $moment[1])." ".$moment[2];
+  }
+
+  function jour_semaine($jour, $mois, $annee)
+  { switch(date("N", mktime(1, 0, 0, 0 + $mois, 0 + $jour, 0 + $annee)))
+    { case 1: return "lundi";
+      case 2: return "mardi";
+      case 3: return "mercredi";
+      case 4: return "jeudi";
+      case 5: return "vendredi";
+      case 6: return "samedi";
+      case 7: return "dimanche";
+	}
+  }
+
+  function mois($mois)
+  { switch($mois)
+    { case 1:  return "janvier";
+      case 2:  return "fevrier";
+      case 3:  return "mars";
+      case 4:  return "avril";
+      case 5:  return "mai";
+      case 6:  return "juin";
+      case 7:  return "juillet";
+      case 8:  return "ao&ucirc;t";
+      case 9:  return "septembre";
+      case 10: return "octobre";
+      case 11: return "novembre";
+      case 12: return "decembre";
+	}
+	return "?";
+  }
+
+  function resume($content, $n)
+  { if($n)
+    { $v_content = explode(" ", $content);
+      if(count($v_content) > $n)
+      { $_content = "";
+        for($i = 0; $i <= $n; $i++) $_content .= $v_content[$i]." ";
+		return $_content." (...)";
+	  }
+    }
+    return $content;
+  }
+
+  function js_str($content)
+  { return str_replace
+    ( array("\"", "\r", "\n"),
+      array("\\\"", "\\r", "\\n"),
+      $content
+	);
+  }
+
+  function js_str_nocrlf($content)
+  { return str_replace
+    ( array("\"", "\r", "\n"),
+      array("\\\"", " ", " "),
+      $content
+	);
+  }
+
+?>
Index: /branches/rsr.v5.1.dev/web/install/out/views/header.php
===================================================================
--- /branches/rsr.v5.1.dev/web/install/out/views/header.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/install/out/views/header.php	(revision 1)
@@ -0,0 +1,7 @@
+<h1>Installation</h1>
+<ul>
+  <li><a href="<?= $env->url(array("e" => "accueil")) ?>"<?= $env->e == "accueil" ? " class=\"current\"" : "" ?>>accueil</a></li>
+  <li><a href="<?= $env->url(array("e" => "check")) ?>"<?= $env->e == "check" ? " class=\"current\"" : "" ?>>v&eacute;rifications</a></li>
+  <li><a href="<?= $env->url(array("e" => "install")) ?>"<?= $env->e == "install" ? " class=\"current\"" : "" ?>>installation</a></li>
+  <li><a href="../">le site</a></li>
+</ul>
Index: /branches/rsr.v5.1.dev/web/pathes.php
===================================================================
--- /branches/rsr.v5.1.dev/web/pathes.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/pathes.php	(revision 1)
@@ -0,0 +1,6 @@
+<?php
+
+  define("RSR_APP_PATH", "app/");
+  define("RSR_CONFIG_FILE", "[config_file]");
+
+?>
Index: /branches/rsr.v5.1.dev/web/post_request.php
===================================================================
--- /branches/rsr.v5.1.dev/web/post_request.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/post_request.php	(revision 1)
@@ -0,0 +1,14 @@
+<?php
+
+  require "pathes.php";
+
+  # chargement de l'environnement
+  require RSR_APP_PATH."env.php";
+  $env = new env(RSR_CONFIG_FILE);
+
+  # traitement de la requete
+  require $env->path("app")."main.php";
+
+  echo $env->str_tab->response_str($env->reponse);
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/admin_bans.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_bans.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_bans.php	(revision 1)
@@ -0,0 +1,360 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
+	message($lang_common['No permission']);
+
+
+// Add/edit a ban (stage 1)
+if (isset($_REQUEST['add_ban']) || isset($_GET['edit_ban']))
+{
+	if (isset($_GET['add_ban']) || isset($_POST['add_ban']))
+	{
+		// If the id of the user to ban was provided through GET (a link from profile.php)
+		if (isset($_GET['add_ban']))
+		{
+			$add_ban = intval($_GET['add_ban']);
+			if ($add_ban < 2)
+				message($lang_common['Bad request']);
+
+			$user_id = $add_ban;
+
+			$result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+			if ($db->num_rows($result))
+				list($group_id, $ban_user, $ban_email) = $db->fetch_row($result);
+			else
+				message('Aucun utilisateur enregistrÃ© sous cet identifiant (ID).');
+		}
+		else	// Otherwise the username is in POST
+		{
+			$ban_user = trim($_POST['new_ban_user']);
+
+			if ($ban_user != '')
+			{
+				$result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+				if ($db->num_rows($result))
+					list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result);
+				else
+					message('Aucun utilisateur enregistrÃ© sous ce nom d\'utilisateur. Si vous souhaitez ajouter un bannissement qui ne soit pas liÃ© Ã  un nom d\'utilisateur particulier, laissez la case vide.');
+			}
+		}
+
+		// Make sure we're not banning an admin
+		if (isset($group_id) && $group_id == PUN_ADMIN)
+			message('L\'utilisateur '.pun_htmlspecialchars($ban_user).' est un administrateur, il ne peut Ãªtre bannis. Si vous souhaitez bannir un administrateur, vous devez d\'abord le rÃ©trograder soit modÃ©rateur soit utilisateur.');
+
+		// If we have a $user_id, we can try to find the last known IP of that user
+		if (isset($user_id))
+		{
+			$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+			$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
+		}
+
+		$mode = 'add';
+	}
+	else	// We are editing a ban
+	{
+		$ban_id = intval($_GET['edit_ban']);
+		if ($ban_id < 1)
+			message($lang_common['Bad request']);
+
+		$result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de retrouver les informations de bannissement', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+			list($ban_user, $ban_ip, $ban_email, $ban_message, $ban_expire) = $db->fetch_row($result);
+		else
+			message($lang_common['Bad request']);
+
+		$ban_expire = ($ban_expire != '') ? date('Y-m-d', $ban_expire) : '';
+
+		$mode = 'edit';
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissements';
+	$focus_element = array('bans2', 'ban_user');
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('bans');
+
+
+?>
+	<div class="blockform">
+		<h2><span>RÃ©glages de bannissement avancÃ©s</span></h2>
+		<div class="box">
+			<form id="bans2" method="post" action="admin_bans.php">
+				<div class="inform">
+				<input type="hidden" name="mode" value="<?php echo $mode ?>" />
+<?php if ($mode == 'edit'): ?>				<input type="hidden" name="ban_id" value="<?php echo $ban_id ?>" />
+<?php endif; ?>				<fieldset>
+						<legend>Bannissement supplÃ©mentaire avec <acronym title="Internet Protocol" lang="en">IP</acronym> est adresse e-mail</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom d'utilisateur</th>
+									<td>
+										<input type="text" name="ban_user" size="25" maxlength="25" value="<?php if (isset($ban_user)) echo pun_htmlspecialchars($ban_user); ?>" tabindex="1" />
+										<span>Le nom d'utilisateur Ã  bannir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Adresses <acronym title="Internet Protocol" lang="en">IP</acronym></th>
+									<td>
+										<input type="text" name="ban_ip" size="45" maxlength="255" value="<?php if (isset($ban_ip)) echo $ban_ip; ?>" tabindex="2" />
+										<span>Une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> 150.11.110.1 ou 150.11.110). SÃ©parez les adresses par des espaces. Si une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> apparaÃ®t dÃ©jÃ , il s'agit de la derniÃšre adresse IP connue de l'utilisateur dans la base de donnÃ©es.<?php if ($ban_user != '' && isset($user_id)) echo ' <a href="admin_users.php?ip_stats='.$user_id.'">Cliquez ici</a> pour voir les statistiques <acronym title="Internet Protocol" lang="en">IP</acronym> de cet utilisateur.' ?></span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail/domaine</th>
+									<td>
+										<input type="text" name="ban_email" size="40" maxlength="50" value="<?php if (isset($ban_email)) echo strtolower($ban_email); ?>" tabindex="3" />
+										<span>L'adresse e-mail ou le domaine e-mail que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com ou domaine.com). Pour plus d'informations, voir "Autoriser les adresses e-mail bannies" Ã  la page des Permissions.</span>
+									</td>
+								</tr>
+							</table>
+							<p class="topspace"><strong class="warntext">Vous devez Ãªtres trÃšs vigilant lorsque vous bannissez une plage d'<acronym title="Internet Protocol" lang="en">IP</acronym> car il y a fort probablement plusieurs utilisateurs qui correspondent Ã  la mÃªme <acronym title="Internet Protocol" lang="en">IP</acronym> partielle.</strong></p>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Message et Ã©chÃ©ance d'interdiction</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Message d'interdiction</th>
+									<td>
+										<input type="text" name="ban_message" size="50" maxlength="255" value="<?php if (isset($ban_message)) echo pun_htmlspecialchars($ban_message); ?>" tabindex="4" />
+										<span>Le  message qui sera affichÃ© Ã  l'utilisateur banni lorsqu'il visitera les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃchÃ©ance d'interdiction</th>
+									<td>
+										<input type="text" name="ban_expire" size="17" maxlength="10" value="<?php if (isset($ban_expire)) echo $ban_expire; ?>" tabindex="5" />
+										<span>La date Ã  laquelle ce bannissement sera automatiquement supprimÃ© (format: AAAA-MM-JJ). Pour supprimer manuellement, laissez ce champ vide.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="add_edit_ban" value=" Enregistrer " tabindex="6" /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+// Add/edit a ban (stage 2)
+else if (isset($_POST['add_edit_ban']))
+{
+	confirm_referrer('admin_bans.php');
+
+	$ban_user = trim($_POST['ban_user']);
+	$ban_ip = trim($_POST['ban_ip']);
+	$ban_email = strtolower(trim($_POST['ban_email']));
+	$ban_message = trim($_POST['ban_message']);
+	$ban_expire = trim($_POST['ban_expire']);
+
+	if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
+		message('Vous devez saisir au moins soit un nom d\'utilisateur, soit une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail.');
+
+	// Validate IP/IP range (it's overkill, I know)
+	if ($ban_ip != '')
+	{
+		$ban_ip = preg_replace('/[\s]{2,}/', ' ', $ban_ip);
+		$addresses = explode(' ', $ban_ip);
+		$addresses = array_map('trim', $addresses);
+
+		for ($i = 0; $i < count($addresses); ++$i)
+		{
+			$octets = explode('.', $addresses[$i]);
+
+			for ($c = 0; $c < count($octets); ++$c)
+			{
+				$octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
+
+				if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255)
+					message('Vous avez saisi une <acronym title="Internet Protocol" lang="en">IP</acronym>/plage d\'<acronym title="Internet Protocol" lang="en">IP</acronym> incorrecte.');
+			}
+
+			$cur_address = implode('.', $octets);
+			$addresses[$i] = $cur_address;
+		}
+
+		$ban_ip = implode(' ', $addresses);
+	}
+
+	require PUN_ROOT.'include/email.php';
+	if ($ban_email != '' && !is_valid_email($ban_email))
+	{
+		if (!preg_match('/^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $ban_email))
+			message('L\'adresse e-mail (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com) ou le domaine d\'adresse e-mail (<abbr title="exemple">ex.</abbr> domaine.com) que vous avez saisi est incorrect.');
+	}
+
+	if ($ban_expire != '' && $ban_expire != 'Never')
+	{
+		$ban_expire = strtotime($ban_expire);
+
+		if ($ban_expire == -1 || $ban_expire <= time())
+			message('Vous avez saisi une date d\'Ã©chÃ©ance incorrecte. Le format doit Ãªtre AAAA-MM-JJ et la date doit-Ãªtre d\'au moins un jour dans le futur.');
+	}
+	else
+		$ban_expire = 'NULL';
+
+	$ban_user = ($ban_user != '') ? '\''.$db->escape($ban_user).'\'' : 'NULL';
+	$ban_ip = ($ban_ip != '') ? '\''.$db->escape($ban_ip).'\'' : 'NULL';
+	$ban_email = ($ban_email != '') ? '\''.$db->escape($ban_email).'\'' : 'NULL';
+	$ban_message = ($ban_message != '') ? '\''.$db->escape($ban_message).'\'' : 'NULL';
+
+	if ($_POST['mode'] == 'add')
+		$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Impossible d\'ajouter le bannissement', __FILE__, __LINE__, $db->error());
+	else
+		$db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Impossible de modifier le bannissement', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the bans cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_bans_cache();
+
+	redirect('admin_bans.php', 'Bannissement '.(($_POST['mode'] == 'edit') ? 'modifiÃ©' : 'ajoutÃ©').'. Redirection ...');
+}
+
+
+// Remove a ban
+else if (isset($_GET['del_ban']))
+{
+	confirm_referrer('admin_bans.php');
+
+	$ban_id = intval($_GET['del_ban']);
+	if ($ban_id < 1)
+		message($lang_common['Bad request']);
+
+	$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de supprimer le bannissement', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the bans cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_bans_cache();
+
+	redirect('admin_bans.php', 'Bannissement supprimÃ©. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissement';
+$focus_element = array('bans', 'new_ban_user');
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('bans');
+
+?>
+	<div class="blockform">
+		<h2><span>Nouveau bannissement</span></h2>
+		<div class="box">
+			<form id="bans" method="post" action="admin_bans.php?action=more">
+				<div class="inform">
+					<fieldset>
+						<legend>Ajouter un bannissement</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom d'utilisateur<div><input type="submit" name="add_ban" value=" Ajouter " tabindex="2" /></div></th>
+									<td>
+										<input type="text" name="new_ban_user" size="25" maxlength="25" tabindex="1" />
+										<span>Le nom d'utilisateur Ã  bannir (insensible Ã  la casse). La page suivante vous permettra d'entrer une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> et/ou une adresse e-mail de votre choix. Si vous souhaitez bannir une adresse <acronym title="Internet Protocol" lang="en">IP</acronym>, une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail, laissez simplement ce champ vide.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+
+		<h2 class="block2"><span>Bannissements actuels</span></h2>
+		<div class="box">
+			<div class="fakeform">
+<?php
+
+$result = $db->query('SELECT id, username, ip, email, message, expire FROM '.$db->prefix.'bans ORDER BY id') or error('Impossible de retrouver la liste des bannissements', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+	while ($cur_ban = $db->fetch_assoc($result))
+	{
+		$expire = format_time($cur_ban['expire'], true);
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend>Date d'Ã©chÃ©ance&#160;: <?php echo $expire ?></legend>
+						<div class="infldset">
+							<table cellspacing="0">
+<?php if ($cur_ban['username'] != ''): ?>								<tr>
+									<th>Nom d'utilisateur</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['username']) ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['email'] != ''): ?>								<tr>
+									<th>E-mail</th>
+									<td><?php echo $cur_ban['email'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['ip'] != ''): ?>								<tr>
+									<th><acronym title="Internet Protocol" lang="en">IP</acronym>/plage d'<acronym title="Internet Protocol" lang="en">IP</acronym></th>
+									<td><?php echo $cur_ban['ip'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['message'] != ''): ?>								<tr>
+									<th>Motif</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['message']) ?></td>
+								</tr>
+<?php endif; ?>							</table>
+							<p class="linkactions"><a href="admin_bans.php?edit_ban=<?php echo $cur_ban['id'] ?>">Modifier</a> - <a href="admin_bans.php?del_ban=<?php echo $cur_ban['id'] ?>">Supprimer</a></p>
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t\t".'<p>Aucun bannissement Ã  lister.</p>'."\n";
+
+?>
+			</div>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_categories.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_categories.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_categories.php	(revision 1)
@@ -0,0 +1,258 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+// Add a new category
+if (isset($_POST['add_cat']))
+{
+	confirm_referrer('admin_categories.php');
+
+	$new_cat_name = trim($_POST['new_cat_name']);
+	if ($new_cat_name == '')
+		message('Vous devez saisir un nom pour la nouvelle catÃ©gorie.');
+
+	$db->query('INSERT INTO '.$db->prefix.'categories (cat_name) VALUES(\''.$db->escape($new_cat_name).'\')') or error('Impossible de crÃ©er la catÃ©gorie', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_categories.php', 'CatÃ©gorie ajoutÃ©e. Redirection ...');
+}
+
+
+// Delete a category
+else if (isset($_POST['del_cat']) || isset($_POST['del_cat_comply']))
+{
+	confirm_referrer('admin_categories.php');
+
+	$cat_to_delete = intval($_POST['cat_to_delete']);
+	if ($cat_to_delete < 1)
+		message($lang_common['Bad request']);
+
+	if (isset($_POST['del_cat_comply']))	// Delete a category with all forums and posts
+	{
+		@set_time_limit(0);
+
+		$result = $db->query('SELECT id FROM '.$db->prefix.'forums WHERE cat_id='.$cat_to_delete) or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+		$num_forums = $db->num_rows($result);
+
+		for ($i = 0; $i < $num_forums; ++$i)
+		{
+			$cur_forum = $db->result($result, $i);
+
+			// Prune all posts and topics
+			prune($cur_forum, 1, -1);
+
+			// Delete the forum
+			$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$cur_forum) or error('Impossible de supprimer le forum', __FILE__, __LINE__, $db->error());
+		}
+
+		// Locate any "orphaned redirect topics" and delete them
+		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Impossible de retrouver les sujets de redirection', __FILE__, __LINE__, $db->error());
+		$num_orphans = $db->num_rows($result);
+
+		if ($num_orphans)
+		{
+			for ($i = 0; $i < $num_orphans; ++$i)
+				$orphans[] = $db->result($result, $i);
+
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Impossible de supprimer les sujets de redirection', __FILE__, __LINE__, $db->error());
+		}
+
+		// Delete the category
+		$db->query('DELETE FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Impossible de supprimer la catÃ©gorie', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_categories.php', 'CatÃ©gorie supprimÃ©e. Redirection ...');
+	}
+	else	// If the user hasn't comfirmed the delete
+	{
+		$result = $db->query('SELECT cat_name FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Impossible de retrouver les informations de la catÃ©gorie', __FILE__, __LINE__, $db->error());
+		$cat_name = $db->result($result);
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / CatÃ©gories';
+		require PUN_ROOT.'header.php';
+
+		generate_admin_menu('categories');
+
+?>
+	<div class="blockform">
+		<h2><span>Supprimer une catÃ©gorie</span></h2>
+		<div class="box">
+			<form method="post" action="admin_categories.php">
+				<div class="inform">
+				<input type="hidden" name="cat_to_delete" value="<?php echo $cat_to_delete ?>" />
+					<fieldset>
+						<legend>Confirmez la supression de la catÃ©gorie</legend>
+						<div class="infldset">
+							<p>Ãtes vous sÃ»r de vouloir supprimer la catÃ©gorie "<?php echo $cat_name ?>"&#160;?</p>
+							<p>ATTENTION ! Supprimer cette catÃ©gorie supprimera en mÃªme temps tous les forums et messages (s'il y en a) prÃ©sents dans cette catÃ©gorie&#160;!</p>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="del_cat_comply" value=" Supprimer " /><a href="javascript:history.go(-1)">Retour</a></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+		require PUN_ROOT.'footer.php';
+	}
+}
+
+
+else if (isset($_POST['update']))	// Change position and name of the categories
+{
+	confirm_referrer('admin_categories.php');
+
+	$cat_order = $_POST['cat_order'];
+	$cat_name = $_POST['cat_name'];
+
+	$result = $db->query('SELECT id, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+	$num_cats = $db->num_rows($result);
+
+	for ($i = 0; $i < $num_cats; ++$i)
+	{
+		if ($cat_name[$i] == '')
+			message('Vous devez saisir un nom de catÃ©gorie.');
+
+		if (!preg_match('#^\d+$#', $cat_order[$i]))
+			message('La position doit Ãªtre un nombre entier.');
+
+		list($cat_id, $position) = $db->fetch_row($result);
+
+		$db->query('UPDATE '.$db->prefix.'categories SET cat_name=\''.$db->escape($cat_name[$i]).'\', disp_position='.$cat_order[$i].' WHERE id='.$cat_id) or error('Impossible de modifier les catÃ©gories', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_quickjump_cache();
+
+	redirect('admin_categories.php', 'CatÃ©gories modifiÃ©es. Redirection ...');
+}
+
+
+// Generate an array with all categories
+$result = $db->query('SELECT id, cat_name, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+$num_cats = $db->num_rows($result);
+
+for ($i = 0; $i < $num_cats; ++$i)
+	$cat_list[] = $db->fetch_row($result);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / CatÃ©gories';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('categories');
+
+?>
+	<div class="blockform">
+		<h2><span>Ajouter/supprimer/modifier les catÃ©gories</span></h2>
+		<div class="box">
+		<form method="post" action="admin_categories.php?action=foo">
+			<div class="inform">
+				<fieldset>
+					<legend>Ajouter/supprimer une catÃ©gorie</legend>
+					<div class="infldset">
+						<table class="aligntop" cellspacing="0">
+							<tr>
+								<th scope="row">Ajouter une catÃ©gorie<div><input type="submit" name="add_cat" value=" Ajouter " tabindex="2" /></div></th>
+								<td>
+									<input type="text" name="new_cat_name" size="35" maxlength="80" tabindex="1" />
+									<span>Saisissez le nom de la catÃ©gorie que vous souhaitez ajouter. Vous pourrez modifier ce nom plus tard (voir ci-dessous). Pour ajouter des forums Ã  une nouvelle catÃ©gorie, allez Ã  la page de gestion des <a href="admin_forums.php">Forums</a>.</span>
+								</td>
+							</tr>
+<?php if ($num_cats): ?>							<tr>
+								<th scope="row">Supprimer une catÃ©gorie<div><input type="submit" name="del_cat" value=" Supprimer " tabindex="4" /></div></th>
+								<td>
+									<select name="cat_to_delete" tabindex="3">
+<?php
+
+	while (list(, list($cat_id, $cat_name, ,)) = @each($cat_list))
+		echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cat_id.'">'.pun_htmlspecialchars($cat_name).'</option>'."\n";
+
+?>
+									</select>
+									<span>Choisissez le nom de la catÃ©gorie que vous souhaitez supprimer. Vous serez invitÃ©s Ã  confirmer votre choix de catÃ©gorie Ã  supprimer avant qu'elle ne soit effectivement supprimÃ©e.</span>
+								</td>
+							</tr>
+<?php endif; ?>						</table>
+					</div>
+				</fieldset>
+			</div>
+<?php if ($num_cats): ?>			<div class="inform">
+				<fieldset>
+					<legend>Modifier les catÃ©gories</legend>
+					<div class="infldset">
+						<table id="categoryedit" cellspacing="0" >
+						<thead>
+							<tr>
+								<th class="tcl" scope="col">Nom</th>
+								<th scope="col">Position</th>
+								<th>&#160;</th>
+							</tr>
+						</thead>
+						<tbody>
+<?php
+
+	@reset($cat_list);
+	for ($i = 0; $i < $num_cats; ++$i)
+	{
+		list(, list($cat_id, $cat_name, $position)) = @each($cat_list);
+
+?>
+							<tr><td><input type="text" name="cat_name[<?php echo $i ?>]" value="<?php echo pun_htmlspecialchars($cat_name) ?>" size="35" maxlength="80" /></td><td><input type="text" name="cat_order[<?php echo $i ?>]" value="<?php echo $position ?>" size="3" maxlength="3" /></td><td>&#160;</td></tr>
+<?php
+
+	}
+
+?>
+						</tbody>
+						</table>
+						<div class="fsetsubmit"><input type="submit" name="update" value=" Modifier " /></div>
+					</div>
+				</fieldset>
+			</div>
+<?php endif; ?>		</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_censoring.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_censoring.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_censoring.php	(revision 1)
@@ -0,0 +1,167 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD)
+	message($lang_common['No permission']);
+
+
+// Add a censor word
+if (isset($_POST['add_word']))
+{
+	confirm_referrer('admin_censoring.php');
+
+	$search_for = trim($_POST['new_search_for']);
+	$replace_with = trim($_POST['new_replace_with']);
+
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
+
+	$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Impossible d\'ajouter un mot Ã  censurer', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_censoring.php', 'Mot Ã  censurer ajoutÃ©. Redirection ...');
+}
+
+
+// Update a censor word
+else if (isset($_POST['update']))
+{
+	confirm_referrer('admin_censoring.php');
+
+	$id = intval(key($_POST['update']));
+
+	$search_for = trim($_POST['search_for'][$id]);
+	$replace_with = trim($_POST['replace_with'][$id]);
+
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
+
+	$db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Impossible de mettre Ã  jour le mot Ã  censurer', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_censoring.php', 'Mot Ã  censurer modifiÃ©. Redirection ...');
+}
+
+
+// Remove a censor word
+else if (isset($_POST['remove']))
+{
+	confirm_referrer('admin_censoring.php');
+
+	$id = intval(key($_POST['remove']));
+
+	$db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Impossible de supprimer le mot Ã  censurer', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_censoring.php', 'Mot Ã  censurer supprimÃ©. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Mots Ã  censurer';
+$focus_element = array('censoring', 'new_search_for');
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('censoring');
+
+?>
+	<div class="blockform">
+		<h2><span>Mots Ã  censurer</span></h2>
+		<div class="box">
+			<form id="censoring" method="post" action="admin_censoring.php?action=foo">
+				<div class="inform">
+					<fieldset>
+						<legend>Ajouter un mot Ã  censurer</legend>
+						<div class="infldset">
+							<p>Saisissez le mot que vous voulez censurer ainsi que le texte qui le remplacera. Les caractÃšres joker sont permis  (ex: *fleur* vÃ©rifiera Â«&#160;fleurette&#160;Â» et Â«&#160;gonfleur&#160;Â» ). Les mots censurÃ©s affectent Ã©galement les noms d'utilisateurs. Un nouvel utilisateur ne pourrait s'inscrire avec un nom d'utilisateur qui contiendrait un des mots censurÃ©s. La recherche est insensible Ã  la casse. <strong>Les mots censurÃ©s doivent Ãªtres activÃ©s Ã  la page <a href="admin_options.php#censoring">Options</a> pour qu'ils aient un quelconque effet.</strong></p>
+							<table  cellspacing="0">
+							<thead>
+								<tr>
+									<th class="tcl" scope="col">Mot Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Action</th>
+								</tr>
+							</thead>
+							<tbody>
+								<tr>
+									<td><input type="text" name="new_search_for" size="24" maxlength="60" tabindex="1" /></td>
+									<td><input type="text" name="new_replace_with" size="24" maxlength="60" tabindex="2" /></td>
+									<td><input type="submit" name="add_word" value=" Add " tabindex="3" /></td>
+								</tr>
+							</tbody>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Modifier/supprimer des mots Ã  censurer</legend>
+						<div class="infldset">
+<?php
+
+$result = $db->query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Impossible de retrouver la liste des mots Ã  censurer', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+
+?>
+							<table cellspacing="0" >
+							<thead>
+								<tr>
+									<th class="tcl" scope="col">Mots Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Actions</th>
+								</tr>
+							</thead>
+							<tbody>
+<?php
+
+	while ($cur_word = $db->fetch_assoc($result))
+		echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="search_for['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['search_for']).'" size="24" maxlength="60" /></td><td><input type="text" name="replace_with['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['replace_with']).'" size="24" maxlength="60" /></td><td><input type="submit" name="update['.$cur_word['id'].']" value=" Modifier " />&#160;<input type="submit" name="remove['.$cur_word['id'].']" value=" Supprimer " /></td></tr>'."\n";
+
+?>
+							</tbody>
+							</table>
+<?php
+
+}
+else
+	echo "\t\t\t\t\t\t\t".'<p>Aucun mot Ã  censurer dans la liste.</p>'."\n";
+
+?>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_forums.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_forums.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_forums.php	(revision 1)
@@ -0,0 +1,459 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+// Add a "default" forum
+if (isset($_POST['add_forum']))
+{
+	confirm_referrer('admin_forums.php');
+
+	$add_to_cat = intval($_POST['add_to_cat']);
+	if ($add_to_cat < 1)
+		message($lang_common['Bad request']);
+
+	$db->query('INSERT INTO '.$db->prefix.'forums (cat_id) VALUES('.$add_to_cat.')') or error('Impossible de crÃ©er un nouveau forum', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_quickjump_cache();
+
+	redirect('admin_forums.php', 'Forum ajoutÃ©. Redirection ...');
+}
+
+
+// Delete a forum
+else if (isset($_GET['del_forum']))
+{
+	confirm_referrer('admin_forums.php');
+
+	$forum_id = intval($_GET['del_forum']);
+	if ($forum_id < 1)
+		message($lang_common['Bad request']);
+
+	if (isset($_POST['del_forum_comply']))	// Delete a forum with all posts
+	{
+		@set_time_limit(0);
+
+		// Prune all posts and topics
+		prune($forum_id, 1, -1);
+
+		// Locate any "orphaned redirect topics" and delete them
+		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Impossible de retrouver les sujets de redirection', __FILE__, __LINE__, $db->error());
+		$num_orphans = $db->num_rows($result);
+
+		if ($num_orphans)
+		{
+			for ($i = 0; $i < $num_orphans; ++$i)
+				$orphans[] = $db->result($result, $i);
+
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Impossible de supprimer les sujets de redirection', __FILE__, __LINE__, $db->error());
+		}
+
+		// Delete the forum and any forum specific group permissions
+		$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de supprimer un forum', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupe du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_forums.php', 'Forum supprimÃ©. Redirection ...');
+	}
+	else	// If the user hasn't confirmed the delete
+	{
+		$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
+		$forum_name = pun_htmlspecialchars($db->result($result));
+
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
+		require PUN_ROOT.'header.php';
+
+		generate_admin_menu('forums');
+
+?>
+	<div class="blockform">
+		<h2><span>Confirmez la suppresion du forum</span></h2>
+		<div class="box">
+			<form method="post" action="admin_forums.php?del_forum=<?php echo $forum_id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend>Important ! Lire attentivement avant de procÃ©der Ã  la suppression.</legend>
+						<div class="infldset">
+							<p>Ãtes vous sÃ»r de vouloir supprimer le forum "<?php echo $forum_name ?>"&#160;?</p>
+							<p>ATTENTION ! Supprimer un forum effacera tous les messages (s'il y en a) prÃ©sent dans ce forum&#160;!</p>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="del_forum_comply" value=" Supprimer " /><a href="javascript:history.go(-1)">Retour</a></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+		require PUN_ROOT.'footer.php';
+	}
+}
+
+
+// Update forum positions
+else if (isset($_POST['update_positions']))
+{
+	confirm_referrer('admin_forums.php');
+
+	while (list($forum_id, $disp_position) = @each($_POST['position']))
+	{
+		if (!preg_match('#^\d+$#', $disp_position))
+			message('La position doit Ãªtre un nombre entier.');
+
+		$db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour les forums', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_quickjump_cache();
+
+	redirect('admin_forums.php', 'Forums modifiÃ©s. Redirection ...');
+}
+
+
+else if (isset($_GET['edit_forum']))
+{
+	$forum_id = intval($_GET['edit_forum']);
+	if ($forum_id < 1)
+		message($lang_common['Bad request']);
+
+	// Update group permissions for $forum_id
+	if (isset($_POST['save']))
+	{
+		confirm_referrer('admin_forums.php');
+
+		// Start with the forum details
+		$forum_name = trim($_POST['forum_name']);
+		$forum_desc = pun_linebreaks(trim($_POST['forum_desc']));
+		$cat_id = intval($_POST['cat_id']);
+		$sort_by = intval($_POST['sort_by']);
+		$redirect_url = isset($_POST['redirect_url']) ? trim($_POST['redirect_url']) : null;
+
+		if ($forum_name == '')
+			message('Vous devez saisir un nom de forum.');
+
+		if ($cat_id < 1)
+			message($lang_common['Bad request']);
+
+		$forum_desc = ($forum_desc != '') ? '\''.$db->escape($forum_desc).'\'' : 'NULL';
+		$redirect_url = ($redirect_url != '') ? '\''.$db->escape($redirect_url).'\'' : 'NULL';
+
+		$db->query('UPDATE '.$db->prefix.'forums SET forum_name=\''.$db->escape($forum_name).'\', forum_desc='.$forum_desc.', redirect_url='.$redirect_url.', sort_by='.$sort_by.', cat_id='.$cat_id.' WHERE id='.$forum_id) or error('Impossible de modifier le forum', __FILE__, __LINE__, $db->error());
+
+		// Now let's deal with the permissions
+		if (isset($_POST['read_forum_old']))
+		{
+			$result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Impossible de retrouver la liste des groupes d\'utilisateurs', __FILE__, __LINE__, $db->error());
+			while ($cur_group = $db->fetch_assoc($result))
+			{
+				$read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']];
+				$post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0';
+				$post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0';
+
+				// Check if the new settings differ from the old
+				if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']])
+				{
+					// If the new settings are identical to the default settings for this group, delete it's row in forum_perms
+					if ($read_forum_new == '1' && $post_replies_new == $cur_group['g_post_replies'] && $post_topics_new == $cur_group['g_post_topics'])
+						$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+					else
+					{
+						// Run an UPDATE and see if it affected a row, if not, INSERT
+						$db->query('UPDATE '.$db->prefix.'forum_perms SET read_forum='.$read_forum_new.', post_replies='.$post_replies_new.', post_topics='.$post_topics_new.' WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+						if (!$db->affected_rows())
+							$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$cur_group['g_id'].', '.$forum_id.', '.$read_forum_new.', '.$post_replies_new.', '.$post_topics_new.')') or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+					}
+				}
+			}
+		}
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_forums.php', 'Forum modifiÃ©. Redirection ...');
+	}
+	else if (isset($_POST['revert_perms']))
+	{
+		confirm_referrer('admin_forums.php');
+
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_forums.php?edit_forum='.$forum_id, 'Permissions remises Ã  leurs valeurs par dÃ©faut. Redirection ...');
+	}
+
+
+	// Fetch forum info
+	$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_common['Bad request']);
+
+	$cur_forum = $db->fetch_assoc($result);
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('forums');
+
+?>
+	<div class="blockform">
+		<h2><span>Modifier forum</span></h2>
+		<div class="box">
+			<form id="edit_forum" method="post" action="admin_forums.php?edit_forum=<?php echo $forum_id ?>">
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer modifications " tabindex="6" /></p>
+				<div class="inform">
+					<fieldset>
+						<legend>Modifier les dÃ©tails du forum</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom du forum</th>
+									<td><input type="text" name="forum_name" size="35" maxlength="80" value="<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?>" tabindex="1" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Description (<acronym title="HyperText Markup Language" lang="en">HTML</acronym>)</th>
+									<td><textarea name="forum_desc" rows="3" cols="50" tabindex="2"><?php echo pun_htmlspecialchars($cur_forum['forum_desc']) ?></textarea></td>
+								</tr>
+								<tr>
+									<th scope="row">CatÃ©gorie</th>
+									<td>
+										<select name="cat_id" tabindex="3">
+<?php
+
+	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+	while ($cur_cat = $db->fetch_assoc($result))
+	{
+		$selected = ($cur_cat['id'] == $cur_forum['cat_id']) ? ' selected="selected"' : '';
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'"'.$selected.'>'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n";
+	}
+
+?>
+										</select>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Trier les discussions par</th>
+									<td>
+										<select name="sort_by" tabindex="4">
+											<option value="0"<?php if ($cur_forum['sort_by'] == '0') echo ' selected="selected"' ?>>Derniers messages</option>
+											<option value="1"<?php if ($cur_forum['sort_by'] == '1') echo ' selected="selected"' ?>>Dates des discussions</option>
+										</select>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de redirection</th>
+									<td><?php echo ($cur_forum['num_topics']) ? 'Disponible uniquement pour les forums vides' : '<input type="text" name="redirect_url" size="45" maxlength="100" value="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" tabindex="5" />'; ?></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Modifier les permissions de groupes de ce forum</legend>
+						<div class="infldset">
+							<p>Avec ce formulaire vous pouvez rÃ©gler les permissions de ce forum spÃ©cifiques aux diffÃ©rents groupes d'utilisateurs. Si vous n'avez effectuÃ© aucune modification Ã  ces permissions de groupes, ce que vous voyez ci-dessous sont les permissions par dÃ©faut basÃ©es sur les paramÃštres des <a href="admin_groups.php">Groupes d'utilisateurs</a>. Les administrateurs ont toujours toutes les permissions et sont donc Ã©cartÃ©s. Les paramÃštres de permission qui diffÃšrent des permissions par dÃ©faut pour le groupe d'utilisateur sont signalÃ©s en rouge. La permission Â«&#160;Lire&#160;Â» pourra Ãªtre dÃ©sactivÃ©e si le groupe en question ne possÃšde pas la permission globale Â«&#160;Lire forums&#160;Â». Pour les forums de redirection seule la permission Â«&#160;Lire&#160;Â» est modifiable.</p>
+							<table id="forumperms" cellspacing="0">
+							<thead>
+								<tr>
+									<th class="atcl">&#160;</th>
+									<th>Lire le forum</th>
+									<th>Ãcrire des rÃ©ponses</th>
+									<th>Lancer des discussions</th>
+								</tr>
+							</thead>
+							<tbody>
+<?php
+
+	$result = $db->query('SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM '.$db->prefix.'groups AS g LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (g.g_id=fp.group_id AND fp.forum_id='.$forum_id.') WHERE g.g_id!='.PUN_ADMIN.' ORDER BY g.g_id') or error('Impossible de retrouver la liste des permissions de groupe du forum', __FILE__, __LINE__, $db->error());
+
+	while ($cur_perm = $db->fetch_assoc($result))
+	{
+		$read_forum = ($cur_perm['read_forum'] != '0') ? true : false;
+		$post_replies = (($cur_perm['g_post_replies'] == '0' && $cur_perm['post_replies'] == '1') || ($cur_perm['g_post_replies'] == '1' && $cur_perm['post_replies'] != '0')) ? true : false;
+		$post_topics = (($cur_perm['g_post_topics'] == '0' && $cur_perm['post_topics'] == '1') || ($cur_perm['g_post_topics'] == '1' && $cur_perm['post_topics'] != '0')) ? true : false;
+
+		// Determine if the current sittings differ from the default or not
+		$read_forum_def = ($cur_perm['read_forum'] == '0') ? false : true;
+		$post_replies_def = (($post_replies && $cur_perm['g_post_replies'] == '0') || (!$post_replies && ($cur_perm['g_post_replies'] == '' || $cur_perm['g_post_replies'] == '1'))) ? false : true;
+		$post_topics_def = (($post_topics && $cur_perm['g_post_topics'] == '0') || (!$post_topics && ($cur_perm['g_post_topics'] == '' || $cur_perm['g_post_topics'] == '1'))) ? false : true;
+
+?>
+								<tr>
+									<th class="atcl"><?php echo pun_htmlspecialchars($cur_perm['g_title']) ?></th>
+									<td<?php if (!$read_forum_def) echo ' class="nodefault"'; ?>>
+										<input type="hidden" name="read_forum_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($read_forum) ? '1' : '0'; ?>" />
+										<input type="checkbox" name="read_forum_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($read_forum) ? ' checked="checked"' : ''; ?><?php echo ($cur_perm['g_read_board'] == '0') ? ' disabled="disabled"' : ''; ?> />
+									</td>
+									<td<?php if (!$post_replies_def && $cur_forum['redirect_url'] == '') echo ' class="nodefault"'; ?>>
+										<input type="hidden" name="post_replies_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($post_replies) ? '1' : '0'; ?>" />
+										<input type="checkbox" name="post_replies_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_replies) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> />
+									</td>
+									<td<?php if (!$post_topics_def && $cur_forum['redirect_url'] == '') echo ' class="nodefault"'; ?>>
+										<input type="hidden" name="post_topics_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($post_topics) ? '1' : '0'; ?>" />
+										<input type="checkbox" name="post_topics_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_topics) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> />
+									</td>
+								</tr>
+<?php
+
+	}
+
+?>
+							</tbody>
+							</table>
+							<div class="fsetsubmit"><input type="submit" name="revert_perms" value=" RÃ©tablir les permissions par dÃ©faut " /></div>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer modifications " /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('forums');
+
+?>
+	<div class="blockform">
+		<h2><span>Ajouter forum</span></h2>
+		<div class="box">
+			<form method="post" action="admin_forums.php?action=adddel">
+				<div class="inform">
+					<fieldset>
+						<legend>CrÃ©er un forum</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Ajouter un forum Ã  la catÃ©gorie<div><input type="submit" name="add_forum" value=" Ajouter " tabindex="2" /></div></th>
+									<td>
+										<select name="add_to_cat" tabindex="1">
+<?php
+
+	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+	while ($cur_cat = $db->fetch_assoc($result))
+		echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n";
+
+?>
+										</select>
+										<span>Choisissez la catÃ©gorie dans laquelle vous souhaitez ajouter un nouveau forum.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+
+		<h2 class="block2"><span>Modifier les forums</span></h2>
+		<div class="box">
+			<form id="edforum" method="post" action="admin_forums.php?action=edit">
+				<p class="submittop"><input type="submit" name="update_positions" value=" Modifier positions " tabindex="3" /></p>
+<?php
+
+$tabindex_count = 4;
+
+// Display all the categories and forums
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+if($db->num_rows($result)) :
+$cur_category = 0;
+while ($cur_forum = $db->fetch_assoc($result))
+{
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+	{
+		if ($cur_category != 0)
+			echo "\t\t\t\t\t\t\t".'</table>'."\n\t\t\t\t\t\t".'</div>'."\n\t\t\t\t\t".'</fieldset>'."\n\t\t\t\t".'</div>'."\n";
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend>CatÃ©gorie&#160;: <?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></legend>
+						<div class="infldset">
+							<table cellspacing="0">
+<?php
+
+		$cur_category = $cur_forum['cid'];
+	}
+
+?>
+								<tr>
+									<th><a href="admin_forums.php?edit_forum=<?php echo $cur_forum['fid'] ?>">Modifier</a> - <a href="admin_forums.php?del_forum=<?php echo $cur_forum['fid'] ?>">Supprimer</a></th>
+									<td>Position&#160;&#160;<input type="text" name="position[<?php echo $cur_forum['fid'] ?>]" size="3" maxlength="3" value="<?php echo $cur_forum['disp_position'] ?>" tabindex="<?php echo $tabindex_count ?>" />
+									&#160;&#160;<strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>
+								</tr>
+<?php
+
+	$tabindex_count += 2;
+}
+
+?>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+<?php endif; ?>
+				<p class="submitend"><input type="submit" name="update_positions" value=" Modifier positions " tabindex="<?php echo $tabindex_count ?>" /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_groups.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_groups.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_groups.php	(revision 1)
@@ -0,0 +1,469 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+// Add/edit a group (stage 1)
+if (isset($_POST['add_group']) || isset($_GET['edit_group']))
+{
+	if (isset($_POST['add_group']))
+	{
+		$base_group = intval($_POST['base_group']);
+
+		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$base_group) or error('Impossible de retrouver les informations de groupes utilisateurs', __FILE__, __LINE__, $db->error());
+		$group = $db->fetch_assoc($result);
+
+		$mode = 'add';
+	}
+	else	// We are editing a group
+	{
+		$group_id = intval($_GET['edit_group']);
+		if ($group_id < 1)
+			message($lang_common['Bad request']);
+
+		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Impossible de retrouver les informations de groupes utilisateurs', __FILE__, __LINE__, $db->error());
+		if (!$db->num_rows($result))
+			message($lang_common['Bad request']);
+
+		$group = $db->fetch_assoc($result);
+
+		$mode = 'edit';
+	}
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+	$required_fields = array('req_title' => 'Nom groupe');
+	$focus_element = array('groups2', 'req_title');
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('groups');
+
+?>
+	<div class="blockform">
+		<h2><span>RÃ©glages du groupe</span></h2>
+		<div class="box">
+			<form id="groups2" method="post" action="admin_groups.php" onsubmit="return process_form(this)">
+				<p class="submittop"><input type="submit" name="add_edit_group" value=" Enregistrer " /></p>
+				<div class="inform">
+					<input type="hidden" name="mode" value="<?php echo $mode ?>" />
+<?php if ($mode == 'edit'): ?>				<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
+<?php endif; ?><?php if ($mode == 'add'): ?>				<input type="hidden" name="base_group" value="<?php echo $base_group ?>" />
+<?php endif; ?>					<fieldset>
+						<legend>RÃ©glages des options et des permissions de groupe</legend>
+						<div class="infldset">
+							<p>Les options et permissions ci-dessous sont les permissions par dÃ©faut pour le groupe. Ces options s'appliquent s'il n'y a pas de rÃ©glages de permissions spÃ©cifiques Ã  un forum.</p>
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom groupe</th>
+									<td>
+										<input type="text" name="req_title" size="25" maxlength="50" value="<?php if ($mode == 'edit') echo pun_htmlspecialchars($group['g_title']); ?>" tabindex="1" />
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Titre utilisateur</th>
+									<td>
+										<input type="text" name="user_title" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($group['g_user_title']) ?>" tabindex="2" />
+										<span>Ce titre remplacera n'importe quel nom de rang que les utilisateurs de ce groupe auront atteint. Laissez vide pour utiliser le titre par dÃ©faut ou le rang.</span>
+									</td>
+								</tr>
+<?php if ($group['g_id'] != PUN_ADMIN): ?>								<tr>
+									<th scope="row">Lire forums</th>
+									<td>
+										<input type="radio" name="read_board" value="1"<?php if ($group['g_read_board'] == '1') echo ' checked="checked"' ?> tabindex="3" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="read_board" value="0"<?php if ($group['g_read_board'] == '0') echo ' checked="checked"' ?> tabindex="4" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  voir les forums. Ce rÃ©glage s'applique Ã  tous les aspects des forums et ne peut Ãªtre outrepassÃ© par les permissions spÃ©cifiques aux forums. Avec cette option Ã  non les utilisateurs de ce groupe ne pourront que s'identifier/se dÃ©connecter.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Ãcrire des rÃ©ponses</th>
+									<td>
+										<input type="radio" name="post_replies" value="1"<?php if ($group['g_post_replies'] == '1') echo ' checked="checked"' ?> tabindex="5" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="post_replies" value="0"<?php if ($group['g_post_replies'] == '0') echo ' checked="checked"' ?> tabindex="6" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  Ã©crire des rÃ©ponses aux discussions.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Lancer des discussions</th>
+									<td>
+										<input type="radio" name="post_topics" value="1"<?php if ($group['g_post_topics'] == '1') echo ' checked="checked"' ?> tabindex="7" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="post_topics" value="0"<?php if ($group['g_post_topics'] == '0') echo ' checked="checked"' ?> tabindex="8" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  lancer des nouveaux sujets.</span>
+									</td>
+								</tr>
+<?php if ($group['g_id'] != PUN_GUEST): ?>								<tr>
+									<th scope="row">Modifier messages</th>
+									<td>
+										<input type="radio" name="edit_posts" value="1"<?php if ($group['g_edit_posts'] == '1') echo ' checked="checked"' ?> tabindex="11" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="edit_posts" value="0"<?php if ($group['g_edit_posts'] == '0') echo ' checked="checked"' ?> tabindex="12" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  modifier leurs propres messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Effacer les messages</th>
+									<td>
+										<input type="radio" name="delete_posts" value="1"<?php if ($group['g_delete_posts'] == '1') echo ' checked="checked"' ?> tabindex="13" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="delete_posts" value="0"<?php if ($group['g_delete_posts'] == '0') echo ' checked="checked"' ?> tabindex="14" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  effacer leurs propres messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Effacer les discussions</th>
+									<td>
+										<input type="radio" name="delete_topics" value="1"<?php if ($group['g_delete_topics'] == '1') echo ' checked="checked"' ?> tabindex="15" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="delete_topics" value="0"<?php if ($group['g_delete_topics'] == '0') echo ' checked="checked"' ?> tabindex="16" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  effacer leurs propres sujets (y compris toutes les rÃ©ponses).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Titre personnalisÃ©</th>
+									<td>
+										<input type="radio" name="set_title" value="1"<?php if ($group['g_set_title'] == '1') echo ' checked="checked"' ?> tabindex="17" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="set_title" value="0"<?php if ($group['g_set_title'] == '0') echo ' checked="checked"' ?> tabindex="18" />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  modifier leur propre titre utilisateur.</span>
+									</td>
+								</tr>
+<?php endif; ?>								<tr>
+									<th scope="row">Utiliser la recherche</th>
+									<td>
+										<input type="radio" name="search" value="1"<?php if ($group['g_search'] == '1') echo ' checked="checked"' ?> tabindex="19" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="search" value="0"<?php if ($group['g_search'] == '0') echo ' checked="checked"' ?> tabindex="20" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  utiliser la fonction de recherche sur les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Recherche d'utilisateur</th>
+									<td>
+										<input type="radio" name="search_users" value="1"<?php if ($group['g_search_users'] == '1') echo ' checked="checked"' ?> tabindex="21" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="search_users" value="0"<?php if ($group['g_search_users'] == '0') echo ' checked="checked"' ?> tabindex="22" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  utiliser	un texte libre pour rechercher dans la liste des utilisateurs.</span>
+									</td>
+								</tr>
+<?php if ($group['g_id'] != PUN_GUEST): ?>								<tr>
+									<th scope="row">Intervalle pour modifier le sujet d'une discussion</th>
+									<td>
+										<input type="text" name="edit_subjects_interval" size="5" maxlength="5" value="<?php echo $group['g_edit_subjects_interval'] ?>" tabindex="23" />
+										<span>Nombre de secondes aprÃšs que le message ait Ã©tÃ© envoyÃ© pendant lesquelles les utilisateurs de ce groupe pourront modifier le sujet d'une discussion qu'ils viennent de lancer. Mettre Ã  0 pour permettre la modification du sujet des discussions sans restriction dans le temps.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Intervalle de contrÃŽle de flood sur les messages</th>
+									<td>
+										<input type="text" name="post_flood" size="5" maxlength="4" value="<?php echo $group['g_post_flood'] ?>" tabindex="24" />
+										<span>Nombre de secondes pendant lesquelles les utilisateurs de ce groupe devront patienter entre deux messages. Mettre Ã  0 pour dÃ©sactiver le contrÃŽle de flood sur les messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Intervalle de contrÃŽle de flood sur les recherches</th>
+									<td>
+										<input type="text" name="search_flood" size="5" maxlength="4" value="<?php echo $group['g_search_flood'] ?>" tabindex="25" />
+										<span>Nombre de secondes pendant lesquelles les utilisateurs de ce groupe devront patienter entre deux recherches. Mettre Ã  0 pour dÃ©sactiver le contrÃŽle de flood sur les recherches.</span>
+									</td>
+								</tr>
+<?php endif; ?><?php endif; ?>							</table>
+<?php if ($group['g_id'] == PUN_MOD ): ?>							<p class="warntext">Pour qu'un utilisateur de ce groupe acquiÃšre les compÃ©tences de modÃ©rateur, il devra nÃ©cessairement Ãªtre dÃ©signÃ© comme modÃ©rateur d'un ou de plusieurs forums. Ceci est possible depuis la page d'administration du profil de l'utilisateur.</p>
+<?php endif; ?>						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="add_edit_group" value=" Enregistrer " tabindex="26" /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+// Add/edit a group (stage 2)
+else if (isset($_POST['add_edit_group']))
+{
+	confirm_referrer('admin_groups.php');
+
+	// Is this the admin group? (special rules apply)
+	$is_admin_group = (isset($_POST['group_id']) && $_POST['group_id'] == PUN_ADMIN) ? true : false;
+
+	$title = trim($_POST['req_title']);
+	$user_title = trim($_POST['user_title']);
+	$read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1';
+	$post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1';
+	$post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1';
+	$edit_posts = isset($_POST['edit_posts']) ? intval($_POST['edit_posts']) : ($is_admin_group) ? '1' : '0';
+	$delete_posts = isset($_POST['delete_posts']) ? intval($_POST['delete_posts']) : ($is_admin_group) ? '1' : '0';
+	$delete_topics = isset($_POST['delete_topics']) ? intval($_POST['delete_topics']) : ($is_admin_group) ? '1' : '0';
+	$set_title = isset($_POST['set_title']) ? intval($_POST['set_title']) : ($is_admin_group) ? '1' : '0';
+	$search = isset($_POST['search']) ? intval($_POST['search']) : '1';
+	$search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1';
+	$edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0';
+	$post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';
+	$search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';
+
+	if ($title == '')
+		message('Vous devez saisir un nom de groupe.');
+
+	$user_title = ($user_title != '') ? '\''.$db->escape($user_title).'\'' : 'NULL';
+
+	if ($_POST['mode'] == 'add')
+	{
+		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Impossible de vÃ©rifier si un groupe porte dÃ©jÃ  ce nom', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+			message('Il existe dÃ©jÃ  un groupe nommÃ© \''.pun_htmlspecialchars($title).'\'.');
+
+		$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Impossible d\'ajouter le groupe', __FILE__, __LINE__, $db->error());
+		$new_group_id = $db->insert_id();
+
+		// Now lets copy the forum specific permissions from the group which this group is based on
+		$result = $db->query('SELECT forum_id, read_forum, post_replies, post_topics FROM '.$db->prefix.'forum_perms WHERE group_id='.intval($_POST['base_group'])) or error('Impossible de retrouver la liste des permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+		while ($cur_forum_perm = $db->fetch_assoc($result))
+			$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+	}
+	else
+	{
+		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('impossible de vÃ©rifier une Ã©ventuelle collision des titres de groupes', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+			message('Il existe dÃ©jÃ  un groupe nommÃ© \''.pun_htmlspecialchars($title).'\'.');
+
+		$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Impossible de modifier le groupe', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_quickjump_cache();
+
+	redirect('admin_groups.php', 'Groupe '.(($_POST['mode'] == 'edit') ? 'modifiÃ©' : 'ajoutÃ©').'. Redirection ...');
+}
+
+
+// Set default group
+else if (isset($_POST['set_default_group']))
+{
+	confirm_referrer('admin_groups.php');
+
+	$group_id = intval($_POST['default_group']);
+	if ($group_id < 1)
+		message($lang_common['Bad request']);
+
+	$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Impossible de modifier la configuration des forums', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the config cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+
+	redirect('admin_groups.php', 'Groupe par dÃ©faut rÃ©glÃ©. Redirection ...');
+}
+
+
+// Remove a group
+else if (isset($_GET['del_group']))
+{
+	confirm_referrer('admin_groups.php');
+
+	$group_id = intval($_GET['del_group']);
+	if ($group_id < 5)
+		message($lang_common['Bad request']);
+
+	// Make sure we don't remove the default group
+	if ($group_id == $pun_config['o_default_user_group'])
+		message('Le groupe par dÃ©faut ne peut Ãªtre supprimÃ©. Vous devez d\'abord dÃ©finir un groupe par dÃ©faut diffÃ©rent.');
+
+
+	// Check if this group has any members
+	$result = $db->query('SELECT g.g_title, COUNT(u.id) FROM '.$db->prefix.'groups AS g INNER JOIN '.$db->prefix.'users AS u ON g.g_id=u.group_id WHERE g.g_id='.$group_id.' GROUP BY g.g_id, g_title') or error('Impossible de retrouver les informations du groupe', __FILE__, __LINE__, $db->error());
+
+	// If the group doesn't have any members or if we've already selected a group to move the members to
+	if (!$db->num_rows($result) || isset($_POST['del_group']))
+	{
+		if (isset($_POST['del_group']))
+		{
+			$move_to_group = intval($_POST['move_to_group']);
+			$db->query('UPDATE '.$db->prefix.'users SET group_id='.$move_to_group.' WHERE group_id='.$group_id) or error('Impossible de dÃ©placer les utilisateurs dans le groupe', __FILE__, __LINE__, $db->error());
+		}
+
+		// Delete the group and any forum specific permissions
+		$db->query('DELETE FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Impossible de supprimer le groupe', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$group_id) or error('Impossible de supprimer les permissions de groupe du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_groups.php', 'Groupe supprimÃ©. Redirection ...');
+	}
+
+
+	list($group_title, $group_members) = $db->fetch_row($result);
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('groups');
+
+?>
+	<div class="blockform">
+		<h2><span>Supprimer groupe</span></h2>
+		<div class="box">
+			<form id="groups" method="post" action="admin_groups.php?del_group=<?php echo $group_id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend>DÃ©placer les utilisateur de ce groupe</legend>
+						<div class="infldset">
+							<p>Il y a actuellement <?php echo $group_members ?> membres dans le groupe "<?php echo pun_htmlspecialchars($group_title) ?>". Veuillez sÃ©lectionner un groupe dans lequel ces utilisateurs seront dÃ©placÃ©s.</p>
+							<label>DÃ©placer les utilisateurs dans
+							<select name="move_to_group">
+<?php
+
+	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' AND g_id!='.$group_id.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+	while ($cur_group = $db->fetch_assoc($result))
+	{
+		if ($cur_group['g_id'] == PUN_MEMBER)	// Pre-select the pre-defined Members group
+			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+		else
+			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+	}
+
+?>
+							</select>
+							</br></label>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="del_group" value=" Supprimer groupe " /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('groups');
+
+?>
+	<div class="blockform">
+		<h2><span>Ajouter/rÃ©gler groupes</span></h2>
+		<div class="box">
+			<form id="groups" method="post" action="admin_groups.php?action=foo">
+				<div class="inform">
+					<fieldset>
+						<legend>Ajouter un groupe</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nouveau groupe basÃ© sur le groupe<div><input type="submit" name="add_group" value=" Ajouter " tabindex="2" /></div></th>
+									<td>
+										<select id="base_group" name="base_group" tabindex="1">
+<?php
+
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+while ($cur_group = $db->fetch_assoc($result))
+{
+	if ($cur_group['g_id'] == $pun_config['o_default_user_group'])
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+	else
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+}
+
+?>
+										</select>
+										<span>Choisissez un groupe d'utilisateurs duquel le nouveau groupe hÃ©ritera les propriÃ©tÃ©s. La page suivante vous permettra d'affiner ces rÃ©glages.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>DÃ©finir le groupe par dÃ©faut</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Groupe par dÃ©faut<div><input type="submit" name="set_default_group" value=" Enregistrer " tabindex="4" /></div></th>
+									<td>
+										<select id="default_group" name="default_group" tabindex="3">
+<?php
+
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+while ($cur_group = $db->fetch_assoc($result))
+{
+	if ($cur_group['g_id'] == $pun_config['o_default_user_group'])
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+	else
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+}
+
+?>
+										</select>
+										<span>Choisissez le groupe que vous voulez dÃ©finir par dÃ©faut. C'est Ã  dire le groupe oÃ¹ les utilisateurs seront placÃ©s quand ils s'inscriront. Pour des raisons de sÃ©curitÃ©, par dÃ©faut les utilisateurs ne peuvent Ãªtre mis ni dans le groupe modÃ©rateur ni dans le groupe administrateur.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+
+		<h2 class="block2"><span>Groupes existants</span></h2>
+		<div class="box">
+			<div class="fakeform">
+				<div class="inform">
+					<fieldset>
+						<legend>Modifier/supprimer les groupes</legend>
+						<div class="infldset">
+							<p>Les groupes prÃ©-dÃ©finis InvitÃ©s, Administrateurs, ModÃ©rateurs et Membres ne peuvent Ãªtre supprimÃ©s. Il peuvent par contre Ãªtre modifiÃ©s. Mais suivant le groupe certaines options ne sont pas disponibles (<abbr title="exemple">ex.</abbr> la permission <em>modifier messages</em> pour les invitÃ©s). Les Administrateurs ont toujours toutes les permisssions.</p>
+							<table cellspacing="0">
+<?php
+
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups ORDER BY g_id') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+while ($cur_group = $db->fetch_assoc($result))
+	echo "\t\t\t\t\t\t\t\t".'<tr><th scope="row"><a href="admin_groups.php?edit_group='.$cur_group['g_id'].'">Modifier</a>'.(($cur_group['g_id'] > PUN_MEMBER) ? ' - <a href="admin_groups.php?del_group='.$cur_group['g_id'].'">Supprimer</a>' : '').'</th><td>'.pun_htmlspecialchars($cur_group['g_title']).'</td></tr>'."\n";
+
+?>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+			</div>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_index.php	(revision 1)
@@ -0,0 +1,230 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD)
+	message($lang_common['No permission']);
+
+
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+
+// Check for upgrade
+if ($action == 'check_upgrade')
+{
+	if (!ini_get('allow_url_fopen'))
+		message('Impossible de vÃ©rifier les mises Ã  jour tant que \'allow_url_fopen\' est dÃ©sactivÃ© sur ce systÃšme.');
+
+	$fp = @fopen('http://www.punbb.org/latest_version', 'r');
+	$latest_version = trim(@fread($fp, 16));
+	@fclose($fp);
+
+	if ($latest_version == '')
+		message('La vÃ©rification de mise Ã  jour a Ã©chouÃ©e pour une raison inconnue.');
+
+	$cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version']));
+	$cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);
+
+	$latest_version = str_replace('.', '', strtolower($latest_version));
+	$latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);
+
+	if ($cur_version >= $latest_version)
+		message('Vous utilisez la derniÃšre version de PunBB.');
+	else
+		message('Une nouvelle version de PunBB est sortie ! Vous pouvez tÃ©lÃ©charger cette derniÃšre version sur <a href="http://www.punbb.org/">PunBB.org</a>.');
+}
+
+// Check for french upgrade
+if ($action == 'check_upgrade_fr')
+{
+	if (!ini_get('allow_url_fopen'))
+		message('Impossible de vÃ©rifier les mises Ã  jour tant que \'allow_url_fopen\' est dÃ©sactivÃ© sur ce systÃšme.');
+
+	$fp = @fopen('http://www.punbb.fr/latest_version', 'r');
+	$latest_version = trim(@fread($fp, 16));
+	@fclose($fp);
+
+	if ($latest_version == '')
+		message('La vÃ©rification de mise Ã  jour a Ã©chouÃ©e pour une raison inconnue.');
+
+	$cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version_fr']));
+	$cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);
+
+	$latest_version = str_replace('.', '', strtolower($latest_version));
+	$latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);
+
+	if ($cur_version >= $latest_version)
+		message('Vous utilisez la derniÃšre version de PunBB en franÃ§ais.');
+	else
+		message('Une nouvelle version de PunBB en franÃ§ais est sortie ! Vous pouvez tÃ©lÃ©charger cette derniÃšre version sur <a href="http://www.punbb.fr/">PunBB.fr</a>.');
+}
+
+
+// Show phpinfo() output
+else if ($action == 'phpinfo' && $pun_user['g_id'] == PUN_ADMIN)
+{
+	// Is phpinfo() a disabled function?
+	if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false)
+		message('La fonction phpinfo() de PHP est dÃ©sactivÃ©e sur ce serveur.');
+
+	phpinfo();
+	exit;
+}
+
+
+// Get the server load averages (if possible)
+if (@file_exists('/proc/loadavg') && is_readable('/proc/loadavg'))
+{
+	// We use @ just in case
+	$fh = @fopen('/proc/loadavg', 'r');
+	$load_averages = @fread($fh, 64);
+	@fclose($fh);
+
+	$load_averages = @explode(' ', $load_averages);
+	$server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Indisponible';
+}
+else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))
+	$server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3];
+else
+	$server_load = 'Indisponible';
+
+
+// Get number of current visitors
+$result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Impossible de retrouver le total d\'utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+$num_online = $db->result($result);
+
+
+// Get the database system version
+switch ($db_type)
+{
+	case 'sqlite':
+		$db_version = 'SQLite '.sqlite_libversion();
+		break;
+
+	default:
+		$result = $db->query('SELECT VERSION()') or error('Impossible de retrouver les informations utilisateurs', __FILE__, __LINE__, $db->error());
+		$db_version = $db->result($result);
+		break;
+}
+
+
+// Collect some additional info about MySQL
+if ($db_type == 'mysql' || $db_type == 'mysqli')
+{
+	$db_version = 'MySQL '.$db_version;
+
+	// Calculate total db size/row count
+	$result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Impossible de retrouver le statut des tables', __FILE__, __LINE__, $db->error());
+
+	$total_records = $total_size = 0;
+	while ($status = $db->fetch_assoc($result))
+	{
+		$total_records += $status['Rows'];
+		$total_size += $status['Data_length'] + $status['Index_length'];
+	}
+
+	$total_size = $total_size / 1024;
+
+	if ($total_size > 1024)
+		$total_size = round($total_size / 1024, 2).' MB';
+	else
+		$total_size = round($total_size, 2).' KB';
+}
+
+
+// See if MMCache or PHPA is loaded
+if (function_exists('mmcache'))
+	$php_accelerator = '<a href="http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
+else if (isset($_PHPA))
+	$php_accelerator = '<a href="http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
+else
+	$php_accelerator = 'N/A';
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('index');
+
+?>
+	<div class="block">
+		<h2>Administration Forum</h2>
+		<div id="adintro" class="box">
+			<div class="inbox">
+				<p>Bienvenue sur le panneau de contrÃŽles de  PunBB. Depuis cet espace vous pouvez contrÃŽler les points essentiels de votre forum. Selon que vous Ãªtes un administrateur ou un modÃ©rateur vous pouvez&#160;:<br /><br />
+					&#160;- organiser les catÃ©gories et les forums.<br />
+					&#160;- rÃ©gler les principales options et prÃ©fÃ©rences.<br />
+					&#160;- contrÃŽler les permissions pour les utilisateurs et les visiteurs.<br />
+					&#160;- voir les statistiques des IP pour les utilisateurs.<br />
+					&#160;- bannir des utilisateurs.<br />
+					&#160;- censurer des mots.<br />
+					&#160;- rÃ©gler les rangs des utilisateurs.<br />
+					&#160;- Ã©laguer les anciens messages.<br />
+					&#160;- traiter les messages signalÃ©s.
+				</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>Statistiques</span></h2>
+		<div id="adstats" class="box">
+			<div class="inbox">
+				<dl>
+					<dt>PunBB version</dt>
+					<dd>
+						PunBB version franÃ§aise <?php echo $pun_config['o_cur_version_fr'] ?> basÃ©e sur PunBB <?php echo $pun_config['o_cur_version'] ?><br />
+						<a href="admin_index.php?action=check_upgrade">VÃ©rifier la version officielle</a> - <a href="admin_index.php?action=check_upgrade_fr">VÃ©rifier la version franÃ§aise</a> <br />
+						&copy; Copyright 2002, 2003, 2004, 2005 Rickard Andersson
+					</dd>
+					<dt>ExÃ©cution serveur</dt>
+					<dd>
+						<?php echo $server_load ?> (<?php echo $num_online ?> utilisateurs en ligne)
+					</dd>
+<?php if ($pun_user['g_id'] == PUN_ADMIN): ?>					<dt>Environnement</dt>
+					<dd>
+						SystÃšme d'exploitation&#160;: <?php echo PHP_OS ?><br />
+						PHP&#160;: <?php echo phpversion() ?> - <a href="admin_index.php?action=phpinfo">Afficher infos</a><br />
+						AccÃ©lÃ©rateur PHP&#160;: <?php echo $php_accelerator."\n" ?>
+					</dd>
+					<dt>Base de donnÃ©es</dt>
+					<dd>
+						<?php echo $db_version."\n" ?>
+<?php if (isset($total_records) && isset($total_size)): ?>						<br />Lignes&#160;: <?php echo $total_records."\n" ?>
+						<br />Taille&#160;: <?php echo $total_size."\n" ?>
+<?php endif; endif; ?>					</dd>
+				</dl>
+			</div>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_loader.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_loader.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_loader.php	(revision 1)
@@ -0,0 +1,72 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD)
+	message($lang_common['No permission']);
+
+
+// The plugin to load should be supplied via GET
+$plugin = isset($_GET['plugin']) ? $_GET['plugin'] : '';
+if (!preg_match('/^AM?P_(\w*?)\.php$/i', $plugin))
+	message($lang_common['Bad request']);
+
+// AP_ == Admins only, AMP_ == admins and moderators
+$prefix = substr($plugin, 0, strpos($plugin, '_'));
+if ($pun_user['g_id'] == PUN_MOD && $prefix == 'AP')
+	message($lang_common['No permission']);
+
+// Make sure the file actually exists
+if (!file_exists(PUN_ROOT.'plugins/'.$plugin))
+	message('Il n\'y a pas de plugin nommÃ© \''.$plugin.'\' dans le rÃ©pertoire de plugin.');
+
+// Construct REQUEST_URI if it isn't set
+if (!isset($_SERVER['REQUEST_URI']))
+	$_SERVER['REQUEST_URI'] = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '').'?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin;
+require PUN_ROOT.'header.php';
+
+// Attempt to load the plugin. We don't use @ here to supress error messages,
+// because if we did and a parse error occurred in the plugin, we would only
+// get the "blank page of death".
+include PUN_ROOT.'plugins/'.$plugin;
+if (!defined('PUN_PLUGIN_LOADED'))
+	message('Le chargement du plugin \''.$plugin.'\' a Ã©chouÃ©.');
+
+// Output the clearer div
+?>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_maintenance.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_maintenance.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_maintenance.php	(revision 1)
@@ -0,0 +1,186 @@
+<?php
+
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+// Tell common.php that we don't want output buffering
+define('PUN_DISABLE_BUFFERING', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+if (isset($_GET['i_per_page']) && isset($_GET['i_start_at']))
+{
+
+	$per_page = intval($_GET['i_per_page']);
+	$start_at = intval($_GET['i_start_at']);
+	if ($per_page < 1 || $start_at < 1)
+		message($lang_common['Bad request']);
+
+	@set_time_limit(0);
+
+	// If this is the first cycle of posts we empty the search index before we proceed
+	if (isset($_GET['i_empty_index']))
+	{
+		// This is the only potentially "dangerous" thing we can do here, so we check the referer
+		confirm_referrer('admin_maintenance.php');
+
+		$truncate_sql = ($db_type != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ';
+		$db->query($truncate_sql.$db->prefix.'search_matches') or error('Impossible de vider la table search index match', __FILE__, __LINE__, $db->error());
+		$db->query($truncate_sql.$db->prefix.'search_words') or error('Impossible de vider la table search index words', __FILE__, __LINE__, $db->error());
+
+		// Reset the sequence for the search words (not needed for SQLite)
+		switch ($db_type)
+		{
+			case 'mysql':
+			case 'mysqli':
+				$result = $db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Impossible de modifier l\'auto-incrÃ©mentation', __FILE__, __LINE__, $db->error());
+				break;
+
+			case 'pgsql';
+				$result = $db->query('SELECT setval(\'search_words_id_seq\', 1, false)') or error('Impossible de modifier la sÃ©quence', __FILE__, __LINE__, $db->error());
+		}
+	}
+
+	$end_at = $start_at + $per_page;
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Reconstruction des index de recherches ...</title>
+<style type="text/css">
+body {
+	font: 10px Verdana, Arial, Helvetica, sans-serif;
+	color: #333333;
+	background-color: #FFFFFF
+}
+</style>
+</head>
+<body>
+
+Reconstruction des index ... C'est peut Ãªtre le bon moment pour aller prendre un cafÃ© :-)<br /><br />
+
+<?php
+
+	require PUN_ROOT.'include/search_idx.php';
+
+	// Fetch posts to process
+	$result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' AND t.id<'.$end_at.' ORDER BY t.id') or error('Impossible de retrouver les informations des discussions et des messages', __FILE__, __LINE__, $db->error());
+
+	$cur_topic = 0;
+	while ($cur_post = $db->fetch_row($result))
+	{
+		if ($cur_post[0] <> $cur_topic)
+		{
+			// Fetch subject and ID of first post in topic
+			$result2 = $db->query('SELECT p.id, t.subject, MIN(p.posted) AS first FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id='.$cur_post[0].' GROUP BY p.id, t.subject ORDER BY first LIMIT 1') or error('Impossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
+			list($first_post, $subject) = $db->fetch_row($result2);
+
+			$cur_topic = $cur_post[0];
+		}
+
+		echo 'Traitement du message <strong>'.$cur_post[1].'</strong> de la discussion <strong>'.$cur_post[0].'</strong><br />'."\n";
+
+		if ($cur_post[1] == $first_post)	// This is the "topic post" so we have to index the subject as well
+			update_search_index('post', $cur_post[1], $cur_post[2], $subject);
+		else
+			update_search_index('post', $cur_post[1], $cur_post[2]);
+	}
+
+	// Check if there is more work to do
+	$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at) or error('Impossible de retrouver les informations de discussions', __FILE__, __LINE__, $db->error());
+
+	$query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : '';
+
+	$db->end_transaction();
+	$db->close();
+
+	exit('<script type="text/javascript">window.location="admin_maintenance.php'.$query_str.'"</script><br />La redirection javaScript a Ã©chouÃ©e. <a href="admin_maintenance.php'.$query_str.'">Cliquez ici</a> pour continuer.');
+}
+
+
+// Get the first post ID from the db
+$result = $db->query('SELECT id FROM '.$db->prefix.'topics ORDER BY id LIMIT 1') or error('Impossible de retrouver les informations de discussions', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+	$first_id = $db->result($result);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Maintenance';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('maintenance');
+
+?>
+	<div class="blockform">
+		<h2><span>Maintenance des Forums</span></h2>
+		<div class="box">
+			<form method="get" action="admin_maintenance.php">
+				<div class="inform">
+					<fieldset>
+						<legend>Reconstruction des index de recherches</legend>
+						<div class="infldset">
+							<p>Si vous avez ajoutÃ©, modifiÃ© ou supprimÃ© manuellement des messages dans la base de donnÃ©es ou si vous avez des problÃšmes avec la  recherche vous devriez reconstruire les index de recherche (supprime les mots inutiles). Pour de meilleures performances, pendant la reconstruction des index, vous devriez mettre vos forums en mode maintenance. <strong>La reconstruction des index de recherches peut prendre beaucoup de temps et augmenter considÃ©rablement la charge serveur au cours du processus de reconstruction&#160;!</strong></p>
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Discussions par cycle</th>
+									<td>
+										<input type="text" name="i_per_page" size="7" maxlength="7" value="100" tabindex="1" />
+										<span>Le nombre de discussions Ã  traiter par cycle. Si vous saisissez 100, une centaine de discussions sera traitÃ©e et ensuite la page sera actualisÃ©e. Cela permet d'Ã©viter que le script n'atteigne le temps limite d'exÃ©cution pendant le processus de recontruction.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ID de la discussion de dÃ©part</th>
+									<td>
+										<input type="text" name="i_start_at" size="7" maxlength="7" value="<?php echo (isset($first_id)) ? $first_id : 0 ?>" tabindex="2" />
+										<span>L'ID de discussion de laquelle vous souhaitez lancer la reconstruction. La valeur par dÃ©faut est le premier ID diponible dans la base de donnÃ©es. Normalement vous ne devriez pas avoir Ã  changer ceci.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Vider index</th>
+									<td class="inputadmin">
+										<span><input type="checkbox" name="i_empty_index" value="1" tabindex="3" checked="checked" />&#160;&#160;Cochez cette option si vous souhaitez que les index de recherches soient vidÃ©s avant la reconstruction (voir ci-dessous).</span>
+									</td>
+								</tr>
+							</table>
+							<p class="topspace">Lorsque le processus sera terminÃ© vous serez redirigÃ© sur cette page. Il est fortement recommandÃ© que Javascript soit activÃ© sur votre navigateur pour effectuer la reconstruction (pour une redirection automatique lorsqu'un cycle est achevÃ©). Si vous Ãªtes obligÃ© d'abandonner le processus de reconstruction, notez l'ID du dernier sujet traitÃ© et saisissez cet ID+1 dans le champ "ID de la discussion de dÃ©part" quand/si vous reprennez le processus  ("Vider index" ne doit pas Ãªtre cochÃ©).</p>
+							<div class="fsetsubmit"><input type="submit" name="rebuild_index" value=" Reconstruire index " tabindex="4" /></div>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_options.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_options.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_options.php	(revision 1)
@@ -0,0 +1,701 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+if (isset($_POST['form_sent']))
+{
+	// Lazy referer check (in case base_url isn't correct)
+	if (!isset($_SERVER['HTTP_REFERER']) || !preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER']))
+		message($lang_common['Bad referrer']);
+
+	$form = array_map('trim', $_POST['form']);
+
+	if ($form['board_title'] == '')
+		message('Vous devez saisir un titre pour vos forums.');
+
+	require PUN_ROOT.'include/email.php';
+
+	$form['admin_email'] = strtolower($form['admin_email']);
+	if (!is_valid_email($form['admin_email']))
+		message('L\'adresse email administrateur que vous avez saisi est incorrecte.');
+
+	$form['webmaster_email'] = strtolower($form['webmaster_email']);
+	if (!is_valid_email($form['webmaster_email']))
+		message('L\'adresse email webmaster que vous avez saisi est incorrecte.');
+
+	if ($form['mailing_list'] != '')
+		$form['mailing_list'] = strtolower(preg_replace('/[\s]/', '', $form['mailing_list']));
+
+	// Make sure base_url doesn't end with a slash
+	if (substr($form['base_url'], -1) == '/')
+		$form['base_url'] = substr($form['base_url'], 0, -1);
+
+	// Make sure avatars_dir doesn't end with a slash
+	if (substr($form['avatars_dir'], -1) == '/')
+		$form['avatars_dir'] = substr($form['avatars_dir'], 0, -1);
+
+	if ($form['additional_navlinks'] != '')
+		$form['additional_navlinks'] = trim(pun_linebreaks($form['additional_navlinks']));
+
+	if ($form['announcement_message'] != '')
+		$form['announcement_message'] = pun_linebreaks($form['announcement_message']);
+	else
+	{
+		$form['announcement_message'] = 'Saisissez votre annonce ici.';
+
+		if ($form['announcement'] == '1')
+			$form['announcement'] = '0';
+	}
+
+	if ($form['rules_message'] != '')
+		$form['rules_message'] = pun_linebreaks($form['rules_message']);
+	else
+	{
+		$form['rules_message'] = 'Saisissez les rÃšgles d\'utilisation ici.';
+
+		if ($form['rules'] == '1')
+			$form['rules'] = '0';
+	}
+
+	if ($form['maintenance_message'] != '')
+		$form['maintenance_message'] = pun_linebreaks($form['maintenance_message']);
+	else
+	{
+		$form['maintenance_message'] = 'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Veuillez essayer Ã  nouveau d\'ici quelques minutes.<br />\\n<br />\\n/Administrateur';
+
+		if ($form['maintenance'] == '1')
+			$form['maintenance'] = '0';
+	}
+
+	$form['timeout_visit'] = intval($form['timeout_visit']);
+	$form['timeout_online'] = intval($form['timeout_online']);
+	$form['redirect_delay'] = intval($form['redirect_delay']);
+	$form['topic_review'] = intval($form['topic_review']);
+	$form['disp_topics_default'] = intval($form['disp_topics_default']);
+	$form['disp_posts_default'] = intval($form['disp_posts_default']);
+	$form['indent_num_spaces'] = intval($form['indent_num_spaces']);
+	$form['avatars_width'] = intval($form['avatars_width']);
+	$form['avatars_height'] = intval($form['avatars_height']);
+	$form['avatars_size'] = intval($form['avatars_size']);
+
+	if ($form['timeout_online'] >= $form['timeout_visit'])
+		message('La valeur de "Temps mort en ligne" doit Ãªtre infÃ©rieur Ã  la valeur de "Temps mort de visite".');
+
+	while (list($key, $input) = @each($form))
+	{
+		// Only update values that have changed
+		if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input)
+		{
+			if ($input != '' || is_int($input))
+				$value = '\''.$db->escape($input).'\'';
+			else
+				$value = 'NULL';
+
+			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Impossible de mettre Ã  jour la configuration des forums', __FILE__, __LINE__, $db->error());
+		}
+	}
+
+	// Regenerate the config cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+
+	redirect('admin_options.php', 'Options modifiÃ©es. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Options';
+$form_name = 'update_options';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('options');
+
+?>
+	<div class="blockform">
+		<h2><span>Options</span></h2>
+		<div class="box">
+			<form method="post" action="admin_options.php?action=foo">
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer " /></p>
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Essentiel</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Titre forums</th>
+									<td>
+										<input type="text" name="form[board_title]" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>" />
+										<span>Le titre de ces forums (affichÃ© en haut de chaques pages). Ce champ ne peut <strong>pas</strong> contenir d'<acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Description forums</th>
+									<td>
+										<input type="text" name="form[board_desc]" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_config['o_board_desc']) ?>" />
+										<span>Une courte description de vos forums (affichÃ© en haut de chaques pages). Ce champ peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base</th>
+									<td>
+										<input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" />
+										<span>L'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de ces forums sans slash Ã  la fin (ex :  http://www.mon-domaine.com/forums). Ce champ <strong>doit</strong> Ãªtre correct pour que toutes les fonctions administrateurs et modÃ©rateurs soient opÃ©rationnelles. Si vous optenez une erreur "Bad referer", il est probablement incorrect.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Fuseau horaire serveur</th>
+									<td>
+										<select name="form[server_timezone]">
+											<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
+											<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+											<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+											<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-09.5</option>
+											<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
+											<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-08.5</option>
+											<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
+											<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
+											<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
+											<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
+											<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
+											<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-03.5</option>
+											<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
+											<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
+											<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+											<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+											<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+											<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
+											<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
+											<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5) echo ' selected="selected"' ?>>+03.5</option>
+											<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
+											<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5) echo ' selected="selected"' ?>>+04.5</option>
+											<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
+											<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5) echo ' selected="selected"' ?>>+05.5</option>
+											<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
+											<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5) echo ' selected="selected"' ?>>+06.5</option>
+											<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
+											<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
+											<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
+											<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5) echo ' selected="selected"' ?>>+09.5</option>
+											<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+											<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5) echo ' selected="selected"' ?>>+10.5</option>
+											<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+											<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5) echo ' selected="selected"' ?>>+11.5</option>
+											<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
+											<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
+										</select>
+										<span>Le fuseau horaire du serveur oÃ¹ est installÃ© PunBB.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Langage par dÃ©faut</th>
+									<td>
+										<select name="form[default_lang]">
+<?php
+
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			 if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
+		
+		@natsort($languages);
+
+		while (list(, $temp) = @each($languages))
+		{
+			if ($pun_config['o_default_lang'] == $temp)
+				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
+			else
+				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
+		}
+
+?>
+										</select>
+										<span>Choisissez la langue par dÃ©faut qui sera utilisÃ©e si l'utilisateur est un invitÃ© ou pour les utilisateurs qui n'auront pas changÃ© de langage dans leur profil. Si vous supprimez un pack de langage vous devrez mettre Ã  jour ce rÃ©glage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Style par dÃ©faut</th>
+									<td>
+										<select name="form[default_style]">
+<?php
+
+		$styles = array();
+		$d = dir(PUN_ROOT.'style');
+		while (($entry = $d->read()) !== false)
+		{
+			if (substr($entry, strlen($entry)-4) == '.css')
+				$styles[] = substr($entry, 0, strlen($entry)-4);
+		}
+		$d->close();
+		
+		@natsort($styles);
+
+		while (list(, $temp) = @each($styles))
+		{
+			if ($pun_config['o_default_style'] == $temp)
+				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
+			else
+				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
+		}
+
+?>
+										</select>
+										<span>SÃ©lÃ©ctionnez le style par dÃ©faut qui sera utilisÃ© par les visiteurs ou les utilisateurs qui n'ont pas changÃ©s de style dans leur profil.</span></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Dates, heures et limites de temps</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Format heure</th>
+									<td>
+										<input type="text" name="form[time_format]" size="25" maxlength="25" value="<?php echo pun_htmlspecialchars($pun_config['o_time_format']) ?>" />
+										<span>[Format actuel : <?php echo date($pun_config['o_time_format']) ?>]&#160;Voir <a href="http://www.php.net/manual/fr/function.date.php">ici</a> pour les options de formatage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Date format</th>
+									<td>
+										<input type="text" name="form[date_format]" size="25" maxlength="25" value="<?php echo pun_htmlspecialchars($pun_config['o_date_format']) ?>" />
+										<span>[Format actuel : <?php echo date($pun_config['o_date_format']) ?>]&#160;Voir <a href="http://www.php.net/manual/fr/function.date.php">ici</a> pour les options de formatage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps mort de visite</th>
+									<td>
+										<input type="text" name="form[timeout_visit]" size="5" maxlength="5" value="<?php echo $pun_config['o_timeout_visit'] ?>" />
+										<span>Nombre de secondes qu'un utilisateur devra rester inactif avant que les donnÃ©es de sa derniÃšre visite soient mises Ã  jours (affecte principalement les indicateurs de nouveaux messages).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps mort en ligne</th>
+									<td>
+										<input type="text" name="form[timeout_online]" size="5" maxlength="5" value="<?php echo $pun_config['o_timeout_online'] ?>" />
+										<span>Nombre de secondes qu'un utilisateur devra rester inactif avant qu'il ne soit supprimÃ© de la liste des utilisateurs en ligne.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps de redirection</th>
+									<td>
+										<input type="text" name="form[redirect_delay]" size="3" maxlength="3" value="<?php echo $pun_config['o_redirect_delay'] ?>" />
+										<span>Nombre de secondes Ã  patienter avant d'Ãªtre redirigÃ©. Si ce champ est rÃ©glÃ© Ã  0, aucune page de redirection ne sera affichÃ©e mais cela n'est pas recommandÃ©.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Afficher</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">NumÃ©ro de version</th>
+									<td>
+										<input type="radio" name="form[show_version]" value="1"<?php if ($pun_config['o_show_version'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_version]" value="0"<?php if ($pun_config['o_show_version'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche le numÃ©ro de version de PunBB en bas de page.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Infos utilisateurs dans les messages</th>
+									<td>
+										<input type="radio" name="form[show_user_info]" value="1"<?php if ($pun_config['o_show_user_info'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_user_info]" value="0"<?php if ($pun_config['o_show_user_info'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche des informations sur les utilisateurs sous leur nom d'utilisateur lorsque l'on affiche un sujet. Affiche le lieu, la date d'inscription, le nombre de message et les liens de contact (e-mail et site web).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages par utilisateur</th>
+									<td>
+										<input type="radio" name="form[show_post_count]" value="1"<?php if ($pun_config['o_show_post_count'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_post_count]" value="0"<?php if ($pun_config['o_show_post_count'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche le nombre de messages qu'un utilisateur a Ã©crit (sur la page d'un sujet, son profil et la liste utilisateurs).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃmoticÃŽnes</th>
+									<td>
+										<input type="radio" name="form[smilies]" value="1"<?php if ($pun_config['o_smilies'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[smilies]" value="0"<?php if ($pun_config['o_smilies'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Convertir les Ã©moticÃŽnes en petites images.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃmoticÃŽnes dans les signatures</th>
+									<td>
+										<input type="radio" name="form[smilies_sig]" value="1"<?php if ($pun_config['o_smilies_sig'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[smilies_sig]" value="0"<?php if ($pun_config['o_smilies_sig'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Convertir les Ã©moticÃŽnes en petites images dans les signatures.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">CrÃ©er des liens cliquables</th>
+									<td>
+										<input type="radio" name="form[make_links]" value="1"<?php if ($pun_config['o_make_links'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[make_links]" value="0"<?php if ($pun_config['o_make_links'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette fonction est activÃ©e, PunBB dÃ©tecte automatiquement lors de l'envoi d'un nouveau message toutes les <acronym title="Uniform Resource Locator" lang="en">URL</acronym> qu'il contient et crÃ©er des liens cliquables.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃ©sumÃ©s des discussions</th>
+									<td>
+										<input type="text" name="form[topic_review]" size="3" maxlength="3" value="<?php echo $pun_config['o_topic_review'] ?>" />
+										<span>Nombre maximum  de messages Ã  afficher quand on Ã©crit une rÃ©ponse. 0 pour dÃ©sactiver.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Discussions par page</th>
+									<td>
+										<input type="text" name="form[disp_topics_default]" size="3" maxlength="3" value="<?php echo $pun_config['o_disp_topics_default'] ?>" />
+										<span>Le nombre de discussions par dÃ©faut Ã  afficher sur la page d'un forum. Les utilisateurs inscrits peuvent personnaliser cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Messages par page</th>
+									<td>
+										<input type="text" name="form[disp_posts_default]" size="3" maxlength="3" value="<?php echo $pun_config['o_disp_posts_default'] ?>" />
+										<span>Le nombre de messages par dÃ©faut Ã  afficher sur la page d'une discussion. Les utilisateurs inscrits peuvent personnaliser cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Taille du retrait</th>
+									<td>
+										<input type="text" name="form[indent_num_spaces]" size="3" maxlength="3" value="<?php echo $pun_config['o_indent_num_spaces'] ?>" />
+										<span>Si rÃ©glÃ©e Ã  8, une tabulation usuelle sera utilisÃ©e pour afficher du texte avec les balises [code][/code]. Sinon c'est le nombre d'espaces qui sera utilisÃ© pour mettre en retrait le texte.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>FonctionnalitÃ©s</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">RÃ©ponse rapide</th>
+									<td>
+										<input type="radio" name="form[quickpost]" value="1"<?php if ($pun_config['o_quickpost'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[quickpost]" value="0"<?php if ($pun_config['o_quickpost'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Lorsque cette option est activÃ©e, PunBB ajoute un formulaire de rÃ©ponse au bas des discussions. Ceci permet aux utilisateurs d'Ã©crire des rÃ©ponses directement depuis l'Ã©cran de lecture des discussions.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Utilisateurs en ligne</th>
+									<td>
+										<input type="radio" name="form[users_online]" value="1"<?php if ($pun_config['o_users_online'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[users_online]" value="0"<?php if ($pun_config['o_users_online'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Affiche sur la page d'accueil des forums des informations concernant les utilisateurs qui sont en ligne lors de l'affichage de la page.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><a name="censoring">Mots Ã  censurer</a></th>
+									<td>
+										<input type="radio" name="form[censoring]" value="1"<?php if ($pun_config['o_censoring'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[censoring]" value="0"<?php if ($pun_config['o_censoring'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour censurer des mots prÃ©dÃ©finis. Pour plus d'information, voir la page d'administration des <a href="admin_censoring.php">Mots censurÃ©s</a>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><a name="ranks">Rangs utilisateurs</a></th>
+									<td>
+										<input type="radio" name="form[ranks]" value="1"<?php if ($pun_config['o_ranks'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[ranks]" value="0"<?php if ($pun_config['o_ranks'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour utiliser les rangs utilisateurs. Pour plus d'information, voir la page d'administration des <a href="admin_ranks.php">Rangs utilisateurs</a>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Utilisateur a Ã©crit recemment</th>
+									<td>
+										<input type="radio" name="form[show_dot]" value="1"<?php if ($pun_config['o_show_dot'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_dot]" value="0"<?php if ($pun_config['o_show_dot'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Cette fonctionnalitÃ© permet d'afficher un point devant les sujets dans le cas oÃ¹ l'utilisateur identifiÃ© aurait rÃ©cemment Ã©crit dans les sujets. DÃ©sactivez si vous constatez d'importantes charges serveur.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Saut rapide</th>
+									<td>
+										<input type="radio" name="form[quickjump]" value="1"<?php if ($pun_config['o_quickjump'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[quickjump]" value="0"<?php if ($pun_config['o_quickjump'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Active le menu dÃ©roulant de saut rapide (saut de forum en forum).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Compression GZip</th>
+									<td>
+										<input type="radio" name="form[gzip]" value="1"<?php if ($pun_config['o_gzip'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[gzip]" value="0"<?php if ($pun_config['o_gzip'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Si activÃ©e, PunBB compressera la sortie envoyÃ©e aux navigateurs. Ceci devrait rÃ©duire la consommation de bande passante mais utilisera un peu plus le <acronym title="Central Processing Unit" lang="en">CPU</acronym> (processeur systÃšme). Cette option nÃ©cessite que <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> soit configurÃ© avec zlib (--with-zlib). Note : Si vous avez dÃ©jÃ  un des modules Apache mod_gzip ou mod_deflate d'installÃ© et de configurÃ© pour compresser les scripts <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym>, vous pouvez alors dÃ©sactiver cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Recherche dans tous les forums</th>
+									<td>
+										<input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette option est dÃ©sactivÃ©e, les recherches ne peuvent Ãªtres effectuÃ©es que sur un forum Ã  la fois. DÃ©sactivez si la charge serveur est Ã©levÃ©e Ã  cause d'un nombre trop important de recherches.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Items de menu additionnels</th>
+									<td>
+										<textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_additional_navlinks']) ?></textarea>
+										<span>En entrant des liens hypertext <acronym title="HyperText Markup Language" lang="en">HTML</acronym> dans cette boite de saisie, autant d'items seront ajoutÃ©s au menu de navigation en haut de toutes les pages. Le format pour ajouter un nouveau lien est   X = &lt;a href="URL"&gt;LIEN&lt;/a&gt; oÃ¹ X est la position Ã  laquelle le lien devra Ãªtre insÃ©rÃ© (<abbr title="exemple">ex.</abbr> 0 pour insÃ©rer au dÃ©but et 2 pour insÃ©rer aprÃšs la Â«&#160;liste des membres&#160;Â»). SÃ©parez chaque entrÃ©e par un retour Ã  la ligne.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Signalements</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">MÃ©thode de signalement</th>
+									<td>
+										<input type="radio" name="form[report_method]" value="0"<?php if ($pun_config['o_report_method'] == '0') echo ' checked="checked"' ?> />&#160;Interne&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="1"<?php if ($pun_config['o_report_method'] == '1') echo ' checked="checked"' ?> />&#160;E-mail&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="2"<?php if ($pun_config['o_report_method'] == '2') echo ' checked="checked"' ?> />&#160;Les deux
+										<span>Choisissez la mÃ©thode pour Ãªtre avertis de nouveaux signalements. Pour la mÃ©thode par e-mail la liste d'adresses ci-dessous sera utilisÃ©e.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Signalement nouvelle inscription</th>
+									<td>
+										<input type="radio" name="form[regs_report]" value="1"<?php if ($pun_config['o_regs_report'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_report]" value="0"<?php if ($pun_config['o_regs_report'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Si activÃ©e, PunBB enverra un e-mail Ã  chacune des adresses de la liste ci-dessous Ã  chaque nouvelle inscription sur les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Liste d'adresses e-mail</th>
+									<td>
+										<textarea name="form[mailing_list]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_mailing_list']) ?></textarea>
+										<span>Utilisez une virgule pour sÃ©parer les adresses. Les adresses de cette liste sont les destinataires des signalements envoyÃ©s par e-mail.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Avatars</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Utiliser les avatars</th>
+									<td>
+										<input type="radio" name="form[avatars]" value="1"<?php if ($pun_config['o_avatars'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[avatars]" value="0"<?php if ($pun_config['o_avatars'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Si cette option est activÃ©e, les utilisateurs pourront envoyer sur le serveur un avatar qui sera affichÃ© sous leur titre/rang.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃ©pertoire avatars</th>
+									<td>
+										<input type="text" name="form[avatars_dir]" size="35" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_avatars_dir']) ?>" />
+										<span>Le dossier oÃ¹ les avatars seront envoyÃ©s (chemin relatif au dossier racine de PunBB). <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> doit avoir les droits en Ã©criture dans ce rÃ©pertoire.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Largeur maximum</th>
+									<td>
+										<input type="text" name="form[avatars_width]" size="5" maxlength="5" value="<?php echo $pun_config['o_avatars_width'] ?>" />
+										<span>La largeur maximum admise (exprimÃ©e en pixels) pour les avatars (60 est recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Hauteur maximum</th>
+									<td>
+										<input type="text" name="form[avatars_height]" size="5" maxlength="5" value="<?php echo $pun_config['o_avatars_height'] ?>" />
+										<span>La hauteur maximum admise (exprimÃ©e en pixels) pour les avatars (60 est recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Taile maximum</th>
+									<td>
+										<input type="text" name="form[avatars_size]" size="6" maxlength="6" value="<?php echo $pun_config['o_avatars_size'] ?>" />
+										<span>La taille maximum admise (exprimÃ©e en bytes) pour les avatars (10240 est recommandÃ©).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>E-mail</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">E-mail administrateur</th>
+									<td>
+										<input type="text" name="form[admin_email]" size="50" maxlength="50" value="<?php echo $pun_config['o_admin_email'] ?>" />
+										<span>L'adresse e-mail de l'administrateur des forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail webmaster</th>
+									<td>
+										<input type="text" name="form[webmaster_email]" size="50" maxlength="50" value="<?php echo $pun_config['o_webmaster_email'] ?>" />
+										<span>Ceci est l'adresse qui sera utilisÃ©e par tous les messages envoyÃ©s par les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Abonnements</th>
+									<td>
+										<input type="radio" name="form[subscriptions]" value="1"<?php if ($pun_config['o_subscriptions'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[subscriptions]" value="0"<?php if ($pun_config['o_subscriptions'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activer l'abonnement des utilisateurs aux discussions  (rÃ©ception d'un e-mail lors d'une rÃ©ponse).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Adresse serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
+									<td>
+										<input type="text" name="form[smtp_host]" size="30" maxlength="100" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_host']) ?>" />
+										<span>L'adresse d'un serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> externe pour envoyer des e-mails. Vous pouvez spÃ©cifier un numÃ©ro de port si le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> n'utilise pas le port par dÃ©faut 25 (<abbr title="exemple">ex.</abbr> smtp.monhote.com:3580). Laissez vide pour utiliser le programme local d'envoi d'e-mails.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nom d'utilisateur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
+									<td>
+										<input type="text" name="form[smtp_user]" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_user']) ?>" />
+										<span>Nom d'utilisateur du serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym>. Saisissez un nom d'utilisateur seulement si cela est nÃ©cessaire pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> (la plupart des serveurs <strong>ne demande pas</strong> d'authentification).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Mot de passe <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
+									<td>
+										<input type="text" name="form[smtp_pass]" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_pass']) ?>" />
+										<span>Le mot de passe pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym>. Saisissez un mot de passe seulement si cela est nÃ©cessaire pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> (la plupart des serveurs <strong>ne demande pas</strong> d'authentification).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Inscriptions</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Autoriser les nouvelles inscriptions</th>
+									<td>
+										<input type="radio" name="form[regs_allow]" value="1"<?php if ($pun_config['o_regs_allow'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_allow]" value="0"<?php if ($pun_config['o_regs_allow'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Permet d'accepter ou non les nouvelles inscriptions aux forums. DÃ©sactivez seulement en cas de circonstances spÃ©ciales.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">VÃ©rification des inscriptions</th>
+									<td>
+										<input type="radio" name="form[regs_verify]" value="1"<?php if ($pun_config['o_regs_verify'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_verify]" value="0"<?php if ($pun_config['o_regs_verify'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Si cette option est activÃ©e, lors de leur inscription les utilisateurs recevront par e-mail un mot de passe alÃ©atoire. Ils pourront alors s'identifier et, si ils le souhaitent, changer le mot de passe depuis leur profil. Cette option nÃ©cessite que les utilisateurs valident leur adresse e-mail si jamais ils veulent la changer depuis leur profil. C'est une bonne mÃ©thode pour limiter les incriptions abusives et pour Ãªtre sÃ»r que les utilisateurs ont une adresse e-mail valide dans leur profil.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Activer rÃšgles d'utilisation</th>
+									<td>
+										<input type="radio" name="form[rules]" value="1"<?php if ($pun_config['o_rules'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[rules]" value="0"<?php if ($pun_config['o_rules'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette option est activÃ©e, les utilisateurs devront accepter les rÃšgles d'utilisation lors de leur inscription (saisissez le texte ci-dessous). Les rÃšgles d'utilisation seront Ã©galement consultables depuis un lien situÃ© dans la barre principale en haut de chaque pages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃšgles d'utilisation</th>
+									<td>
+										<textarea name="form[rules_message]" rows="10" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_rules_message']) ?></textarea>
+										<span>Ici vous pouvez saisir toutes les rÃšgles d'utilisation ou toutes autres informations que les utilisateurs devront lire et accepter lors de leur inscription. Si vous activez les rÃšgles d'utilisation ci-dessus vous devez saisir quelque chose ici, sinon elles seront dÃ©sactivÃ©es. Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Annonce</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Afficher annonce</th>
+									<td>
+										<input type="radio" name="form[announcement]" value="1"<?php if ($pun_config['o_announcement'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[announcement]" value="0"<?php if ($pun_config['o_announcement'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour afficher sur les forums le texte ci-dessous.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message de l'annonce</th>
+									<td>
+										<textarea name="form[announcement_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_announcement_message']) ?></textarea>
+										<span>Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Maintenance</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row"><a name="maintenance">Mode maintenance</a></th>
+									<td>
+										<input type="radio" name="form[maintenance]" value="1"<?php if ($pun_config['o_maintenance'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[maintenance]" value="0"<?php if ($pun_config['o_maintenance'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette fonctionnalitÃ© est activÃ©e, les forums ne seront disponibles que pour les administrateurs. Ceci peut Ãªtre utilisÃ© si les forums doivent Ãªtre fermÃ©s temporairement pour maintenance. ATTENTION ! Ne vous dÃ©connectez pas lorsque les forums sont en mode maintenance. Vous ne pourrez pas vous reconnecter.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message de maintenance</th>
+									<td>
+										<textarea name="form[maintenance_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_maintenance_message']) ?></textarea>
+										<span>Le message qui sera affichÃ© aux utilisateurs lorsque les forums sont en mode maintenance. Si laissÃ© vide, le message par dÃ©faut sera utilisÃ©. Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_permissions.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_permissions.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_permissions.php	(revision 1)
@@ -0,0 +1,228 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+if (isset($_POST['form_sent']))
+{
+	confirm_referrer('admin_permissions.php');
+
+	$form = array_map('intval', $_POST['form']);
+
+	while (list($key, $input) = @each($form))
+	{
+		// Only update values that have changed
+		if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
+			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Impossible de mettre Ã  jour la configuration des forums', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the config cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+
+	redirect('admin_permissions.php', 'Permissions modifiÃ©es. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
+require PUN_ROOT.'header.php';
+generate_admin_menu('permissions');
+
+?>
+	<div class="blockform">
+		<h2><span>Permissions</span></h2>
+		<div class="box">
+			<form method="post" action="admin_permissions.php">
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer " /></p>
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Ãcriture</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode</th>
+									<td>
+										<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisaton du BBCode dans les messages (recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise Image</th>
+									<td>
+										<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans les messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les messages qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Sujet tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les sujets qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail invitÃ© obligatoire</th>
+									<td>
+										<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Obliger les invitÃ©s Ã  donner une adresse e-mail pour Ã©crire un message.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Signatures</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation du BBCodes dans les signatures des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise image dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans la signature des utilisateurs (non recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Signature tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les signatures qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Longueur maximum des signatures</th>
+									<td>
+										<input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
+										<span>Le nombre maximum de caractÃšres qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre maximum de lignes dans les signatures</th>
+									<td>
+										<input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
+										<span>Le nombre maximum de lignes qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>ModÃ©rateurs</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Modifier les profils utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_edit_users]" value="1"<?php if ($pun_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_edit_users]" value="0"<?php if ($pun_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  modifier les profils des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Renommer utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_rename_users]" value="1"<?php if ($pun_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_rename_users]" value="0"<?php if ($pun_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  renommer les utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Changer les mots de passe des utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_change_passwords]" value="1"<?php if ($pun_config['p_mod_change_passwords'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_change_passwords]" value="0"<?php if ($pun_config['p_mod_change_passwords'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  changer les mots de passe des utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Bannir utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_ban_users]" value="1"<?php if ($pun_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_ban_users]" value="0"<?php if ($pun_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  bannir les utilisateurs (et modifier/supprimer les bannissements en cours).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Inscriptions</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail bannies</th>
+									<td>
+										<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire (ou changer d'adresse) avec une adresse/un domaine e-mail bannis. Si vous laissez cette option Ã  son rÃ©glage par dÃ©faut (oui) ceci sera possible mais une alerte par e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums (une maniÃšre efficace pour dÃ©tecter les inscriptions multiples).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail en double</th>
+									<td>
+										<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire avec une adresse e-mail dÃ©jÃ  utilisÃ©e par un autre nom d'utilisateur. Si autorisÃ© une alerte e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums lorsqu'un doublon sera dÃ©tectÃ©.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_prune.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_prune.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_prune.php	(revision 1)
@@ -0,0 +1,230 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+if (isset($_GET['action']) || isset($_POST['prune']) || isset($_POST['prune_comply']))
+{
+	if (isset($_POST['prune_comply']))
+	{
+		confirm_referrer('admin_prune.php');
+
+		$prune_from = $_POST['prune_from'];
+		$prune_days = intval($_POST['prune_days']);
+		$prune_date = ($prune_days) ? time() - ($prune_days*86400) : -1;
+
+		@set_time_limit(0);
+
+		if ($prune_from == 'all')
+		{
+			$result = $db->query('SELECT id FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+			$num_forums = $db->num_rows($result);
+
+			for ($i = 0; $i < $num_forums; ++$i)
+			{
+				$fid = $db->result($result, $i);
+
+				prune($fid, $_POST['prune_sticky'], $prune_date);
+				update_forum($fid);
+			}
+		}
+		else
+		{
+			$prune_from = intval($prune_from);
+			prune($prune_from, $_POST['prune_sticky'], $prune_date);
+			update_forum($prune_from);
+		}
+
+		// Locate any "orphaned redirect topics" and delete them
+		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Impossible de retrouver les sujets de redirection', __FILE__, __LINE__, $db->error());
+		$num_orphans = $db->num_rows($result);
+
+		if ($num_orphans)
+		{
+			for ($i = 0; $i < $num_orphans; ++$i)
+				$orphans[] = $db->result($result, $i);
+
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
+		}
+
+		redirect('admin_prune.php', 'Messages supprimÃ©s. Redirection ...');
+	}
+
+
+	$prune_days = $_POST['req_prune_days'];
+	if (!preg_match('#^\d+$#', $prune_days))
+		message('Le nombre de jours d\'anciennetÃ© doit Ãªtre un entier positif.');
+
+	$prune_date = time() - ($prune_days*86400);
+	$prune_from = $_POST['prune_from'];
+
+	// Concatenate together the query for counting number or topics to prune
+	$sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL';
+
+	if ($_POST['prune_sticky'] == '0')
+		$sql .= ' AND sticky=\'0\'';
+
+	if ($prune_from != 'all')
+	{
+		$prune_from = intval($prune_from);
+		$sql .= ' AND forum_id='.$prune_from;
+
+		// Fetch the forum name (just for cosmetic reasons)
+		$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$prune_from) or error('Impossible de retrouver le nom du forum', __FILE__, __LINE__, $db->error());
+		$forum = '"'.pun_htmlspecialchars($db->result($result)).'"';
+	}
+	else
+		$forum = 'tous les forums';
+
+	$result = $db->query($sql) or error('Impossible de retrouver le nombre de discussions supprimÃ©es', __FILE__, __LINE__, $db->error());
+	$num_topics = $db->result($result);
+
+	if (!$num_topics)
+		message('Il n\'y a pas de sujets anciens de '.$prune_days.' jours. Diminuez la valeur de Jours d\'anciennetÃ© et essayez Ã  nouveau.');
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Ãlaguage';
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('prune');
+
+?>
+	<div class="blockform">
+		<h2><span>Ãlaguage</span></h2>
+		<div class="box">
+			<form method="post" action="admin_prune.php?action=foo">
+				<div class="inform">
+					<input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" />
+					<input type="hidden" name="prune_sticky" value="<?php echo $_POST['prune_sticky'] ?>" />
+					<input type="hidden" name="prune_from" value="<?php echo $prune_from ?>" />
+					<fieldset>
+						<legend>Confirmez l'Ã©laguage des messages</legend>
+						<div class="infldset">
+							<p>Ãtes-vous sÃ»r de vouloir supprimer toutes les discussions plus anciennes de <?php echo $prune_days ?> jours de <?php echo $forum ?>? (<?php echo $num_topics ?> discussions)</p>
+							<p>ATTENTION ! L'Ã©laguage est irrÃ©versible, les messages seront dÃ©finitivement supprimÃ©s.</p>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="prune_comply" value=" Ãlaguer " /><a href="javascript:history.go(-1)">Retour</a></p>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else
+{
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Ãlaguage';
+	$required_fields = array('req_prune_days' => 'Days old');
+	$focus_element = array('prune', 'req_prune_days');
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('prune');
+
+?>
+	<div class="blockform">
+		<h2><span>Ãlaguage</span></h2>
+		<div class="box">
+			<form id="prune" method="post" action="admin_prune.php?action=foo" onsubmit="return process_form(this)">
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Ãlaguer les messages anciens</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Jours d'anciennetÃ©</th>
+									<td>
+										<input type="text" name="req_prune_days" size="3" maxlength="3" tabindex="1" />
+										<span>Le nombre de jours d'anciennetÃ© qu'un sujet doit avoir pour Ãªtre Ã©laguÃ©. Autrement dit, si vous saisissez 30, tous les sujets qui ne contiennent pas de messages datÃ©s de moins de 30 jours seront supprimÃ©s.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Ãlaguer les discussions Ã©pinglÃ©es</th>
+									<td>
+										<input type="radio" name="prune_sticky" value="1" tabindex="2" checked="checked" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="prune_sticky" value="0" />&#160;<strong>Non</strong>
+										<span>Lorsque cette option est activÃ©e les discussions Ã©pinglÃ©es seront Ã©galement Ã©laguÃ©es.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Forum</th>
+									<td>
+										<select name="prune_from" tabindex="3">
+											<option value="all">Tous les forums</option>
+<?php
+
+	$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+	$cur_category = 0;
+	while ($forum = $db->fetch_assoc($result))
+	{
+		if ($forum['cid'] != $cur_category)	// Are we still in the same category?
+		{
+			if ($cur_category)
+				echo "\t\t\t\t\t\t\t\t\t\t\t".'</optgroup>'."\n";
+
+			echo "\t\t\t\t\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($forum['cat_name']).'">'."\n";
+			$cur_category = $forum['cid'];
+		}
+
+		echo "\t\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$forum['fid'].'">'.pun_htmlspecialchars($forum['forum_name']).'</option>'."\n";
+	}
+
+?>
+											</optgroup>
+										</select>
+										<span>Choisissez le forum dans lequel vous voulez effectuer l'Ã©laguage.</span>
+									</td>
+								</tr>
+							</table>
+							<p class="topspace">Utilisez cette fonctionnalitÃ© avec prÃ©caution. L'Ã©laguage des messages est irrÃ©versible. Pour de meilleures performances, au cours du processus d'Ã©laguage vous devriez mettre les forums en mode maintenance.</p>
+							<div class="fsetsubmit"><input type="submit" name="prune" value=" Ãlaguer " tabindex="5" /></div>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
Index: /branches/rsr.v5.1.dev/web/punbb/admin_ranks.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_ranks.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_ranks.php	(revision 1)
@@ -0,0 +1,195 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_ADMIN)
+	message($lang_common['No permission']);
+
+
+// Add a rank
+if (isset($_POST['add_rank']))
+{
+	confirm_referrer('admin_ranks.php');
+
+	$rank = trim($_POST['new_rank']);
+	$min_posts = $_POST['new_min_posts'];
+
+	if ($rank == '')
+		message('Vous devez saisir un titre au rang.');
+
+	if (!preg_match('#^\d+$#', $min_posts))
+		message('Le nombre minimum de messages doit Ãªtre un entier positif.');
+
+	// Make sure there isn't already a rank with the same min_posts value
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+		message('Il y a dÃ©jÃ  un rang avec un nombre minimum de '.$min_posts.'messages.');
+
+	$db->query('INSERT INTO '.$db->prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($rank).'\', '.$min_posts.')') or error('Impossible d\'ajouter le rang', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the ranks cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_ranks_cache();
+
+	redirect('admin_ranks.php', 'Rang ajoutÃ©. Redirection ...');
+}
+
+
+// Update a rank
+else if (isset($_POST['update']))
+{
+	confirm_referrer('admin_ranks.php');
+
+	$id = intval(key($_POST['update']));
+
+	$rank = trim($_POST['rank'][$id]);
+	$min_posts = trim($_POST['min_posts'][$id]);
+
+	if ($rank == '')
+		message('You must enter a rank title.');
+
+	if (!preg_match('#^\d+$#', $min_posts))
+		message('Le nombre minimum de messages doit Ãªtre un entier positif.');
+
+	// Make sure there isn't already a rank with the same min_posts value
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' && min_posts='.$min_posts) or error('Impossible de retrouver les informations des rangs', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+		message('Il y a dÃ©jÃ  un rang avec un nombre minimum de '.$min_posts.' messages.');
+
+	$db->query('UPDATE '.$db->prefix.'ranks SET rank=\''.$db->escape($rank).'\', min_posts='.$min_posts.' WHERE id='.$id) or error('Impossible de modifier les rangs', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the ranks cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_ranks_cache();
+
+	redirect('admin_ranks.php', 'Rangs modifiÃ©s. Redirection ...');
+}
+
+
+// Remove a rank
+else if (isset($_POST['remove']))
+{
+	confirm_referrer('admin_ranks.php');
+
+	$id = intval(key($_POST['remove']));
+
+	$db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Impossible de supprimer le rang', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the ranks cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_ranks_cache();
+
+	redirect('admin_ranks.php', 'Rang supprimÃ©. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Rangs';
+$focus_element = array('ranks', 'new_rank');
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('ranks');
+
+?>
+	<div class="blockform">
+		<h2><span>Rangs</span></h2>
+		<div class="box">
+			<form id="ranks" method="post" action="admin_ranks.php?action=foo">
+				<div class="inform">
+					<fieldset>
+						<legend>Ajouter un rang</legend>
+						<div class="infldset">
+							<p>Saisissez un titre de rang et un nombre minimum de messages que l'utilisateur devra atteindre afin d'obtenir ce rang. Plusieurs rangs ne peuvent avoir le mÃªme nombre minimum de messages. Si un titre est donnÃ© Ã  un utilisateur, le titre sera affichÃ© Ã  la place du rang. <strong>Les rangs utilisateurs doivent Ãªtres activÃ©s Ã  la page <a href="admin_options.php#ranks">Options</a> pour qu'ils aient un quelconque effet.</strong></p>
+							<table  cellspacing="0">
+							<thead>
+								<tr>
+									<th class="tcl" scope="col">Titre du rang</th>
+									<th class="tc2" scope="col">Nombre minimum de messages</th>
+									<th class="hidehead" scope="col">Action</th>
+								</tr>
+							</thead>
+							<tbody>
+								<tr>
+									<td><input type="text" name="new_rank" size="24" maxlength="50" tabindex="1" /></td>
+									<td><input type="text" name="new_min_posts" size="7" maxlength="7" tabindex="2" /></td>
+									<td><input type="submit" name="add_rank" value=" Ajouter " tabindex="3" /></td>
+								</tr>
+							</tbody>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Modifier/supprimer les rangs</legend>
+						<div class="infldset">
+<?php
+
+$result = $db->query('SELECT id, rank, min_posts FROM '.$db->prefix.'ranks ORDER BY min_posts') or error('Impossible de retrouver la liste des rangs', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+
+?>
+							<table  cellspacing="0">
+							<thead>
+								<tr>
+									<th class="tcl" scope="col"><strong>Titre du rang</strong></th>
+									<th class="tc2" scope="col"><strong>Nombre minimum de messages</strong></th>
+									<th class="hidehead" scope="col">Actions</th>
+								</tr>
+							</thead>
+							<tbody>
+<?php
+
+	while ($cur_rank = $db->fetch_assoc($result))
+		echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="rank['.$cur_rank['id'].']" value="'.pun_htmlspecialchars($cur_rank['rank']).'" size="24" maxlength="50" /></td><td><input type="text" name="min_posts['.$cur_rank['id'].']" value="'.$cur_rank['min_posts'].'" size="7" maxlength="7" /></td><td><input type="submit" name="update['.$cur_rank['id'].']" value="Modifier" />&#160;<input type="submit" name="remove['.$cur_rank['id'].']" value="Supprimer" /></td></tr>'."\n";
+
+?>
+							</tbody>
+							</table>
+<?php
+
+}
+else
+	echo "\t\t\t\t\t\t\t".'<p>Aucun rang dans la liste.</p>'."\n";
+
+?>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_reports.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_reports.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_reports.php	(revision 1)
@@ -0,0 +1,161 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD)
+	message($lang_common['No permission']);
+
+
+// Zap a report
+if (isset($_POST['zap_id']))
+{
+	confirm_referrer('admin_reports.php');
+
+	$zap_id = intval(key($_POST['zap_id']));
+
+	$result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Impossible de retrouver les informations de signalements', __FILE__, __LINE__, $db->error());
+	$zapped = $db->result($result);
+
+	if ($zapped == '')
+		$db->query('UPDATE '.$db->prefix.'reports SET zapped='.time().', zapped_by='.$pun_user['id'].' WHERE id='.$zap_id) or error('Impossible d\'ignorer le signalement', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_reports.php', 'Signalement ignorÃ©. Redirection ...');
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Signalements';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('reports');
+
+?>
+	<div class="blockform">
+		<h2><span>Nouveaux signalements</span></h2>
+		<div class="box">
+			<form method="post" action="admin_reports.php?action=zap">
+<?php
+
+$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Impossible de retrouver la liste des signalements', __FILE__, __LINE__, $db->error());
+
+if ($db->num_rows($result))
+{
+	while ($cur_report = $db->fetch_assoc($result))
+	{
+		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Utilisateur supprimÃ©';
+		$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'SupprimÃ©';
+		$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'SupprimÃ©';
+		$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'SupprimÃ©';
+		$postid = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'SupprimÃ©';
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend>SignalÃ© le <?php echo format_time($cur_report['created']) ?></legend>
+						<div class="infldset">
+							<table cellspacing="0">
+								<tr>
+									<th scope="row">Forum&#160;&raquo;&#160;Discussion&#160;&raquo;&#160;Message</th>
+									<td><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $topic ?>&#160;&raquo;&#160;<?php echo $postid ?></td>
+								</tr>
+								<tr>
+									<th scope="row">SignalÃ© par <?php echo $reporter ?><div><input type="submit" name="zap_id[<?php echo $cur_report['id'] ?>]" value=" Ignorer " /></div></th>
+									<td><?php echo $post ?></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t\t".'<p>Il n\'y a pas de nouveaux signalements.</p>'."\n";
+
+?>
+			</form>
+		</div>
+	</div>
+
+	<div class="blockform block2">
+		<h2><span>10 derniers signalements ignorÃ©s</span></h2>
+		<div class="box">
+			<div class="fakeform">
+<?php
+
+$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Impossible de retrouver la liste des signalements', __FILE__, __LINE__, $db->error());
+
+if ($db->num_rows($result))
+{
+	while ($cur_report = $db->fetch_assoc($result))
+	{
+		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Utilisateur supprimÃ©';
+		$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'SupprimÃ©';
+		$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'SupprimÃ©';
+		$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'SupprimÃ©';
+		$post_id = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'SupprimÃ©';
+		$zapped_by = ($cur_report['zapped_by'] != '') ? '<a href="profile.php?id='.$cur_report['zapped_by_id'].'">'.pun_htmlspecialchars($cur_report['zapped_by']).'</a>' : 'N/A';
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend>Zapped <?php echo format_time($cur_report['zapped']) ?></legend>
+						<div class="infldset">
+							<table cellspacing="0">
+								<tr>
+									<th scope="row">Forum&#160;&raquo;&#160;Discussion&#160;&raquo;&#160;Message</th>
+									<td><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $topic ?>&#160;&raquo;&#160;<?php echo $post_id ?></td>
+								</tr>
+								<tr>
+									<th scope="row">SignalÃ© par <?php echo $reporter ?><div class="topspace">IgnorÃ© par <?php echo $zapped_by ?></div></th>
+									<td><?php echo $post ?></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t\t".'<p>Il n\'y a pas de signalement ignorÃ©.</p>'."\n";
+
+?>
+			</div>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/admin_users.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/admin_users.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/admin_users.php	(revision 1)
@@ -0,0 +1,511 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] > PUN_MOD)
+	message($lang_common['No permission']);
+
+
+// Show IP statistics for a certain user ID
+if (isset($_GET['ip_stats']))
+{
+	$ip_stats = intval($_GET['ip_stats']);
+	if ($ip_stats < 1)
+		message($lang_common['Bad request']);
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+
+<div id="users1" class="blocktable">
+	<h2><span>Utilisateurs</span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col">Adresse <acronym title="Internet Protocol" lang="en">IP</acronym></th>
+					<th class="tc2" scope="col">DerniÃšre visite</th>
+					<th class="tc3" scope="col">Occurences</th>
+					<th class="tcr" scope="col">Action</th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+	$result = $db->query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip ORDER BY last_used DESC') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+	{
+		while ($cur_ip = $db->fetch_assoc($result))
+		{
+
+?>
+				<tr>
+					<td class="tcl"><a href="moderate.php?get_host=<?php echo $cur_ip['poster_ip'] ?>"><?php echo $cur_ip['poster_ip'] ?></a></td>
+					<td class="tc2"><?php echo format_time($cur_ip['last_used']) ?></td>
+					<td class="tc3"><?php echo $cur_ip['used_times'] ?></td>
+					<td class="tcr"><a href="admin_users.php?show_users=<?php echo $cur_ip['poster_ip'] ?>">Trouver plus d'utilisateur pour cette <acronym title="Internet Protocol" lang="en">IP</acronym></a></td>
+				</tr>
+<?php
+
+		}
+	}
+	else
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="4">Il n\'y a actuellement aucun message de cet utilisateur dans les forums.</td></tr>'."\n";
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+if (isset($_GET['show_users']))
+{
+	$ip = $_GET['show_users'];
+
+	if (!preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip))
+		message('L\'adresse IP soumise n\'est pas correctement formÃ©e.');
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+
+<div id="users2" class="blocktable">
+	<h2><span>Utilisateurs</span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col">Nom d'utilisateur</th>
+					<th class="tc2" scope="col">E-mail</th>
+					<th class="tc3" scope="col">Titre/Statut</th>
+					<th class="tc4" scope="col">Messages</th>
+					<th class="tc5" scope="col">Note admin</th>
+					<th class="tcr" scope="col">Actions</th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+	$result = $db->query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\' ORDER BY poster DESC') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+	$num_posts = $db->num_rows($result);
+
+	if ($num_posts)
+	{
+		// Loop through users and print out some info
+		for ($i = 0; $i < $num_posts; ++$i)
+		{
+			list($poster_id, $poster) = $db->fetch_row($result);
+
+			$result2 = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND u.id='.$poster_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+
+			if (($user_data = $db->fetch_assoc($result2)))
+			{
+				$user_title = get_title($user_data);
+
+				$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">Voir stats IP</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Afficher messages</a>';
+
+?>
+				<tr>
+					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
+					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
+					<td class="tc3"><?php echo $user_title ?></td>
+					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
+					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $actions ?></td>
+				</tr>
+<?php
+
+			}
+			else
+			{
+
+?>
+				<tr>
+					<td class="tcl"><?php echo pun_htmlspecialchars($poster) ?></td>
+					<td class="tc2">&#160;</td>
+					<td class="tc3">InvitÃ©</td>
+					<td class="tc4">&#160;</td>
+					<td class="tc5">&#160;</td>
+					<td class="tcr">&#160;</td>
+				</tr>
+<?php
+
+			}
+		}
+	}
+	else
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">L\'adresse IP soumise est introuvable dans la base de donnÃ©es.</td></tr>'."\n";
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+<?php
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if (isset($_POST['find_user']))
+{
+	$form = $_POST['form'];
+	$form['username'] = $_POST['username'];
+
+	// trim() all elements in $form
+	$form = array_map('trim', $form);
+	$conditions = array();
+	
+	$posts_greater = trim($_POST['posts_greater']);
+	$posts_less = trim($_POST['posts_less']);
+	$last_post_after = trim($_POST['last_post_after']);
+	$last_post_before = trim($_POST['last_post_before']);
+	$registered_after = trim($_POST['registered_after']);
+	$registered_before = trim($_POST['registered_before']);
+	$order_by = $_POST['order_by'];
+	$direction = $_POST['direction'];
+	$user_group = $_POST['user_group'];
+
+	if (preg_match('/[^0-9]/', $posts_greater.$posts_less))
+		message('Vous avez saisi une donnÃ©e non-numÃ©rique dans un champ qui en requiÃšre une.');
+
+	// Try to convert date/time to timestamps
+	if ($last_post_after != '')
+		$last_post_after = strtotime($last_post_after);
+	if ($last_post_before != '')
+		$last_post_before = strtotime($last_post_before);
+	if ($registered_after != '')
+		$registered_after = strtotime($registered_after);
+	if ($registered_before != '')
+		$registered_before = strtotime($registered_before);
+
+	if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1)
+		message('Vous avez saisi une date/heure invalide.');
+
+	if ($last_post_after != '')
+		$conditions[] = 'u.last_post>'.$last_post_after;
+	if ($last_post_before != '')
+		$conditions[] = 'u.last_post<'.$last_post_before;
+	if ($registered_after != '')
+		$conditions[] = 'u.registered>'.$registered_after;
+	if ($registered_before != '')
+		$conditions[] = 'u.registered<'.$registered_before;
+
+	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
+	while (list($key, $input) = @each($form))
+	{
+		if ($input != '')
+			$conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
+	}
+
+	if ($posts_greater != '')
+		$conditions[] = 'u.num_posts>'.$posts_greater;
+	if ($posts_less != '')
+		$conditions[] = 'u.num_posts<'.$posts_less;
+
+	if ($user_group != 'all')
+		$conditions[] = 'u.group_id='.$db->escape($user_group);
+
+	if (empty($conditions))
+		message('Vous n\'avez saisi aucun critÃšres de recherche.');
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+
+<div id="users2" class="blocktable">
+	<h2><span>Utilisateurs</span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col">Nom d'utilisateur</th>
+					<th class="tc2" scope="col">E-mail</th>
+					<th class="tc3" scope="col">Titre/Status</th>
+					<th class="tc4" scope="col">Messages</th>
+					<th class="tc5" scope="col">Note admin</th>
+					<th class="tcr" scope="col">Actions</th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+	$result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Impossible de retrouver les informations utilisateurs', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+	{
+		while ($user_data = $db->fetch_assoc($result))
+		{
+			$user_title = get_title($user_data);
+
+			// This script is a special case in that we want to display "Not verified" for non-verified users
+			if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
+				$user_title = '<span class="warntext">Not verified</span>';
+
+			$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">Voir stats IP</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Afficher messages</a>';
+
+?>
+				<tr>
+					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
+					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
+					<td class="tc3"><?php echo $user_title ?></td>
+					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
+					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $actions ?></td>
+				</tr>
+<?php
+
+		}
+	}
+	else
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">Aucun rÃ©sultat.</td></tr>'."\n";
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else
+{
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
+	$focus_element = array('find_user', 'username');
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('users');
+
+?>
+	<div class="blockform">
+		<h2><span>Recherche d'utilisateur</span></h2>
+		<div class="box">
+			<form id="find_user" method="post" action="admin_users.php?action=find_user">
+				<p class="submittop"><input type="submit" name="find_user" value=" Rechercher " tabindex="1" /></p>
+				<div class="inform">
+					<fieldset>
+						<legend>Saisissez vos critÃšres de recherche</legend>
+						<div class="infldset">
+							<p>Recherche d'utilisateur dans la base de donnÃ©es. Vous pouvez saisir un ou plusieurs termes Ã  rechercher. Utilisez le caractÃšre astÃ©risque (*) comme joker.</p>
+							<table  class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom d'utilisateur</th>
+									<td><input type="text" name="username" size="25" maxlength="25" tabindex="2" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Adresse e-mail</th>
+									<td><input type="text" name="form[email]" size="30" maxlength="50" tabindex="3" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Titre</th>
+									<td><input type="text" name="form[title]" size="30" maxlength="50" tabindex="4" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Nom rÃ©el</th>
+									<td><input type="text" name="form[realname]" size="30" maxlength="40" tabindex="5" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Site web</th>
+									<td><input type="text" name="form[url]" size="35" maxlength="100" tabindex="6" /></td>
+								</tr>
+								<tr>
+									<th scope="row">ICQ</th>
+									<td><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="7" /></td>
+								</tr>
+								<tr>
+									<th scope="row">MSN Messenger</th>
+									<td><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="8" /></td>
+								</tr>
+								<tr>
+									<th scope="row">AOL IM</th>
+									<td><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="9" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Yahoo! Messenger</th>
+									<td><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="10" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Lieu</th>
+									<td><input type="text" name="form[location]" size="30" maxlength="30" tabindex="11" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Signature</th>
+									<td><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="12" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Note admin</th>
+									<td><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="13" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages supÃ©rieur Ã </th>
+									<td><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="14" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages infÃ©rieur Ã </th>
+									<td><input type="text" name="posts_less" size="5" maxlength="8" tabindex="15" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Le dernier message est aprÃšs le</th>
+									<td><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="16" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Le dernier message est avant le</th>
+									<td><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="17" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Inscrit aprÃšs le</th>
+									<td><input type="text" name="registered_after" size="24" maxlength="19" tabindex="18" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Inscrit avant le</th>
+									<td><input type="text" name="registered_before" size="24" maxlength="19" tabindex="19" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Trier par</th>
+									<td>
+										<select name="order_by" tabindex="20">
+											<option value="username" selected="selected">Nom d'utilisateur</option>
+											<option value="email">e-mail</option>
+											<option value="num_posts">messages</option>
+											<option value="last_post">dernier message</option>
+											<option value="registered">inscriptions</option>
+										</select>&#160;&#160;&#160;<select name="direction" tabindex="21">
+											<option value="ASC" selected="selected">croissant</option>
+											<option value="DESC">dÃ©croissant</option>
+										</select>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Groupe utilisateurs</th>
+									<td>
+										<select name="user_group" tabindex="22">
+												<option value="all" selected="selected">Tous les groupes</option>
+<?php
+
+	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+	while ($cur_group = $db->fetch_assoc($result))
+		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+
+?>
+										</select>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="find_user" value=" Rechercher " tabindex="23" /></p>
+			</form>
+		</div>
+
+		<h2 class="block2"><span>Recherche <acronym title="Internet Protocol" lang="en">IP</acronym></span></h2>
+		<div class="box">
+			<form method="get" action="admin_users.php">
+				<div class="inform">
+					<fieldset>
+						<legend>Saisissez une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> Ã  rechercher</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Adresse <acronym title="Internet Protocol" lang="en">IP</acronym><div><input type="submit" value=" Trouver " tabindex="25" /></div></th>
+									<td><input type="text" name="show_users" size="18" maxlength="15" tabindex="24" />
+									<span>L'adresse <acronym title="Internet Protocol" lang="en">IP</acronym> Ã  rechercher dans la base de donnÃ©es.</span></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
Index: /branches/rsr.v5.1.dev/web/punbb/cache/.htaccess
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/cache/.htaccess	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/cache/.htaccess	(revision 1)
@@ -0,0 +1,4 @@
+<Limit GET POST PUT>
+Order Allow,Deny
+Deny from All
+</Limit>
Index: /branches/rsr.v5.1.dev/web/punbb/cache/cache_smilies.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/cache/cache_smilies.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/cache/cache_smilies.php	(revision 1)
@@ -0,0 +1,39 @@
+<?php
+
+$smiley_text = array(
+':top:',
+'whaou',
+':d',
+':terminator:',
+':roll:',
+':|',
+':mad2:',
+':/',
+':cool:',
+':D',
+':(',
+':)',
+':p',
+';)',
+);
+
+$smiley_img = array(
+'canon.gif',
+'whaouh6na.gif',
+'yikes.png',
+'terminator.png',
+'roll.png',
+'neutral.png',
+'mad.png',
+'hmm.png',
+'cool.png',
+'big_smile.png',
+'sad.png',
+'smile.png',
+'tongue.png',
+'wink.png',
+);
+
+define('PUN_CACHE_SMILEY', 1);
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/cache/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/cache/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/cache/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/chatbox.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/chatbox.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/chatbox.txt	(revision 1)
@@ -0,0 +1,1 @@
+
Index: /branches/rsr.v5.1.dev/web/punbb/config.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/config.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/config.php	(revision 1)
@@ -0,0 +1,28 @@
+<?php
+
+  if(!isset($env))
+  { $site_path = "../";
+    require $site_path."pathes.php";
+    require $site_path.RSR_APP_PATH."env.php";
+    $env = new env($site_path.RSR_CONFIG_FILE, $site_path);
+  }
+
+  $db_type = $env->bdd["sgbd"];
+
+  $db_host = $env->bdd["host"];
+  $db_name = $env->bdd["base"];
+  $db_username = $env->bdd["user"];
+  $db_password = $env->bdd["password"];
+
+  $db_prefix = $env->bdd["prefix"].'pun_';
+  $p_connect = false;
+
+  $cookie_name = 'rsr_punbb_cookie';
+  $cookie_domain = '';
+  $cookie_path = '/';
+  $cookie_secure = 0;
+  $cookie_seed = '0e52ca5f';
+
+  define('PUN', 1);
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/delete.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/delete.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/delete.php	(revision 1)
@@ -0,0 +1,127 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+if ($id < 1)
+	message($lang_common['Bad request']);
+
+// Fetch some info about the post, the topic and the forum
+$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_post = $db->fetch_assoc($result);
+
+// Sort out who the moderators are and if we are currently a moderator (or an admin)
+$mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Determine whether this post is the "topic post" or not
+$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+$topic_post_id = $db->result($result);
+
+$is_topic_post = ($id == $topic_post_id) ? true : false;
+
+// Do we have permission to edit this post?
+if (($pun_user['g_delete_posts'] == '0' ||
+	($pun_user['g_delete_topics'] == '0' && $is_topic_post) ||
+	$cur_post['poster_id'] != $pun_user['id'] ||
+	$cur_post['closed'] == '1') &&
+	!$is_admmod)
+	message($lang_common['No permission']);
+
+// Load the delete.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/delete.php';
+
+
+if (isset($_POST['delete']))
+{
+	if ($is_admmod)
+		confirm_referrer('delete.php');
+
+	require PUN_ROOT.'include/search_idx.php';
+
+	if ($is_topic_post)
+	{
+		// Delete the topic and all of it's posts
+		delete_topic($cur_post['tid']);
+		update_forum($cur_post['fid']);
+
+		redirect('viewforum.php?id='.$cur_post['fid'], $lang_delete['Topic del redirect']);
+	}
+	else
+	{
+		// Delete just this one post
+		delete_post($id, $cur_post['tid']);
+		update_forum($cur_post['fid']);
+
+		redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);
+	}
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_delete['Delete post'];
+require PUN_ROOT.'header.php';
+
+require PUN_ROOT.'include/parser.php';
+$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
+	</div>
+</div>
+
+<div class="blockform">
+	<h2><span><?php echo $lang_delete['Delete post'] ?></span></h2>
+	<div class="box">
+		<form method="post" action="delete.php?id=<?php echo $id ?>">
+			<div class="inform">
+				<fieldset>
+					<legend class="warntext"><?php echo $lang_delete['Warning'] ?></legend>
+					<div class="infldset">
+						<div class="postmsg">
+							<p><?php echo $lang_common['Author'] ?>: <strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></p>
+							<?php echo $cur_post['message'] ?>
+						</div>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="delete" value="<?php echo $lang_delete['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/edit.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/edit.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/edit.php	(revision 1)
@@ -0,0 +1,265 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+if ($id < 1)
+	message($lang_common['Bad request']);
+
+// Fetch some info about the post, the topic and the forum
+$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_post = $db->fetch_assoc($result);
+
+// Sort out who the moderators are and if we are currently a moderator (or an admin)
+$mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Determine whether this post is the "topic post" or not
+$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+$topic_post_id = $db->result($result);
+
+$can_edit_subject = ($id == $topic_post_id && (($pun_user['g_edit_subjects_interval'] == '0' || (time() - $cur_post['posted']) < $pun_user['g_edit_subjects_interval']) || $is_admmod)) ? true : false;
+
+// Do we have permission to edit this post?
+if (($pun_user['g_edit_posts'] == '0' ||
+	$cur_post['poster_id'] != $pun_user['id'] ||
+	$cur_post['closed'] == '1') &&
+	!$is_admmod)
+	message($lang_common['No permission']);
+
+// Load the post.php/edit.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
+
+// Start with a clean slate
+$errors = array();
+
+
+if (isset($_POST['form_sent']))
+{
+	if ($is_admmod)
+		confirm_referrer('edit.php');
+
+	// If it is a topic it must contain a subject
+	if ($can_edit_subject)
+	{
+		$subject = pun_trim($_POST['req_subject']);
+
+		if ($subject == '')
+			$errors[] = $lang_post['No subject'];
+		else if (pun_strlen($subject) > 70)
+			$errors[] = $lang_post['Too long subject'];
+		else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
+			$subject = ucwords(strtolower($subject));
+	}
+
+	// Clean up message from POST
+	$message = pun_linebreaks(pun_trim($_POST['req_message']));
+
+	if ($message == '')
+		$errors[] = $lang_post['No message'];
+	else if (strlen($message) > 65535)
+		$errors[] = $lang_post['Too long message'];
+	else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
+		$message = ucwords(strtolower($message));
+
+	// Validate BBCode syntax
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
+	{
+		require PUN_ROOT.'include/parser.php';
+		$message = preparse_bbcode($message, $errors);
+	}
+
+
+	$hide_smilies = isset($_POST['hide_smilies']) ? intval($_POST['hide_smilies']) : 0;
+	if ($hide_smilies != '1') $hide_smilies = '0';
+
+	// Did everything go according to plan?
+	if (empty($errors) && !isset($_POST['preview']))
+	{
+		$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';
+
+		require PUN_ROOT.'include/search_idx.php';
+
+		if ($can_edit_subject)
+		{
+			// Update the topic and any redirect topics
+			$db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
+
+			// We changed the subject, so we need to take that into account when we update the search words
+			update_search_index('edit', $id, $message, $subject);
+		}
+		else
+			update_search_index('edit', $id, $message);
+
+		// Update the post
+		$db->query('UPDATE '.$db->prefix.'posts SET message=\''.$db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\''.$edited_sql.' WHERE id='.$id) or error('Impossible de modifier le message', __FILE__, __LINE__, $db->error());
+
+		redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
+	}
+}
+
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_post['Edit post'];
+$required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
+$focus_element = array('edit', 'req_message');
+require PUN_ROOT.'header.php';
+
+$cur_index = 1;
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
+	</div>
+</div>
+
+<?php
+
+// If there are errors, we display them
+if (!empty($errors))
+{
+
+?>
+<div id="posterror" class="block">
+	<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
+	<div class="box">
+		<div class="inbox"
+			<p><?php echo $lang_post['Post errors info'] ?></p>
+			<ul>
+<?php
+
+	while (list(, $cur_error) = each($errors))
+		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
+?>
+			</ul>
+		</div>
+	</div>
+</div>
+
+<?php
+
+}
+else if (isset($_POST['preview']))
+{
+	require_once PUN_ROOT.'include/parser.php';
+	$preview_message = parse_message($message, $hide_smilies);
+
+?>
+<div id="postpreview" class="blockpost">
+	<h2><span><?php echo $lang_post['Post preview'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $preview_message."\n" ?>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<?php
+
+}
+
+?>
+<div class="blockform">
+	<h2><?php echo $lang_post['Edit post'] ?></h2>
+	<div class="box">
+		<form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&amp;action=edit" onsubmit="return process_form(this)">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_post['Edit post legend'] ?></legend>
+					<input type="hidden" name="form_sent" value="1" />
+					<div class="infldset txtarea">
+<?php if ($can_edit_subject): ?>						<label><?php echo $lang_common['Subject'] ?><br />
+						<input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label>
+<?php endif; $bbcode_form = 'edit'; $bbcode_field = 'req_message'; require PUN_ROOT.'mod_easy_bbcode.php'; ?>						<label><?php echo $lang_common['Message'] ?><br />
+
+						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label>
+						<ul class="bblinks">
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+						</ul>
+					</div>
+				</fieldset>
+<?php
+
+$checkboxes = array();
+if ($pun_config['o_smilies'] == '1')
+{
+	if (isset($_POST['hide_smilies']) || $cur_post['hide_smilies'] == '1')
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Hide smilies'];
+	else
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Hide smilies'];
+}
+
+if ($is_admmod)
+{
+	if ((isset($_POST['form_sent']) && isset($_POST['silent'])) || !isset($_POST['form_sent']))
+		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" checked="checked" />&#160;'.$lang_post['Silent edit'];
+	else
+		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Silent edit'];
+}
+
+if (!empty($checkboxes))
+{
+
+?>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_common['Options'] ?></legend>
+					<div class="infldset">
+						<div class="rbox">
+							<?php echo implode('</label>'."\n\t\t\t\t\t\t\t", $checkboxes).'</label>'."\n" ?>
+						</div>
+					</div>
+				</fieldset>
+<?php
+
+	}
+
+?>
+			</div>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/extern.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/extern.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/extern.php	(revision 1)
@@ -0,0 +1,332 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************
+
+
+  INSTRUCTIONS
+
+  Le script extern.php est utiliser pour inclure des informations Ã  
+  propos de vos forums sur des pages externes aux forums et pour 
+  syndiquer les discussions rÃ©centes via RSS. Le script peut afficher 
+  une liste de discussions rÃ©centes (triÃ©e par messages, dates ou 
+  derniers messages), une liste dÂutilisateurs actifs ou une 
+  collection de statistiques gÃ©nÃ©rales. Le script peut Ãªtre appeler 
+  directement par lÂintermÃ©diaire dÂune URL (pour RSS), de la 
+  commande inclue de PHP ou par lÂutilisation du Server Side 
+  Includes (SSI).
+
+  Le comportement du script est commandÃ© par lÂintermÃ©diaire de 
+  variables fournies au script dans lÂURL. Les diffÃ©rentes variables 
+  sont : action (que faut-il afficher), show (combien de discussions 
+  afficher), forum (lÂID du forum Ã  sonder pour rÃ©cupÃšrer les 
+  discussions) et type (sortie comme HTML ou RSS). La seule variable 
+  obligatoire est action. Les valeurs de possibles (par defaut) sont :
+
+    action: 
+	  active (affiche les discussions rÃ©cemment actives) (HTML ou RSS)
+      new (afficher les plus rÃ©centes discussions) (HTML ou RSS)
+      online (afficher les utilisateurs en ligne) (HTML)
+      online_full (idem, mais inclut une liste complÃšte) (HTML)
+      stats (afficher les statistiques des forums) (HTML)
+
+    show:   NÂimporte quÂelle valeur, nombre entier entre 1 et 50. 
+	        Cette variable est ignorÃ©es pour la sortie RSS. 15 par 
+			dÃ©faut.
+
+    fid:    Un ou plusieurs ID de forum (sÃ©parÃ©s par des virgules). 
+	        Si ignorÃ©e, des discussions de tous les forums lisibles 
+			par les invitÃ©s seront rÃ©cupÃ©rÃ©es.
+
+    nfid:   Un ou plusieurs ID de forum (sÃ©parÃ©s par des virgules) 
+	        qui seront ignorÃ©s. Ex. l'ID d'un forum de test.
+
+    type:   RSS. Toute autre chose signifie une sortie en HTML.
+
+
+  Voici quelques exemples en utilisant la fonction include() de PHP :
+
+    Afficher les 15 discussions les plus rÃ©cemment actives depuis tous les forums :
+    include('http://host.com/forums/extern.php?action=active');
+
+    Afficher les 10 discussions les plus rÃ©centes depuis les forums dÂID 5, 6 et 7 :
+    include('http://host.com/forums/extern.php?action=new&show=10&fid=5,6,7');
+
+    Afficher les utilisateurs en ligne :
+    include('http://host.com/forums/extern.php?action=online');
+
+    Afficher les utilisateurs en ligne avec une liste complÃšte :
+    include('http://host.com/forums/extern.php?action=online_full');
+
+    Afficher les statistiques des forums :
+    include('http://host.com/forums/extern.php?action=stats');
+
+
+  Voici quelques exemples en utilisant SSI :
+
+    Afficher les 5 discussions les plus rÃ©centes depuis les forums dÂID 11 et 22:
+    <!--#include virtual="forums/extern.php?action=new&show=5&fid=11,22" -->
+
+    Afficher les statistiques des forums :
+    <!--#include virtual="forums/extern.php?action=stats" -->
+
+
+  Et finalement quelques exemples en utilisant extern.php pour produire un fil RSS 0.91 :
+
+    Afficher les 15 discussions les plus rÃ©cemment actives :
+    http://host.com/extern.php?action=active&type=RSS
+
+    Afficher les 15 discussions les plus rÃ©cemment actives depuis le forum dÂID 2:
+    http://host.com/extern.php?action=active&type=RSS&fid=2
+
+  Ci-dessous vous trouverez des variables que vous pouvez modifier pour que le 
+  script se comporte selon vos besoins.
+
+/***********************************************************************/
+
+// Le nombre maximum de discussions qui seront affichÃ©es
+$show_max_topics = 60;
+
+// La longueur Ã  laquelle les sujets des discussions seront tronquÃ©es (pour HTML)
+$max_subject_length = 30;
+
+/***********************************************************************/
+
+// NE MODIFIEZ RIEN AU-DESSOUS DE CETTE LIGNE ! (Ã  moins que vous sachiez ce que vous faites)
+
+
+define('PUN_ROOT', './');
+@include PUN_ROOT.'config.php';
+
+// If PUN isn't defined, config.php is missing or corrupt
+if (!defined('PUN'))
+	exit('Le fichier "config.php" n\'existe pas ou est endommagÃ©. Veuillez lancer install.php pour installer PunBB.');
+
+
+// Make sure PHP reports all errors except E_NOTICE
+error_reporting(E_ALL ^ E_NOTICE);
+
+// Turn off magic_quotes_runtime
+set_magic_quotes_runtime(0);
+
+
+// Load the functions script
+require PUN_ROOT.'include/functions.php';
+
+// Load DB abstraction layer and try to connect
+require PUN_ROOT.'include/dblayer/common_db.php';
+
+// Load cached config
+@include PUN_ROOT.'cache/cache_config.php';
+if (!defined('PUN_CONFIG_LOADED'))
+{
+	require PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+	require PUN_ROOT.'cache/cache_config.php';
+}
+
+// Make sure we (guests) have permission to read the forums
+$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
+if ($db->result($result) == '0')
+	exit('Vous n\'avez pas les permissions');
+
+
+// Attempt to load the common language file
+@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
+if (!isset($lang_common))
+	exit('Il n\'y a pas de pack de langue \''.$pun_config['o_default_lang'].'\' d\'installÃ©. Veuillez rÃ©-installer une langue de ce nom.');
+
+if (!isset($_GET['action']))
+	exit('Aucun paramÃštre de fourni. Veuillez voir extern.php pour les instructions.');
+
+
+//
+// Converts the CDATA end sequence ]]> into ]]&gt;
+//
+function escape_cdata($str)
+{
+	return str_replace(']]>', ']]&gt;', $str);
+}
+
+
+//
+// Show recent discussions
+//
+if ($_GET['action'] == 'active' || $_GET['action'] == 'new')
+{
+	$order_by = ($_GET['action'] == 'active') ? 't.last_post' : 't.posted';
+	$forum_sql = '';
+
+	// Was any specific forum ID's supplied?
+	if (isset($_GET['fid']) && $_GET['fid'] != '')
+	{
+		$fids = explode(',', trim($_GET['fid']));
+		$fids = array_map('intval', $fids);
+
+		if (!empty($fids))
+			$forum_sql = ' AND f.id IN('.implode(',', $fids).')';
+	}
+
+	// Any forum ID's to exclude?
+	if (isset($_GET['nfid']) && $_GET['nfid'] != '')
+	{
+		$nfids = explode(',', trim($_GET['nfid']));
+		$nfids = array_map('intval', $nfids);
+
+		if (!empty($nfids))
+			$forum_sql = ' AND f.id NOT IN('.implode(',', $nfids).')';
+	}
+
+	// Should we output this as RSS?
+	if (isset($_GET['type']) && strtoupper($_GET['type']) == 'RSS')
+	{
+		$rss_description = ($_GET['action'] == 'active') ? $lang_common['RSS Desc Active'] : $lang_common['RSS Desc New'];
+		$url_action = ($_GET['action'] == 'active') ? '&amp;action=new' : '';
+
+		// Send XML/no cache headers
+		header('Content-Type: text/xml');
+		header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
+		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+		header('Pragma: public');
+
+		// It's time for some syndication!
+		echo '<?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?>'."\r\n";
+		echo '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\r\n";
+		echo '<rss version="0.91">'."\r\n";
+		echo '<channel>'."\r\n";
+		echo "\t".'<title>'.pun_htmlspecialchars($pun_config['o_board_title']).'</title>'."\r\n";
+		echo "\t".'<link>'.$pun_config['o_base_url'].'/</link>'."\r\n";
+		echo "\t".'<description>'.pun_htmlspecialchars($rss_description.' '.$pun_config['o_board_title']).'</description>'."\r\n";
+		echo "\t".'<language>en-us</language>'."\r\n";
+
+		// Fetch 15 topics
+		$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT 15') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+		while ($cur_topic = $db->fetch_assoc($result))
+		{
+			if ($pun_config['o_censoring'] == '1')
+				$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+			echo "\t".'<item>'."\r\n";
+			echo "\t\t".'<title>'.pun_htmlspecialchars($cur_topic['subject']).'</title>'."\r\n";
+			echo "\t\t".'<link>'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].$url_action.'</link>'."\r\n";
+			echo "\t\t".'<description><![CDATA['.escape_cdata($lang_common['Forum'].': <a href="'.$pun_config['o_base_url'].'/viewforum.php?id='.$cur_topic['fid'].'">'.$cur_topic['forum_name'].'</a><br />'."\r\n".$lang_common['Author'].': '.$cur_topic['poster'].'<br />'."\r\n".$lang_common['Posted'].': '.date('r', $cur_topic['posted']).'<br />'."\r\n".$lang_common['Last post'].': '.date('r', $cur_topic['last_post'])).']]></description>'."\r\n";
+			echo "\t".'</item>'."\r\n";
+		}
+
+		echo '</channel>'."\r\n";
+		echo '</rss>';
+	}
+
+
+	// Output regular HTML
+	else
+	{
+		$show = isset($_GET['show']) ? intval($_GET['show']) : 15;
+		if ($show < 1 || $show > 50)
+			$show = 15;
+
+		// Fetch $show topics
+		$result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+		while ($cur_topic = $db->fetch_assoc($result))
+		{
+			if ($pun_config['o_censoring'] == '1')
+				$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+			if (pun_strlen($cur_topic['subject']) > $max_subject_length)
+				$subject_truncated = pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, ($max_subject_length-5)))).' ...';
+			else
+				$subject_truncated = pun_htmlspecialchars($cur_topic['subject']);
+
+			echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
+		}
+	}
+
+	return;
+}
+
+
+//
+// Show users online
+//
+else if ($_GET['action'] == 'online' || $_GET['action'] == 'online_full')
+{
+	// Load the index.php language file
+	require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
+	
+	// Fetch users online info and generate strings for output
+	$num_guests = $num_users = 0;
+	$users = array();
+	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+	while ($pun_user_online = $db->fetch_assoc($result))
+	{
+		if ($pun_user_online['user_id'] > 1)
+		{
+			$users[] = '<a href="'.$pun_config['o_base_url'].'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
+			++$num_users;
+		}
+		else
+			++$num_guests;
+	}
+
+	echo $lang_index['Guests online'].': '.$num_guests.'<br />';
+
+	if ($_GET['action'] == 'online_full')
+		echo $lang_index['Users online'].': '.implode(', ', $users).'<br />';
+	else
+		echo $lang_index['Users online'].': '.$num_users.'<br />';
+
+	return;
+}
+
+
+//
+// Show board statistics
+//
+else if ($_GET['action'] == 'stats')
+{
+	// Load the index.php language file
+	require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
+
+	// Collect some statistics from the database
+	$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\'utilisateurs', __FILE__, __LINE__, $db->error());
+	$stats['total_users'] = $db->result($result);
+
+	$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier utilisateur inscrit', __FILE__, __LINE__, $db->error());
+	$stats['last_user'] = $db->fetch_assoc($result);
+
+	$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le total de discussions et de messages', __FILE__, __LINE__, $db->error());
+	list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
+
+	echo $lang_index['No of users'].': '.$stats['total_users'].'<br />';
+	echo $lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a><br />';
+	echo $lang_index['No of topics'].': '.$stats['total_topics'].'<br />';
+	echo $lang_index['No of posts'].': '.$stats['total_posts'];
+
+	return;
+}
+
+
+else
+	exit('Bad request');
Index: /branches/rsr.v5.1.dev/web/punbb/footer.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/footer.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/footer.php	(revision 1)
@@ -0,0 +1,177 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+/* dÃ©commenter pour activer les stats phpmyvisites */
+
+// include ("../phpmv2.php");
+
+
+
+
+/* dÃ©commenter pour activer les stats google analytics */
+
+// include ("../google_analytics.php");
+
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+$tpl_temp = trim(ob_get_contents());
+$tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
+ob_end_clean();
+// END SUBST - <pun_main>
+
+
+// START SUBST - <pun_footer>
+ob_start();
+
+?>
+<div id="brdfooter" class="block">
+	<h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+<?php
+
+// If no footer style has been specified, we use the default (only copyright/debug info)
+$footer_style = isset($footer_style) ? $footer_style : NULL;
+
+if ($footer_style == 'index' || $footer_style == 'search')
+{
+	if (!$pun_user['is_guest'])
+	{
+		echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
+		echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";
+
+		if ($pun_config['o_subscriptions'] == '1')
+			echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";
+
+		echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&amp;user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
+	}
+	else
+	{
+		if ($pun_user['g_search'] == '1')
+		{
+			echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
+			echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
+		}
+	}
+}
+else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
+{
+	echo "\n\t\t\t".'<div class="conl">'."\n";
+
+	// Display the "Jump to" drop list
+	if ($pun_config['o_quickjump'] == '1')
+	{
+		// Load cached quickjump
+		@include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
+		if (!defined('PUN_QJ_LOADED'))
+		{
+			require_once PUN_ROOT.'include/cache.php';
+			generate_quickjump_cache($pun_user['g_id']);
+			require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
+		}
+	}
+
+	if ($footer_style == 'viewforum' && $is_admmod)
+		echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
+	else if ($footer_style == 'viewtopic' && $is_admmod)
+	{
+		echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";
+		echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";
+
+		if ($cur_topic['closed'] == '1')
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
+		else
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";
+
+		if ($cur_topic['sticky'] == '1')
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
+		else
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
+	}
+
+	echo "\t\t\t".'</div>'."\n";
+}
+
+?>
+		  <p class="conr">PropulsÃ© par <a href="http://www.punbb.org/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson<br /> Traduction par <a href="http://www.punbb.fr/">punbb.fr</a></p>
+<?php
+
+// Display debug info (if enabled/defined)
+if (defined('PUN_DEBUG'))
+{
+	// Calculate script generation time
+	list($usec, $sec) = explode(' ', microtime());
+	$time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
+	echo "\t\t\t".'<p class="conr">[ GÃ©nÃ©rÃ©e en '.$time_diff.' sec., '.$db->get_num_queries().' requÃªtes exÃ©cutÃ©es ]</p>'."\n";
+}
+
+?>
+			<div class="clearer"></div>
+		</div>
+	</div>
+</div>
+<?php
+
+
+// End the transaction
+$db->end_transaction();
+
+// Display executed queries (if enabled)
+if (defined('PUN_SHOW_QUERIES'))
+	display_saved_queries();
+
+$tpl_temp = trim(ob_get_contents());
+$tpl_main = str_replace('<pun_footer>', $tpl_temp, $tpl_main);
+ob_end_clean();
+// END SUBST - <pun_footer>
+
+
+// START SUBST - <pun_include "*">
+while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
+{
+	if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
+	    error('Impossible de procÃ©der Ã  l\'inclusion utilisateur &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; depuis le template main.tpl. Il n\'y a pas de fichier dans le rÃ©pertoire /include/user/');
+	
+	ob_start();
+	include PUN_ROOT.'include/user/'.$cur_include[1];
+	$tpl_temp = ob_get_contents();
+	$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
+    ob_end_clean();
+}
+// END SUBST - <pun_include "*">
+
+
+// Close the db connection (and free up any result data)
+// $db->close();
+
+// Spit out the page
+//exit($tpl_main);
+
+ require "pun_integration.php";
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/header.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/header.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/header.php	(revision 1)
@@ -0,0 +1,210 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+// Send no-cache headers
+header('Expires: Thu, 21 Jul 1977 07:30:00 GMT');	// When yours truly first set eyes on this world! :)
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+header('Cache-Control: post-check=0, pre-check=0', false);
+header('Pragma: no-cache');		// For HTTP/1.0 compability
+
+
+// Load the template
+if (defined('PUN_ADMIN_CONSOLE'))
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
+else if (defined('PUN_HELP'))
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
+else
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');
+
+
+// START SUBST - <pun_content_direction>
+$tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main);
+// END SUBST - <pun_content_direction>
+
+
+// START SUBST - <pun_char_encoding>
+$tpl_main = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_main);
+// END SUBST - <pun_char_encoding>
+
+
+// START SUBST - <pun_head>
+ob_start();
+
+// Is this a page that we want search index spiders to index?
+if (!defined('PUN_ALLOW_INDEX'))
+	echo '<meta name="ROBOTS" content="NOINDEX, FOLLOW" />'."\n";
+
+?>
+<title><?php echo $page_title ?></title>
+<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
+<?php
+
+if (defined('PUN_ADMIN_CONSOLE'))
+	echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n";
+
+if (isset($required_fields))
+{
+	// Output JavaScript to validate form (make sure required fields are filled out)
+
+?>
+<script type="text/javascript">
+<!--
+function process_form(the_form)
+{
+	var element_names = new Object()
+<?php
+
+	// Output a JavaScript array with localised field names
+	while (list($elem_orig, $elem_trans) = @each($required_fields))
+		echo "\t".'element_names["'.$elem_orig.'"] = "'.addslashes(str_replace('&#160;', ' ', $elem_trans)).'"'."\n";
+
+?>
+
+	if (document.all || document.getElementById)
+	{
+		for (i = 0; i < the_form.length; ++i)
+		{
+			var elem = the_form.elements[i]
+			if (elem.name && elem.name.substring(0, 4) == "req_")
+			{
+				if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
+				{
+					alert("\"" + element_names[elem.name] + "\" <?php echo $lang_common['required field'] ?>")
+					elem.focus()
+					return false
+				}
+			}
+		}
+	}
+
+	return true
+}
+// -->
+</script>
+<?php
+
+}
+
+$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
+if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false)
+	echo '<script type="text/javascript" src="style/imports/minmax.js"></script>';
+
+$tpl_temp = trim(ob_get_contents());
+$tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);
+ob_end_clean();
+// END SUBST - <pun_head>
+
+
+// START SUBST - <body>
+if (isset($focus_element))
+{
+	$tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
+	$tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
+}
+// END SUBST - <body>
+
+
+// START SUBST - <pun_page>
+$tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main);
+// END SUBST - <pun_title>
+
+
+// START SUBST - <pun_title>
+$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>', $tpl_main);
+// END SUBST - <pun_title>
+
+
+// START SUBST - <pun_desc>
+$tpl_main = str_replace('<pun_desc>', '<p><span>'.$pun_config['o_board_desc'].'</span></p>', $tpl_main);
+// END SUBST - <pun_desc>
+
+
+// START SUBST - <pun_navlinks>
+$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);
+// END SUBST - <pun_navlinks>
+
+
+// START SUBST - <pun_status>
+if ($pun_user['is_guest'])
+	$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
+else
+{
+	$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
+
+	if ($pun_user['g_id'] < PUN_GUEST)
+	{
+		$result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
+
+		if ($db->result($result_header))
+			$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">Il y a de nouveaux signalements</a></strong></li>';
+
+		if ($pun_config['o_maintenance'] == '1')
+			$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Le mode maintenance est activÃ©&#160;!</a></strong></li>';
+	}
+
+	if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
+		$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
+	else
+		$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
+}
+
+$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
+// END SUBST - <pun_status>
+
+
+// START SUBST - <pun_announcement>
+if ($pun_config['o_announcement'] == '1')
+{
+	ob_start();
+
+?>
+<div id="announce" class="block">
+	<h2><span><?php echo $lang_common['Announcement'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<div><?php echo $pun_config['o_announcement_message'] ?></div>
+		</div>
+	</div>
+</div>
+<?php
+
+	$tpl_temp = trim(ob_get_contents());
+	$tpl_main = str_replace('<pun_announcement>', $tpl_temp, $tpl_main);
+	ob_end_clean();
+}
+else
+	$tpl_main = str_replace('<pun_announcement>', '', $tpl_main);
+// END SUBST - <pun_announcement>
+
+
+// START SUBST - <pun_main>
+ob_start();
+
+
+define('PUN_HEADER', 1);
Index: /branches/rsr.v5.1.dev/web/punbb/help.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/help.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/help.php	(revision 1)
@@ -0,0 +1,163 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Tell header.php to use the help template
+define('PUN_HELP', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+// Load the help.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php';
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help'];
+require PUN_ROOT.'header.php';
+
+?>
+<h2><?php echo $lang_common['BBCode'] ?></h2>
+<div class="box">
+	<div class="inbox">
+		<p><a name="bbcode"></a><?php echo $lang_help['BBCode info 1'] ?></p><br />
+		<p><?php echo $lang_help['BBCode info 2'] ?></p>
+	</div>
+</div>
+<h2><?php echo $lang_help['Text style'] ?></h2>
+<div class="box">
+	<p><?php echo $lang_help['Text style info'] ?></p><br />
+	<div style="padding-left: 4px">
+		[b]<?php echo $lang_help['Bold text'] ?>[/b] <?php echo $lang_help['produces'] ?> <b><?php echo $lang_help['Bold text'] ?></b><br />
+		[u]<?php echo $lang_help['Underlined text'] ?>[/u] <?php echo $lang_help['produces'] ?> <span class="bbu"><?php echo $lang_help['Underlined text'] ?></span><br />
+		[i]<?php echo $lang_help['Italic text'] ?>[/i] <?php echo $lang_help['produces'] ?> <i><?php echo $lang_help['Italic text'] ?></i><br />
+		[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span><br />
+		[color=blue]<?php echo $lang_help['Blue text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: blue"><?php echo $lang_help['Blue text'] ?></span>
+	</div>
+</div>
+<h2><?php echo $lang_help['Links and images'] ?></h2>
+<div class="box">
+	<p><?php echo $lang_help['Links info'] ?></p><br />
+	<div style="padding-left: 4px">
+		[url=<?php echo $pun_config['o_base_url'].'/' ?>]<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'].'/' ?>"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a><br />
+		[url]<?php echo $pun_config['o_base_url'].'/' ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_base_url'].'/' ?></a><br />
+		[email]myname@mydomain.com[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com">myname@mydomain.com</a><br />
+		[email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br />
+	</div>
+	<p><a name="img"></a><?php echo $lang_help['Images info'] ?></p>
+	<div>[img]http://www.punbb.org/img/small_logo.png[/img] <?php echo $lang_help['produces'] ?> <img src="http://www.punbb.org/img/small_logo.png" alt="http://www.punbb.org/img/small_logo.png" /></div>
+</div>
+<h2><?php echo $lang_help['Quotes'] ?></h2>
+<div class="box">
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Quotes info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
+		<?php echo $lang_help['produces quote box'] ?><br /><br />
+		<div class="postmsg">
+			<blockquote><div class="incqbox"><h4>James <?php echo $lang_common['wrote'] ?>:</h4><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
+		</div>
+		<br />
+		<?php echo $lang_help['Quotes info 2'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
+		<?php echo $lang_help['produces quote box'] ?><br /><br />
+		<div class="postmsg">
+			<blockquote><div class="incqbox"><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
+		</div>
+	</div>
+</div>
+<h2><?php echo $lang_help['Code'] ?></h2>
+<div class="box">
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Code info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[code]<?php echo $lang_help['Code text'] ?>[/code]<br /><br />
+		<?php echo $lang_help['produces code box'] ?><br /><br />
+		<div class="postmsg">
+			<div class="codebox"><div class="incqbox"><h4><?php echo $lang_common['Code'] ?>:</h4><div class="scrollbox" style="height: 4.5em"><pre><?php echo $lang_help['Code text'] ?></pre></div></div></div>
+		</div>
+	</div>
+</div>
+<h2><?php echo $lang_help['Nested tags'] ?></h2>
+<div class="box">
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Nested tags info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b] <?php echo $lang_help['produces'] ?> <span class="bbu"><b><?php echo $lang_help['Bold, underlined text'] ?></b></span><br /><br />
+	</div>
+</div>
+<h2><?php echo $lang_common['Smilies'] ?></h2>
+<div class="box">
+	<div style="padding-left: 4px">
+		<a name="smilies"></a><?php echo $lang_help['Smilies info'] ?><br /><br />
+<?php
+
+// Display the smiley set
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
+$num_smilies = count($smiley_text);
+for ($i = 0; $i < $num_smilies; ++$i)
+{
+	// Is there a smiley at the current index?
+	if (!isset($smiley_text[$i]))
+		continue;
+
+	echo "\t\t".'&#160;&#160;&#160;&#160;'.$smiley_text[$i];
+
+	// Save the current text and image
+	$cur_img = $smiley_img[$i];
+	$cur_text = $smiley_text[$i];
+
+	// Loop through the rest of the array and see if there are any duplicate images
+	// (more than one text representation for one image)
+	for ($next = $i + 1; $next < $num_smilies; ++$next)
+	{
+		// Did we find a dupe?
+		if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next])
+		{
+			echo ' '.$lang_common['and'].' '.$smiley_text[$next];
+
+			// Remove the dupe so we won't display it twice
+			unset($smiley_text[$next]);
+			unset($smiley_img[$next]);
+		}
+	}
+
+	echo ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" alt="'.$cur_text.'" /><br />'."\n";
+}
+
+?>
+		<br />
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/img/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/img/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/img/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/img/smilies/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/img/smilies/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/img/smilies/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/cache.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/cache.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/cache.php	(revision 1)
@@ -0,0 +1,205 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+//
+// If we are running pre PHP 4.2.0, we add our own implementation of var_export
+//
+if (!function_exists('var_export'))
+{
+	function var_export()
+	{
+		$args = func_get_args();
+		$indent = (isset($args[2])) ? $args[2] : '';
+
+		if (is_array($args[0]))
+		{
+			$output = 'array ('."\n";
+
+			foreach ($args[0] as $k => $v)
+			{
+				if (is_numeric($k))
+					$output .= $indent.'  '.$k.' => ';
+				else
+					$output .= $indent.'  \''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $k)).'\' => ';
+
+				if (is_array($v))
+					$output .= var_export($v, true, $indent.'  ');
+				else
+				{
+					if (gettype($v) != 'string' && !empty($v))
+						$output .= $v.','."\n";
+					else
+						$output .= '\''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $v)).'\','."\n";
+				}
+			}
+
+			$output .= ($indent != '') ? $indent.'),'."\n" : ')';
+		}
+		else
+			$output = $args[0];
+
+		if ($args[1] == true)
+			return $output;
+		else
+			echo $output;
+	}
+}
+
+
+//
+// Generate the config cache PHP script
+//
+function generate_config_cache()
+{
+	global $db;
+
+	// Get the forum config from the DB
+	$result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Impossible de retrouver la configuration des forums', __FILE__, __LINE__, $db->error());
+	while ($cur_config_item = $db->fetch_row($result))
+		$output[$cur_config_item[0]] = $cur_config_item[1];
+
+	// Output config as PHP code
+	$fh = @fopen(PUN_ROOT.'cache/cache_config.php', 'wb');
+	if (!$fh)
+		error('Impossible d\'Ã©crire le fichier cache de configuration dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
+
+	fwrite($fh, '<?php'."\n\n".'define(\'PUN_CONFIG_LOADED\', 1);'."\n\n".'$pun_config = '.var_export($output, true).';'."\n\n".'?>');
+
+	fclose($fh);
+}
+
+
+//
+// Generate the bans cache PHP script
+//
+function generate_bans_cache()
+{
+	global $db;
+
+	// Get the ban list from the DB
+	$result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Impossible de retrouver la liste de bannissements', __FILE__, __LINE__, $db->error());
+
+	$output = array();
+	while ($cur_ban = $db->fetch_assoc($result))
+		$output[] = $cur_ban;
+
+	// Output ban list as PHP code
+	$fh = @fopen(PUN_ROOT.'cache/cache_bans.php', 'wb');
+	if (!$fh)
+		error('Impossible d\'Ã©crire le fichier cache de bannissements dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
+
+	fwrite($fh, '<?php'."\n\n".'define(\'PUN_BANS_LOADED\', 1);'."\n\n".'$pun_bans = '.var_export($output, true).';'."\n\n".'?>');
+
+	fclose($fh);
+}
+
+
+//
+// Generate the ranks cache PHP script
+//
+function generate_ranks_cache()
+{
+	global $db;
+
+	// Get the rank list from the DB
+	$result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Impossible de retrouver la liste des rangs utilisateurs', __FILE__, __LINE__, $db->error());
+
+	$output = array();
+	while ($cur_rank = $db->fetch_assoc($result))
+		$output[] = $cur_rank;
+
+	// Output ranks list as PHP code
+	$fh = @fopen(PUN_ROOT.'cache/cache_ranks.php', 'wb');
+	if (!$fh)
+		error('Impossible d\'Ã©crire le fichier de cache de rangs utilisateurs dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
+
+	fwrite($fh, '<?php'."\n\n".'define(\'PUN_RANKS_LOADED\', 1);'."\n\n".'$pun_ranks = '.var_export($output, true).';'."\n\n".'?>');
+
+	fclose($fh);
+}
+
+
+//
+// Generate quickjump cache PHP scripts
+//
+function generate_quickjump_cache($group_id = false)
+{
+	global $db, $lang_common, $pun_user;
+
+	// If a group_id was supplied, we generate the quickjump cache for that group only
+	if ($group_id !== false)
+		$groups[0] = $group_id;
+	else
+	{
+		// A group_id was now supplied, so we generate the quickjump cache for all groups
+		$result = $db->query('SELECT g_id FROM '.$db->prefix.'groups') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
+		$num_groups = $db->num_rows($result);
+
+		for ($i = 0; $i < $num_groups; ++$i)
+			$groups[] = $db->result($result, $i);
+	}
+
+	// Loop through the groups in $groups and output the cache for each of them
+	while (list(, $group_id) = @each($groups))
+	{
+		// Output quickjump as PHP code
+		$fh = @fopen(PUN_ROOT.'cache/cache_quickjump_'.$group_id.'.php', 'wb');
+		if (!$fh)
+			error('Impossible d\'Ã©crire le fichier cache de saut rapide de forums dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
+
+		$output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';
+		$output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
+
+
+		$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+		$cur_category = 0;
+		while ($cur_forum = $db->fetch_assoc($result))
+		{
+			if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+			{
+				if ($cur_category)
+					$output .= "\t\t\t\t\t\t".'</optgroup>'."\n";
+
+				$output .= "\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
+				$cur_category = $cur_forum['cid'];
+			}
+
+			$redirect_tag = ($cur_forum['redirect_url'] != '') ? ' &gt;&gt;&gt;' : '';
+			$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";
+		}
+
+		$output .= "\t\t\t\t\t".'</optgroup>'."\n\t\t\t\t\t".'</select>'."\n\t\t\t\t\t".'<input type="submit" value="<?php echo $lang_common[\'Go\'] ?>" accesskey="g" />'."\n\t\t\t\t\t".'</label></div>'."\n\t\t\t\t".'</form>'."\n";
+
+		fwrite($fh, $output);
+
+		fclose($fh);
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/cache_smilies.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/cache_smilies.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/cache_smilies.php	(revision 1)
@@ -0,0 +1,48 @@
+<?php
+
+//
+// Generate smiley cache PHP array
+//
+function generate_smiley_cache()
+{
+	global $db;
+	
+	$smiley_text = array();
+	$smiley_img = array();
+	
+	$result = $db->query('SELECT image, text FROM '.$db->prefix.'smilies ORDER BY disp_position') or error('Impossible de retrouver les smilies', __FILE__, __LINE__, $db->error());
+	while ($db_smilies = $db->fetch_assoc($result))
+	{
+		$smiley_text[] = $db_smilies['text'];
+		$smiley_img[] = $db_smilies['image'];
+	}
+	
+	$smiley_text = array_map('addslashes', $smiley_text);
+	$smiley_text = array_map('pun_htmlspecialchars', $smiley_text);
+
+	$str = '';
+	
+	$str .= '<?php'."\n\n";
+	$str .= '$smiley_text = array('."\n";
+	
+	foreach ($smiley_text as $t)
+		$str .= "'".$t."',"."\n";
+		
+	$str .= ');'."\n\n";
+	$str .= '$smiley_img = array('."\n";
+	
+	foreach ($smiley_img as $i)
+		$str .= "'".$i."',"."\n";
+		
+	$str .= ');'."\n\n";
+	$str .= 'define(\'PUN_CACHE_SMILEY\', 1);'."\n\n";
+	$str .= '?>';
+	
+	$fh = @fopen(PUN_ROOT.'cache/cache_smilies.php', 'wb');
+	if (!$fh)
+		error('Impossible d\'Ã©crire le fichier cache de smileys dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);		
+	
+	fwrite($fh, $str);
+	
+	fclose($fh);
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/common.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/common.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/common.php	(revision 1)
@@ -0,0 +1,148 @@
+<?php
+
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Activez le mode DEBUG en enlevant // du dÃ©but de la ligne ci-dessous
+//define('PUN_DEBUG', 1);
+
+// Ceci permettra d'afficher en bas de page toutes les requÃªtes exÃ©cutÃ©es
+// N'ACTIVEZ PAS cela sur un environnement de production !
+//define('PUN_SHOW_QUERIES', 1);
+
+if (!defined('PUN_ROOT'))
+	exit('La constante PUN_ROOT doit Ãªtre dÃ©finie est doit pointer le repertoire racine d\'une installation fonctionnelle de PunBB.');
+
+
+// Load the functions script
+require PUN_ROOT.'include/functions.php';
+
+// Reverse the effect of register_globals
+if (@ini_get('register_globals'))
+	unregister_globals();
+
+include PUN_ROOT.'config.php';
+
+// If PUN isn't defined, config.php is missing or corrupt
+if (!defined('PUN'))
+	exit('Le fichier "config.php" n\'existe pas ou est endommagÃ©. Veuillez lancer <a href="install.php">install.php</a> pour installer PunBB.');
+
+
+// Record the start time (will be used to calculate the generation time for the page)
+list($usec, $sec) = explode(' ', microtime());
+$pun_start = ((float)$usec + (float)$sec);
+
+// Enable full error, warning and notice reporting
+error_reporting(E_ALL ^ E_NOTICE);
+
+// Turn off magic_quotes_runtime
+set_magic_quotes_runtime(0);
+
+// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
+if (get_magic_quotes_gpc())
+{
+	function stripslashes_array($array)
+	{
+		return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
+	}
+
+	$_GET = stripslashes_array($_GET);
+	$_POST = stripslashes_array($_POST);
+	$_COOKIE = stripslashes_array($_COOKIE);
+}
+
+// Seed the random number generator
+mt_srand((double)microtime()*1000000);
+
+// If a cookie name is not specified in config.php, we use the default (punbb_cookie)
+if (empty($cookie_name))
+	$cookie_name = 'punbb_cookie';
+
+// Define a few commonly used constants
+define('PUN_UNVERIFIED', 32000);
+define('PUN_ADMIN', 1);
+define('PUN_MOD', 2);
+define('PUN_GUEST', 3);
+define('PUN_MEMBER', 4);
+
+
+// Load DB abstraction layer and connect
+require PUN_ROOT.'include/dblayer/common_db.php';
+
+// Start a transaction
+$db->start_transaction();
+
+// Load cached config
+@include PUN_ROOT.'cache/cache_config.php';
+if (!defined('PUN_CONFIG_LOADED'))
+{
+	require PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+	require PUN_ROOT.'cache/cache_config.php';
+}
+
+
+// Enable output buffering
+if (!defined('PUN_DISABLE_BUFFERING'))
+{
+	// For some very odd reason, "Norton Internet Security" unsets this
+	$_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';
+
+	// Should we use gzip output compression?
+	if ($pun_config['o_gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
+		ob_start('ob_gzhandler');
+	else
+		ob_start();
+}
+
+
+// Check/update/set cookie and fetch user info
+$pun_user = array();
+check_cookie($pun_user);
+
+// Attempt to load the common language file
+@include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
+if (!isset($lang_common))
+	exit('Il n\'y a pas de pack de langue \''.pun_htmlspecialchars($pun_user['language']).'\' d\'installÃ©. Veuillez rÃ©-installer une langue de ce nom.');
+
+// Check if we are to display a maintenance message
+if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))
+	maintenance_message();
+
+
+// Load cached bans
+@include PUN_ROOT.'cache/cache_bans.php';
+if (!defined('PUN_BANS_LOADED'))
+{
+	require_once PUN_ROOT.'include/cache.php';
+	generate_bans_cache();
+	require PUN_ROOT.'cache/cache_bans.php';
+}
+
+// Check if current user is banned
+check_bans();
+
+// Update online list
+update_users_online();
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/include/common_admin.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/common_admin.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/common_admin.php	(revision 1)
@@ -0,0 +1,149 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+//
+// Display the admin navigation menu
+//
+function generate_admin_menu($page = '')
+{
+	global $pun_config, $pun_user;
+
+	$is_admin = $pun_user['g_id'] == PUN_ADMIN ? true : false;
+
+?>
+<div id="adminconsole" class="block2col">
+	<div id="adminmenu" class="blockmenu">
+		<h2><span>Menu <?php echo ($is_admin) ? 'Admin' : 'ModÃ©rateur' ?></span></h2>
+		<div class="box">
+			<div class="inbox">
+				<ul>
+					<li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="admin_index.php">Index</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="admin_categories.php">CatÃ©gories</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="admin_forums.php">Forums</a></li>
+<?php endif; ?>					<li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="admin_users.php">Utilisateurs</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="admin_groups.php">Groupes</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="admin_options.php">Options</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="admin_permissions.php">Permissions</a></li>
+<?php endif; ?>					<li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="admin_censoring.php">Mots censurÃ©s</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="admin_ranks.php">Rangs utilisateurs</a></li>
+<?php endif; ?><?php if ($is_admin || $pun_config['p_mod_ban_users'] == '1'): ?>					<li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="admin_bans.php">Bannissements</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'prune') echo ' class="isactive"'; ?>><a href="admin_prune.php">Ãlaguage</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="admin_maintenance.php">Maintenance</a></li>
+<?php endif; ?>					<li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="admin_reports.php">Signalements</a></li>
+				</ul>
+			</div>
+		</div>
+<?php
+
+	// See if there are any plugins
+	$plugins = array();
+	$d = dir(PUN_ROOT.'plugins');
+	while (($entry = $d->read()) !== false)
+	{
+		$prefix = substr($entry, 0, strpos($entry, '_'));
+		$suffix = substr($entry, strlen($entry) - 4);
+
+		if ($suffix == '.php' && ((!$is_admin && $prefix == 'AMP') || ($is_admin && ($prefix == 'AP' || $prefix == 'AMP'))))
+			$plugins[] = array(substr(substr($entry, strpos($entry, '_') + 1), 0, -4), $entry);
+	}
+	$d->close();
+
+	// Did we find any plugins?
+	if (!empty($plugins))
+	{
+
+?>
+		<h2 class="block2"><span>Plugins</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<ul>
+<?php
+
+		while (list(, $cur_plugin) = @each($plugins))
+			echo "\t\t\t\t\t".'<li'.(($page == $cur_plugin[1]) ? ' class="isactive"' : '').'><a href="admin_loader.php?plugin='.$cur_plugin[1].'">'.str_replace('_', ' ', $cur_plugin[0]).'</a></li>'."\n";
+
+?>
+				</ul>
+			</div>
+		</div>
+<?php
+
+	}
+
+?>
+	</div>
+
+<?php
+
+}
+
+
+//
+// Delete topics from $forum_id that are "older than" $prune_date (if $prune_sticky is 1, sticky topics will also be deleted)
+//
+function prune($forum_id, $prune_sticky, $prune_date)
+{
+	global $db;
+
+	$extra_sql = ($prune_date != -1) ? ' AND last_post<'.$prune_date : '';
+
+	if (!$prune_sticky)
+		$extra_sql .= ' AND sticky=\'0\'';
+
+	// Fetch topics to prune
+	$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra_sql, true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+	$topic_ids = '';
+	while ($row = $db->fetch_row($result))
+		$topic_ids .= (($topic_ids != '') ? ',' : '').$row[0];
+
+	if ($topic_ids != '')
+	{
+		// Fetch posts to prune
+		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topic_ids.')', true) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
+
+		$post_ids = '';
+		while ($row = $db->fetch_row($result))
+			$post_ids .= (($post_ids != '') ? ',' : '').$row[0];
+
+		if ($post_ids != '')
+		{
+			// Delete topics
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topic_ids.')') or error('Impossible d\'Ã©laguer les discussions', __FILE__, __LINE__, $db->error());
+			// Delete subscriptions
+			$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id IN('.$topic_ids.')') or error('Impossible d\'Ã©laguer les abonnements', __FILE__, __LINE__, $db->error());
+			// Delete posts
+			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$post_ids.')') or error('Impossible d\'Ã©laguer les messages', __FILE__, __LINE__, $db->error());
+
+			// We removed a bunch of posts, so now we have to update the search index
+			require_once PUN_ROOT.'include/search_idx.php';
+			strip_search_index($post_ids);
+		}
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/common_db.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/common_db.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/common_db.php	(revision 1)
@@ -0,0 +1,70 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+//
+// Return current timestamp (with microseconds) as a float (used in dblayer)
+//
+if (defined('PUN_SHOW_QUERIES'))
+{
+	function get_microtime()
+	{
+		list($usec, $sec) = explode(' ', microtime());
+		return ((float)$usec + (float)$sec);
+	}
+}
+
+
+// Load the appropriate DB layer class
+switch ($db_type)
+{
+	case 'mysql':
+		require PUN_ROOT.'include/dblayer/mysql.php';
+		break;
+
+	case 'mysqli':
+		require PUN_ROOT.'include/dblayer/mysqli.php';
+		break;
+
+	case 'pgsql':
+		require PUN_ROOT.'include/dblayer/pgsql.php';
+		break;
+
+	case 'sqlite':
+		require PUN_ROOT.'include/dblayer/sqlite.php';
+		break;
+
+	default:
+		error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es valable. Veuillez vÃ©rifier vos paramÃštres de configuration dans config.php', __FILE__, __LINE__);
+		break;
+}
+
+
+// Create the database adapter object (and open/connect to/select db)
+$db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect);
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysql.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysql.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysql.php	(revision 1)
@@ -0,0 +1,190 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure we have built in support for MySQL
+if (!function_exists('mysql_connect'))
+	exit('This PHP environment doesn\'t have MySQL support built in. MySQL support is required if you want to use a MySQL database to run this forum. Consult the PHP documentation for further assistance.');
+
+
+class DBLayer
+{
+	var $prefix;
+	var $link_id;
+	var $query_result;
+
+	var $saved_queries = array();
+	var $num_queries = 0;
+
+
+	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
+	{
+		$this->prefix = $db_prefix;
+
+		if ($p_connect)
+			$this->link_id = @mysql_pconnect($db_host, $db_username, $db_password);
+		else
+			$this->link_id = @mysql_connect($db_host, $db_username, $db_password);
+
+		if ($this->link_id)
+		{
+			if (@mysql_select_db($db_name, $this->link_id))
+			{ mysql_query("SET NAMES utf8");
+				return $this->link_id;
+		   }
+			else
+				error('Unable to select database. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
+		}
+		else
+			error('Unable to connect to MySQL server. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
+	}
+
+
+	function start_transaction()
+	{
+		return;
+	}
+
+
+	function end_transaction()
+	{
+		return;
+	}
+
+
+	function query($sql, $unbuffered = false)
+	{
+		if (defined('PUN_SHOW_QUERIES'))
+			$q_start = get_microtime();
+
+		if ($unbuffered)
+			$this->query_result = @mysql_unbuffered_query($sql, $this->link_id);
+		else
+			$this->query_result = @mysql_query($sql, $this->link_id);
+
+		if ($this->query_result)
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
+
+			++$this->num_queries;
+
+			return $this->query_result;
+		}
+		else
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, 0);
+
+			return false;
+		}
+	}
+
+
+	function result($query_id = 0, $row = 0)
+	{
+		return ($query_id) ? @mysql_result($query_id, $row) : false;
+	}
+
+
+	function fetch_assoc($query_id = 0)
+	{
+		return ($query_id) ? @mysql_fetch_assoc($query_id) : false;
+	}
+
+
+	function fetch_row($query_id = 0)
+	{
+		return ($query_id) ? @mysql_fetch_row($query_id) : false;
+	}
+
+
+	function num_rows($query_id = 0)
+	{
+		return ($query_id) ? @mysql_num_rows($query_id) : false;
+	}
+
+
+	function affected_rows()
+	{
+		return ($this->link_id) ? @mysql_affected_rows($this->link_id) : false;
+	}
+
+
+	function insert_id()
+	{
+		return ($this->link_id) ? @mysql_insert_id($this->link_id) : false;
+	}
+
+
+	function get_num_queries()
+	{
+		return $this->num_queries;
+	}
+
+
+	function get_saved_queries()
+	{
+		return $this->saved_queries;
+	}
+
+
+	function free_result($query_id = false)
+	{
+		return ($query_id) ? @mysql_free_result($query_id) : false;
+	}
+
+
+	function escape($str)
+	{
+		if (function_exists('mysql_real_escape_string'))
+			return mysql_real_escape_string($str, $this->link_id);
+		else
+			return mysql_escape_string($str);
+	}
+
+
+	function error()
+	{
+		$result['error_sql'] = @current(@end($this->saved_queries));
+		$result['error_no'] = @mysql_errno($this->link_id);
+		$result['error_msg'] = @mysql_error($this->link_id);
+
+		return $result;
+	}
+
+
+	function close()
+	{
+		if ($this->link_id)
+		{
+			if ($this->query_result)
+				@mysql_free_result($this->query_result);
+
+			return @mysql_close($this->link_id);
+		}
+		else
+			return false;
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysqli.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysqli.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/mysqli.php	(revision 1)
@@ -0,0 +1,188 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure we have built in support for MySQL
+if (!function_exists('mysqli_connect'))
+	exit('This PHP environment doesn\'t have Improved MySQL (mysqli) support built in. Improved MySQL support is required if you want to use a MySQL 4.1 (or later) database to run this forum. Consult the PHP documentation for further assistance.');
+
+
+class DBLayer
+{
+	var $prefix;
+	var $link_id;
+	var $query_result;
+
+	var $saved_queries = array();
+	var $num_queries = 0;
+
+
+	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $foo)
+	{
+		$this->prefix = $db_prefix;
+
+		// Was a custom port supplied with $db_host?
+		if (strpos($db_host, ':') !== false)
+			list($db_host, $db_port) = explode(':', $db_host);
+
+		if (isset($db_port))
+			$this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name, $db_port);
+		else
+			$this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name);
+
+		if (!$this->link_id)
+			error('Unable to connect to MySQL and select database. MySQL reported: '.mysqli_connect_error(), __FILE__, __LINE__);
+	}
+
+
+	function start_transaction()
+	{
+		return;
+	}
+
+
+	function end_transaction()
+	{
+		return;
+	}
+
+
+	function query($sql, $unbuffered = false)
+	{
+		if (defined('PUN_SHOW_QUERIES'))
+			$q_start = get_microtime();
+
+		$this->query_result = @mysqli_query($this->link_id, $sql);
+
+		if ($this->query_result)
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
+
+			++$this->num_queries;
+
+			return $this->query_result;
+		}
+		else
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, 0);
+
+			return false;
+		}
+	}
+
+
+	function result($query_id = 0, $row = 0)
+	{
+		if ($query_id)
+		{
+			if ($row)
+				@mysqli_data_seek($query_id, $row);
+
+			$cur_row = @mysqli_fetch_row($query_id);
+			return $cur_row[0];
+		}
+		else
+			return false;
+	}
+
+
+	function fetch_assoc($query_id = 0)
+	{
+		return ($query_id) ? @mysqli_fetch_assoc($query_id) : false;
+	}
+
+
+	function fetch_row($query_id = 0)
+	{
+		return ($query_id) ? @mysqli_fetch_row($query_id) : false;
+	}
+
+
+	function num_rows($query_id = 0)
+	{
+		return ($query_id) ? @mysqli_num_rows($query_id) : false;
+	}
+
+
+	function affected_rows()
+	{
+		return ($this->link_id) ? @mysqli_affected_rows($this->link_id) : false;
+	}
+
+
+	function insert_id()
+	{
+		return ($this->link_id) ? @mysqli_insert_id($this->link_id) : false;
+	}
+
+
+	function get_num_queries()
+	{
+		return $this->num_queries;
+	}
+
+
+	function get_saved_queries()
+	{
+		return $this->saved_queries;
+	}
+
+
+	function free_result($query_id = false)
+	{
+		return ($query_id) ? @mysqli_free_result($query_id) : false;
+	}
+
+
+	function escape($str)
+	{
+		return mysqli_real_escape_string($this->link_id, $str);
+	}
+
+
+	function error()
+	{
+		$result['error_sql'] = @current(@end($this->saved_queries));
+		$result['error_no'] = @mysqli_errno($this->link_id);
+		$result['error_msg'] = @mysqli_error($this->link_id);
+
+		return $result;
+	}
+
+
+	function close()
+	{
+		if ($this->link_id)
+		{
+			if ($this->query_result)
+				@mysqli_free_result($this->query_result);
+
+			return @mysqli_close($this->link_id);
+		}
+		else
+			return false;
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/pgsql.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/pgsql.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/pgsql.php	(revision 1)
@@ -0,0 +1,264 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure we have built in support for PostgreSQL
+if (!function_exists('pg_connect'))
+	exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.');
+
+
+class DBLayer
+{
+	var $prefix;
+	var $link_id;
+	var $query_result;
+	var $last_query_text = array();
+	var $in_transaction = 0;
+
+	var $saved_queries = array();
+	var $num_queries = 0;
+
+	var $error_no = false;
+	var $error_msg = 'Unknown';
+
+
+	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
+	{
+		$this->prefix = $db_prefix;
+
+		if ($db_host != '')
+		{
+			if (strpos($db_host, ':') !== false)
+			{
+				list($db_host, $dbport) = explode(':', $db_host);
+				$connect_str[] = 'host='.$db_host.' port='.$dbport;
+			}
+			else
+			{
+				if ($db_host != 'localhost')
+					$connect_str[] = 'host='.$db_host;
+			}
+		}
+
+		if ($db_name)
+			$connect_str[] = 'dbname='.$db_name;
+
+		if ($db_username != '')
+			$connect_str[] = 'user='.$db_username;
+
+		if ($db_password != '')
+			$connect_str[] = 'password='.$db_password;
+
+		if ($p_connect)
+			$this->link_id = @pg_pconnect(implode(' ', $connect_str));
+		else
+			$this->link_id = @pg_connect(implode(' ', $connect_str));
+
+		if (!$this->link_id)
+			error('Unable to connect to PostgreSQL server', __FILE__, __LINE__);
+		else
+			return $this->link_id;
+	}
+
+
+	function start_transaction()
+	{
+		++$this->in_transaction;
+
+		return (@pg_query($this->link_id, 'BEGIN')) ? true : false;
+	}
+
+
+	function end_transaction()
+	{
+		--$this->in_transaction;
+
+		if (@pg_query($this->link_id, 'COMMIT'))
+			return true;
+		else
+		{
+			@pg_query($this->link_id, 'ROLLBACK');
+			return false;
+		}
+	}
+
+
+	function query($sql, $unbuffered = false)	// $unbuffered is ignored since there is no pgsql_unbuffered_query()
+	{
+		if (strrpos($sql, 'LIMIT') !== false)
+			$sql = preg_replace('#LIMIT ([0-9]+),([ 0-9]+)#', 'LIMIT \\2 OFFSET \\1', $sql);
+
+		if (defined('PUN_SHOW_QUERIES'))
+			$q_start = get_microtime();
+
+		@pg_send_query($this->link_id, $sql);
+		$this->query_result = @pg_get_result($this->link_id);
+
+		if (pg_result_status($this->query_result) != PGSQL_FATAL_ERROR)
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
+
+			++$this->num_queries;
+
+			$this->last_query_text[$this->query_result] = $sql;
+
+			return $this->query_result;
+		}
+		else
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, 0);
+
+			$this->error_msg = @pg_result_error($this->query_result);
+
+			if ($this->in_transaction)
+				@pg_query($this->link_id, 'ROLLBACK');
+
+			--$this->in_transaction;
+
+			return false;
+		}
+	}
+
+
+	function result($query_id = 0, $row = 0)
+	{
+		return ($query_id) ? @pg_fetch_result($query_id, $row, 0) : false;
+	}
+
+
+	function fetch_assoc($query_id = 0)
+	{
+		return ($query_id) ? @pg_fetch_assoc($query_id) : false;
+	}
+
+
+	function fetch_row($query_id = 0)
+	{
+		return ($query_id) ? @pg_fetch_row($query_id) : false;
+	}
+
+
+	function num_rows($query_id = 0)
+	{
+		return ($query_id) ? @pg_num_rows($query_id) : false;
+	}
+
+
+	function affected_rows()
+	{
+		return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
+	}
+
+
+	function insert_id()
+	{
+		$query_id = $this->query_result;
+
+		if ($query_id && $this->last_query_text[$query_id] != '')
+		{
+			if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $table_name))
+			{
+				// Hack (don't ask)
+				if (substr($table_name[1], -6) == 'groups')
+					$table_name[1] .= '_g';
+
+				$temp_q_id = @pg_query($this->link_id, 'SELECT currval(\''.$table_name[1].'_id_seq\')');
+				return ($temp_q_id) ? intval(@pg_fetch_result($temp_q_id, 0)) : false;
+			}
+		}
+
+		return false;
+	}
+
+
+	function get_num_queries()
+	{
+		return $this->num_queries;
+	}
+
+
+	function get_saved_queries()
+	{
+		return $this->saved_queries;
+	}
+
+
+	function free_result($query_id = false)
+	{
+		if (!$query_id)
+			$query_id = $this->query_result;
+
+		return ($query_id) ? @pg_free_result($query_id) : false;
+	}
+
+
+	function escape($str)
+	{
+		return pg_escape_string($str);
+	}
+
+
+	function error()
+	{
+		$result['error_sql'] = @current(@end($this->saved_queries));
+		$result['error_no'] = false;
+/*
+		if (!empty($this->query_result))
+		{
+			$result['error_msg'] = trim(@pg_result_error($this->query_result));
+			if ($result['error_msg'] != '')
+				return $result;
+		}
+
+		$result['error_msg'] = (!empty($this->link_id)) ? trim(@pg_last_error($this->link_id)) : trim(@pg_last_error());
+*/
+		$result['error_msg'] = $this->error_msg;
+
+		return $result;
+	}
+
+
+	function close()
+	{
+		if ($this->link_id)
+		{
+			if ($this->in_transaction)
+			{
+				if (defined('PUN_SHOW_QUERIES'))
+					$this->saved_queries[] = array('COMMIT', 0);
+
+				@pg_query($this->link_id, 'COMMIT');
+			}
+
+			if ($this->query_result)
+				@pg_free_result($this->query_result);
+
+			return @pg_close($this->link_id);
+		}
+		else
+			return false;
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/dblayer/sqlite.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/dblayer/sqlite.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/dblayer/sqlite.php	(revision 1)
@@ -0,0 +1,253 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure we have built in support for SQLite
+if (!function_exists('sqlite_open'))
+	exit('This PHP environment doesn\'t have SQLite support built in. SQLite support is required if you want to use a SQLite database to run this forum. Consult the PHP documentation for further assistance.');
+
+
+class DBLayer
+{
+	var $prefix;
+	var $link_id;
+	var $query_result;
+	var $in_transaction = 0;
+
+	var $saved_queries = array();
+	var $num_queries = 0;
+
+	var $error_no = false;
+	var $error_msg = 'Unknown';
+
+
+	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
+	{
+		// Prepend $db_name with the path to the forum root directory
+		$db_name = PUN_ROOT.$db_name;
+
+		$this->prefix = $db_prefix;
+
+		if (!file_exists($db_name))
+		{
+			@touch($db_name);
+			@chmod($db_name, 0666);
+			if (!file_exists($db_name))
+				error('Unable to create new database \''.$db_name.'\'. Permission denied', __FILE__, __LINE__);
+		}
+
+		if (!is_readable($db_name))
+			error('Unable to open database \''.$db_name.'\' for reading. Permission denied', __FILE__, __LINE__);
+
+		if (!is_writable($db_name))
+			error('Unable to open database \''.$db_name.'\' for writing. Permission denied', __FILE__, __LINE__);
+
+		if ($p_connect)
+			$this->link_id = @sqlite_popen($db_name, 0666, $sqlite_error);
+		else
+			$this->link_id = @sqlite_open($db_name, 0666, $sqlite_error);
+
+		if (!$this->link_id)
+			error('Unable to open database \''.$db_name.'\'. SQLite reported: '.$sqlite_error, __FILE__, __LINE__);
+		else
+			return $this->link_id;
+	}
+
+
+	function start_transaction()
+	{
+		++$this->in_transaction;
+
+		return (@sqlite_query($this->link_id, 'BEGIN')) ? true : false;
+	}
+
+
+	function end_transaction()
+	{
+		--$this->in_transaction;
+
+		if (@sqlite_query($this->link_id, 'COMMIT'))
+			return true;
+		else
+		{
+			@sqlite_query($this->link_id, 'ROLLBACK');
+			return false;
+		}
+	}
+
+
+	function query($sql, $unbuffered = false)
+	{
+		if (defined('PUN_SHOW_QUERIES'))
+			$q_start = get_microtime();
+
+		if ($unbuffered)
+			$this->query_result = @sqlite_unbuffered_query($this->link_id, $sql);
+		else
+			$this->query_result = @sqlite_query($this->link_id, $sql);
+
+		if ($this->query_result)
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
+
+			++$this->num_queries;
+
+			return $this->query_result;
+		}
+		else
+		{
+			if (defined('PUN_SHOW_QUERIES'))
+				$this->saved_queries[] = array($sql, 0);
+
+			$this->error_no = @sqlite_last_error($this->link_id);
+			$this->error_msg = @sqlite_error_string($this->error_no);
+
+			if ($this->in_transaction)
+				@sqlite_query($this->link_id, 'ROLLBACK');
+
+			--$this->in_transaction;
+
+			return false;
+		}
+	}
+
+
+	function result($query_id = 0, $row = 0)
+	{
+		if ($query_id)
+		{
+			if ($row != 0)
+				@sqlite_seek($query_id, $row);
+
+			return @current(@sqlite_current($query_id));
+		}
+		else
+			return false;
+	}
+
+
+	function fetch_assoc($query_id = 0)
+	{
+		if ($query_id)
+		{
+			$cur_row = @sqlite_fetch_array($query_id, SQLITE_ASSOC);
+			if ($cur_row)
+			{
+				// Horrible hack to get rid of table names and table aliases from the array keys
+				while (list($key, $value) = @each($cur_row))
+				{
+				    $dot_spot = strpos($key, '.');
+				    if ($dot_spot !== false)
+				    {
+				        unset($cur_row[$key]);
+				        $key = substr($key, $dot_spot+1);
+				        $cur_row[$key] = $value;
+				    }
+				}
+			}
+
+			return $cur_row;
+		}
+		else
+			return false;
+	}
+
+
+	function fetch_row($query_id = 0)
+	{
+		return ($query_id) ? @sqlite_fetch_array($query_id, SQLITE_NUM) : false;
+	}
+
+
+	function num_rows($query_id = 0)
+	{
+		return ($query_id) ? @sqlite_num_rows($query_id) : false;
+	}
+
+
+	function affected_rows()
+	{
+		return ($this->query_result) ? @sqlite_changes($this->query_result) : false;
+	}
+
+
+	function insert_id()
+	{
+		return ($this->link_id) ? @sqlite_last_insert_rowid($this->link_id) : false;
+	}
+
+
+	function get_num_queries()
+	{
+		return $this->num_queries;
+	}
+
+
+	function get_saved_queries()
+	{
+		return $this->saved_queries;
+	}
+
+
+	function free_result($query_id = false)
+	{
+		return true;
+	}
+
+
+	function escape($str)
+	{
+		return sqlite_escape_string($str);
+	}
+
+
+	function error()
+	{
+		$result['error_sql'] = @current(@end($this->saved_queries));
+		$result['error_no'] = $this->error_no;
+		$result['error_msg'] = $this->error_msg;
+
+		return $result;
+	}
+
+
+	function close()
+	{
+		if ($this->link_id)
+		{
+			if ($this->in_transaction)
+			{
+				if (defined('PUN_SHOW_QUERIES'))
+					$this->saved_queries[] = array('COMMIT', 0);
+
+				@sqlite_query($this->link_id, 'COMMIT');
+			}
+
+			return @sqlite_close($this->link_id);
+		}
+		else
+			return false;
+	}
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/email.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/email.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/email.php	(revision 1)
@@ -0,0 +1,186 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+//
+// Validate an e-mail address
+//
+function is_valid_email($email)
+{
+	if (strlen($email) > 50)
+		return false;
+
+	return preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email);
+}
+
+
+//
+// Check if $email is banned
+//
+function is_banned_email($email)
+{
+	global $db, $pun_bans;
+
+	foreach ($pun_bans as $cur_ban)
+	{
+		if ($cur_ban['email'] != '' &&
+			($email == $cur_ban['email'] ||
+			(strpos($cur_ban['email'], '@') === false && stristr($email, '@'.$cur_ban['email']))))
+			return true;
+	}
+
+	return false;
+}
+
+
+//
+// Wrapper for PHP's mail()
+//
+function pun_mail($to, $subject, $message, $from = '')
+{
+	global $pun_config, $lang_common;
+
+	// Default sender/return address
+	if (!$from)
+		$from = '"'.str_replace('"', '', $pun_config['o_board_title'].' '.$lang_common['Mailer']).'" <'.$pun_config['o_webmaster_email'].'>';
+
+	// Do a little spring cleaning
+	$to = trim(preg_replace('#[\n\r]+#s', '', $to));
+	$subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
+	$from = trim(preg_replace('#[\n\r:]+#s', '', $from));
+
+	$headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer';
+
+	// Make sure all linebreaks are CRLF in message
+	$message = str_replace("\n", "\r\n", pun_linebreaks($message));
+
+	if ($pun_config['o_smtp_host'] != '')
+		smtp_mail($to, $subject, $message, $headers);
+	else
+	{
+		// Change the linebreaks used in the headers according to OS
+		if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC')
+			$headers = str_replace("\r\n", "\r", $headers);
+		else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
+			$headers = str_replace("\r\n", "\n", $headers);
+		
+		mail($to, $subject, $message, $headers);
+	}
+}
+
+
+//
+// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com).
+// They deserve all the credit for writing it. I made small modifications for it to suit PunBB and it's coding standards.
+//
+function server_parse($socket, $expected_response)
+{
+	$server_response = '';
+	while (substr($server_response, 3, 1) != ' ')
+	{
+		if (!($server_response = fgets($socket, 256)))
+			error('N\'a pas pu obtenir les codes de rÃ©ponse du serveur mail. Veuillez contacter l\'administrateur de forum', __FILE__, __LINE__);
+	}
+
+	if (!(substr($server_response, 0, 3) == $expected_response))
+		error('Impossible d\'envoyer l\'e-mail. Veuillez contacter l\'administrateur des forums avec le message d\'erreur suivant rapportÃ© par le serveur SMTP : "'.$server_response.'"', __FILE__, __LINE__);
+}
+
+
+//
+// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com).
+// They deserve all the credit for writing it. I made small modifications for it to suit PunBB and it's coding standards.
+//
+function smtp_mail($to, $subject, $message, $headers = '')
+{
+	global $pun_config;
+
+	$recipients = explode(',', $to);
+
+	// Are we using port 25 or a custom port?
+	if (strpos($pun_config['o_smtp_host'], ':') !== false)
+		list($smtp_host, $smtp_port) = explode(':', $pun_config['o_smtp_host']);
+	else
+	{
+		$smtp_host = $pun_config['o_smtp_host'];
+		$smtp_port = 25;
+	}
+
+	if (!($socket = fsockopen($smtp_host, $smtp_port, $errno, $errstr, 15)))
+		error('Impossible de joindre l\'hÃŽte SMTP "'.$pun_config['o_smtp_host'].'" ('.$errno.') ('.$errstr.')', __FILE__, __LINE__);
+
+	server_parse($socket, '220');
+
+	if ($pun_config['o_smtp_user'] != '' && $pun_config['o_smtp_pass'] != '')
+	{
+		fwrite($socket, 'EHLO '.$smtp_host."\r\n");
+		server_parse($socket, '250');
+
+		fwrite($socket, 'AUTH LOGIN'."\r\n");
+		server_parse($socket, '334');
+
+		fwrite($socket, base64_encode($pun_config['o_smtp_user'])."\r\n");
+		server_parse($socket, '334');
+
+		fwrite($socket, base64_encode($pun_config['o_smtp_pass'])."\r\n");
+		server_parse($socket, '235');
+	}
+	else
+	{
+		fwrite($socket, 'HELO '.$smtp_host."\r\n");
+		server_parse($socket, '250');
+	}
+
+	fwrite($socket, 'MAIL FROM: <'.$pun_config['o_webmaster_email'].'>'."\r\n");
+	server_parse($socket, '250');
+
+	$to_header = 'To: ';
+
+	@reset($recipients);
+	while (list(, $email) = @each($recipients))
+	{
+		fwrite($socket, 'RCPT TO: <'.$email.'>'."\r\n");
+		server_parse($socket, '250');
+
+		$to_header .= '<'.$email.'>, ';
+	}
+
+	fwrite($socket, 'DATA'."\r\n");
+	server_parse($socket, '354');
+
+	fwrite($socket, 'Subject: '.$subject."\r\n".$to_header."\r\n".$headers."\r\n\r\n".$message."\r\n");
+
+	fwrite($socket, '.'."\r\n");
+	server_parse($socket, '250');
+
+	fwrite($socket, 'QUIT'."\r\n");
+	fclose($socket);
+
+	return true;
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/functions.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/functions.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/functions.php	(revision 1)
@@ -0,0 +1,1070 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+//
+// Cookie stuff!
+//
+function check_cookie(&$pun_user)
+{
+	global $db, $pun_config, $cookie_name, $cookie_seed;
+
+	$now = time();
+	$expire = $now + 31536000;	// The cookie expires after a year
+
+	// We assume it's a guest
+	$cookie = array('user_id' => 1, 'password_hash' => 'InvitÃ©');
+
+	// If a cookie is set, we get the user_id and password hash from it
+	if (isset($_COOKIE[$cookie_name]))
+		list($cookie['user_id'], $cookie['password_hash']) = @unserialize($_COOKIE[$cookie_name]);
+
+	if ($cookie['user_id'] > 1)
+	{
+		// Check if there's a user with the user ID and password hash from the cookie
+        $_query = 'SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id']);
+		$result = $db->query($_query) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+		$pun_user = $db->fetch_assoc($result);
+
+		// If user authorisation failed
+		if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash'])
+		{
+			pun_setcookie(0, random_pass(8), $expire);
+			set_default_user();
+
+			return;
+		}
+
+		// Set a default language if the user selected language no longer exists
+		if (!$pun_user['language'] || !@file_exists(PUN_ROOT.'lang/'.$pun_user['language']))
+			$pun_user['language'] = $pun_config['o_default_lang'];
+
+		// Set a default style if the user selected style no longer exists
+		if (!@file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css'))
+			$pun_user['style'] = $pun_config['o_default_style'];
+
+		if (!$pun_user['disp_topics'])
+			$pun_user['disp_topics'] = $pun_config['o_disp_topics_default'];
+		if (!$pun_user['disp_posts'])
+			$pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];
+
+		if ($pun_user['save_pass'] == '0')
+			$expire = 0;
+
+		// Define this if you want this visit to affect the online list and the users last visit data
+		if (!defined('PUN_QUIET_VISIT'))
+		{
+			// Update the online list
+			if (!$pun_user['logged'])
+				$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Impossbile d\'insÃ©rer dans la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+			else
+			{
+				// Special case: We've timed out, but no other user has browsed the forums since we timed out
+				if ($pun_user['logged'] < ($now-$pun_config['o_timeout_visit']))
+				{
+					$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de mettre Ã  jour les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+					$pun_user['last_visit'] = $pun_user['logged'];
+				}
+
+				$idle_sql = ($pun_user['idle'] == '1') ? ', idle=0' : '';
+				$db->query('UPDATE '.$db->prefix.'online SET logged='.$now.$idle_sql.' WHERE user_id='.$pun_user['id']) or error('Impossible de mettre Ã  jour la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+			}
+		}
+
+		$pun_user['is_guest'] = false;
+	}
+	else
+		set_default_user();
+}
+
+
+//
+// Fill $pun_user with default values (for guests)
+//
+function set_default_user()
+{
+	global $db, $pun_user, $pun_config;
+
+	$remote_addr = get_remote_address();
+
+	// Fetch guest user
+	$result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Impossible de retrouver les informations d\'invitÃ©', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		exit('Impossible de retrouver les informations invitÃ©. La table \''.$db->prefix.'users\' doit contenir une entrÃ©e avec un id = 1 qui reprÃ©sente les utilisateurs anonymes.');
+
+	$pun_user = $db->fetch_assoc($result);
+
+	// Update online list
+	if (!$pun_user['logged'])
+		$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.time().')') or error('Impossbile d\'insÃ©rer dans la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+	else
+		$db->query('UPDATE '.$db->prefix.'online SET logged='.time().' WHERE ident=\''.$db->escape($remote_addr).'\'') or error('Impossible de mettre Ã  jour la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+	$pun_user['disp_topics'] = $pun_config['o_disp_topics_default'];
+	$pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];
+	$pun_user['timezone'] = $pun_config['o_server_timezone'];
+	$pun_user['language'] = $pun_config['o_default_lang'];
+	$pun_user['style'] = $pun_config['o_default_style'];
+	$pun_user['is_guest'] = true;
+
+}
+
+
+//
+// Set a cookie, PunBB style!
+//
+function pun_setcookie($user_id, $password_hash, $expire)
+{
+	global $cookie_name, $cookie_path, $cookie_domain, $cookie_secure, $cookie_seed;
+
+	// Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)
+//	@header('P3P: CP="CUR ADM"');
+
+	setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure);
+}
+
+
+//
+// Check whether the connecting user is banned (and delete any expired bans while we're at it)
+//
+function check_bans()
+{
+	global $db, $pun_config, $lang_common, $pun_user, $pun_bans;
+
+	// Admins aren't affected
+	if ($pun_user['g_id'] == PUN_ADMIN || !$pun_bans)
+		return;
+
+	// Add a dot at the end of the IP address to prevent banned address 192.168.0.5 from matching e.g. 192.168.0.50
+	$user_ip = get_remote_address().'.';
+	$bans_altered = false;
+
+	foreach ($pun_bans as $cur_ban)
+	{
+		// Has this ban expired?
+		if ($cur_ban['expire'] != '' && $cur_ban['expire'] <= time())
+		{
+			$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$cur_ban['id']) or error('Impossible de supprimÃ© le bannissement expirÃ©', __FILE__, __LINE__, $db->error());
+			$bans_altered = true;
+			continue;
+		}
+
+		if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))
+		{
+			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+			message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+		}
+
+		if ($cur_ban['ip'] != '')
+		{
+			$cur_ban_ips = explode(' ', $cur_ban['ip']);
+
+			for ($i = 0; $i < count($cur_ban_ips); ++$i)
+			{
+				$cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
+
+				if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])
+				{
+					$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+					message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+				}
+			}
+		}
+	}
+
+	// If we removed any expired bans during our run-through, we need to regenerate the bans cache
+	if ($bans_altered)
+	{
+		require_once PUN_ROOT.'include/cache.php';
+		generate_bans_cache();
+	}
+}
+
+
+//
+// Update "Users online"
+//
+function update_users_online()
+{
+	global $db, $pun_config, $pun_user;
+
+	$now = time();
+
+	// Fetch all online list entries that are older than "o_timeout_online"
+	$result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Impossible de retrouver les anciennes entrÃ©es de la liste des utilisateurs', __FILE__, __LINE__, $db->error());
+	while ($cur_user = $db->fetch_assoc($result))
+	{
+		// If the entry is a guest, delete it
+		if ($cur_user['user_id'] == '1')
+			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($cur_user['ident']).'\'') or error('Impossible de supprimer de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+		else
+		{
+			// If the entry is older than "o_timeout_visit", update last_visit for the user in question, then delete him/her from the online list
+			if ($cur_user['logged'] < ($now-$pun_config['o_timeout_visit']))
+			{
+				$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$cur_user['logged'].' WHERE id='.$cur_user['user_id']) or error('Impossible de mettre Ã  jour les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+				$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$cur_user['user_id']) or error('Impossible de supprimer de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+			}
+			else if ($cur_user['idle'] == '0')
+				$db->query('UPDATE '.$db->prefix.'online SET idle=1 WHERE user_id='.$cur_user['user_id']) or error('Impossible d\'insÃ©rer Ã  la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+		}
+	}
+}
+
+
+//
+// Generate the "navigator" that appears at the top of every page
+//
+function generate_navlinks()
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	// Index and Userlist should always be displayed
+	$links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
+	$links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';
+
+	if ($pun_config['o_rules'] == '1')
+		$links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
+
+	if ($pun_user['is_guest'])
+	{
+		if ($pun_user['g_search'] == '1')
+			$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+
+		$links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>';
+		$links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>';
+
+		$info = $lang_common['Not logged in'];
+	}
+	else
+	{
+		if ($pun_user['g_id'] > PUN_MOD)
+		{
+			if ($pun_user['g_search'] == '1')
+				$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+
+			$links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
+			$links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
+		}
+		else
+		{
+			$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+			$links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
+			$links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';
+			$links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
+		}
+	}
+
+	// Are there any additional navlinks we should insert into the array before imploding it?
+	if ($pun_config['o_additional_navlinks'] != '')
+	{
+		if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))
+		{
+			// Insert any additional links into the $links array (at the correct index)
+			for ($i = 0; $i < count($extra_links[1]); ++$i)
+				array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
+		}
+	}
+
+	return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';
+}
+
+
+//
+// Display the profile navigation menu
+//
+function generate_profile_menu($page = '')
+{
+	global $lang_profile, $pun_config, $pun_user, $id;
+
+?>
+<div id="profile" class="block2col">
+	<div class="blockmenu">
+		<h2><span><?php echo $lang_profile['Profile menu'] ?></span></h2>
+		<div class="box">
+			<div class="inbox">
+				<ul>
+					<li<?php if ($page == 'essentials') echo ' class="isactive"'; ?>><a href="profile.php?section=essentials&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section essentials'] ?></a></li>
+					<li<?php if ($page == 'personal') echo ' class="isactive"'; ?>><a href="profile.php?section=personal&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section personal'] ?></a></li>
+					<li<?php if ($page == 'messaging') echo ' class="isactive"'; ?>><a href="profile.php?section=messaging&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section messaging'] ?></a></li>
+					<li<?php if ($page == 'personality') echo ' class="isactive"'; ?>><a href="profile.php?section=personality&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section personality'] ?></a></li>
+					<li<?php if ($page == 'display') echo ' class="isactive"'; ?>><a href="profile.php?section=display&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section display'] ?></a></li>
+					<li<?php if ($page == 'privacy') echo ' class="isactive"'; ?>><a href="profile.php?section=privacy&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section privacy'] ?></a></li>
+<?php if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '1')): ?>					<li<?php if ($page == 'admin') echo ' class="isactive"'; ?>><a href="profile.php?section=admin&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section admin'] ?></a></li>
+<?php endif; ?>				</ul>
+			</div>
+		</div>
+	</div>
+<?php
+
+}
+
+
+//
+// Update posts, topics, last_post, last_post_id and last_poster for a forum (redirect topics are not included)
+//
+function update_forum($forum_id)
+{
+	global $db;
+
+	$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$forum_id) or error('Impossible de retrouver le total de discussions du forum', __FILE__, __LINE__, $db->error());
+	list($num_topics, $num_posts) = $db->fetch_row($result);
+
+	$num_posts = $num_posts + $num_topics;		// $num_posts is only the sum of all replies (we have to add the topic posts)
+
+	$result = $db->query('SELECT last_post, last_post_id, last_poster FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND moved_to IS NULL ORDER BY last_post DESC LIMIT 1') or error('Impossible de retrouver last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))		// There are topics in the forum
+	{
+		list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);
+
+		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
+	}
+	else	// There are no topics
+		$db->query('UPDATE '.$db->prefix.'forums SET num_topics=0, num_posts=0, last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
+}
+
+
+//
+// Delete a topic and all of it's posts
+//
+function delete_topic($topic_id)
+{
+	global $db;
+
+	// Delete the topic and any redirect topics
+	$db->query('DELETE FROM '.$db->prefix.'topics WHERE id='.$topic_id.' OR moved_to='.$topic_id) or error('Impossible de supprimer le sujet', __FILE__, __LINE__, $db->error());
+
+	// Create a list of the post ID's in this topic
+	$post_ids = '';
+	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
+	while ($row = $db->fetch_row($result))
+		$post_ids .= ($post_ids != '') ? ','.$row[0] : $row[0];
+
+	// Make sure we have a list of post ID's
+	if ($post_ids != '')
+	{
+		strip_search_index($post_ids);
+
+		// Delete posts in topic
+		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
+	}
+
+	// Delete any subscriptions for this topic
+	$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id='.$topic_id) or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
+}
+
+
+//
+// Delete a single post
+//
+function delete_post($post_id, $topic_id)
+{
+	global $db;
+
+	$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY id DESC LIMIT 2') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	list($last_id, ,) = $db->fetch_row($result);
+	list($second_last_id, $second_poster, $second_posted) = $db->fetch_row($result);
+
+	// Delete the post
+	$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.$post_id) or error('Impossible de supprimer le message', __FILE__, __LINE__, $db->error());
+
+	strip_search_index($post_id);
+
+	// Count number of replies in the topic
+	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de retrouver le total de messages pour la discussion', __FILE__, __LINE__, $db->error());
+	$num_replies = $db->result($result, 0) - 1;
+
+	// If the message we deleted is the most recent in the topic (at the end of the topic)
+	if ($last_id == $post_id)
+	{
+		// If there is a $second_last_id there is more than 1 reply to the topic
+		if (!empty($second_last_id))
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$second_posted.', last_post_id='.$second_last_id.', last_poster=\''.$db->escape($second_poster).'\', num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
+		else
+			// We deleted the only reply, so now last_post/last_post_id/last_poster is posted/id/poster from the topic itself
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post=posted, last_post_id=id, last_poster=poster, num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
+	}
+	else
+		// Otherwise we just decrement the reply counter
+		$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
+}
+
+
+//
+// Replace censored words in $text
+//
+function censor_words($text)
+{
+	global $db;
+	static $search_for, $replace_with;
+
+	// If not already built in a previous call, build an array of censor words and their replacement text
+	if (!isset($search_for))
+	{
+		$result = $db->query('SELECT search_for, replace_with FROM '.$db->prefix.'censoring') or error('Impossible de retrouver la liste des mots Ã  censurer', __FILE__, __LINE__, $db->error());
+		$num_words = $db->num_rows($result);
+
+		$search_for = array();
+		for ($i = 0; $i < $num_words; ++$i)
+		{
+			list($search_for[$i], $replace_with[$i]) = $db->fetch_row($result);
+			$search_for[$i] = '/\b('.str_replace('\*', '\w*?', preg_quote($search_for[$i], '/')).')\b/i';
+		}
+	}
+
+	if (!empty($search_for))
+		$text = substr(preg_replace($search_for, $replace_with, ' '.$text.' '), 1, -1);
+
+	return $text;
+}
+
+
+//
+// Determines the correct title for $user
+// $user must contain the elements 'username', 'title', 'posts', 'g_id' and 'g_user_title'
+//
+function get_title($user)
+{
+	global $db, $pun_config, $pun_bans, $lang_common;
+	static $ban_list, $pun_ranks;
+
+	// If not already built in a previous call, build an array of lowercase banned usernames
+	if (empty($ban_list))
+	{
+		$ban_list = array();
+
+		foreach ($pun_bans as $cur_ban)
+			$ban_list[] = strtolower($cur_ban['username']);
+	}
+
+	// If not already loaded in a previous call, load the cached ranks
+	if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
+	{
+		@include PUN_ROOT.'cache/cache_ranks.php';
+		if (!defined('PUN_RANKS_LOADED'))
+		{
+			require_once PUN_ROOT.'include/cache.php';
+			generate_ranks_cache();
+			require PUN_ROOT.'cache/cache_ranks.php';
+		}
+	}
+
+	// If the user has a custom title
+	if ($user['title'] != '')
+		$user_title = pun_htmlspecialchars($user['title']);
+	// If the user is banned
+	else if (in_array(strtolower($user['username']), $ban_list))
+		$user_title = $lang_common['Banned'];
+	// If the user group has a default user title
+	else if ($user['g_user_title'] != '')
+		$user_title = pun_htmlspecialchars($user['g_user_title']);
+	// If the user is a guest
+	else if ($user['g_id'] == PUN_GUEST)
+		$user_title = $lang_common['Guest'];
+	else
+	{
+		// Are there any ranks?
+		if ($pun_config['o_ranks'] == '1' && !empty($pun_ranks))
+		{
+			@reset($pun_ranks);
+			while (list(, $cur_rank) = @each($pun_ranks))
+			{
+				if (intval($user['num_posts']) >= $cur_rank['min_posts'])
+					$user_title = pun_htmlspecialchars($cur_rank['rank']);
+			}
+		}
+
+		// If the user didn't "reach" any rank (or if ranks are disabled), we assign the default
+		if (!isset($user_title))
+			$user_title = $lang_common['Member'];
+	}
+
+	return $user_title;
+}
+
+
+//
+// Generate a string with numbered links (for multipage scripts)
+//
+function paginate($num_pages, $cur_page, $link_to)
+{
+	$pages = array();
+	$link_to_all = false;
+
+	// If $cur_page == -1, we link to all pages (used in viewforum.php)
+	if ($cur_page == -1)
+	{
+		$cur_page = 1;
+		$link_to_all = true;
+	}
+
+	if ($num_pages <= 1)
+		$pages = array('<strong>1</strong>');
+	else
+	{
+		if ($cur_page > 3)
+		{
+			$pages[] = '<a href="'.$link_to.'&amp;p=1">1</a>';
+
+			if ($cur_page != 4)
+				$pages[] = '&hellip;';
+		}
+
+		// Don't ask me how the following works. It just does, OK? :-)
+		for ($current = $cur_page - 2, $stop = $cur_page + 3; $current < $stop; ++$current)
+		{
+			if ($current < 1 || $current > $num_pages)
+				continue;
+			else if ($current != $cur_page || $link_to_all)
+				$pages[] = '<a href="'.$link_to.'&amp;p='.$current.'">'.$current.'</a>';
+			else
+				$pages[] = '<strong>'.$current.'</strong>';
+		}
+
+		if ($cur_page <= ($num_pages-3))
+		{
+			if ($cur_page != ($num_pages-3))
+				$pages[] = '&hellip;';
+
+			$pages[] = '<a href="'.$link_to.'&amp;p='.$num_pages.'">'.$num_pages.'</a>';
+		}
+	}
+
+	return implode('&#160;', $pages);
+}
+
+
+//
+// Display a message
+//
+function message($message, $no_back_link = false)
+{
+
+	global $db, $lang_common, $pun_config, $pun_start, $tpl_main, $env;
+
+	if (!defined('PUN_HEADER'))
+	{
+		global $pun_user;
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Info'];
+		require PUN_ROOT.'header.php';
+	}
+
+?>
+
+<div id="msg" class="block">
+	<h2><span><?php echo $lang_common['Info'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+		<p><?php echo $message ?></p>
+<?php if (!$no_back_link): ?>		<p><a href="javascript: history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+<?php endif; ?>		</div>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+//
+// Format a time string according to $time_format and timezones
+//
+function format_time($timestamp, $date_only = false)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($timestamp == '')
+		return $lang_common['Never'];
+
+	$diff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;
+	$timestamp += $diff;
+	$now = time();
+
+	$date = date($pun_config['o_date_format'], $timestamp);
+	$today = date($pun_config['o_date_format'], $now+$diff);
+	$yesterday = date($pun_config['o_date_format'], $now+$diff-86400);
+
+	if ($date == $today)
+		$date = $lang_common['Today'];
+	else if ($date == $yesterday)
+		$date = $lang_common['Yesterday'];
+
+	if (!$date_only)
+		return $date.' '.date($pun_config['o_time_format'], $timestamp);
+	else
+		return $date;
+}
+
+
+//
+// If we are running pre PHP 4.3.0, we add our own implementation of file_get_contents
+//
+if (!function_exists('file_get_contents'))
+{
+	function file_get_contents($filename, $use_include_path = 0)
+	{
+		$data = '';
+
+		if ($fh = fopen($filename, 'rb', $use_include_path))
+		{
+			$data = fread($fh, filesize($filename));
+			fclose($fh);
+		}
+
+		return $data;
+	}
+}
+
+
+//
+// Make sure that HTTP_REFERER matches $pun_config['o_base_url']/$script
+//
+function confirm_referrer($script)
+{
+	global $pun_config, $lang_common;
+
+	if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
+		message($lang_common['Bad referrer']);
+}
+
+
+//
+// Generate a random password of length $len
+//
+function random_pass($len)
+{
+	$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+	$password = '';
+	for ($i = 0; $i < $len; ++$i)
+		$password .= substr($chars, (mt_rand() % strlen($chars)), 1);
+
+	return $password;
+}
+
+
+//
+// Compute a hash of $str
+// Uses sha1() if available. If not, SHA1 through mhash() if available. If not, fall back on md5().
+//
+function pun_hash($str)
+{
+	if (function_exists('sha1'))	// Only in PHP 4.3.0+
+		return sha1($str);
+	else if (function_exists('mhash'))	// Only if Mhash library is loaded
+		return bin2hex(mhash(MHASH_SHA1, $str));
+	else
+		return md5($str);
+}
+
+
+//
+// Try to determine the correct remote IP-address
+//
+function get_remote_address()
+{
+	return $_SERVER['REMOTE_ADDR'];
+}
+
+
+//
+// Equivalent to htmlspecialchars(), but allows &#[0-9]+ (for unicode)
+//
+function pun_htmlspecialchars($str)
+{
+	$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);
+	$str = str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $str);
+
+	return $str;
+}
+
+
+//
+// Equivalent to strlen(), but counts &#[0-9]+ as one character (for unicode)
+//
+function pun_strlen($str)
+{
+	return strlen(preg_replace('/&#([0-9]+);/', '!', $str));
+}
+
+
+//
+// Convert \r\n and \r to \n
+//
+function pun_linebreaks($str)
+{
+	return str_replace("\r", "\n", str_replace("\r\n", "\n", $str));
+}
+
+
+//
+// A more aggressive version of trim()
+//
+function pun_trim($str)
+{
+	global $lang_common;
+
+	if (strpos($lang_common['lang_encoding'], '8859') !== false)
+	{
+		$fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0));
+		return trim(str_replace($fishy_chars, ' ', $str));
+	}
+	else
+		return trim($str);
+}
+
+
+//
+// Display a message when board is in maintenance mode
+//
+function maintenance_message()
+{
+	global $db, $pun_config, $lang_common, $pun_user;
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\t", '  ', '  ');
+	$replace = array('&#160; &#160; ', '&#160; ', ' &#160;');
+	$message = str_replace($pattern, $replace, $pun_config['o_maintenance_message']);
+
+
+	// Load the maintenance template
+	$tpl_maint = trim(file_get_contents(PUN_ROOT.'include/template/maintenance.tpl'));
+
+
+	// START SUBST - <pun_content_direction>
+	$tpl_maint = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_maint);
+	// END SUBST - <pun_content_direction>
+
+
+	// START SUBST - <pun_char_encoding>
+	$tpl_maint = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_maint);
+	// END SUBST - <pun_char_encoding>
+
+
+	// START SUBST - <pun_head>
+	ob_start();
+
+?>
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Maintenance'] ?></title>
+<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
+<?php
+
+	$tpl_temp = trim(ob_get_contents());
+	$tpl_maint = str_replace('<pun_head>', $tpl_temp, $tpl_maint);
+	ob_end_clean();
+	// END SUBST - <pun_head>
+
+
+	// START SUBST - <pun_maint_heading>
+	$tpl_maint = str_replace('<pun_maint_heading>', $lang_common['Maintenance'], $tpl_maint);
+	// END SUBST - <pun_maint_heading>
+
+
+	// START SUBST - <pun_maint_message>
+	$tpl_maint = str_replace('<pun_maint_message>', $message, $tpl_maint);
+	// END SUBST - <pun_maint_message>
+
+
+	// End the transaction
+	$db->end_transaction();
+
+
+	// START SUBST - <pun_include "*">
+	while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include))
+	{
+		if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
+	 	   error('Impossible de procÃ©der Ã  l\'inclusion utilisateur &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; depuis le template main.tpl. Il n\'y a pas de fichier dans le rÃ©pertoire /include/user/');
+
+		ob_start();
+		include PUN_ROOT.'include/user/'.$cur_include[1];
+		$tpl_temp = ob_get_contents();
+		$tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
+	    ob_end_clean();
+	}
+	// END SUBST - <pun_include "*">
+
+
+	// Close the db connection (and free up any result data)
+	$db->close();
+
+	exit($tpl_maint);
+}
+
+
+//
+// Display $message and redirect user to $destination_url
+//
+function redirect($destination_url, $message)
+{
+	global $db, $pun_config, $lang_common, $pun_user;
+
+	if ($destination_url == '')
+		$destination_url = 'index.php';
+
+	// If the delay is 0 seconds, we might as well skip the redirect all together
+	if ($pun_config['o_redirect_delay'] == '0')
+		header('Location: '.str_replace('&amp;', '&', $destination_url));
+
+
+	// Load the redirect template
+	$tpl_redir = trim(file_get_contents(PUN_ROOT.'include/template/redirect.tpl'));
+
+
+	// START SUBST - <pun_content_direction>
+	$tpl_redir = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_redir);
+	// END SUBST - <pun_content_direction>
+
+
+	// START SUBST - <pun_char_encoding>
+	$tpl_redir = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_redir);
+	// END SUBST - <pun_char_encoding>
+
+
+	// START SUBST - <pun_head>
+	ob_start();
+
+?>
+<meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) ?>" />
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>
+<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
+<?php
+
+	$tpl_temp = trim(ob_get_contents());
+	$tpl_redir = str_replace('<pun_head>', $tpl_temp, $tpl_redir);
+	ob_end_clean();
+	// END SUBST - <pun_head>
+
+
+	// START SUBST - <pun_redir_heading>
+	$tpl_redir = str_replace('<pun_redir_heading>', $lang_common['Redirecting'], $tpl_redir);
+	// END SUBST - <pun_redir_heading>
+
+
+	// START SUBST - <pun_redir_text>
+	$tpl_temp = $message.'<br /><br />'.'<a href="'.$destination_url.'">'.$lang_common['Click redirect'].'</a>';
+	$tpl_redir = str_replace('<pun_redir_text>', $tpl_temp, $tpl_redir);
+	// END SUBST - <pun_redir_text>
+
+
+	// START SUBST - <pun_footer>
+	ob_start();
+
+	// End the transaction
+	$db->end_transaction();
+
+	// Display executed queries (if enabled)
+	if (defined('PUN_SHOW_QUERIES'))
+		display_saved_queries();
+
+	$tpl_temp = trim(ob_get_contents());
+	$tpl_redir = str_replace('<pun_footer>', $tpl_temp, $tpl_redir);
+	ob_end_clean();
+	// END SUBST - <pun_footer>
+
+
+	// START SUBST - <pun_include "*">
+	while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include))
+	{
+		ob_start();
+		include PUN_ROOT.$cur_include[1];
+		$tpl_temp = ob_get_contents();
+		$tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir);
+	    ob_end_clean();
+	}
+	// END SUBST - <pun_include "*">
+
+
+	// Close the db connection (and free up any result data)
+	$db->close();
+
+	exit($tpl_redir);
+}
+
+
+//
+// Display a simple error message
+//
+function error($message, $file, $line, $db_error = false)
+{
+	global $pun_config;
+
+	// Set a default title if the script failed before $pun_config could be populated
+	if (empty($pun_config))
+		$pun_config['o_board_title'] = 'PunBB';
+
+	// Empty output buffer and stop buffering
+	@ob_end_clean();
+
+	// "Restart" output buffering if we are using ob_gzhandler (since the gzip header is already sent)
+	if (!empty($pun_config['o_gzip']) && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
+		ob_start('ob_gzhandler');
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html dir="ltr">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang_common["lang_encoding"] ?>" />
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title>
+<style type="text/css">
+<!--
+BODY {MARGIN: 10% 20% auto 20%; font: 10px Verdana, Arial, Helvetica, sans-serif}
+#errorbox {BORDER: 1px solid #B84623}
+H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADDING: 5px 4px}
+#errorbox DIV {PADDING: 6px 5px; BACKGROUND-COLOR: #F1F1F1}
+-->
+</style>
+</head>
+<body>
+
+<div id="errorbox">
+	<h2>Une erreur s'est produite</h2>
+	<div>
+<?php
+
+	if (defined('PUN_DEBUG'))
+	{
+		echo "\t\t".'<strong>Fichier :</strong> '.$file.'<br />'."\n\t\t".'<strong>Ligne :</strong> '.$line.'<br /><br />'."\n\t\t".'<strong>PunBB a rapportÃ© :</strong> '.$message."\n";
+
+		if ($db_error)
+		{
+			echo "\t\t".'<br /><br /><strong>La base de donnÃ©es a rapportÃ© :</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n";
+
+			if ($db_error['error_sql'] != '')
+				echo "\t\t".'<br /><br /><strong>RequÃªte Ã©chouÃ©e :</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n";
+		}
+	}
+	else
+		echo "\t\t".'Erreur : <strong>'.$message.'.</strong>'."\n";
+
+?>
+	</div>
+</div>
+
+</body>
+</html>
+<?php
+
+	// If a database connection was established (before this error) we close it
+	if ($db_error)
+		$GLOBALS['db']->close();
+
+	exit;
+}
+
+// DEBUG FUNCTIONS BELOW
+
+//
+// Display executed queries (if enabled)
+//
+function display_saved_queries()
+{
+	global $db, $lang_common;
+
+	// Get the queries so that we can print them out
+	$saved_queries = $db->get_saved_queries();
+
+?>
+
+<div id="debug" class="blocktable">
+	<h2><span><?php echo $lang_common['Debug table'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col">Temps (s)</th>
+					<th class="tcr" scope="col">RequÃªte</th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+	$query_time_total = 0.0;
+	while (list(, $cur_query) = @each($saved_queries))
+	{
+		$query_time_total += $cur_query[1];
+
+?>
+				<tr>
+					<td class="tcl"><?php echo ($cur_query[1] != 0) ? $cur_query[1] : '&#160;' ?></td>
+					<td class="tcr"><?php echo pun_htmlspecialchars($cur_query[0]) ?></td>
+				</tr>
+<?php
+
+	}
+
+?>
+				<tr>
+					<td class="tcl" colspan="2">Temps total requÃªte : <?php echo $query_time_total ?> s</td>
+				</tr>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+<?php
+
+}
+
+
+//
+// Unset any variables instantiated as a result of register_globals being enabled
+//
+function unregister_globals()
+{
+	// Prevent script.php?GLOBALS[foo]=bar
+	if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
+		exit('I\'ll have a steak sandwich and... a steak sandwich.');
+	
+	// Variables that shouldn't be unset
+	$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
+	
+	// Remove elements in $GLOBALS that are present in any of the superglobals
+	$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
+	foreach ($input as $k => $v)
+	{
+		if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
+			unset($GLOBALS[$k]);
+	}
+}
+
+
+//
+// Dump contents of variable(s)
+//
+function dump()
+{
+	echo '<pre>';
+
+	$num_args = func_num_args();
+
+	for ($i = 0; $i < $num_args; ++$i)
+	{
+		print_r(func_get_arg($i));
+		echo "\n\n";
+	}
+
+	echo '</pre>';
+	exit;
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/parser.bak.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/parser.bak.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/parser.bak.php	(revision 1)
@@ -0,0 +1,504 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+// Load cache smiley
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
+
+//
+// Make sure all BBCodes are lower case and do a little cleanup
+//
+function preparse_bbcode($text, &$errors, $is_signature = false)
+{
+	// Change all simple BBCodes to lower case
+	$a = array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]');
+	$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
+	$text = str_replace($a, $b, $text);
+
+	// Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
+	$a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[url\]\s*#i',
+				'#\s*\[/url\]#i',
+				'#\[email=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[email\]\s*#i',
+				'#\s*\[/email\]#i',
+				'#\[img\]\s*(.*?)\s*\[/img\]#is',
+				'#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
+
+	$b = array(	'[url=$2]',
+				'[url]',
+				'[/url]',
+				'[email=$2]',
+				'[email]',
+				'[/email]',
+				'[img]$1[/img]',
+				'[color=$2]$3[/color]');
+
+	if (!$is_signature)
+	{
+		// For non-signatures, we have to do the quote and code tags as well
+		$a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
+		$a[] = '#\[quote\]\s*#i';
+		$a[] = '#\s*\[/quote\]\s*#i';
+		$a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
+
+		$b[] = '[quote=$1$2$1]';
+		$b[] = '[quote]';
+		$b[] = '[/quote]'."\n";
+		$b[] = '[code]$1[/code]'."\n";
+	}
+
+	// Run this baby!
+	$text = preg_replace($a, $b, $text);
+
+	if (!$is_signature)
+	{
+		$overflow = check_tag_order($text, $error);
+
+		if ($error)
+			// A BBCode error was spotted in check_tag_order()
+			$errors[] = $error;
+		else if ($overflow)
+			// The quote depth level was too high, so we strip out the inner most quote(s)
+			$text = substr($text, 0, $overflow[0]).substr($text, $overflow[1], (strlen($text) - $overflow[0]));
+	}
+	else
+	{
+		global $lang_prof_reg;
+
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
+			message($lang_prof_reg['Signature quote/code']);
+	}
+
+	return trim($text);
+}
+
+
+//
+// Parse text and make sure that [code] and [quote] syntax is correct
+//
+function check_tag_order($text, &$error)
+{
+	global $lang_common;
+
+	// The maximum allowed quote depth
+	$max_depth = 3;
+
+	$cur_index = 0;
+	$q_depth = 0;
+
+	while (true)
+	{
+		// Look for regular code and quote tags
+		$c_start = strpos($text, '[code]');
+		$c_end = strpos($text, '[/code]');
+		$q_start = strpos($text, '[quote]');
+		$q_end = strpos($text, '[/quote]');
+
+		// Look for [quote=username] style quote tags
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]#sU', $text, $matches))
+			$q2_start = strpos($text, $matches[0]);
+		else
+			$q2_start = 65536;
+
+		// Deal with strpos() returning false when the string is not found
+		// (65536 is one byte longer than the maximum post length)
+		if ($c_start === false) $c_start = 65536;
+		if ($c_end === false) $c_end = 65536;
+		if ($q_start === false) $q_start = 65536;
+		if ($q_end === false) $q_end = 65536;
+
+		// If none of the strings were found
+		if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536)
+			break;
+
+		// We are interested in the first quote (regardless of the type of quote)
+		$q3_start = ($q_start < $q2_start) ? $q_start : $q2_start;
+
+		// We found a [quote] or a [quote=username]
+		if ($q3_start < min($q_end, $c_start, $c_end))
+		{
+			$step = ($q_start < $q2_start) ? 7 : strlen($matches[0]);
+
+			$cur_index += $q3_start + $step;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_begin = $cur_index - $step;
+
+			++$q_depth;
+			$text = substr($text, $q3_start + $step);
+		}
+
+		// We found a [/quote]
+		else if ($q_end < min($q_start, $c_start, $c_end))
+		{
+			if ($q_depth == 0)
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 1'];
+				return;
+			}
+
+			$q_depth--;
+			$cur_index += $q_end+8;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_end = $cur_index;
+
+			$text = substr($text, $q_end+8);
+		}
+
+		// We found a [code]
+		else if ($c_start < min($c_end, $q_start, $q_end))
+		{
+			// Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
+			$tmp = strpos($text, '[/code]');
+			$tmp2 = strpos(substr($text, $c_start+6), '[code]');
+			if ($tmp2 !== false)
+				$tmp2 += $c_start+6;
+				
+			if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
+				return;
+			}
+			else
+				$text = substr($text, $tmp+7);
+
+			$cur_index += $tmp+7;
+		}
+
+		// We found a [/code] (this shouldn't happen since we handle both start and end tag in the if clause above)
+		else if ($c_end < min($c_start, $q_start, $q_end))
+		{
+			$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 3'];
+			return;
+		}
+	}
+
+	// If $q_depth <> 0 something is wrong with the quote syntax
+	if ($q_depth)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 4'];
+		return;
+	}
+	else if ($q_depth < 0)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 5'];
+		return;
+	}
+
+	// If the quote depth level was higher than $max_depth we return the index for the
+	// beginning and end of the part we should strip out
+	if (isset($overflow_begin))
+		return array($overflow_begin, $overflow_end);
+	else
+		return null;
+}
+
+
+//
+// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
+//
+function split_text($text, $start, $end)
+{
+	global $pun_config;
+
+	$tokens = explode($start, $text);
+
+	$outside[] = $tokens[0];
+
+	$num_tokens = count($tokens);
+	for ($i = 1; $i < $num_tokens; ++$i)
+	{
+		$temp = explode($end, $tokens[$i]);
+		$inside[] = $temp[0];
+		$outside[] = $temp[1];
+	}
+
+	if ($pun_config['o_indent_num_spaces'] != 8 && $start == '[code]')
+	{
+		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
+		$inside = str_replace("\t", $spaces, $inside);
+	}
+
+	return array($inside, $outside);
+}
+
+
+//
+// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
+//
+function handle_url_tag($url, $link = '')
+{
+	global $pun_user;
+
+	$full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url);
+	if (strpos($url, 'www.') === 0)			// If it starts with www, we add http://
+		$full_url = 'http://'.$full_url;
+	else if (strpos($url, 'ftp.') === 0)	// Else if it starts with ftp, we add ftp://
+		$full_url = 'ftp://'.$full_url;
+	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah)) 	// Else if it doesn't start with abcdef://, we add http://
+		$full_url = 'http://'.$full_url;
+
+	// Ok, not very pretty :-)
+	$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);
+
+	return '<a href="'.$full_url.'" target=\"_blank\">'.$link.'</a>';
+}
+
+
+//
+// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
+//
+function handle_img_tag($url, $is_signature = false)
+{
+	global $lang_common, $pun_config, $pun_user;
+
+	$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';
+
+	if ($is_signature && $pun_user['show_img_sig'] != '0')
+		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+	else if (!$is_signature && $pun_user['show_img'] != '0')
+		$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+
+	return $img_tag;
+}
+
+
+//
+// Convert BBCodes to their HTML equivalent
+//
+function do_bbcode($text)
+{
+	global $lang_common, $pun_user;
+
+	if (strpos($text, 'quote') !== false)
+	{
+		$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
+		$text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
+		$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
+	}
+	
+	$pattern = array('#\[b\](.*?)\[/b\]#s',
+					 '#\[i\](.*?)\[/i\]#s',
+					 '#\[u\](.*?)\[/u\]#s',
+					 '#\[url\]([^\[]*?)\[/url\]#e',
+					 '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
+					 '#\[email\]([^\[]*?)\[/email\]#',
+					 '#\[email=([^\[]*?)\](.*?)\[/email\]#',
+					 '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
+					 '#\[font=(.*?)](.*?)\[/font\]#s',
+					 '#\[align=(.*?)\](.*?)\[/align\]#s',
+					 '#\[hr /\]#',
+					 '#\[hr\]#',
+					 '#\[s\](.*?)\[/s\]#s',
+					 '#\[h\](.*?)\[/h\]#s',
+                               '#\[size=([0-9]{1,2})](.*?)\[/size\]#s');
+
+	$replace = array('<strong>$1</strong>',
+					 '<em>$1</em>',
+					 '<span class="bbu">$1</span>',
+					 'handle_url_tag(\'$1\')',
+					 'handle_url_tag(\'$1\', \'$2\')',
+					 '<a href="mailto:$1">$1</a>',
+					 '<a href="mailto:$1">$2</a>',
+					 '<span style="color: $1">$2</span>',
+					 '<span style="font-family: $1">$2</span>',
+					 '<div align="$1">$2</div>',
+					 '<hr />',
+					 '<hr />',
+					 '<del>$1</del>',
+					 '<span style="background-color: #FFFF00; color: #000000">$1</span>',
+                               '<span style="font-size: $1pt;">$2</span>');
+
+	// This thing takes a while! :)
+	$text = preg_replace($pattern, $replace, $text);
+
+	return $text;
+}
+
+
+//
+// Make hyperlinks clickable
+//
+function do_clickable($text)
+{
+	global $pun_user;
+
+	$text = ' '.$text;
+
+	$text = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2://$3\')', $text);
+	$text = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2.$3\', \'$2.$3\')', $text);
+
+	return substr($text, 1);
+}
+
+
+//
+// Convert a series of smilies to images
+//
+function do_smilies($text)
+{
+	global $smiley_text, $smiley_img;
+
+	$text = ' '.$text.' ';
+
+	$num_smilies = count($smiley_text);
+	for ($i = 0; $i < $num_smilies; ++$i)
+		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
+
+	return substr($text, 1, -1);
+}
+
+
+//
+// Parse message text
+//
+function parse_message($text, $hide_smilies)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	// Convert applicable characters to HTML entities
+	$text = pun_htmlspecialchars($text);
+
+	// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
+	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
+	{
+		list($inside, $outside) = split_text($text, '[code]', '[/code]');
+		$outside = array_map('ltrim', $outside);
+		$text = implode('<">', $outside);
+	}
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_message_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	// If we split up the message before we have to concatenate it together again (code tags)
+	if (isset($inside))
+	{
+		$outside = explode('<">', $text);
+		$text = '';
+
+		$num_tokens = count($outside);
+
+		for ($i = 0; $i < $num_tokens; ++$i)
+		{
+			$text .= $outside[$i];
+			if (isset($inside[$i]))
+			{
+				$num_lines = ((substr_count($inside[$i], "\n")) + 3) * 1.5;
+				$height_str = ($num_lines > 35) ? '35em' : $num_lines.'em';
+				$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';
+			}
+		}
+	}
+
+	// Add paragraph tag around post, but make sure there are no empty paragraphs
+	$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
+
+	// Mod: Flash MP3 Player (8 nouvelles lignes suivent)
+	$player_url     = 'dewplayer-multi.swf';
+	$player_bgcolor = 'ffffff';
+	$player_width   = 240;
+	$player_height  = 20;
+	$player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$1';  // Pour plus d'options: http://www.alsacreations.fr/?dewplayer
+	$player_alternative = '<strong>Flash non dÃ©tÃ©ctÃ©</strong>';
+	$player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";
+	$text = preg_replace("/\[mp3 url=([^ ]+)\]/", $player_code, $text);
+
+	return $text;
+}
+
+
+//
+// Parse signature text
+//
+function parse_signature($text)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	$text = pun_htmlspecialchars($text);
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_sig_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	return $text;
+}
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/include/parser.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/parser.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/parser.php	(revision 1)
@@ -0,0 +1,504 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+// Load cache smiley
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
+
+//
+// Make sure all BBCodes are lower case and do a little cleanup
+//
+function preparse_bbcode($text, &$errors, $is_signature = false)
+{
+	// Change all simple BBCodes to lower case
+	$a = array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]');
+	$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
+	$text = str_replace($a, $b, $text);
+
+	// Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
+	$a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[url\]\s*#i',
+				'#\s*\[/url\]#i',
+				'#\[email=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[email\]\s*#i',
+				'#\s*\[/email\]#i',
+				'#\[img\]\s*(.*?)\s*\[/img\]#is',
+				'#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
+
+	$b = array(	'[url=$2]',
+				'[url]',
+				'[/url]',
+				'[email=$2]',
+				'[email]',
+				'[/email]',
+				'[img]$1[/img]',
+				'[color=$2]$3[/color]');
+
+	if (!$is_signature)
+	{
+		// For non-signatures, we have to do the quote and code tags as well
+		$a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
+		$a[] = '#\[quote\]\s*#i';
+		$a[] = '#\s*\[/quote\]\s*#i';
+		$a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
+
+		$b[] = '[quote=$1$2$1]';
+		$b[] = '[quote]';
+		$b[] = '[/quote]'."\n";
+		$b[] = '[code]$1[/code]'."\n";
+	}
+
+	// Run this baby!
+	$text = preg_replace($a, $b, $text);
+
+	if (!$is_signature)
+	{
+		$overflow = check_tag_order($text, $error);
+
+		if ($error)
+			// A BBCode error was spotted in check_tag_order()
+			$errors[] = $error;
+		else if ($overflow)
+			// The quote depth level was too high, so we strip out the inner most quote(s)
+			$text = substr($text, 0, $overflow[0]).substr($text, $overflow[1], (strlen($text) - $overflow[0]));
+	}
+	else
+	{
+		global $lang_prof_reg;
+
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
+			message($lang_prof_reg['Signature quote/code']);
+	}
+
+	return trim($text);
+}
+
+
+//
+// Parse text and make sure that [code] and [quote] syntax is correct
+//
+function check_tag_order($text, &$error)
+{
+	global $lang_common;
+
+	// The maximum allowed quote depth
+	$max_depth = 3;
+
+	$cur_index = 0;
+	$q_depth = 0;
+
+	while (true)
+	{
+		// Look for regular code and quote tags
+		$c_start = strpos($text, '[code]');
+		$c_end = strpos($text, '[/code]');
+		$q_start = strpos($text, '[quote]');
+		$q_end = strpos($text, '[/quote]');
+
+		// Look for [quote=username] style quote tags
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]#sU', $text, $matches))
+			$q2_start = strpos($text, $matches[0]);
+		else
+			$q2_start = 65536;
+
+		// Deal with strpos() returning false when the string is not found
+		// (65536 is one byte longer than the maximum post length)
+		if ($c_start === false) $c_start = 65536;
+		if ($c_end === false) $c_end = 65536;
+		if ($q_start === false) $q_start = 65536;
+		if ($q_end === false) $q_end = 65536;
+
+		// If none of the strings were found
+		if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536)
+			break;
+
+		// We are interested in the first quote (regardless of the type of quote)
+		$q3_start = ($q_start < $q2_start) ? $q_start : $q2_start;
+
+		// We found a [quote] or a [quote=username]
+		if ($q3_start < min($q_end, $c_start, $c_end))
+		{
+			$step = ($q_start < $q2_start) ? 7 : strlen($matches[0]);
+
+			$cur_index += $q3_start + $step;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_begin = $cur_index - $step;
+
+			++$q_depth;
+			$text = substr($text, $q3_start + $step);
+		}
+
+		// We found a [/quote]
+		else if ($q_end < min($q_start, $c_start, $c_end))
+		{
+			if ($q_depth == 0)
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 1'];
+				return;
+			}
+
+			$q_depth--;
+			$cur_index += $q_end+8;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_end = $cur_index;
+
+			$text = substr($text, $q_end+8);
+		}
+
+		// We found a [code]
+		else if ($c_start < min($c_end, $q_start, $q_end))
+		{
+			// Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
+			$tmp = strpos($text, '[/code]');
+			$tmp2 = strpos(substr($text, $c_start+6), '[code]');
+			if ($tmp2 !== false)
+				$tmp2 += $c_start+6;
+				
+			if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
+				return;
+			}
+			else
+				$text = substr($text, $tmp+7);
+
+			$cur_index += $tmp+7;
+		}
+
+		// We found a [/code] (this shouldn't happen since we handle both start and end tag in the if clause above)
+		else if ($c_end < min($c_start, $q_start, $q_end))
+		{
+			$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 3'];
+			return;
+		}
+	}
+
+	// If $q_depth <> 0 something is wrong with the quote syntax
+	if ($q_depth)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 4'];
+		return;
+	}
+	else if ($q_depth < 0)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 5'];
+		return;
+	}
+
+	// If the quote depth level was higher than $max_depth we return the index for the
+	// beginning and end of the part we should strip out
+	if (isset($overflow_begin))
+		return array($overflow_begin, $overflow_end);
+	else
+		return null;
+}
+
+
+//
+// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
+//
+function split_text($text, $start, $end)
+{
+	global $pun_config;
+
+	$tokens = explode($start, $text);
+
+	$outside[] = $tokens[0];
+
+	$num_tokens = count($tokens);
+	for ($i = 1; $i < $num_tokens; ++$i)
+	{
+		$temp = explode($end, $tokens[$i]);
+		$inside[] = $temp[0];
+		$outside[] = $temp[1];
+	}
+
+	if ($pun_config['o_indent_num_spaces'] != 8 && $start == '[code]')
+	{
+		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
+		$inside = str_replace("\t", $spaces, $inside);
+	}
+
+	return array($inside, $outside);
+}
+
+
+//
+// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
+//
+function handle_url_tag($url, $link = '')
+{
+	global $pun_user;
+
+	$full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url);
+	if (strpos($url, 'www.') === 0)			// If it starts with www, we add http://
+		$full_url = 'http://'.$full_url;
+	else if (strpos($url, 'ftp.') === 0)	// Else if it starts with ftp, we add ftp://
+		$full_url = 'ftp://'.$full_url;
+	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah)) 	// Else if it doesn't start with abcdef://, we add http://
+		$full_url = 'http://'.$full_url;
+
+	// Ok, not very pretty :-)
+	$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);
+
+	return '<a href="'.$full_url.'" target=\"_blank\">'.$link.'</a>';
+}
+
+
+//
+// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
+//
+function handle_img_tag($url, $is_signature = false)
+{
+	global $lang_common, $pun_config, $pun_user;
+
+	$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';
+
+	if ($is_signature && $pun_user['show_img_sig'] != '0')
+		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+	else if (!$is_signature && $pun_user['show_img'] != '0')
+		$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+
+	return $img_tag;
+}
+
+
+//
+// Convert BBCodes to their HTML equivalent
+//
+function do_bbcode($text)
+{
+	global $lang_common, $pun_user;
+
+	if (strpos($text, 'quote') !== false)
+	{
+		$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
+		$text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
+		$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
+	}
+	
+	$pattern = array('#\[b\](.*?)\[/b\]#s',
+					 '#\[i\](.*?)\[/i\]#s',
+					 '#\[u\](.*?)\[/u\]#s',
+					 '#\[url\]([^\[]*?)\[/url\]#e',
+					 '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
+					 '#\[email\]([^\[]*?)\[/email\]#',
+					 '#\[email=([^\[]*?)\](.*?)\[/email\]#',
+					 '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
+					 '#\[font=(.*?)](.*?)\[/font\]#s',
+					 '#\[align=(.*?)\](.*?)\[/align\]#s',
+					 '#\[hr /\]#',
+					 '#\[hr\]#',
+					 '#\[s\](.*?)\[/s\]#s',
+					 '#\[h\](.*?)\[/h\]#s',
+                               '#\[size=([0-9]{1,2})](.*?)\[/size\]#s');
+
+	$replace = array('<strong>$1</strong>',
+					 '<em>$1</em>',
+					 '<span class="bbu">$1</span>',
+					 'handle_url_tag(\'$1\')',
+					 'handle_url_tag(\'$1\', \'$2\')',
+					 '<a href="mailto:$1">$1</a>',
+					 '<a href="mailto:$1">$2</a>',
+					 '<span style="color: $1">$2</span>',
+					 '<span style="font-family: $1">$2</span>',
+					 '<div align="$1">$2</div>',
+					 '<hr />',
+					 '<hr />',
+					 '<del>$1</del>',
+					 '<span style="background-color: #FFFF00; color: #000000">$1</span>',
+                               '<span style="font-size: $1pt;">$2</span>');
+
+	// This thing takes a while! :)
+	$text = preg_replace($pattern, $replace, $text);
+
+	return $text;
+}
+
+
+//
+// Make hyperlinks clickable
+//
+function do_clickable($text)
+{
+	global $pun_user;
+
+	$text = ' '.$text;
+
+	$text = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2://$3\')', $text);
+	$text = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2.$3\', \'$2.$3\')', $text);
+
+	return substr($text, 1);
+}
+
+
+//
+// Convert a series of smilies to images
+//
+function do_smilies($text)
+{
+	global $smiley_text, $smiley_img;
+
+	$text = ' '.$text.' ';
+
+	$num_smilies = count($smiley_text);
+	for ($i = 0; $i < $num_smilies; ++$i)
+		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="'.PUN_ROOT.'img/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
+
+	return substr($text, 1, -1);
+}
+
+
+//
+// Parse message text
+//
+function parse_message($text, $hide_smilies)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	// Convert applicable characters to HTML entities
+	$text = pun_htmlspecialchars($text);
+
+	// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
+	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
+	{
+		list($inside, $outside) = split_text($text, '[code]', '[/code]');
+		$outside = array_map('ltrim', $outside);
+		$text = implode('<">', $outside);
+	}
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_message_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	// If we split up the message before we have to concatenate it together again (code tags)
+	if (isset($inside))
+	{
+		$outside = explode('<">', $text);
+		$text = '';
+
+		$num_tokens = count($outside);
+
+		for ($i = 0; $i < $num_tokens; ++$i)
+		{
+			$text .= $outside[$i];
+			if (isset($inside[$i]))
+			{
+				$num_lines = ((substr_count($inside[$i], "\n")) + 3) * 1.5;
+				$height_str = ($num_lines > 35) ? '35em' : $num_lines.'em';
+				$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';
+			}
+		}
+	}
+
+	// Add paragraph tag around post, but make sure there are no empty paragraphs
+	$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
+
+	// Mod: Flash MP3 Player (8 nouvelles lignes suivent)
+	$player_url     = 'dewplayer-multi.swf';
+	$player_bgcolor = 'ffffff';
+	$player_width   = 240;
+	$player_height  = 20;
+	$player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$1';  // Pour plus d'options: http://www.alsacreations.fr/?dewplayer
+	$player_alternative = '<strong>Flash non dÃ©tÃ©ctÃ©</strong>';
+	$player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";
+	$text = preg_replace("/\[mp3 url=([^ ]+)\]/", $player_code, $text);
+
+	return $text;
+}
+
+
+//
+// Parse signature text
+//
+function parse_signature($text)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	$text = pun_htmlspecialchars($text);
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_sig_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	return $text;
+}
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/include/parser.test.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/parser.test.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/parser.test.php	(revision 1)
@@ -0,0 +1,504 @@
+q<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+// Load cache smiley
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
+
+//
+// Make sure all BBCodes are lower case and do a little cleanup
+//
+function preparse_bbcode($text, &$errors, $is_signature = false)
+{
+	// Change all simple BBCodes to lower case
+	$a = array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]');
+	$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
+	$text = str_replace($a, $b, $text);
+
+	// Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
+	$a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[url\]\s*#i',
+				'#\s*\[/url\]#i',
+				'#\[email=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[email\]\s*#i',
+				'#\s*\[/email\]#i',
+				'#\[img\]\s*(.*?)\s*\[/img\]#is',
+				'#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
+
+	$b = array(	'[url=$2]',
+				'[url]',
+				'[/url]',
+				'[email=$2]',
+				'[email]',
+				'[/email]',
+				'[img]$1[/img]',
+				'[color=$2]$3[/color]');
+
+	if (!$is_signature)
+	{
+		// For non-signatures, we have to do the quote and code tags as well
+		$a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
+		$a[] = '#\[quote\]\s*#i';
+		$a[] = '#\s*\[/quote\]\s*#i';
+		$a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
+
+		$b[] = '[quote=$1$2$1]';
+		$b[] = '[quote]';
+		$b[] = '[/quote]'."\n";
+		$b[] = '[code]$1[/code]'."\n";
+	}
+
+	// Run this baby!
+	$text = preg_replace($a, $b, $text);
+
+	if (!$is_signature)
+	{
+		$overflow = check_tag_order($text, $error);
+
+		if ($error)
+			// A BBCode error was spotted in check_tag_order()
+			$errors[] = $error;
+		else if ($overflow)
+			// The quote depth level was too high, so we strip out the inner most quote(s)
+			$text = substr($text, 0, $overflow[0]).substr($text, $overflow[1], (strlen($text) - $overflow[0]));
+	}
+	else
+	{
+		global $lang_prof_reg;
+
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
+			message($lang_prof_reg['Signature quote/code']);
+	}
+
+	return trim($text);
+}
+
+
+//
+// Parse text and make sure that [code] and [quote] syntax is correct
+//
+function check_tag_order($text, &$error)
+{
+	global $lang_common;
+
+	// The maximum allowed quote depth
+	$max_depth = 3;
+
+	$cur_index = 0;
+	$q_depth = 0;
+
+	while (true)
+	{
+		// Look for regular code and quote tags
+		$c_start = strpos($text, '[code]');
+		$c_end = strpos($text, '[/code]');
+		$q_start = strpos($text, '[quote]');
+		$q_end = strpos($text, '[/quote]');
+
+		// Look for [quote=username] style quote tags
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]#sU', $text, $matches))
+			$q2_start = strpos($text, $matches[0]);
+		else
+			$q2_start = 65536;
+
+		// Deal with strpos() returning false when the string is not found
+		// (65536 is one byte longer than the maximum post length)
+		if ($c_start === false) $c_start = 65536;
+		if ($c_end === false) $c_end = 65536;
+		if ($q_start === false) $q_start = 65536;
+		if ($q_end === false) $q_end = 65536;
+
+		// If none of the strings were found
+		if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536)
+			break;
+
+		// We are interested in the first quote (regardless of the type of quote)
+		$q3_start = ($q_start < $q2_start) ? $q_start : $q2_start;
+
+		// We found a [quote] or a [quote=username]
+		if ($q3_start < min($q_end, $c_start, $c_end))
+		{
+			$step = ($q_start < $q2_start) ? 7 : strlen($matches[0]);
+
+			$cur_index += $q3_start + $step;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_begin = $cur_index - $step;
+
+			++$q_depth;
+			$text = substr($text, $q3_start + $step);
+		}
+
+		// We found a [/quote]
+		else if ($q_end < min($q_start, $c_start, $c_end))
+		{
+			if ($q_depth == 0)
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 1'];
+				return;
+			}
+
+			$q_depth--;
+			$cur_index += $q_end+8;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_end = $cur_index;
+
+			$text = substr($text, $q_end+8);
+		}
+
+		// We found a [code]
+		else if ($c_start < min($c_end, $q_start, $q_end))
+		{
+			// Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
+			$tmp = strpos($text, '[/code]');
+			$tmp2 = strpos(substr($text, $c_start+6), '[code]');
+			if ($tmp2 !== false)
+				$tmp2 += $c_start+6;
+				
+			if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
+				return;
+			}
+			else
+				$text = substr($text, $tmp+7);
+
+			$cur_index += $tmp+7;
+		}
+
+		// We found a [/code] (this shouldn't happen since we handle both start and end tag in the if clause above)
+		else if ($c_end < min($c_start, $q_start, $q_end))
+		{
+			$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 3'];
+			return;
+		}
+	}
+
+	// If $q_depth <> 0 something is wrong with the quote syntax
+	if ($q_depth)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 4'];
+		return;
+	}
+	else if ($q_depth < 0)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 5'];
+		return;
+	}
+
+	// If the quote depth level was higher than $max_depth we return the index for the
+	// beginning and end of the part we should strip out
+	if (isset($overflow_begin))
+		return array($overflow_begin, $overflow_end);
+	else
+		return null;
+}
+
+
+//
+// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
+//
+function split_text($text, $start, $end)
+{
+	global $pun_config;
+
+	$tokens = explode($start, $text);
+
+	$outside[] = $tokens[0];
+
+	$num_tokens = count($tokens);
+	for ($i = 1; $i < $num_tokens; ++$i)
+	{
+		$temp = explode($end, $tokens[$i]);
+		$inside[] = $temp[0];
+		$outside[] = $temp[1];
+	}
+
+	if ($pun_config['o_indent_num_spaces'] != 8 && $start == '[code]')
+	{
+		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
+		$inside = str_replace("\t", $spaces, $inside);
+	}
+
+	return array($inside, $outside);
+}
+
+
+//
+// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
+//
+function handle_url_tag($url, $link = '')
+{
+	global $pun_user;
+
+	$full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url);
+	if (strpos($url, 'www.') === 0)			// If it starts with www, we add http://
+		$full_url = 'http://'.$full_url;
+	else if (strpos($url, 'ftp.') === 0)	// Else if it starts with ftp, we add ftp://
+		$full_url = 'ftp://'.$full_url;
+	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah)) 	// Else if it doesn't start with abcdef://, we add http://
+		$full_url = 'http://'.$full_url;
+
+	// Ok, not very pretty :-)
+	$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);
+
+	return '<a href="'.$full_url.'" target=\"_blank\">'.$link.'</a>';
+}
+
+
+//
+// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
+//
+function handle_img_tag($url, $is_signature = false)
+{
+	global $lang_common, $pun_config, $pun_user;
+
+	$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';
+
+	if ($is_signature && $pun_user['show_img_sig'] != '0')
+		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+	else if (!$is_signature && $pun_user['show_img'] != '0')
+		$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+
+	return $img_tag;
+}
+
+
+//
+// Convert BBCodes to their HTML equivalent
+//
+function do_bbcode($text)
+{
+	global $lang_common, $pun_user;
+
+	if (strpos($text, 'quote') !== false)
+	{
+		$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
+		$text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
+		$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
+	}
+	
+	$pattern = array('#\[b\](.*?)\[/b\]#s',
+					 '#\[i\](.*?)\[/i\]#s',
+					 '#\[u\](.*?)\[/u\]#s',
+					 '#\[url\]([^\[]*?)\[/url\]#e',
+					 '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
+					 '#\[email\]([^\[]*?)\[/email\]#',
+					 '#\[email=([^\[]*?)\](.*?)\[/email\]#',
+					 '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
+					 '#\[font=(.*?)](.*?)\[/font\]#s',
+					 '#\[align=(.*?)\](.*?)\[/align\]#s',
+					 '#\[hr /\]#',
+					 '#\[hr\]#',
+					 '#\[s\](.*?)\[/s\]#s',
+					 '#\[h\](.*?)\[/h\]#s',
+                               '#\[size=([0-9]{1,2})](.*?)\[/size\]#s');
+
+	$replace = array('<strong>$1</strong>',
+					 '<em>$1</em>',
+					 '<span class="bbu">$1</span>',
+					 'handle_url_tag(\'$1\')',
+					 'handle_url_tag(\'$1\', \'$2\')',
+					 '<a href="mailto:$1">$1</a>',
+					 '<a href="mailto:$1">$2</a>',
+					 '<span style="color: $1">$2</span>',
+					 '<span style="font-family: $1">$2</span>',
+					 '<div align="$1">$2</div>',
+					 '<hr />',
+					 '<hr />',
+					 '<del>$1</del>',
+					 '<span style="background-color: #FFFF00; color: #000000">$1</span>',
+                               '<span style="font-size: $1pt;">$2</span>');
+
+	// This thing takes a while! :)
+	$text = preg_replace($pattern, $replace, $text);
+
+	return $text;
+}
+
+
+//
+// Make hyperlinks clickable
+//
+function do_clickable($text)
+{
+	global $pun_user;
+
+	$text = ' '.$text;
+
+	$text = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2://$3\')', $text);
+	$text = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2.$3\', \'$2.$3\')', $text);
+
+	return substr($text, 1);
+}
+
+
+//
+// Convert a series of smilies to images
+//
+function do_smilies($text)
+{
+	global $smiley_text, $smiley_img;
+
+	$text = ' '.$text.' ';
+
+	$num_smilies = count($smiley_text);
+	for ($i = 0; $i < $num_smilies; ++$i)
+		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="'.PUN_ROOT.'img/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
+
+	return substr($text, 1, -1);
+}
+
+
+//
+// Parse message text
+//
+function parse_message($text, $hide_smilies)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	// Convert applicable characters to HTML entities
+	$text = pun_htmlspecialchars($text);
+
+	// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
+	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
+	{
+		list($inside, $outside) = split_text($text, '[code]', '[/code]');
+		$outside = array_map('ltrim', $outside);
+		$text = implode('<">', $outside);
+	}
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_message_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	// If we split up the message before we have to concatenate it together again (code tags)
+	if (isset($inside))
+	{
+		$outside = explode('<">', $text);
+		$text = '';
+
+		$num_tokens = count($outside);
+
+		for ($i = 0; $i < $num_tokens; ++$i)
+		{
+			$text .= $outside[$i];
+			if (isset($inside[$i]))
+			{
+				$num_lines = ((substr_count($inside[$i], "\n")) + 3) * 1.5;
+				$height_str = ($num_lines > 35) ? '35em' : $num_lines.'em';
+				$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';
+			}
+		}
+	}
+
+	// Add paragraph tag around post, but make sure there are no empty paragraphs
+	$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
+
+	// Mod: Flash MP3 Player (8 nouvelles lignes suivent)
+	$player_url     = 'dewplayer-multi.swf';
+	$player_bgcolor = 'ffffff';
+	$player_width   = 240;
+	$player_height  = 20;
+	$player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$1';  // Pour plus d'options: http://www.alsacreations.fr/?dewplayer
+	$player_alternative = '<strong>Flash non dÃ©tÃ©ctÃ©</strong>';
+	$player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";
+	$text = preg_replace("/\[mp3 url=([^ ]+)\]/", $player_code, $text);
+
+	return $text;
+}
+
+
+//
+// Parse signature text
+//
+function parse_signature($text)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	$text = pun_htmlspecialchars($text);
+
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
+		$text = do_smilies($text);
+
+	if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_sig_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
+		}
+	}
+
+	// Deal with newlines, tabs and multiple spaces
+	$pattern = array("\n", "\t", '  ', '  ');
+	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
+	$text = str_replace($pattern, $replace, $text);
+
+	return $text;
+}
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/include/search_idx.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/search_idx.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/search_idx.php	(revision 1)
@@ -0,0 +1,231 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// The contents of this file are very much inspired by the file functions_search.php
+// from the phpBB Group forum software phpBB2 (http://www.phpbb.com). 
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+
+//
+// "Cleans up" a text string and returns an array of unique words
+// This function depends on the current locale setting
+//
+function split_words($text)
+{
+	global $pun_user;
+	static $noise_match, $noise_replace, $stopwords;
+
+	if (empty($noise_match))
+	{
+		$noise_match = array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*');
+		$noise_replace = array('',       '',      '',     '',     '',       '',       '',        '',       '',      '',     '',     '',       '',       '',        ' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ', ' ', ' ');
+
+		$stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt');
+		$stopwords = array_map('trim', $stopwords);
+	}
+
+	// Clean up
+	$patterns[] = '#&[\#a-z0-9]+?;#i';
+	$patterns[] = '#\b[\w]+:\/\/[a-z0-9\.\-]+(\/[a-z0-9\?\.%_\-\+=&\/~]+)?#';
+	$patterns[] = '#\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]#';
+	$text = preg_replace($patterns, ' ', ' '.strtolower($text).' ');
+
+	// Filter out junk
+	$text = str_replace($noise_match, $noise_replace, $text);
+
+	// Strip out extra whitespace between words
+	$text = trim(preg_replace('#\s+#', ' ', $text));
+
+	// Fill an array with all the words
+	$words = explode(' ', $text);
+
+	if (!empty($words))
+	{
+		while (list($i, $word) = @each($words))
+		{
+			$words[$i] = trim($word, '.');
+			$num_chars = pun_strlen($word);
+
+			if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
+				unset($words[$i]);
+		}
+	}
+
+	return array_unique($words);
+}
+
+
+//
+// Updates the search index with the contents of $post_id (and $subject)
+//
+function update_search_index($mode, $post_id, $message, $subject = null)
+{
+	global $db_type, $db;
+
+	// Split old and new post/subject to obtain array of 'words'
+	$words_message = split_words($message);
+	$words_subject = ($subject) ? split_words($subject) : array();
+
+	if ($mode == 'edit')
+	{
+		$result = $db->query('SELECT w.id, w.word, m.subject_match FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON w.id=m.word_id WHERE m.post_id='.$post_id, true) or error('Impossible de retrouver les mots index de recherches', __FILE__, __LINE__, $db->error());
+
+		// Declare here to stop array_keys() and array_diff() from complaining if not set
+		$cur_words['post'] = array();
+		$cur_words['subject'] = array();
+
+		while ($row = $db->fetch_row($result))
+		{
+			$match_in = ($row[2]) ? 'subject' : 'post';
+			$cur_words[$match_in][$row[1]] = $row[0];
+		}
+
+		$db->free_result($result);
+
+		$words['add']['post'] = array_diff($words_message, array_keys($cur_words['post']));
+		$words['add']['subject'] = array_diff($words_subject, array_keys($cur_words['subject']));
+		$words['del']['post'] = array_diff(array_keys($cur_words['post']), $words_message);
+		$words['del']['subject'] = array_diff(array_keys($cur_words['subject']), $words_subject);
+	}
+	else
+	{
+		$words['add']['post'] = $words_message;
+		$words['add']['subject'] = $words_subject;
+		$words['del']['post'] = array();
+		$words['del']['subject'] = array();
+	}
+
+	unset($words_message);
+	unset($words_subject);
+
+	// Get unique words from the above arrays
+	$unique_words = array_unique(array_merge($words['add']['post'], $words['add']['subject']));
+
+	if (!empty($unique_words))
+	{
+		$result = $db->query('SELECT id, word FROM '.$db->prefix.'search_words WHERE word IN('.implode(',', preg_replace('#^(.*)$#', '\'\1\'', $unique_words)).')', true) or error('Impossible de retrouver les mots index de recherches', __FILE__, __LINE__, $db->error());
+
+		$word_ids = array();
+		while ($row = $db->fetch_row($result))
+			$word_ids[$row[1]] = $row[0];
+
+		$db->free_result($result);
+
+		$new_words = array_diff($unique_words, array_keys($word_ids));
+		unset($unique_words);
+
+		if (!empty($new_words))
+		{
+			switch ($db_type)
+			{
+				case 'mysql':
+				case 'mysqli':
+					$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Impossible d\'ajouter les mots index de recherche', __FILE__, __LINE__, $db->error());
+					break;
+
+				default:
+					while (list(, $word) = @each($new_words))
+						$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.$word.'\')') or error('Impossible d\'ajouter les mots index de recherche', __FILE__, __LINE__, $db->error());
+					break;
+			}
+		}
+
+		unset($new_words);
+	}
+
+	// Delete matches (only if editing a post)
+	while (list($match_in, $wordlist) = @each($words['del']))
+	{
+		$subject_match = ($match_in == 'subject') ? 1 : 0;
+
+		if (!empty($wordlist))
+		{
+			$sql = '';
+			while (list(, $word) = @each($wordlist))
+				$sql .= (($sql != '') ? ',' : '').$cur_words[$match_in][$word];
+
+			$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE word_id IN('.$sql.') AND post_id='.$post_id.' AND subject_match='.$subject_match) or error('Impossible de supprimer des mots index de recherche', __FILE__, __LINE__, $db->error());
+		}
+	}
+
+	// Add new matches
+	while (list($match_in, $wordlist) = @each($words['add']))
+	{
+		$subject_match = ($match_in == 'subject') ? 1 : 0;
+
+		if (!empty($wordlist))
+			$db->query('INSERT INTO '.$db->prefix.'search_matches (post_id, word_id, subject_match) SELECT '.$post_id.', id, '.$subject_match.' FROM '.$db->prefix.'search_words WHERE word IN('.implode(',', preg_replace('#^(.*)$#', '\'\1\'', $wordlist)).')') or error('Impossible d\'ajouter les correspondances index de recherche', __FILE__, __LINE__, $db->error());
+	}
+
+	unset($words);
+}
+
+
+//
+// Strip search index of indexed words in $post_ids
+//
+function strip_search_index($post_ids)
+{
+	global $db_type, $db;
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+		{
+			$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Impossible de retrouver les correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
+
+			if ($db->num_rows($result))
+			{
+				$word_ids = '';
+				while ($row = $db->fetch_row($result))
+					$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];
+
+				$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN('.$word_ids.') GROUP BY word_id HAVING COUNT(word_id)=1') or error('Impossible de retrouver les correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
+
+				if ($db->num_rows($result))
+				{
+					$word_ids = '';
+					while ($row = $db->fetch_row($result))
+						$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];
+
+					$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN('.$word_ids.')') or error('Impossible de supprimer des mots index de recherche', __FILE__, __LINE__, $db->error());
+				}
+			}
+
+			break;
+		}
+
+		default:
+			$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id) GROUP BY word_id HAVING COUNT(word_id)=1)') or error('Impossible de supprimer depuis l\'index de recherche', __FILE__, __LINE__, $db->error());
+			break;
+	}
+
+	$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.')') or error('Impossible de supprimer des correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
+}
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/admin.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/admin.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/admin.tpl	(revision 1)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+
+<div id="punwrap">
+<div id="punadmin" class="pun">
+
+<div id="brdheader" class="block">
+	<div class="box">
+		<div id="brdtitle" class="inbox">
+			<pun_title>
+			<pun_desc>
+		</div>
+		<pun_navlinks>
+		<pun_status>
+	</div>
+</div>
+
+<pun_announcement>
+
+<pun_main>
+
+<pun_footer>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/help.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/help.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/help.tpl	(revision 1)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+
+<div id="punwrap">
+<div id="helpfile" class="pun">
+
+<pun_main>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/main.bak.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/main.bak.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/main.bak.tpl	(revision 1)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+
+<div id="punwrap">
+<div id="pun<pun_page>" class="pun">
+
+<div id="brdheader" class="block">
+	<div class="box">
+		<div id="brdtitle" class="inbox">
+			<pun_desc>
+            <div align="right"><a href="http://www.revolutionsoundrecords.org"><img src="img/RSRBAN468x60.gif" width="468" height="60" border="0"></a>
+             </div>
+		</div>
+		<pun_navlinks>
+		<pun_status>
+	</div>
+</div>
+
+<pun_announcement>
+
+<pun_main>
+
+<pun_footer>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/main.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/main.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/main.tpl	(revision 1)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+<div id="punwrap">
+<div id="pun<pun_page>" class="pun">
+  <div id="brdheader" class="block">
+	<div class="box">
+		<div id="brdtitle" class="inbox">
+			<pun_desc>
+		</div>
+		<pun_navlinks>
+		<pun_status>
+	</div>
+  </div>
+
+<pun_announcement>
+
+<pun_main>
+
+<pun_footer>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/maintenance.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/maintenance.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/maintenance.tpl	(revision 1)
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+
+<div id="punwrap">
+<div id="punmaint" class="pun">
+
+<div class="block">
+	<h2><pun_maint_heading></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><pun_maint_message></p>
+		</div>
+	</div>
+</div>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/include/template/redirect.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/include/template/redirect.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/include/template/redirect.tpl	(revision 1)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html dir="<pun_content_direction>">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
+<pun_head>
+</head>
+<body>
+
+<div id="punwrap">
+<div id="punredirect" class="pun">
+
+<div class="block">
+	<h2><pun_redir_heading></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><pun_redir_text></p>
+		</div>
+	</div>
+</div>
+
+<pun_footer>
+
+</div>
+</div>
+
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/index.php	(revision 1)
@@ -0,0 +1,334 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+// Load the index.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
+define('PUN_ALLOW_INDEX', 1);
+require PUN_ROOT.'header.php';
+
+// Print the categories and forums
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums.', __FILE__, __LINE__, $db->error());
+
+$cur_category = 0;
+$cat_count = 0;
+while ($cur_forum = $db->fetch_assoc($result))
+{
+	$moderators = '';
+
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+	{
+		if ($cur_category != 0)
+			echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n";
+
+		++$cat_count;
+
+?>
+<div id="idx<?php echo $cat_count ?>" class="blocktable">
+	<h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th>
+					<th class="tc2" scope="col"><?php echo $lang_index['Topics'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
+					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+		$cur_category = $cur_forum['cid'];
+	}
+
+	$item_status = '';
+	$icon_text = $lang_common['Normal icon'];
+	$icon_type = 'icon';
+
+	// Are there new posts?
+	if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit'])
+	{
+		$item_status = 'inew';
+		$icon_text = $lang_common['New icon'];
+		$icon_type = 'icon inew';
+	}
+
+	// Is this a redirect forum?
+	if ($cur_forum['redirect_url'] != '')
+	{
+		$forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
+		$num_topics = $num_posts = '&#160;';
+		$item_status = 'iredirect';
+		$icon_text = $lang_common['Redirect icon'];
+		$icon_type = 'icon';
+	}
+	else
+	{
+		$forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
+		$num_topics = $cur_forum['num_topics'];
+		$num_posts = $cur_forum['num_posts'];
+	}
+
+	if ($cur_forum['forum_desc'] != '')
+		$forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc'];
+
+
+	// If there is a last_post/last_poster.
+	if ($cur_forum['last_post'] != '')
+		$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
+	else
+		$last_post = '&#160;';
+
+	if ($cur_forum['moderators'] != '')
+	{
+		$mods_array = unserialize($cur_forum['moderators']);
+		$moderators = array();
+
+		while (list($mod_username, $mod_id) = @each($mods_array))
+			$moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
+
+		$moderators = "\t\t\t\t\t\t\t\t".'<p><em>('.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
+	}
+
+?>
+ 				<tr<?php if ($item_status != '') echo ' class="'.$item_status.'"'; ?>>
+					<td class="tcl">
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo $icon_text ?></div></div>
+							<div class="tclcon">
+								<?php echo $forum_field."\n".$moderators ?>
+							</div>
+						</div>
+					</td>
+					<td class="tc2"><?php echo $num_topics ?></td>
+					<td class="tc3"><?php echo $num_posts ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
+				</tr>
+<?php
+
+}
+
+// Did we output any categories and forums?
+if ($cur_category > 0)
+	echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n";
+else
+	echo '<div id="idx0" class="block"><div class="box"><div class="inbox"><p>'.$lang_index['Empty board'].'</p></div></div></div>';
+
+
+// Collect some statistics from the database
+$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\utilisateurs', __FILE__, __LINE__, $db->error());
+$stats['total_users'] = $db->result($result);
+
+$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier membre inscrit', __FILE__, __LINE__, $db->error());
+$stats['last_user'] = $db->fetch_assoc($result);
+
+$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le nombre de discussions et de messages', __FILE__, __LINE__, $db->error());
+list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
+
+?>
+<div id="brdstats" class="block">
+	<h2><span><?php echo $lang_index['Board info'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<dl class="conr">
+				<dt><strong><?php echo $lang_index['Board stats'] ?></strong></dt>
+				<dd><?php echo $lang_index['No of users'].': <strong>'. $stats['total_users'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of topics'].': <strong>'.$stats['total_topics'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of posts'].': <strong>'.$stats['total_posts'] ?></strong></dd>
+			</dl>
+			<dl class="conl">
+				<dt><strong><?php echo $lang_index['User info'] ?></strong></dt>
+				<dd><?php echo $lang_index['Newest user'] ?>: <a href="profile.php?id=<?php echo $stats['last_user']['id'] ?>"><?php echo pun_htmlspecialchars($stats['last_user']['username']) ?></a></dd>
+<?php
+
+if ($pun_config['o_users_online'] == '1')
+{
+	// Fetch users online info and generate strings for output
+	$num_guests = 0;
+	$users = array();
+	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+	while ($pun_user_online = $db->fetch_assoc($result))
+	{
+		if ($pun_user_online['user_id'] > 1)
+			$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
+		else
+			++$num_guests;
+	}
+
+	$num_users = count($users);
+	echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";
+
+
+	if ($num_users > 0)
+		echo "\t\t\t".'<dl id="onlinelist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].':&#160;</strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
+	else
+		echo "\t\t\t".'<div class="clearer"></div>'."\n";
+
+}
+else
+	echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
+
+
+?>
+		</div>
+	</div>
+</div>
+<?php
+$hide_smilies = 0;
+$nb_messages_max = 50;
+$nom_fichier = 'chatbox.txt';
+$hauteur_parloire = '200px';
+$largeur_parloire = '100%';
+$color_box = '#666666';
+$color_title = '#FFFFFF';
+
+$anti_flood_msg = '<strong>ATTENTION : Vous avez dÃ©jÃ  postÃ© exactement le mÃªme message dans la chatbox auparavant. Pour Ã©viter d\'encombrer la chatbox, votre message n\'a pas Ã©tÃ© postÃ©.</strong>';
+$anti_blanc_msg = '<strong>ATTENTION : Vous avez postÃ© un message sans aucun texte ! Votre "message" n\'a pas Ã©tÃ© postÃ©.</strong>';
+$no_membre_msg = '<strong>Vous devez Ãªtre membre pour accÃ©der Ã  la chatbox</strong>';
+$actualiser_msg = 'Actualiser';
+$poster_msg = 'Poster';
+
+
+require PUN_ROOT.'include/parser.php';
+
+$tpl_parloir = file_get_contents(PUN_ROOT.$nom_fichier);
+
+$messages = explode("</MESSAGE>", $tpl_parloir);
+
+$nb_messages = count($messages);
+
+$parloir = '';
+$parloir_txt = '';
+$anti_flood = 0;
+
+if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
+  $parloir_tmp_flood = '<MESSAGE><ID>'.$pun_user['id'].'</ID><TEXTE>'.$_POST['message'].'</TEXTE>';
+else
+  $parloir_tmp_flood = '<no_post>';
+
+  
+for($i=0;$i<$nb_messages - 1;$i++)
+{
+  $grab = ereg("<ID>(.*)</ID>", $messages[$i], $mess_id);
+  $grab = ereg("<PSEUDO>(.*)</PSEUDO>", $messages[$i], $mess_pseudo);
+  $grab = ereg("<DATE>(.*)</DATE>", $messages[$i], $mess_date);
+  $grab = ereg("<TEXTE>(.*)</TEXTE>", $messages[$i], $mess_texte);
+
+  $parloir .= '<a href="profile.php?id='.$mess_id[1].'"><strong>'.pun_htmlspecialchars($mess_pseudo[1]).'</strong></a> - '.format_time($mess_date[1])."\n".'<br />'."\n".parse_message($mess_texte[1], $hide_smilies)."\n"."\n"."\n";
+  if ($i+1 < $nb_messages_max)
+  {
+
+  $parloir_txt_flood = '<MESSAGE><ID>'.$mess_id[1].'</ID><TEXTE>'.$mess_texte[1].'</TEXTE>';
+
+   if ($parloir_tmp_flood == $parloir_txt_flood)
+    $anti_flood = 1;
+
+    $parloir_txt .= '<MESSAGE>'."\r".' <ID>'.$mess_id[1].'</ID>'."\r".' <PSEUDO>'.$mess_pseudo[1].'</PSEUDO>'."\r".' <DATE>'.$mess_date[1].'</DATE>'."\r".' <TEXTE>'.$mess_texte[1].'</TEXTE>'."\r".'</MESSAGE>'."\n\n";
+
+  }
+
+}
+
+if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
+{
+    if ($anti_flood == 0 && $_POST['message'] != '')
+    {
+      $fp = fopen(PUN_ROOT.$nom_fichier, "w");
+      if ($fp)
+      {
+        $parloir_txt = '<MESSAGE>'."\r".' <ID>'.$pun_user['id'].'</ID>'."\r".' <PSEUDO>'.$pun_user['username'].'</PSEUDO>'."\r".' <DATE>'.time().'</DATE>'."\r".' <TEXTE>'.$_POST['message'].'</TEXTE>'."\r".'</MESSAGE>'."\n\n".$parloir_txt;
+        $r = fwrite($fp, $parloir_txt);
+      }
+      fclose($fp); 
+      $parloir = '<a href="profile.php?id='.$pun_user['id'].'"><strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></a> - '.format_time(time())."\n".'<br />'."\n".parse_message($_POST['message'], $hide_smilies)."\n"."\n"."\n".$parloir;
+    }
+    elseif ($anti_flood == 1)
+    {
+      $parloir = $anti_flood_msg."\n".'<br />'."\n".'<br />'."\n".$parloir;
+    }
+    else
+    {
+      $parloir = $anti_blanc_msg."\n".'<br />'."\n".'<br />'."\n".$parloir;
+    }
+}
+
+
+
+?>
+  <div style="border:1px solid <?php echo $color_box; ?>;width:<?php echo $largeur_parloire; ?>;">
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;"><strong>Chatbox</strong></td>
+          </tr>
+    </table>
+  <div style="background-color:#1f1f1f;padding:5px;margin:0;overflow:auto;height:<?php echo $hauteur_parloire; ?>;">
+<?php echo $parloir; ?>
+
+  </div>
+<?php
+
+if ($pun_user['is_guest'])
+{
+?>
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;"><?php echo $no_membre_msg; ?></td>
+          </tr>
+    </table>
+<?php
+}
+else
+{
+?>
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;vertical-align:middle;">
+          <form method="post" name="form_parloir" action="?option=post">
+            <NOBR><strong>Message : </strong> <input type="text" name="message"  size="35" maxlength="255" /> <input type="submit" name="ajouter" value="<?php echo $poster_msg; ?>" /> <a href="?refresh=1"><input type="button" value="<?php echo $actualiser_msg; ?>" /></a></NOBR>
+                </form>
+        </td>
+          </tr>
+    </table>
+<?php
+}
+
+?>
+  </div>
+<?php
+
+$footer_style = 'index';
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/index2.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/index2.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/index2.php	(revision 1)
@@ -0,0 +1,231 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+// Load the index.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
+define('PUN_ALLOW_INDEX', 1);
+require PUN_ROOT.'header.php';
+
+// Print the categories and forums
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+$cur_category = 0;
+$cat_count = 0;
+while ($cur_forum = $db->fetch_assoc($result))
+{
+	$moderators = '';
+
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+	{
+		if ($cur_category != 0)
+			echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n";
+
+		++$cat_count;
+
+?>
+<div id="idx<?php echo $cat_count ?>" class="blocktable">
+	<h2><span><?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th>
+					<th class="tc2" scope="col"><?php echo $lang_index['Topics'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
+					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+		$cur_category = $cur_forum['cid'];
+	}
+
+	$item_status = '';
+	$icon_text = $lang_common['Normal icon'];
+	$icon_type = 'icon';
+
+	// Are there new posts?
+	if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit'])
+	{
+		$item_status = 'inew';
+		$icon_text = $lang_common['New icon'];
+		$icon_type = 'icon inew';
+	}
+
+	// Is this a redirect forum?
+	if ($cur_forum['redirect_url'] != '')
+	{
+		$forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
+		$num_topics = $num_posts = '&#160;';
+		$item_status = 'iredirect';
+		$icon_text = $lang_common['Redirect icon'];
+		$icon_type = 'icon';
+	}
+	else
+	{
+		$forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
+		$num_topics = $cur_forum['num_topics'];
+		$num_posts = $cur_forum['num_posts'];
+	}
+
+	if ($cur_forum['forum_desc'] != '')
+		$forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc'];
+
+
+	// If there is a last_post/last_poster.
+	if ($cur_forum['last_post'] != '')
+		$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
+	else
+		$last_post = '&#160;';
+
+	if ($cur_forum['moderators'] != '')
+	{
+		$mods_array = unserialize($cur_forum['moderators']);
+		$moderators = array();
+
+		while (list($mod_username, $mod_id) = @each($mods_array))
+			$moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
+
+		$moderators = "\t\t\t\t\t\t\t\t".'<p><em>('.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
+	}
+
+?>
+ 				<tr<?php if ($item_status != '') echo ' class="'.$item_status.'"'; ?>>
+					<td class="tcl">
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo $icon_text ?></div></div>
+							<div class="tclcon">
+								<?php echo $forum_field."\n".$moderators ?>
+							</div>
+						</div>
+					</td>
+					<td class="tc2"><?php echo $num_topics ?></td>
+					<td class="tc3"><?php echo $num_posts ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
+				</tr>
+<?php
+
+}
+
+// Did we output any categories and forums?
+if ($cur_category > 0)
+	echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n";
+else
+	echo '<div id="idx0" class="block"><div class="box"><div class="inbox"><p>'.$lang_index['Empty board'].'</p></div></div></div>';
+
+
+// Collect some statistics from the database
+$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\utilisateurs', __FILE__, __LINE__, $db->error());
+$stats['total_users'] = $db->result($result);
+
+$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier membre inscrit', __FILE__, __LINE__, $db->error());
+$stats['last_user'] = $db->fetch_assoc($result);
+
+$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le nombre de discussions et de messages', __FILE__, __LINE__, $db->error());
+list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
+
+?>
+<div id="brdstats" class="block">
+	<h2><span><?php echo $lang_index['Board info'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<dl class="conr">
+				<dt><strong><?php echo $lang_index['Board stats'] ?></strong></dt>
+				<dd><?php echo $lang_index['No of users'].': <strong>'. $stats['total_users'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of topics'].': <strong>'.$stats['total_topics'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of posts'].': <strong>'.$stats['total_posts'] ?></strong></dd>
+			</dl>
+			<dl class="conl">
+				<dt><strong><?php echo $lang_index['User info'] ?></strong></dt>
+				<dd><?php echo $lang_index['Newest user'] ?>: <a href="profile.php?id=<?php echo $stats['last_user']['id'] ?>"><?php echo pun_htmlspecialchars($stats['last_user']['username']) ?></a></dd>
+<?php
+
+if ($pun_config['o_users_online'] == '1')
+{
+	// Fetch users online info and generate strings for output
+	$num_guests = 0;
+	$users = array();
+	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+	while ($pun_user_online = $db->fetch_assoc($result))
+	{
+		if ($pun_user_online['user_id'] > 1)
+			$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
+		else
+			++$num_guests;
+	}
+
+	$num_users = count($users);
+	// utilisateurs en ligne aujourd'hui
+	$date = getdate(time());
+	$todaystamp = mktime(0,0,0, $date['mon'], $date['mday'], $date['year']);
+
+	$result = $db->query('SELECT username, id, last_visit from '.$db->prefix.'users WHERE last_visit >= \''.$todaystamp.'\' ORDER by last_visit DESC') or error('Impossible de retrouver la liste des utilisateurs en ligne aujourd\'hui', __FILE__, __LINE__, $db->error());
+
+	$users_today = array();
+	while ($pun_user_online_today = $db->fetch_assoc($result))
+		$users_today[] .=  "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online_today['id'].'" title="DerniÃšre visite de '.$pun_user_online_today['username'].' : '.format_time($pun_user_online_today['last_visit']).'">'.$pun_user_online_today['username'].'</a>';
+	// liste utilisateurs en ligne aujourd'hui
+	echo "\t\t\t".'<dl id="onlinetodaylist">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online today'].': </strong></dt>';
+				
+	if ($num_users_today > 0) 
+		echo implode(',</dd> ', $users_today).'</dd>'."\n\t\t\t".'</dl>'."\n";
+	else
+		echo '<dd><em>aucun</em></dd>'."\n\t\t\t".'</dl>'."\n";
+			
+	$num_users_today = count($users_today);
+	echo "\t\t\t\t".'<dd>'.$lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Users today'].': <strong>'.$num_users_today.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";
+
+
+	if ($num_users > 0)
+		echo "\t\t\t".'<dl id="onlinelist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].':&#160;</strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
+	else
+		echo "\t\t\t".'<div class="clearer"></div>'."\n";
+
+}
+else
+	echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
+
+
+?>
+		</div>
+	</div>
+</div>
+<?php
+
+$footer_style = 'index';
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/install.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/install.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/install.php	(revision 1)
@@ -0,0 +1,1461 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// The PunBB version this script installs
+$punbb_version = '1.2.10';
+$punbb_version_fr = '1.2.10';
+
+
+define('PUN_ROOT', './');
+if (file_exists(PUN_ROOT.'config.php'))
+	exit('Le fichier \'config.php\' existe dÃ©jÃ , ce qui signifie trÃšs probablement que PunBB est dÃ©jÃ  installÃ©. Vous devriez plutÃŽt <a href="index.php">aller ici</a>.');
+
+
+// Make sure we are running at least PHP 4.1.0
+if (intval(str_replace('.', '', phpversion())) < 410)
+	exit('Vous utilisez la version '.PHP_VERSION.' de PHP. PunBB nÃ©cÃ©ssite au minimum PHP 4.1.0 pour fonctionner correctement. Vous devez mettre Ã  jour votre installation de PHP afin que vous ne puissiez continuer.');
+
+// Disable error reporting for uninitialized variables
+error_reporting(E_ALL);
+
+// Turn off PHP time limit
+@set_time_limit(0);
+
+
+if (!isset($_POST['form_sent']))
+{
+	// Determine available database extensions
+	$dual_mysql = false;
+	$db_extensions = array();
+	if (function_exists('mysqli_connect'))
+		$db_extensions[] = array('mysqli', 'MySQL amÃ©liorÃ© (MySQL Improved)');
+	if (function_exists('mysql_connect'))
+	{
+		$db_extensions[] = array('mysql', 'MySQL Standard');
+
+		if (count($db_extensions) > 1)
+			$dual_mysql = true;
+	}
+	if (function_exists('sqlite_open'))
+		$db_extensions[] = array('sqlite', 'SQLite');
+	if (function_exists('pg_connect'))
+		$db_extensions[] = array('pgsql', 'PostgreSQL');
+
+	if (empty($db_extensions))
+		exit('Cet environnement PHP n\'a le support pour aucune bases de donnÃ©es que PunBB peut utiliser. Afin d\'installer PunBB, PHP doit supporter soit MySQL, PostgreSQL ou SQLite.');
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Installation de PunBB</title>
+<link rel="stylesheet" type="text/css" href="style/Oxygen.css" />
+<script type="text/javascript">
+<!--
+function process_form(the_form)
+{
+	var element_names = new Object()
+	element_names["req_db_type"] = "Type de base de donnÃ©es"
+	element_names["req_db_host"] = "HÃŽte serveur de base de donnÃ©es"
+	element_names["req_db_name"] = "Nom de base de donnÃ©es"
+	element_names["db_prefix"] = "PrÃ©fixe tables"
+	element_names["req_username"] = "Nom utilisateur administrateur"
+	element_names["req_password1"] = "Mot de passe administrateur 1"
+	element_names["req_password2"] = "Mot de passe administrateur 2"
+	element_names["req_email"] = "E-mail administrateur"
+	element_names["req_base_url"] = "URL de base"
+
+	if (document.all || document.getElementById)
+	{
+		for (i = 0; i < the_form.length; ++i)
+		{
+			var elem = the_form.elements[i]
+			if (elem.name && elem.name.substring(0, 4) == "req_")
+			{
+				if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
+				{
+					alert("\"" + element_names[elem.name] + "\" est un champ requis pour ce formulaire.")
+					elem.focus()
+					return false
+				}
+			}
+		}
+	}
+
+	return true
+}
+// -->
+</script>
+</head>
+<body onload="document.getElementById('install').req_db_type.focus()">
+
+<div id="puninstall" style="margin: auto 10% auto 10%">
+<div class="pun">
+
+<div class="block">
+	<h2><span>Installation de PunBB</span></h2>
+	<div class="box">
+		<div class="inbox">
+			<p>Bienvenue sur l'application d'installation de  PunBB ! Vous vous apprÃªtez Ã  installer PunBB. Afin d'installer celui-ci vous devez remplir le formulaire ci-dessous. Si vous rencontrez des difficultÃ©s avec l'installation, veuillez s'il vous plait vous rÃ©fÃ©rer Ã  la documentation.</p>
+		</div>
+	</div>
+</div>
+
+<div class="blockform">
+	<h2><span>Installer PunBB</span></h2>
+	<div class="box">
+		<form id="install" method="post" action="install.php" onsubmit="this.start.disabled=true;if(process_form(this)){return true;}else{this.start.disabled=false;return false;}">
+		<div><input type="hidden" name="form_sent" value="1" /></div>
+			<div class="inform">
+				<div class="forminfo">
+					<h3>RÃ©glages de la base de donnÃ©es</h3>
+					<p>Afin d'installer votre base de donnÃ©es pour PunBB, veuillez saisir les informations demandÃ©es ci-dessous. Vous devez connaÃ®tre toutes les informations demandÃ©es avant de procÃ©der Ã  l'installation.</p>
+				</div>
+				<fieldset>
+				<legend>SÃ©lectionnez le type de votre base de donnÃ©es</legend>
+					<div class="infldset">
+						<p>PunBB supporte actuellement MySQL, PostgreSQL et SQLite. Si votre base de donnÃ©es est absente du menu dÃ©roulant ci-dessous, cela signifie que cet environnement <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> n'a pas le support pour cette base de donnÃ©es particuliÃšre. Plus d'information concernant le support des versions particuliÃšres de chaque base de donnÃ©es pourra Ãªtre trouvÃ©e dans la <acronym title="Frequently Asked Questions" lang="en">FAQ</acronym>.</p>
+<?php if ($dual_mysql): ?>						<p>PunBB a dÃ©tectÃ© que votre environnement PHP supporte deux maniÃšres diffÃ©rentes de communiquer avec MySQL. Les deux options s'appellent "standard" (MySQL) et "amÃ©liorÃ©" (MySQLi ; "i" comme "improved"). Si vous n'Ãªtes pas certain de laquelle utiliser, commencez par essayer "amÃ©liorÃ©" et si cela Ã©choue, essayez "standard".</p>
+<?php endif; ?>						<label><strong>Type de base de donnÃ©es</strong>
+						<br /><select name="req_db_type">
+<?php
+
+	foreach ($db_extensions as $db_type)
+		echo "\t\t\t\t\t\t\t".'<option value="'.$db_type[0].'">'.$db_type[1].'</option>'."\n";
+
+?>
+						</select>
+						<br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez l'adresse de votre serveur de base de donnÃ©es</legend>
+					<div class="infldset">
+						<p>L'adresse du serveur de base de donnÃ©es  (exemples : localhost, db.monhote.com ou 192.168.0.15). Vous pouvez indiquer un numÃ©ro de port personnalisÃ© au cas oÃ¹ votre base de donnÃ©e ne fonctionne pas sur le port par dÃ©faut  (exemple : localhost:3580). Pour le support de SQLite, Ã©crivez n'importe quoi ou laissez 'localhost'.</p>
+						<label><strong>HÃŽte serveur de base de donnÃ©es</strong><br /><input type="text" name="req_db_host" value="localhost" size="50" maxlength="100" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez le nom de votre base de donnÃ©es</legend>
+					<div class="infldset">
+						<p>Le nom de la base de donnÃ©es sur laquelle PunBB sera installÃ©. La base de donnÃ©es doit exister. Pour SQLite, il s'agit du chemin relatif vers le fichier de base de donnÃ©es. Si ce fichier de base de donnÃ©es SQLite n'existe pas, PunBB essayera de le crÃ©er.</p>
+						<label for="req_db_name"><strong>Nom de la base de donnÃ©es</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez votre nom d'utilisateur et votre mot de passe de la base de donnÃ©es</legend>
+					<div class="infldset">
+						<p>Saisissez le nom d'utilisateur et le mot de passe que vous utilisez pour vous connecter Ã  la base de donnÃ©es. Ignorez pour SQLite.</p>
+						<label class="conl">Nom d'utilisateur <acronym title="Base de donnÃ©es">BDD</acronym><br /><input type="text" name="db_username" size="30" maxlength="50" /><br /></label>
+						<label class="conl">Mot de passe <acronym title="Base de donnÃ©es">BDD</acronym><br /><input type="text" name="db_password" size="30" maxlength="50" /><br /></label>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez le prÃ©fixe des tables</legend>
+					<div class="infldset">
+						<p>Si vous le souhaitez vous pouvez indiquer un prÃ©fixe de tables. De cette faÃ§on vous pouvez utiliser plusieurs installations de PunBB sur la mÃªme base de donnÃ©es. (exemple : pun_).</p>
+						<label>PrÃ©fixe tables<br /><input id="db_prefix" type="text" name="db_prefix" size="20" maxlength="30" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<div class="forminfo">
+					<h3>RÃ©glages d'administration</h3>
+					<p>Veuillez saisir les informations demandÃ©es ci-dessous afin de dÃ©finir un administrateur pour votre installation de PunBB.</p>
+				</div>
+				<fieldset>
+					<legend>Saisissez le nom d'utilisateur de l'administrateur</legend>
+					<div class="infldset">
+						<p>Le nom d'utilisateur de l'administrateur des forums. Vous pourrez par la suite crÃ©er de nouveaux administrateurs ainsi que des modÃ©rateurs. Ce nom d'utilisateur peut faire entre 2 et 25 caractÃšres de long.</p>
+						<label><strong>Nom d'utilisateur administrateur</strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez et confirmez le mot de passe administrateur</legend>
+					<div class="infldset">
+					<p>Les mots de passe peuvent faire entre 4 et 16 caractÃšres de long. Les mots de passe sont sensibles Ã  la casse.</p>
+						<label class="conl"><strong>Mot de passe</strong><br /><input id="req_password1" type="text" name="req_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong>Confirmez le mot de passe</strong><br /><input type="text" name="req_password2" size="16" maxlength="16" /><br /></label>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez l'adresse e-mail de l'administrateur</legend>
+					<div class="infldset">
+						<p>L'adresse e-mail de l'administrateur des forums.</p>
+						<label for="req_email"><strong>E-mail administrateur</strong><br /><input id="req_email" type="text" name="req_email" size="50" maxlength="50" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend>Saisissez l'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base de votre installation de PunBB</legend>
+					<div class="infldset">
+						<p>L'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base (sans slash Ã  la fin) de vos forums PunBB (exemple : http://forum.mondomaine.com ou http://monhote.com/~utilisateur). Ceci <strong>doit Ãªtre correct</strong> ou les administrateurs et modÃ©rateurs ne pourront valider aucun des formulaires. Veuillez noter que la valeur prÃ©-rÃ©glÃ©e ci-dessous est juste une proposition devinÃ©e par PunBB.</p>
+						<label><strong><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base</strong><br /><input type="text" name="req_base_url" value="http://<?php echo $_SERVER['SERVER_NAME'].str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])) ?>" size="60" maxlength="100" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="start" value="Lancer l'installation" /></p>
+		</form>
+	</div>
+</div>
+
+</div>
+</div>
+
+</body>
+</html>
+<?php
+
+}
+else
+{
+	//
+	// Strip slashes only if magic_quotes_gpc is on.
+	//
+	function unescape($str)
+	{
+		return (get_magic_quotes_gpc() == 1) ? stripslashes($str) : $str;
+	}
+
+
+	//
+	// Compute a hash of $str.
+	// Uses sha1() if available. If not, SHA1 through mhash() if available. If not, fall back on md5().
+	//
+	function pun_hash($str)
+	{
+		if (function_exists('sha1'))	// Only in PHP 4.3.0+
+			return sha1($str);
+		else if (function_exists('mhash'))	// Only if Mhash library is loaded
+			return bin2hex(mhash(MHASH_SHA1, $str));
+		else
+			return md5($str);
+	}
+
+
+	//
+	// A temporary replacement for the full error handler found in functions.php.
+	// It's here because a function called error() must be callable in the database abstraction layer.
+	//
+	function error($message, $file = false, $line = false, $db_error = false)
+	{
+		if ($file !== false && $line !== false)
+			echo '<strong style="color: A00000">Une erreur s\'est produite Ã  la ligne '.$line.' dans le fichier '.$file.'.</strong><br /><br />';
+		else
+			echo '<strong style="color: A00000">Une erreur s\'est produite.</strong><br /><br />';
+
+		echo '<strong>PunBB a rapportÃ©&#160;:</strong> '.htmlspecialchars($message).'<br /><br />';
+
+		if ($db_error !== false)
+			echo '<strong>La base de donnÃ©es a rapportÃ©&#160;:</strong> '.htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '');
+
+		exit;
+	}
+
+
+	$db_type = $_POST['req_db_type'];
+	$db_host = trim($_POST['req_db_host']);
+	$db_name = trim($_POST['req_db_name']);
+	$db_username = unescape(trim($_POST['db_username']));
+	$db_password = unescape(trim($_POST['db_password']));
+	$db_prefix = trim($_POST['db_prefix']);
+	$username = unescape(trim($_POST['req_username']));
+	$email = strtolower(trim($_POST['req_email']));
+	$password1 = unescape(trim($_POST['req_password1']));
+	$password2 = unescape(trim($_POST['req_password2']));
+
+
+	// Make sure base_url doesn't end with a slash
+	if (substr($_POST['req_base_url'], -1) == '/')
+		$base_url = substr($_POST['req_base_url'], 0, -1);
+	else
+		$base_url = $_POST['req_base_url'];
+
+
+	// Validate username and passwords
+	if (strlen($username) < 2)
+		error('Le nom d\'utilisateur administrateur doit faire au moins 2 caractÃšres de long. Veuillez retourner en arriÃšre et corriger.');
+	if (strlen($password1) < 4)
+		error('Le mot de passe administrateur doit faire au moins 4 caractÃšres de long. Veuillez retourner en arriÃšre et corriger.');
+	if ($password1 != $password2)
+		error('Les mots de passe administrateur ne correspondent pas. Veuillez retourner en arriÃšre et corriger.');
+	if (!strcasecmp($username, 'invitÃ©'))
+		error('Le nom d\'utilisateur \'invitÃ©\' est rÃ©servÃ©. Veuillez retourner en arriÃšre et corriger.');
+	if (!strcasecmp($username, 'guest'))
+		error('Le nom d\'utilisateur \'guest\' est rÃ©servÃ©. Veuillez retourner en arriÃšre et corriger.');
+	if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+		error('Les noms d\'utilisateur ne peuvent Ãªtre de la forme d\'une adresse IP. Veuillez retourner en arriÃšre et corriger.');
+	if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+		error('Le nom d\'utilisateur ne peut contenir aucune des balise de formatage (BBCode) que les forums utilisent. Veuillez retourner en arriÃšre et corriger.');
+
+	if (strlen($email) > 50 || !preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email))
+		error('L\'adresse e-mail administrateur que vous avez saisie est incorrecte. Veuillez retourner en arriÃšre et corriger.');
+
+
+	// Load the appropriate DB layer class
+	switch ($db_type)
+	{
+		case 'mysql':
+			require PUN_ROOT.'include/dblayer/mysql.php';
+			break;
+
+		case 'mysqli':
+			require PUN_ROOT.'include/dblayer/mysqli.php';
+			break;
+
+		case 'pgsql':
+			require PUN_ROOT.'include/dblayer/pgsql.php';
+			break;
+
+		case 'sqlite':
+			require PUN_ROOT.'include/dblayer/sqlite.php';
+			break;
+			
+		default:
+			error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es valable.');
+	}
+
+	// Create the database object (and connect/select db)
+	$db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, false);
+
+
+	// Do some DB type specific checks
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			break;
+
+		case 'pgsql':
+			// Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL)
+			if (version_compare(PHP_VERSION, '4.3.0', '<'))
+				error('Vous utilisez la version '.PHP_VERSION.'de PHP. PunBB nÃ©cÃ©ssite au minimum PHP 4.3.0 pour fonctionner correctement avec PostgreSQL. Vous devez mettre Ã  jour votre installation de PHP ou utiliser une base de donnÃ©es diffÃ©rente pour continuer.');
+			break;
+
+		case 'sqlite':
+			if (strtolower($db_prefix) == 'sqlite_')
+				error('Le prÃ©fixe de tables \'sqlite_\' est rÃ©servÃ© pour l\'utilisation du moteur SQLite. Veuillez choisir un prÃ©fixe diffÃ©rent.');
+			break;
+	}
+
+
+	// Make sure PunBB isn't already installed
+	$result = $db->query('SELECT 1 FROM '.$db_prefix.'users WHERE id=1');
+	if ($db->num_rows($result))
+		error('Une table nommÃ©e "'.$db_prefix.'users" est dÃ©jÃ  prÃ©sente dans la base de donnÃ©es "'.$db_name.'". Ceci pourrait signifier que PunBB est dÃ©jÃ  installÃ© ou qu\'un autre logiciel est installÃ© et occupe un ou plusieurs des noms de tables nÃ©cÃ©ssaires Ã  PunBB. Si vous souhaitez installer plusieurs copies de PunBB sur la mÃªme base de donnÃ©s, vous devez choisir des prÃ©fixes de tables diffÃ©rents.');
+
+
+	// Create all tables
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					username VARCHAR(200),
+					ip VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INT(10) UNSIGNED,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$db->start_transaction();
+
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id SERIAL,
+					username VARCHAR(200),
+					ip VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INT,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$db->start_transaction();
+
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id INTEGER NOT NULL,
+					username VARCHAR(200),
+					ip  VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INTEGER,
+					PRIMARY KEY (id)
+					)";
+			break;
+			
+		
+		default:  
+			error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es correct.'); 
+
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'bans. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INT(10) NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id SERIAL,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id INTEGER NOT NULL,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'categories. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id SERIAL,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id INTEGER NOT NULL,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'censoring. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'config. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INT(10) NOT NULL DEFAULT 0,
+					forum_id INT(10) NOT NULL DEFAULT 0,
+					read_forum TINYINT(1) NOT NULL DEFAULT 1,
+					post_replies TINYINT(1) NOT NULL DEFAULT 1,
+					post_topics TINYINT(1) NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INT NOT NULL DEFAULT 0,
+					forum_id INT NOT NULL DEFAULT 0,
+					read_forum SMALLINT NOT NULL DEFAULT 1,
+					post_replies SMALLINT NOT NULL DEFAULT 1,
+					post_topics SMALLINT NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INTEGER NOT NULL DEFAULT 0,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					read_forum INTEGER NOT NULL DEFAULT 1,
+					post_replies INTEGER NOT NULL DEFAULT 1,
+					post_topics INTEGER NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'forum_perms. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					num_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED,
+					last_post_id INT(10) UNSIGNED,
+					last_poster VARCHAR(200),
+					sort_by TINYINT(1) NOT NULL DEFAULT 0,
+					disp_position INT(10) NOT NULL DEFAULT 0,
+					cat_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id SERIAL,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics INT NOT NULL DEFAULT 0,
+					num_posts INT NOT NULL DEFAULT 0,
+					last_post INT,
+					last_post_id INT,
+					last_poster VARCHAR(200),
+					sort_by SMALLINT NOT NULL DEFAULT 0,
+					disp_position INT NOT NULL DEFAULT 0,
+					cat_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id INTEGER NOT NULL,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics INTEGER NOT NULL DEFAULT 0,
+					num_posts INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER,
+					last_post_id INTEGER,
+					last_poster VARCHAR(200),
+					sort_by INTEGER NOT NULL DEFAULT 0,
+					disp_position INTEGER NOT NULL DEFAULT 0,
+					cat_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'forums. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_replies TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_topics TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_polls TINYINT(1) NOT NULL DEFAULT 1,
+					g_edit_posts TINYINT(1) NOT NULL DEFAULT 1,
+					g_delete_posts TINYINT(1) NOT NULL DEFAULT 1,
+					g_delete_topics TINYINT(1) NOT NULL DEFAULT 1,
+					g_set_title TINYINT(1) NOT NULL DEFAULT 1,
+					g_search TINYINT(1) NOT NULL DEFAULT 1,
+					g_search_users TINYINT(1) NOT NULL DEFAULT 1,
+					g_edit_subjects_interval SMALLINT(6) NOT NULL DEFAULT 300,
+					g_post_flood SMALLINT(6) NOT NULL DEFAULT 30,
+					g_search_flood SMALLINT(6) NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id SERIAL,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board SMALLINT NOT NULL DEFAULT 1,
+					g_post_replies SMALLINT NOT NULL DEFAULT 1,
+					g_post_topics SMALLINT NOT NULL DEFAULT 1,
+					g_post_polls SMALLINT NOT NULL DEFAULT 1,
+					g_edit_posts SMALLINT NOT NULL DEFAULT 1,
+					g_delete_posts SMALLINT NOT NULL DEFAULT 1,
+					g_delete_topics SMALLINT NOT NULL DEFAULT 1,
+					g_set_title SMALLINT NOT NULL DEFAULT 1,
+					g_search SMALLINT NOT NULL DEFAULT 1,
+					g_search_users SMALLINT NOT NULL DEFAULT 1,
+					g_edit_subjects_interval SMALLINT NOT NULL DEFAULT 300,
+					g_post_flood SMALLINT NOT NULL DEFAULT 30,
+					g_search_flood SMALLINT NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id INTEGER NOT NULL,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board INTEGER NOT NULL DEFAULT 1,
+					g_post_replies INTEGER NOT NULL DEFAULT 1,
+					g_post_topics INTEGER NOT NULL DEFAULT 1,
+					g_post_polls INTEGER NOT NULL DEFAULT 1,
+					g_edit_posts INTEGER NOT NULL DEFAULT 1,
+					g_delete_posts INTEGER NOT NULL DEFAULT 1,
+					g_delete_topics INTEGER NOT NULL DEFAULT 1,
+					g_set_title INTEGER NOT NULL DEFAULT 1,
+					g_search INTEGER NOT NULL DEFAULT 1,
+					g_search_users INTEGER NOT NULL DEFAULT 1,
+					g_edit_subjects_interval INTEGER NOT NULL DEFAULT 300,
+					g_post_flood INTEGER NOT NULL DEFAULT 30,
+					g_search_flood INTEGER NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'groups. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					idle TINYINT(1) NOT NULL DEFAULT 0
+					) TYPE=HEAP;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INT NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INT NOT NULL DEFAULT 0,
+					idle SMALLINT NOT NULL DEFAULT 0
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INTEGER NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INTEGER NOT NULL DEFAULT 0,
+					idle INTEGER NOT NULL DEFAULT 0
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'online. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies TINYINT(1) NOT NULL DEFAULT 0,
+					posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					edited INT(10) UNSIGNED,
+					edited_by VARCHAR(200),
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id SERIAL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INT NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies SMALLINT NOT NULL DEFAULT 0,
+					posted INT NOT NULL DEFAULT 0,
+					edited INT,
+					edited_by VARCHAR(200),
+					topic_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id INTEGER NOT NULL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INTEGER NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies INTEGER NOT NULL DEFAULT 0,
+					posted INTEGER NOT NULL DEFAULT 0,
+					edited INTEGER,
+					edited_by VARCHAR(200),
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'posts. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id SERIAL,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id INTEGER NOT NULL,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'titles. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					created INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INT(10) UNSIGNED,
+					zapped_by INT(10) UNSIGNED,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id SERIAL,
+					post_id INT NOT NULL DEFAULT 0,
+					topic_id INT NOT NULL DEFAULT 0,
+					forum_id INT NOT NULL DEFAULT 0,
+					reported_by INT NOT NULL DEFAULT 0,
+					created INT NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INT,
+					zapped_by INT,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id INTEGER NOT NULL,
+					post_id INTEGER NOT NULL DEFAULT 0,
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					reported_by INTEGER NOT NULL DEFAULT 0,
+					created INTEGER NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INTEGER,
+					zapped_by INTEGER,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'reports. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INT NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INTEGER NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_cache. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					word_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					subject_match TINYINT(1) NOT NULL DEFAULT 0
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INT NOT NULL DEFAULT 0,
+					word_id INT NOT NULL DEFAULT 0,
+					subject_match SMALLINT NOT NULL DEFAULT 0
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INTEGER NOT NULL DEFAULT 0,
+					word_id INTEGER NOT NULL DEFAULT 0,
+					subject_match INTEGER NOT NULL DEFAULT 0
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_matches. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+					word VARCHAR(20) BINARY NOT NULL DEFAULT '',
+					PRIMARY KEY (word),
+					KEY ".$db_prefix."search_words_id_idx (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id SERIAL,
+					word VARCHAR(20) NOT NULL DEFAULT '',
+					PRIMARY KEY (word)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id INTEGER NOT NULL,
+					word VARCHAR(20) NOT NULL DEFAULT '',
+					PRIMARY KEY (id),
+					UNIQUE (word)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_words. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INT NOT NULL DEFAULT 0,
+					topic_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INTEGER NOT NULL DEFAULT 0,
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'subscriptions. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					num_replies MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					closed TINYINT(1) NOT NULL DEFAULT 0,
+					sticky TINYINT(1) NOT NULL DEFAULT 0,
+					moved_to INT(10) UNSIGNED,
+					forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id SERIAL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INT NOT NULL DEFAULT 0,
+					last_post INT NOT NULL DEFAULT 0,
+					last_post_id INT NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views INT NOT NULL DEFAULT 0,
+					num_replies INT NOT NULL DEFAULT 0,
+					closed SMALLINT NOT NULL DEFAULT 0,
+					sticky SMALLINT NOT NULL DEFAULT 0,
+					moved_to INT,
+					forum_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id INTEGER NOT NULL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER NOT NULL DEFAULT 0,
+					last_post_id INTEGER NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views INTEGER NOT NULL DEFAULT 0,
+					num_replies INTEGER NOT NULL DEFAULT 0,
+					closed INTEGER NOT NULL DEFAULT 0,
+					sticky INTEGER NOT NULL DEFAULT 0,
+					moved_to INTEGER,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'topics. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					group_id INT(10) UNSIGNED NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar TINYINT(1) NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics TINYINT(3) UNSIGNED,
+					disp_posts TINYINT(3) UNSIGNED,
+					email_setting TINYINT(1) NOT NULL DEFAULT 1,
+					save_pass TINYINT(1) NOT NULL DEFAULT 1,
+					notify_with_post TINYINT(1) NOT NULL DEFAULT 0,
+					show_smilies TINYINT(1) NOT NULL DEFAULT 1,
+					show_img TINYINT(1) NOT NULL DEFAULT 1,
+					show_img_sig TINYINT(1) NOT NULL DEFAULT 1,
+					show_avatars TINYINT(1) NOT NULL DEFAULT 1,
+					show_sig TINYINT(1) NOT NULL DEFAULT 1,
+					timezone FLOAT NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED,
+					registered INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id SERIAL,
+					group_id INT NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar SMALLINT NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics SMALLINT,
+					disp_posts SMALLINT,
+					email_setting SMALLINT NOT NULL DEFAULT 1,
+					save_pass SMALLINT NOT NULL DEFAULT 1,
+					notify_with_post SMALLINT NOT NULL DEFAULT 0,
+					show_smilies SMALLINT NOT NULL DEFAULT 1,
+					show_img SMALLINT NOT NULL DEFAULT 1,
+					show_img_sig SMALLINT NOT NULL DEFAULT 1,
+					show_avatars SMALLINT NOT NULL DEFAULT 1,
+					show_sig SMALLINT NOT NULL DEFAULT 1,
+					timezone REAL NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INT NOT NULL DEFAULT 0,
+					last_post INT,
+					registered INT NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INT NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id INTEGER NOT NULL,
+					group_id INTEGER NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar INTEGER NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics INTEGER,
+					disp_posts INTEGER,
+					email_setting INTEGER NOT NULL DEFAULT 1,
+					save_pass INTEGER NOT NULL DEFAULT 1,
+					notify_with_post INTEGER NOT NULL DEFAULT 0,
+					show_smilies INTEGER NOT NULL DEFAULT 1,
+					show_img INTEGER NOT NULL DEFAULT 1,
+					show_img_sig INTEGER NOT NULL DEFAULT 1,
+					show_avatars INTEGER NOT NULL DEFAULT 1,
+					show_sig INTEGER NOT NULL DEFAULT 1,
+					timezone FLOAT NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER,
+					registered INTEGER NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INTEGER NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'users. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+	// Add some indexes
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			// We use MySQL's ALTER TABLE ... ADD INDEX syntax instead of CREATE INDEX to avoid problems with users lacking the INDEX privilege
+			$queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX '.$db_prefix.'online_user_id_idx(user_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_topic_id_idx(topic_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_multi_idx(poster_id, topic_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'reports ADD INDEX '.$db_prefix.'reports_zapped_idx(zapped)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX '.$db_prefix.'search_matches_word_id_idx(word_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX '.$db_prefix.'search_matches_post_id_idx(post_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX '.$db_prefix.'topics_forum_id_idx(forum_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX '.$db_prefix.'topics_moved_to_idx(moved_to)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX '.$db_prefix.'users_registered_idx(registered)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_cache ADD INDEX '.$db_prefix.'search_cache_ident_idx(ident(8))';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX '.$db_prefix.'users_username_idx(username(8))';
+			break;
+
+		default:
+			$queries[] = 'CREATE INDEX '.$db_prefix.'online_user_id_idx ON '.$db_prefix.'online(user_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'posts_topic_id_idx ON '.$db_prefix.'posts(topic_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'posts_multi_idx ON '.$db_prefix.'posts(poster_id, topic_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'reports_zapped_idx ON '.$db_prefix.'reports(zapped)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_word_id_idx ON '.$db_prefix.'search_matches(word_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_post_id_idx ON '.$db_prefix.'search_matches(post_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'topics_forum_id_idx ON '.$db_prefix.'topics(forum_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'topics_moved_to_idx ON '.$db_prefix.'topics(moved_to)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'users_registered_idx ON '.$db_prefix.'users(registered)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'users_username_idx ON '.$db_prefix.'users(username)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_cache_ident_idx ON '.$db_prefix.'search_cache(ident)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_words_id_idx ON '.$db_prefix.'search_words(id)';
+			break;
+	}
+
+	@reset($queries);
+	while (list(, $sql) = @each($queries))
+		$db->query($sql) or error('Impossible de crÃ©er les index. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+	// Insert the four preset groups
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Administrateurs', 'Administrateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('InvitÃ©s', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Membres', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+
+
+	// Insert config data
+	$config = array(
+		'o_cur_version'				=> "'$punbb_version'",
+		'o_cur_version_fr'			=> "'$punbb_version_fr'",
+		'o_board_title'				=> "'Mon forum PunBB'",
+		'o_board_desc'				=> "'Malheureusement personne ne peut vous dire ce que PunBB est - vous devez le voir par vous-mÃªme.'",
+		'o_server_timezone'			=> "'0'",
+		'o_time_format'				=> "'H:i:s'",
+		'o_date_format'				=> "'d-m-Y'",
+		'o_timeout_visit'			=> "'600'",
+		'o_timeout_online'			=> "'300'",
+		'o_redirect_delay'			=> "'1'",
+		'o_show_version'			=> "'0'",
+		'o_show_user_info'			=> "'1'",
+		'o_show_post_count'			=> "'1'",
+		'o_smilies'					=> "'1'",
+		'o_smilies_sig'				=> "'1'",
+		'o_make_links'				=> "'1'",
+		'o_default_lang'			=> "'French'",
+		'o_default_style'			=> "'Oxygen'",
+		'o_default_user_group'		=> "'4'",
+		'o_topic_review'			=> "'15'",
+		'o_disp_topics_default'		=> "'30'",
+		'o_disp_posts_default'		=> "'25'",
+		'o_indent_num_spaces'		=> "'4'",
+		'o_quickpost'				=> "'1'",
+		'o_users_online'			=> "'1'",
+		'o_censoring'				=> "'0'",
+		'o_ranks'					=> "'1'",
+		'o_show_dot'				=> "'0'",
+		'o_quickjump'				=> "'1'",
+		'o_gzip'					=> "'0'",
+		'o_additional_navlinks'		=> "''",
+		'o_report_method'			=> "'0'",
+		'o_regs_report'				=> "'0'",
+		'o_mailing_list'			=> "'$email'",
+		'o_avatars'					=> "'1'",
+		'o_avatars_dir'				=> "'img/avatars'",
+		'o_avatars_width'			=> "'60'",
+		'o_avatars_height'			=> "'60'",
+		'o_avatars_size'			=> "'10240'",
+		'o_search_all_forums'		=> "'1'",
+		'o_base_url'				=> "'$base_url'",
+		'o_admin_email'				=> "'$email'",
+		'o_webmaster_email'			=> "'$email'",
+		'o_subscriptions'			=> "'1'",
+		'o_smtp_host'				=> "NULL",
+		'o_smtp_user'				=> "NULL",
+		'o_smtp_pass'				=> "NULL",
+		'o_regs_allow'				=> "'1'",
+		'o_regs_verify'				=> "'0'",
+		'o_announcement'			=> "'0'",
+		'o_announcement_message'	=> "'Saisissez votre annonce ici.'",
+		'o_rules'					=> "'0'",
+		'o_rules_message'			=> "'Saisissez vos rÃšgles ici.'",
+		'o_maintenance'				=> "'0'",
+		'o_maintenance_message'		=> "'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Veuillez essayer Ã  nouveau dans quelques minutes.<br />\\n<br />\\n/Administrateur'",
+		'p_mod_edit_users'			=> "'1'",
+		'p_mod_rename_users'		=> "'0'",
+		'p_mod_change_passwords'	=> "'0'",
+		'p_mod_ban_users'			=> "'0'",
+		'p_message_bbcode'			=> "'1'",
+		'p_message_img_tag'			=> "'1'",
+		'p_message_all_caps'		=> "'1'",
+		'p_subject_all_caps'		=> "'1'",
+		'p_sig_all_caps'			=> "'1'",
+		'p_sig_bbcode'				=> "'1'",
+		'p_sig_img_tag'				=> "'0'",
+		'p_sig_length'				=> "'400'",
+		'p_sig_lines'				=> "'4'",
+		'p_allow_banned_email'		=> "'1'",
+		'p_allow_dupe_email'		=> "'0'",
+		'p_force_guest_email'		=> "'1'"
+	);
+
+	while (list($conf_name, $conf_value) = @each($config))
+	{
+		$db->query('INSERT INTO '.$db_prefix."config (conf_name, conf_value) VALUES('$conf_name', $conf_value)")
+			or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'config. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+	}
+
+
+	$now = time();
+	// Insert guest and first admin user
+	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email) VALUES(3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©')")
+		or error('Impossible d\'ajouter l\'utilisateur "invitÃ©".');
+
+	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, '".$db->escape($username)."', '".pun_hash($password1)."', '$email', 1, ".$now.", ".$now.", '127.0.0.1', ".$now.')')
+		or error('Impossible d\'ajouter le compte administrateur.');
+
+	// Insert some other default data
+	$db->query('INSERT INTO '.$db_prefix."categories (cat_name, disp_position) VALUES('CatÃ©gorie test', 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'categories. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, disp_position, cat_id) VALUES('Forum test', 'Ceci est juste un forum de test.', 1, 1, ".$now.", 1, '".$db->escape($username)."', 1, 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'forums. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."topics (poster, subject, posted, last_post, last_post_id, last_poster, forum_id) VALUES('".$db->escape($username)."', 'Message de test', ".$now.", ".$now.", 1, '".$db->escape($username)."', 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'topics. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES('".$db->escape($username)."', 2, '127.0.0.1', 'Si vous lisez ceci (et je devine que vous Ãªtes Ã©videment en train de la faire), l\'installation de PunBB semble avoir fonctionnÃ©e ! Maintenant identifiez vous au panneau de contrÃŽle d\'administration pour configurer vos forums.', ".$now.', 1)')
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'posts. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Nouveau membre', 0)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'ranks. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Membre', 10)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'ranks. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+
+	if ($db_type == 'pgsql' || $db_type == 'sqlite')
+		$db->end_transaction();
+
+
+
+	$alerts = '';
+	// Check if the cache directory is writable
+	if (!@is_writable('./cache/'))
+		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>Le rÃ©pertoire du cache n\'est actuellement pas inscriptible !</strong></span> Afin que PunBB fonctionne corretement, le rÃ©pertoire nommÃ© <em>cache</em> doit Ãªtre inscriptible par PHP. Utilisez chmod pour rÃ©gler les permissions appropriÃ©e Ã  ce rÃ©pertoire. Si vous avez un doute, chmod 0777.</p>';
+
+	// Check if default avatar directory is writable
+	if (!@is_writable('./img/avatars/'))
+		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>Le rÃ©pertoire des avatars n\'est actuellement pas inscriptible !</strong></span> Si vous voulez que les utilisateurs puissent envoyer sur le serveur leur propres avatars vous devez rÃ©gler les permissions du dossier <em>img/avatars</em> pour que PHP puisse Ã©crire dedans. Utilisez chmod pour rÃ©gler les permissions appropriÃ©e Ã  ce rÃ©pertoire. Si vous avez un doute, chmod 0777.</p>';
+
+
+	/// Display config.php and give further instructions
+	$config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);";
+
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Installation de PunBB</title>
+<link rel="stylesheet" type="text/css" href="style/Oxygen.css" />
+</head>
+<body>
+
+<div id="puninstall" style="margin: auto 10% auto 10%">
+<div class="pun">
+
+<div class="blockform">
+	<h2>Instructions finales</h2>
+	<div class="box">
+		<div class="fakeform">
+			<div class="inform">
+				<div class="forminfo">
+					<p>Afin de terminer l'installation tout ce que vous avez Ã  faire est de <strong>copier et coller le texte de la boite ci-dessous dans un fichier que vous nommerez <em>config.php</em> et qu'ensuite vous enverrez sur votre serveur dans le rÃ©pertoire racine de votre installation de PunBB</strong>. Assurez-vous qu'il n'y a aucun saut de ligne ou d'espace avant &lt;?php et aprÃšs ?&gt; dans ce fichier. Vous pourrez par la suite modifier config.php si vous reconfigurez votre installation (ex. modification du mot de passe base de donnÃ©s ... ).</p>
+<?php if ($alerts != ''): ?>					<?php echo $alerts."\n" ?>
+<?php endif; ?>				</div>
+				<fieldset>
+					<legend>Copiez ce contenu dans config.php</legend>
+					<div class="infldset">
+						<textarea cols="80" rows="20"><?php echo htmlspecialchars($config) ?></textarea>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<div class="forminfo">
+					<p>Une fois que vous aurez crÃ©Ã© config.php avec le contenu ci-dessus, PunBB sera installÃ© !</p>
+					<p><a href="index.php">Aller Ã  l'index des forums</a></p>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+</div>
+</div>
+
+</body>
+</html>
+<?php
+
+}
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/common.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/common.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/common.php	(revision 1)
@@ -0,0 +1,154 @@
+<?php
+
+/*
+// Determine what locale to use
+switch (PHP_OS)
+{
+	case 'WINNT':
+	case 'WIN32':
+		$locale = 'english';
+		break;
+
+	case 'FreeBSD':
+	case 'NetBSD':
+	case 'OpenBSD':
+		$locale = 'en_US.US-ASCII';
+		break;
+
+	default:
+		$locale = 'en_US';
+		break;
+}
+
+// Attempt to set the locale
+setlocale(LC_CTYPE, $locale);
+*/
+
+// Language definitions for frequently used strings
+
+$lang_common = array(
+
+// Text orientation and encoding
+'lang_direction'		=>	'ltr',	// ltr (Left-To-Right) or rtl (Right-To-Left)
+'lang_encoding'			=>	'iso-8859-1',
+'lang_multibyte'		=>	false,
+
+// Notices
+'Bad request'			=>	'Bad request. The link you followed is incorrect or outdated.',
+'No view'				=>	'You do not have permission to view these forums.',
+'No permission'			=>	'You do not have permission to access this page.',
+'Bad referrer'			=>	'Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that \'Base URL\' is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the PunBB documentation.',
+
+// Topic/forum indicators
+'New icon'				=>	'There are new posts',
+'Normal icon'			=>	'<!-- -->',
+'Closed icon'			=>	'This topic is closed',
+'Redirect icon'			=>	'Redirected forum',
+
+// Miscellaneous
+'Announcement'			=>	'Announcement',
+'Options'				=>	'Options',
+'Actions'				=>	'Actions',
+'Submit'				=>	'Submit',	// "name" of submit buttons
+'Ban message'			=>	'You are banned from this forum.',
+'Ban message 2'			=>	'The ban expires at the end of',
+'Ban message 3'			=>	'The administrator or moderator that banned you left the following message:',
+'Ban message 4'			=>	'Please direct any inquiries to the forum administrator at',
+'Never'					=>	'Never',
+'Today'					=>	'Today',
+'Yesterday'				=>	'Yesterday',
+'Info'					=>	'Info',		// a common table header
+'Go back'				=>	'Go back',
+'Maintenance'			=>	'Maintenance',
+'Redirecting'			=>	'Redirecting',
+'Click redirect'		=>	'Click here if you do not want to wait any longer (or if your browser does not automatically forward you)',
+'on'					=>	'on',		// as in "BBCode is on"
+'off'					=>	'off',
+'Invalid e-mail'		=>	'The e-mail address you entered is invalid.',
+'required field'		=>	'is a required field in this form.',	// for javascript form validation
+'Last post'				=>	'Last post',
+'by'					=>	'by',	// as in last post by someuser
+'New posts'				=>	'New&#160;posts',	// the link that leads to the first new post (use &#160; for spaces)
+'New posts info'		=>	'Go to the first new post in this topic.',	// the popup text for new posts links
+'Username'				=>	'Username',
+'Password'				=>	'Password',
+'E-mail'				=>	'E-mail',
+'Send e-mail'			=>	'Send e-mail',
+'Moderated by'			=>	'Moderated by',
+'Registered'			=>	'Registered',
+'Subject'				=>	'Subject',
+'Message'				=>	'Message',
+'Topic'					=>	'Topic',
+'Forum'					=>	'Forum',
+'Posts'					=>	'Posts',
+'Replies'				=>	'Replies',
+'Author'				=>	'Author',
+'Pages'					=>	'Pages',
+'BBCode'				=>	'BBCode',	// You probably shouldn't change this
+'img tag'				=>	'[img] tag',
+'Smilies'				=>	'Smilies',
+'and'					=>	'and',
+'Image link'			=>	'image',	// This is displayed (i.e. <image>) instead of images when "Show images" is disabled in the profile
+'wrote'					=>	'wrote',	// For [quote]'s
+'Code'					=>	'Code',		// For [code]'s
+'Mailer'				=>	'Mailer',	// As in "MyForums Mailer" in the signature of outgoing e-mails
+'Important information'	=>	'Important information',
+'Write message legend'	=>	'Write your message and submit',
+
+// Title
+'Title'					=>	'Title',
+'Member'				=>	'Member',	// Default title
+'Moderator'				=>	'Moderator',
+'Administrator'			=>	'Administrator',
+'Banned'				=>	'Banned',
+'Guest'					=>	'Guest',
+
+// Stuff for include/parser.php
+'BBCode error'			=>	'The BBCode syntax in the message is incorrect.',
+'BBCode error 1'		=>	'Missing start tag for [/quote].',
+'BBCode error 2'		=>	'Missing end tag for [code].',
+'BBCode error 3'		=>	'Missing start tag for [/code].',
+'BBCode error 4'		=>	'Missing one or more end tags for [quote].',
+'BBCode error 5'		=>	'Missing one or more start tags for [/quote].',
+
+// Stuff for the navigator (top of every page)
+'Index'					=>	'Index',
+'User list'				=>	'User list',
+'Rules'					=>  'Rules',
+'Search'				=>  'Search',
+'Register'				=>  'Register',
+'Login'					=>  'Login',
+'Not logged in'			=>  'You are not logged in.',
+'Profile'				=>	'Profile',
+'Logout'				=>	'Logout',
+'Logged in as'			=>	'Logged in as',
+'Admin'					=>	'Administration',
+'Last visit'			=>	'Last visit',
+'Show new posts'		=>	'Show new posts since last visit',
+'Mark all as read'		=>	'Mark all topics as read',
+'Link separator'		=>	'',	// The text that separates links in the navigator
+
+// Stuff for the page footer
+'Board footer'			=>	'Board footer',
+'Search links'			=>	'Search links',
+'Show recent posts'		=>	'Show recent posts',
+'Show unanswered posts'	=>	'Show unanswered posts',
+'Show your posts'		=>	'Show your posts',
+'Show subscriptions'	=>	'Show your subscribed topics',
+'Jump to'				=>	'Jump to',
+'Go'					=>	' Go ',		// submit button in forum jump
+'Move topic'			=>  'Move topic',
+'Open topic'			=>  'Open topic',
+'Close topic'			=>  'Close topic',
+'Unstick topic'			=>  'Unstick topic',
+'Stick topic'			=>  'Stick topic',
+'Moderate forum'		=>	'Moderate forum',
+'Delete posts'			=>	'Delete multiple posts',
+'Debug table'			=>	'Debug information',
+
+// For extern.php RSS feed
+'RSS Desc Active'		=>	'The most recently active topics at',	// board_title will be appended to this string
+'RSS Desc New'			=>	'The newest topics at',					// board_title will be appended to this string
+'Posted'				=>	'Posted'	// The date/time a topic was started
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/delete.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/delete.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/delete.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in delete.php
+$lang_delete = array(
+
+'Delete post'			=>	'Delete post',
+'Warning'				=>	'Warning! If this is the first post in the topic, the whole topic will be deleted.',
+'Delete'				=>	'Delete',	// The submit button
+'Post del redirect'		=>	'Post deleted. Redirection ...',
+'Topic del redirect'	=>	'Topic deleted. Redirection ...'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/forum.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in viewforum.php
+$lang_forum = array(
+
+'Post topic'	=>	'Post new topic',
+'Views'			=>	'Views',
+'Moved'			=>	'Moved',
+'Sticky'		=>	'Sticky',
+'Empty forum'	=>	'Forum is empty.'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/help.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/help.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/help.php	(revision 1)
@@ -0,0 +1,42 @@
+<?php
+
+// Language definitions used in help.php
+$lang_help = array(
+
+'Help'					=>	'Help',
+'produces'				=>	'produces',
+
+'BBCode info 1'			=>	'BBCode is a collection of formatting tags that are used to change the look of text in this forum. BBCode is based on the same principal as, and is very similar to, HTML. Below is a list of all the available BBCodes and instructions on how to use them.',
+'BBCode info 2'			=>	'Administrators have the ability to enable or disable BBCode. You can tell if BBCode is enabled or disabled out in the left margin whenever you post a message or edit your signature.',
+
+'Text style'			=>	'Text style',
+'Text style info'		=>	'The following tags change the appearance of text:',
+'Bold text'				=>	'Bold text',
+'Underlined text'		=>	'Underlined text',
+'Italic text'			=>	'Italic text',
+'Red text'				=>	'Red text',
+'Blue text'				=>	'Blue text',
+
+'Links and images'		=>	'Links and images',
+'Links info'			=>	'You can create links to other documents or to e-mail addresses using the following tags:',
+'My e-mail address'		=>	'My e-mail address',
+'Images info'			=>	'If you want to display an image you can use the img tag.',
+
+'Quotes'				=>	'Quotes',
+'Quotes info'			=>	'If you want to quote someone, you should use the quote tag.',
+'Quotes info 2'			=>	'If you don\'t want to quote anyone in particular, you can use the quote tag without specifying a name.',
+'Quote text'			=>	'This is the text i want to quote.',
+'produces quote box'	=>	'produces a quote box like this:',
+
+'Code'					=>	'Code',
+'Code info'				=>	'When displaying source code you should make sure that you use the code tag. Text displayed with the code tag will use a monospaced font and will not be affected by other tags.',
+'Code text'				=>	'This is some code.',
+'produces code box'		=>	'produces a code box like this:',
+
+'Nested tags'			=>	'Nested tags',
+'Nested tags info'		=>	'BBCode can be nested to create more advanced formatting. For example:',
+'Bold, underlined text'	=>	'Bold, underlined text',
+
+'Smilies info'			=>	'If you like (and if it is enabled), the forum can convert a series of smilies to images representations of that smiley. This forum recognizes the following smilies and replaces them with images:'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/index.php	(revision 1)
@@ -0,0 +1,21 @@
+<?php
+
+// Language definitions used in index.php
+$lang_index = array(
+
+'Topics'				=>  'Topics',
+'Moderators'			=>  'Moderators',
+'Link to'				=>	'Link to',	// As in "Link to http://www.punbb.org/"
+'Empty board'			=>	'Board is empty.',
+'Newest user'			=>	'Newest registered user',
+'Users online'			=>	'Registered users online',
+'Guests online'			=>	'Guests online',
+'No of users'			=>	'Total number of registered users',
+'No of topics'			=>	'Total number of topics',
+'No of posts'			=>	'Total number of posts',
+'Online'				=>	'Online',	// As in "Online: User A, User B etc."
+'Board info'			=>	'Board information',
+'Board stats'			=>	'Board statistics',
+'User info'				=>	'User information'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/login.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/login.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/login.php	(revision 1)
@@ -0,0 +1,22 @@
+<?php
+
+// Language definitions used in delete.php
+$lang_login = array(
+
+// Miscellaneous
+'Wrong user/pass'		=>	'Wrong username and/or password.',
+'Forgotten pass'		=>	'Forgotten your password?',
+'Login redirect'		=>	'Logged in successfully. Redirection ...',
+'Logout redirect'		=>	'Logged out. Redirection ...',
+'No e-mail match'		=>	'There is no user registered with the e-mail address',
+'Request pass'			=>	'Request password',
+'Request pass legend'	=>	'Enter the e-mail address with which you registered',
+'Request pass info'		=>	'A new password together with a link to activate the new password will be sent to that address.',
+'Not registered'		=>	'Not registered yet?',
+'Login legend'			=>	'Enter your username and password below',
+'Login info'			=>	'If you have not registered or have forgotten your password click on the appropriate link below.',
+
+// Forget password mail stuff
+'Forget mail'			=>	'An e-mail has been sent to the specified address with instructions on how to change your password. If it does not arrive you can contact the forum administrator at'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_email.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_email.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_email.tpl	(revision 1)
@@ -0,0 +1,12 @@
+Subject: Change e-mail address requested
+
+Hello <username>,
+
+You have requested to have a new e-mail address assigned to your account in the discussion forum at <base_url>. If you didn't request this or if you don't want to change your e-mail address you should just ignore this message. Only if you visit the activation page below will your e-mail address be changed. In order for the activation page to work, you must be logged in to the forum.
+
+To change your e-mail address, please visit the following page:
+<activation_url>
+
+-- 
+<board_mailer>
+(Do not reply to this message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_password.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_password.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/activate_password.tpl	(revision 1)
@@ -0,0 +1,14 @@
+Subject: New password requested
+
+Hello <username>,
+
+You have requested to have a new password assigned to your account in the discussion forum at <base_url>. If you didn't request this or if you don't want to change your password you should just ignore this message. Only if you visit the activation page below will your password be changed.
+
+Your new password is: <new_password>
+
+To change your password, please visit the following page:
+<activation_url>
+
+-- 
+<board_mailer>
+(Do not reply to this message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/form_email.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/form_email.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/form_email.tpl	(revision 1)
@@ -0,0 +1,13 @@
+Subject: <mail_subject>
+
+<sender> from <board_title> has sent you a message. You can reply to <sender> by replying to this e-mail.
+
+The message reads as follows:
+-----------------------------------------------------------------------
+
+<mail_message>
+
+-----------------------------------------------------------------------
+
+-- 
+<board_mailer>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply.tpl	(revision 1)
@@ -0,0 +1,11 @@
+Subject: Reply to topic: <topic_subject>
+
+<replier> has replied to the topic <topic_subject> to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
+
+The post is located at <post_url>
+
+You can unsubscribe by going to <unsubscribe_url>
+
+-- 
+<board_mailer>
+(Do not reply to this message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply_full.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply_full.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/new_reply_full.tpl	(revision 1)
@@ -0,0 +1,18 @@
+Subject: Reply to topic: <topic_subject>
+
+<replier> has replied to the topic <topic_subject> to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
+
+The message reads as follows:
+-----------------------------------------------------------------------
+
+<message>
+
+-----------------------------------------------------------------------
+
+The post is located at <post_url>
+
+You can unsubscribe by going to <unsubscribe_url>
+
+-- 
+<board_mailer>
+(Do not reply to this message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/welcome.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/welcome.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/mail_templates/welcome.tpl	(revision 1)
@@ -0,0 +1,12 @@
+Subject: Welcome to <board_title>!
+
+Thank you for registering in the forums at <base_url>. Your account details are:
+
+Username: <username>
+Password: <password>
+
+Login at <login_url> to activate the account.
+
+--
+<board_mailer>
+(Do not reply to this message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/misc.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/misc.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/misc.php	(revision 1)
@@ -0,0 +1,67 @@
+<?php
+
+// Language definitions used in various scripts
+$lang_misc = array(
+
+'Mark read redirect'		=>	'All topics and forums have been marked as read. Redirection ...',
+
+// Send e-mail
+'Form e-mail disabled'		=>	'The user you are trying to send an e-mail to has disabled form e-mail.',
+'No e-mail subject'			=>	'You must enter a subject.',
+'No e-mail message'			=>	'You must enter a message.',
+'Too long e-mail message'	=>	'Messages cannot be longer than 65535 characters (64 KB).',
+'E-mail sent redirect'		=>	'E-mail sent. Redirection ...',
+'Send e-mail to'			=>	'Send e-mail to',
+'E-mail subject'			=>	'Subject',
+'E-mail message'			=>	'Message',
+'E-mail disclosure note'	=>	'Please note that by using this form, your e-mail address will be disclosed to the recipient.',
+'Write e-mail'				=>	'Write and submit your e-mail message',
+
+// Report
+'No reason'					=>	'You must enter a reason.',
+'Report redirect'			=>	'Post reported. Redirection ...',
+'Report post'				=>	'Report post',
+'Reason'					=>	'Reason',
+'Reason desc'				=>	'Please enter a short reason why you are reporting this post',
+
+// Subscriptions
+'Already subscribed'		=>	'You are already subscribed to this topic.',
+'Subscribe redirect'		=>	'Your subscription has been added. Redirection ...',
+'Not subscribed'			=>	'You are not subscribed to this topic.',
+'Unsubscribe redirect'		=>	'Your subscription has been removed. Redirection ...',
+
+// General forum and topic moderation
+'Moderate'					=>	'Moderate',
+'Select'					=>	'Select',	// the header of a column of checkboxes
+'Move'						=>	'Move',
+'Delete'					=>	'Delete',
+
+// Moderate forum
+'Open'						=>	'Open',
+'Close'						=>	'Close',
+'Move topic'				=>	'Move topic',
+'Move topics'				=>	'Move topics',
+'Move legend'				=>	'Select destination of move',
+'Move to'					=>	'Move to',
+'Leave redirect'			=>	'Leave redirect topic(s)',
+'Move topic redirect'		=>	'Topic moved. Redirection ...',
+'Move topics redirect'		=>	'Topics moved. Redirection ...',
+'Confirm delete legend'		=>	'Please confirm deletion',
+'Delete topics'				=>	'Delete topics',
+'Delete topics comply'		=>	'Are you sure you want to delete the selected topics?',
+'Delete topics redirect'	=>	'Topics deleted. Redirection ...',
+'Open topic redirect'		=>	'Topic opened. Redirection ...',
+'Open topics redirect'		=>	'Topics opened. Redirection ...',
+'Close topic redirect'		=>	'Topic closed. Redirection ...',
+'Close topics redirect'		=>	'Topics closed. Redirection ...',
+'No topics selected'		=>	'You must select at least one topic for move/delete/open/close.',
+'Stick topic redirect'		=>	'Topic sticked. Redirection ...',
+'Unstick topic redirect'	=>	'Topic unsticked. Redirection ...',
+
+// Delete multiple posts in topic
+'Delete posts'				=>	'Delete posts',
+'Delete posts comply'		=>	'Are you sure you want to delete the selected posts?',
+'Delete posts redirect'		=>	'Posts deleted. Redirection ...',
+'No posts selected'			=>	'You must select at least one post to be deleted.'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/post.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/post.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/post.php	(revision 1)
@@ -0,0 +1,33 @@
+<?php
+
+// Language definitions used in post.php and edit.php
+$lang_post = array(
+
+// Post validation stuff (many are similiar to those in edit.php)
+'No subject'			=>	'Topics must contain a subject.',
+'Too long subject'		=>	'Subjects cannot be longer than 70 characters.',
+'No message'			=>	'You must enter a message.',
+'Too long message'		=>	'Posts cannot be longer that 65535 characters (64 KB).',
+
+// Posting
+'Post errors'			=>	'Post errors',
+'Post errors info'		=>	'The following errors need to be corrected before the message can be posted:',
+'Post preview'			=>	'Post preview',
+'Guest name'			=>	'Name',	// For guests (instead of Username)
+'Post redirect'			=>	'Post entered. Redirection ...',
+'Post a reply'			=>	'Post a reply',
+'Post new topic'		=>	'Post new topic',
+'Hide smilies'			=>	'Never show smilies as icons for this post',
+'Subscribe'				=>	'Subscribe to this topic',
+'Topic review'			=>	'Topic review (newest first)',
+'Flood start'			=>	'At least',
+'flood end'				=>	'seconds have to pass between posts. Please wait a little while and try posting again.',
+'Preview'				=>	'Preview',	// submit button to preview message
+
+// Edit post
+'Edit post legend'		=>	'Edit the post and submit changes',
+'Silent edit'			=>	'Silent edit (don\'t display "Edited by ..." in topic view)',
+'Edit post'				=>	'Edit post',
+'Edit redirect'			=>	'Post updated. Redirection ...'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/prof_reg.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/prof_reg.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/prof_reg.php	(revision 1)
@@ -0,0 +1,39 @@
+<?php
+
+// Language definitions used in both profile.php and register.php
+$lang_prof_reg = array(
+
+'E-mail legend'				=>	'Enter a valid e-mail address',
+'E-mail legend 2'			=>	'Enter and confirm a valid e-mail address',
+'Localisation legend'		=>	'Set your localisation options',
+'Timezone'					=>	'Timezone',
+'Timezone info'				=>	'For the forum to display times correctly you must select your local timezone.',
+'Language'					=>	'Language',
+'Language info'				=>	'You can choose which language you wish to use to view the forum.',
+'E-mail setting info'		=>	'Select whether you want your e-mail address to be viewable to other users or not and if you want other users to be able to send you e-mail via the forum (form e-mail) or not.',
+'E-mail setting 1'			=>	'Display your e-mail address.',
+'E-mail setting 2'			=>	'Hide your e-mail address but allow form e-mail.',
+'E-mail setting 3'			=>	'Hide your e-mail address and disallow form e-mail.',
+'Privacy options legend'	=>	'Set your privacy options',
+'Save user/pass'			=>	'Save username and password between visits.',
+'Save user/pass info'		=>	'This option sets whether the forum should "remember" you between visits. If enabled, you will not have to login every time you visit the forum. You will be logged in automatically. Recommended.',
+'Confirm pass'				=>	'Confirm password',
+
+'Username too short'		=>	'Usernames must be at least 2 characters long. Please choose another (longer) username.',
+'Username guest'			=>	'The username guest is reserved. Please choose another username.',
+'Username IP'				=>	'Usernames may not be in the form of an IP address. Please choose another username.',
+'Username reserved chars'	=>	'Usernames may not contain all the characters \', " and [ or ] at once. Please choose another username.',
+'Username BBCode'			=>	'Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please choose another username.',
+'Dupe username'				=>	'Someone else has already registered with that username. Please choose another username.',
+'Pass too short'			=>	'Passwords must be at least 4 characters long. Please choose another (longer) password.',
+'Pass not match'			=>	'Passwords do not match. Please go back and correct.',
+'Banned e-mail'				=>	'The e-mail address you entered is banned in this forum. Please choose another e-mail address.',
+'Dupe e-mail'				=>	'Someone else is already registered with that e-mail address. Please choose another e-mail address.',
+'Sig too long'				=>	'Signatures cannot be longer than',
+'characters'				=>	'characters',
+'Sig too many lines'		=>	'Signatures cannot have more than',
+'lines'						=>	'lines',
+'Signature quote/code'		=>	'The quote and code BBCodes are not allowed in signatures. Please go back and correct.',
+'Bad ICQ'					=>	'You entered an invalid ICQ UIN. Please go back and correct.'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/profile.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/profile.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/profile.php	(revision 1)
@@ -0,0 +1,144 @@
+<?php
+
+// Language definitions used in profile.php
+$lang_profile = array(
+
+// Navigation and sections
+'Profile menu'				=>	'Profile menu',
+'Section essentials'		=>	'Essentials',
+'Section personal'			=>	'Personal',
+'Section messaging'			=>	'Messaging',
+'Section personality'		=>	'Personality',
+'Section display'			=>	'Display',
+'Section privacy'			=>	'Privacy',
+'Section admin'				=>	'Administration',
+
+// Miscellaneous
+'Username and pass legend'	=>	'Enter your username and password',
+'Personal details legend'	=>	'Enter your personal details',
+'Contact details legend'	=>	'Enter your messaging details',
+'Options display'			=>	'Set your display options',
+'Options post'				=>	'Set your post viewing options',
+'User activity'				=>	'User activity',
+'Paginate info'				=>	'Enter the number of topics and posts you wish to view on each page.',
+
+// Password stuff
+'Pass key bad'				=>	'The specified password activation key was incorrect or has expired. Please re-request a new password. If that fails, contact the forum administrator at',
+'Pass updated'				=>	'Your password has been updated. You can now login with your new password.',
+'Pass updated redirect'		=>	'Password updated. Redirection ...',
+'Wrong pass'				=>	'Wrong old password.',
+'Change pass'				=>	'Change password',
+'Change pass legend'		=>	'Enter and confirm your new password',
+'Old pass'					=>	'Old password',
+'New pass'					=>	'New password',
+'Confirm new pass'			=>	'Confirm new password',
+
+// E-mail stuff
+'E-mail key bad'			=>	'The specified e-mail activation key was incorrect or has expired. Please re-request change of e-mail address. If that fails, contact the forum administrator at',
+'E-mail updated'			=>	'Your e-mail address has been updated.',
+'Activate e-mail sent'		=>	'An email has been sent to the specified address with instructions on how to activate the new e-mail address. If it doesn\'t arrive you can contact the forum administrator at',
+'E-mail legend'				=>	'Enter your new e-mail address',
+'E-mail instructions'		=>	'An e-mail will be sent to your new address with an activation link. You must click the link in the e-mail you receive to activate the new address.',
+'Change e-mail'				=>	'Change e-mail address',
+'New e-mail'				=>	'New e-mail',
+
+// Avatar upload stuff
+'Avatars disabled'			=>	'The administrator has disabled avatar support.',
+'Too large ini'				=>	'The selected file was too large to upload. The server didn\'t allow the upload.',
+'Partial upload'			=>	'The selected file was only partially uploaded. Please try again.',
+'No tmp directory'			=>	'PHP was unable to save the uploaded file to a temporary location.',
+'No file'					=>	'You did not select a file for upload.',
+'Bad type'					=>	'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.',
+'Too wide or high'			=>	'The file you tried to upload is wider and/or higher than the maximum allowed',
+'Too large'					=>	'The file you tried to upload is larger than the maximum allowed',
+'pixels'					=>	'pixels',
+'bytes'						=>	'bytes',
+'Move failed'				=>	'The server was unable to save the uploaded file. Please contact the forum administrator at',
+'Unknown failure'			=>	'An unknown error occurred. Please try again.',
+'Avatar upload redirect'	=>	'Avatar uploaded. Redirection ...',
+'Avatar deleted redirect'	=>	'Avatar deleted. Redirection ...',
+'Avatar desc'				=>	'An avatar is a small image that will be displayed under your username in your posts. It must not be any bigger than',
+'Upload avatar'				=>	'Upload avatar',
+'Upload avatar legend'		=>	'Enter an avatar file to upload',
+'Delete avatar'				=>	'Delete avatar',	// only for admins
+'File'						=>	'File',
+'Upload'					=>	'Upload',	// submit button
+
+// Form validation stuff
+'Dupe username'				=>	'Someone else has already registered with that username. Please go back and try a different username.',
+'Forbidden title'			=>	'The title you entered contains a forbidden word. You must choose a different title.',
+'Profile redirect'			=>	'Profile updated. Redirection ...',
+
+// Profile display stuff
+'Not activated'				=>	'This user hasn\'t activated his/her account yet. The account is activated when he/she logs in the first time.',
+'Unknown'					=>	'(Unknown)',	// This is displayed when a user hasn't filled out profile field (e.g. Location)
+'Private'					=>	'(Private)',	// This is displayed when a user does not want to receive e-mails
+'No avatar'					=>	'(No avatar)',
+'Show posts'				=>	'Show all posts',
+'Realname'					=>	'Real name',
+'Location'					=>	'Location',
+'Website'					=>	'Website',
+'Jabber'					=>	'Jabber',
+'ICQ'						=>	'ICQ',
+'MSN'						=>	'MSN Messenger',
+'AOL IM'					=>	'AOL IM',
+'Yahoo'						=>	'Yahoo! Messenger',
+'Avatar'					=>	'Avatar',
+'Signature'					=>	'Signature',
+'Sig max length'			=>	'Max length',
+'Sig max lines'				=>	'Max lines',
+'Avatar legend'				=>	'Set your avatar display options',
+'Avatar info'				=>	'An avatar is a small image that will be displayed with all your posts. You can upload an avatar by clicking the link below. The checkbox \'Use avatar\' below must be checked in order for the avatar to be visible in your posts.',
+'Change avatar'				=>	'Change avatar',
+'Use avatar'				=>	'Use avatar.',
+'Signature legend'			=>	'Compose your signature',
+'Signature info'			=>	'A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like. Perhaps you would like to enter your favourite quote or your star sign. It\'s up to you! In your signature you can use BBCode if it is allowed in this particular forum. You can see the features that are allowed/enabled listed below whenever you edit your signature.',
+'Sig preview'				=>	'Current signature preview:',
+'No sig'					=>	'No signature currently stored in profile.',
+'Topics per page'			=>	'Topics',
+'Topics per page info'		=>	'This setting controls how many topics are displayed per page when you view a forum. If you are uncertain about what to use, you can just leave it blank and the forum default will be used.',
+'Posts per page'			=>	'Posts',
+'Posts per page info'		=>	'This setting controls how many posts are displayed per page when you view a topic. If you are uncertain about what to use, you can just leave it blank and the forum default will be used.',
+'Leave blank'				=>	'Leave blank to use forum default.',
+'Notify full'				=>	'Include post in subscription e-mails.',
+'Notify full info'			=>	'With this enabled, a plain text version of the new post will be included in subscription notification e-mails.',
+'Show smilies'				=>	'Show smilies as graphic icons',
+'Show smilies info'			=>	'If you enable this option, small images will be displayed instead of text smilies.',
+'Show images'				=>	'Show images in posts.',
+'Show images info'			=>	'Disable this if you don\'t want to see images in posts (i.e. images displayed with the [img]-tag).',
+'Show images sigs'			=>	'Show images in user signatures.',
+'Show images sigs info'		=>	'Disable this if you don\'t want to see images in signatures (i.e. images displayed with the [img]-tag).',
+'Show avatars'				=>	'Show user avatars in posts.',
+'Show avatars info'			=>	'This option toggles whether user avatar images will be displayed in posts or not.',
+'Show sigs'					=>	'Show user signatures.',
+'Show sigs info'			=>	'Enable if you would like to see user signatures.',
+'Style legend'				=>	'Select your preferred style',
+'Style info'				=>	'If you like you can use a different visual style for this forum.',
+'Admin note'				=>	'Admin note',
+'Pagination legend'			=>	'Enter your pagination options',
+'Post display legend'		=>	'Set your options for viewing posts',
+'Post display info'			=>	'If you are on a slow connection, disabling these options, particularly showing images in posts and signatures, will make pages load faster.',
+'Instructions'				=>	'When you update your profile, you will be redirected back to this page.',
+
+// Administration stuff
+'Group membership legend'	=>	'Choose user group',
+'Save'						=>	'Save',
+'Set mods legend'			=>	'Set moderator access',
+'Moderator in'				=>	'Moderator in',
+'Moderator in info'			=>	'Choose what forums this user should be allowed to moderate. Note: This only applies to moderators. Administrators always have full permissions in all forums.',
+'Update forums'				=>	'Update forums',
+'Delete ban legend'			=>	'Delete (administrators only) or ban user',
+'Delete user'				=>	'Delete user',
+'Ban user'					=>	'Ban user',
+'Confirm delete legend'		=>	'Important: read before deleting user',
+'Confirm delete user'		=>	'Confirm delete user',
+'Confirmation info'			=>	'Please confirm that you want to delete the user',	// the username will be appended to this string
+'Delete warning'			=>	'Warning! Deleted users and/or posts cannot be restored. If you choose not to delete the posts made by this user, the posts can only be deleted manually at a later time.',
+'Delete posts'				=>	'Delete any posts and topics this user has made.',
+'Delete'					=>	'Delete',		// submit button (confirm user delete)
+'User delete redirect'		=>	'User deleted. Redirection ...',
+'Group membership redirect'	=>	'Group membership saved. Redirection ...',
+'Update forums redirect'	=>	'Forum moderator rights updated. Redirection ...',
+'Ban redirect'				=>	'Redirection ...'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/register.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/register.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/register.php	(revision 1)
@@ -0,0 +1,35 @@
+<?php
+
+// Language definitions used in register.php
+$lang_register = array(
+
+// Miscellaneous
+'No new regs'				=>	'This forum is not accepting new registrations.',
+'Reg cancel redirect'		=>	'Registration cancelled. Redirection ...',
+'Forum rules'				=>	'Forum rules',
+'Rules legend'				=>	'You must agree to the following in order to register',
+'Agree'						=>	'Agree',
+'Cancel'					=>	'Cancel',
+'Register'					=>	'Register',
+
+// Form validation stuff (some of these are also used in post.php)
+'Username censor'			=>	'The username you entered contains one or more censored words. Please choose a different username.',
+'Username dupe 1'			=>	'Someone is already registered with the username',
+'Username dupe 2'			=>	'The username you entered is too similar. The username must differ from that by at least one alphanumerical character (a-z or 0-9). Please choose a different username.',
+'E-mail not match'			=>	'E-mail addresses do not match. Please go back and correct.',
+
+// Registration e-mail stuff
+'Reg e-mail'				=>	'Thank you for registering. Your password has been sent to the specified address. If it doesn\'t arrive you can contact the forum administrator at',
+'Reg complete'				=>	'Registration complete. Logging in and Redirection ...',
+
+// Register info
+'Desc 1'					=>	'Registration will grant you access to a number of features and capabilities otherwise unavailable. These functions include the ability to edit and delete posts, design your own signature that accompanies your posts and much more. If you have any questions regarding this forum you should ask an administrator.',
+'Desc 2'					=>	'Below is a form you must fill out in order to register. Once you are registered you should visit your profile and review the different settings you can change. The fields below only make up a small part of all the settings you can alter in your profile.',
+'Username legend'			=>	'Please enter a username between 2 and 25 characters long',
+'Pass legend 1'				=>	'Please enter and confirm your chosen password',
+'Pass legend 2'				=>	'Please read the instructions below',
+'Pass info'					=>	'Passwords can be between 4 and 16 characters long. Passwords are case sensitive.',
+'E-mail info'				=>	'You must enter a valid e-mail address as your randomly generated password will be sent to that address.',
+'Confirm e-mail'			=>	'Confirm e-mail address',
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/search.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/search.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/search.php	(revision 1)
@@ -0,0 +1,47 @@
+<?php
+
+// Language definitions used in search.php
+$lang_search = array(
+
+// The search form
+'User search'				=>	'User search',
+'No search permission'		=>	'You do not have permission to use the search feature.',
+'Search'					=>	'Search',
+'Search criteria legend'	=>	'Enter your search criteria',
+'Search info'				=>	'To search by keyword, enter a term or terms to search for. Separate terms with spaces. Use AND, OR and NOT to refine your search. To search by author enter the username of the author whose posts you wish to search for. Use wildcard character * for partial matches.',
+'Keyword search'			=>	'Keyword search',
+'Author search'				=>	'Author search',
+'Search in legend'			=>	'Select where to search',
+'Search in info'			=>	'Choose in which forum you would like to search and if you want to search in topic subjects, message text or both.',
+'Forum search'				=>	'Forum',
+'All forums'				=>	'All forums',
+'Search in'					=>	'Search in',
+'Message and subject'		=>	'Message text and topic subject',
+'Message only'				=>	'Message text only',
+'Topic only'				=>	'Topic subject only',
+'Sort by'					=>	'Sort by',
+'Sort order'				=>	'Sort order',
+'Search results legend'		=>	'Select how to view search results',
+'Search results info'		=>	'You can choose how you wish to sort and show your results.',
+'Sort by post time'			=>	'Post time',
+'Sort by author'			=>	'Author',
+'Sort by subject'			=>	'Subject',
+'Sort by forum'				=>	'Forum',
+'Ascending'					=>	'Ascending',
+'Descending'				=>	'Descending',
+'Show as'					=>	'Show results as',
+'Show as topics'			=>	'Topics',
+'Show as posts'				=>	'Posts',
+
+// Results
+'Search results'			=>	'Search results',
+'No terms'					=>	'You have to enter at least one keyword and/or an author to search for.',
+'No hits'					=>	'Your search returned no hits.',
+'No user posts'				=>	'There are no posts by this user in this forum.',
+'No subscriptions'			=>	'You are currently not subscribed to any topics.',
+'No new posts'				=>	'There are no topics with new posts since your last visit.',
+'No recent posts'			=>	'No new posts have been made within the last 24 hours.',
+'No unanswered'				=>	'There are no unanswered posts in this forum.',
+'Go to post'				=>	'Go to post'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/smilies.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/smilies.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/smilies.php	(revision 1)
@@ -0,0 +1,56 @@
+<?php
+
+// Language definitions used in the smilies mpanager
+$lang_smiley = array(
+	
+'Create Smiley Code None'	=>	'You must give a text code.',
+'Create Smiley Image None'	=>	'You must give an image.',
+'Code already exists'		=>	'The text code already exists.',
+'Images affected'			=>	'The following images cannot beings deleted because they are used: %s <br />To delete them remove them from the list of the smileys',
+'Images not deleted'		=>	'For an unknown reason the following images were not deleted: %s',
+'Description'				=>	'This plugin makes it possible to manage the smilies your forum.',
+'Submit New Smiley'			=>	'Create a new smiley',
+'Add Images Smilies'		=>	'Add a new image',
+'Smiley Code'				=>	'Text code',
+'Smiley Image'				=>	'Image filename',
+'Smiley Code Description'	=>	'Enter the text code that you want the smiley to be displayed as (ex. :O)).',
+'Smiley Image Description'	=>	'Enter the name of the image that cooresponds to the above text code (ex. bignose.png).',
+'Submit Smiley'				=>	'Create smiley',
+'Upload'					=>	'Upload',
+'Delete Smiley Redirect'	=>	'Smileys were successfully removed. Redirecting ...',
+'Images deleted'			=>	'Images were successfully deleted. Redirecting ...',
+'Successful Creation'		=>	'You successfully created in a new smiley. Redirecting ...',
+'Successful Upload'			=>	'Image successfully uploaded. Redirecting ...',
+'Current Smilies'			=>	'Current Smilies',
+'List Current Smilies'		=>	'List of Current Smilies',
+'List Images Smilies'		=>	'List of Current Images',
+'Code'						=>	'Code',
+'Image'						=>	'Image',
+'Image Filename'			=>	'Image filename',
+'Delete'					=>	'Delete',
+'Delete Selected'			=>	'Delete selection',
+'Remove'					=>	'Remove',
+'Remove Selected'			=>	'Remove selection',
+'No smiley'					=>	'There is no smiley.',
+'Too large ini'				=>	'The selected file was too large to upload. The server didn\'t allow the upload.',
+'Partial upload'			=>	'The selected file was only partially uploaded. Please try again.',
+'No tmp directory'			=>	'PHP was unable to save the uploaded file to a temporary location.',
+'No file'					=>	'You did not select a file for upload.',
+'Bad type'					=>	'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.',
+'Too wide or high'			=>	'The file you tried to upload is wider and/or higher than the maximum allowed',
+'Too large'					=>	'The file you tried to upload is larger than the maximum allowed',
+'pixels'					=>	'pixels',
+'bytes'						=>	'bytes',
+'Move failed'				=>	'The server was unable to save the uploaded file.',
+'Unknown failure'			=>	'An unknown error occurred. Please try again.',
+
+'Image file'				=>	'Image file',
+
+'Position'					=>	'Position',
+'Change position'			=>	'Change positions',
+'Must int'					=>	'Position must be an integer.',
+'Positions changed'			=>	'Positions successfully changed. Redirecting ...',
+
+);
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/stopwords.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/stopwords.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/stopwords.txt	(revision 1)
@@ -0,0 +1,150 @@
+about
+after
+ago
+all
+almost
+along
+also
+any
+anybody
+anywhere
+are
+arent
+around
+ask
+been
+before
+being
+between
+but
+came
+can
+cant
+come
+could
+couldnt
+did
+didnt
+does
+doesnt
+dont
+each
+either
+else
+even
+every
+everybody
+everyone
+find
+for
+from
+get
+going
+gone
+got
+had
+has
+have
+havent
+having
+her
+here
+hers
+him
+his
+how
+ill
+into
+isnt
+its
+ive
+just
+know
+less
+like
+make
+many
+may
+more
+most
+much
+must
+near
+never
+none
+nothing
+now
+off
+often
+once
+one
+only
+other
+our
+ours
+out
+over
+please
+rather
+really
+said
+see
+she
+should
+small
+some
+something
+sometime
+somewhere
+take
+than
+thank
+thanks
+that
+thats
+the
+their
+theirs
+them
+then
+there
+these
+they
+thing
+think
+this
+those
+though
+through
+thus
+too
+true
+two
+under
+until
+upon
+use
+very
+want
+was
+way
+well
+were
+what
+when
+where
+which
+who
+whom
+whose
+why
+will
+with
+within
+without
+would
+yes
+yet
+you
+your
+yours
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/topic.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/topic.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/topic.php	(revision 1)
@@ -0,0 +1,27 @@
+<?php
+
+// Language definitions used in viewtopic.php
+$lang_topic = array(
+
+'Post reply'		=>	'Post reply',
+'Topic closed'		=>	'Topic closed',
+'From'				=>	'From',				// User location
+'Note'				=>	'Note',				// Admin note
+'Website'			=>	'Website',
+'Guest'				=>	'Guest',
+'Online'			=>	'Online',
+'Offline'			=>	'Offline',
+'Last edit'			=>	'Last edited by',
+'Report'			=>	'Report',
+'Delete'			=>	'Delete',
+'Edit'				=>	'Edit',
+'Quote'				=>	'Quote',
+'Is subscribed'		=>	'You are currently subscribed to this topic',
+'Unsubscribe'		=>	'Unsubscribe',
+'Subscribe'			=>	'Subscribe to this topic',
+'Quick post'		=>	'Quick post',
+
+'Link separator'	=>	' | ',	// The text that separates links in posts (website, e-mail, report, edit etc.)
+'Mod controls'		=>	'Moderator controls'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/English/userlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/English/userlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/English/userlist.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in userlist.php
+$lang_ul = array(
+
+'User find legend'		=>	'Find and sort users',
+'User search info'		=>	'Enter a username to search for and/or a user group to filter by. The username field can be left blank. Use the wildcard character * for partial matches. Sort users by name, date registered or number of posts and in ascending/descending order.',
+'User group'			=>	'User group',
+'No of posts'			=>	'No. of posts',
+'All users'				=>	'All'
+
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/common.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/common.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/common.php	(revision 1)
@@ -0,0 +1,154 @@
+<?php
+
+/*
+// Determine what locale to use
+switch (PHP_OS)
+{
+	case 'WINNT':
+	case 'WIN32':
+		$locale = 'french';
+		break;
+
+	case 'FreeBSD':
+	case 'NetBSD':
+	case 'OpenBSD':
+		$locale = 'fr_FR.ISO8859-1';
+		break;
+
+	default:
+		$locale = 'fr_FR';
+		break;
+}
+
+// Attempt to set the locale
+setlocale(LC_CTYPE, $locale);
+*/
+
+
+// Language definitions for frequently used strings
+ 
+$lang_common = array(
+// Text orientation and encoding
+'lang_direction'		=>	'ltr',	// ltr (Left-To-Right) or rtl (Right-To-Left)
+'lang_encoding'			=>	'utf-8',
+'lang_multibyte'		=>	false,
+ 
+// Notices
+'Bad request'			=>	'Erreur. Le lien que vous avez suivi est incorrect ou pÃ©rimÃ©.',
+'No view'				=>	'Vous n\'Ãªtes pas autorisÃ© Ã  visiter ces forums.',
+'No permission'			=>	'Vous n\'Ãªtes pas autorisÃ© Ã  afficher cette page.',
+'Bad referrer'			=>	'Mauvais HTTP_REFERER. Vous avez Ã©tÃ© renvoyÃ© sur cette page par une source inconnue ou interdite. Si le problÃšme persiste, assurez-vous que le champ \'URL de base\' de la page Admin/Options est correctement renseignÃ© et que vous visitez ces forums en utilisant cette URL. Plus d\'informations pourront-Ãªtres trouvÃ©es dans la documentation de PunBB.',
+ 
+// Topic/forum indicators
+'New icon'				=>	'Il y a des nouveaux messages',
+'Normal icon'			=>	'<!-- -->',
+'Closed icon'			=>	'Cette discussion est fermÃ©e',
+'Redirect icon'			=>	'Forum de redirection',
+ 
+// Miscellaneous
+'Announcement'			=>	'Annonce',
+'Options'				=>	'Options',
+'Actions'				=>	'Actions',
+'Submit'				=>	'Envoyer',	// "name" of submit buttons
+'Ban message'			=>	'Vous Ãªtes exclu de ce forum.',
+'Ban message 2'			=>	'Votre exclusion expire le',
+'Ban message 3'			=>	'L\'administrateur ou le modÃ©rateur qui vous a exclu envoit le message suivant&#160;:',
+'Ban message 4'			=>	'Pour toute question, contactez l\'administrateur',
+'Never'					=>	'Jamais',
+'Today'					=>	'Aujourd\'hui',
+'Yesterday'				=>	'Hier',
+'Info'					=>	'Info',		// a common table header
+'Go back'				=>	'Retour',
+'Maintenance'			=>	'Maintenance',
+'Redirecting'			=>	'Redirection',
+'Click redirect'		=>	'Cliquez ici si vous ne voulez pas attendre (ou si votre navigateur ne vous redirige pas).',
+'on'					=>	'actif',		// as in "BBCode is on"
+'off'					=>	'inactif',
+'Invalid e-mail'		=>	'L\'adresse e-mail que vous avez saisie est invalide.',
+'required field'		=>	'est un champ requis pour ce formulaire.',	// for javascript form validation
+'Last post'				=>	'Dernier message',
+'by'					=>	'par',	// as in last post by someuser
+'New posts'				=>	'Nouveaux&#160;messages',	// the link that leads to the first new post (use &#160; for spaces)
+'New posts info'		=>	'Allez au premier nouveau message de cette discussion.',	// the popup text for new posts links
+'Username'				=>	'Nom d\'utilisateur',
+'Password'				=>	'Mot de passe',
+'E-mail'				=>	'e-mail',
+'Send e-mail'			=>	'Envoyer un e-mail',
+'Moderated by'			=>	'ModÃ©rÃ© par',
+'Registered'			=>	'Date d\'inscription',
+'Subject'				=>	'Sujet',
+'Message'				=>	'Message',
+'Topic'					=>	'Discussion',
+'Forum'					=>	'Forum',
+'Posts'					=>	'Messages',
+'Replies'				=>	'RÃ©ponses',
+'Author'				=>	'Auteur',
+'Pages'					=>	'Pages',
+'BBCode'				=>	'BBCode',	// You probably shouldn't change this
+'img tag'				=>	'Balise [img]',
+'Smilies'				=>	'ÃmoticÃŽnes',
+'and'					=>	'et',
+'Image link'			=>	'image',	// This is displayed (i.e. <image>) instead of images when "Show images" is disabled in the profile
+'wrote'					=>	'a Ã©crit',	// For [quote]'s
+'Code'					=>	'Code',		// For [code]'s
+'Mailer'				=>	'E-mail automatique',	// As in "MyForums Mailer" in the signature of outgoing e-mails
+'Important information'	=>	'Information importante',
+'Write message legend'	=>	'Veuillez Ã©crire votre message et l\'envoyer',
+ 
+// Title
+'Title'					=>	'Titre',
+'Member'				=>	'Membre',	// Default title
+'Moderator'				=>	'ModÃ©rateur',
+'Administrator'			=>	'Administrateur',
+'Banned'				=>	'Banni',
+'Guest'					=>	'InvitÃ©',
+ 
+// Stuff for include/parser.php
+'BBCode error'			=>	'La syntaxe BBCode est incorrecte.',
+'BBCode error 1'		=>	'Il manque la balise d\'ouverture pour [/quote].',
+'BBCode error 2'		=>	'Il manque la balise de fermeture pour [code].',
+'BBCode error 3'		=>	'Il manque la balise d\'ouverture pour [/code].',
+'BBCode error 4'		=>	'Il manque une ou plusieurs balises de fermeture pour [quote].',
+'BBCode error 5'		=>	'Il manque une ou plusieurs balises d\'ouverture manquantes pour [/quote].',
+ 
+// Stuff for the navigator (top of every page)
+'Index'					=>	'Index',
+'User list'				=>	'Liste des membres',
+'Rules'					=>  'RÃšgles',
+'Search'				=>  'Recherche',
+'Register'				=>  'Inscription',
+'Login'					=>  'S\'identifier',
+'Not logged in'			=>  'Vous n\'Ãªtes pas identifiÃ©.',
+'Profile'				=>	'Profil',
+'Logout'				=>	'DÃ©connexion',
+'Logged in as'			=>	'ConnectÃ© en tant que',
+'Admin'					=>	'Administration',
+'Last visit'			=>	'DerniÃšre visite',
+'Show new posts'		=>	'Afficher les nouveaux messages depuis la derniÃšre visite',
+'Mark all as read'		=>	'Marquer toutes les discussions comme lues',
+'Link separator'		=>	'',	// The text that separates links in the navigator
+ 
+// Stuff for the page footer
+'Board footer'			=>	'Pied de page des forums',
+'Search links'			=>	'Liens de recherche',
+'Show recent posts'		=>	'Afficher les messages rÃ©cents',
+'Show unanswered posts'	=>	'Afficher les messages sans rÃ©ponse',
+'Show your posts'		=>	'Afficher vos messages',
+'Show subscriptions'	=>	'Afficher les discussions auxquelles vous Ãªtes abonnÃ©s',
+'Jump to'				=>	'Aller Ã ',
+'Go'					=>	' Aller ',		// submit button in forum jump
+'Move topic'			=>  'DÃ©placer la discussion',
+'Open topic'			=>  'Ouvrir la discussion',
+'Close topic'			=>  'Fermer la discussion',
+'Unstick topic'			=>  'DÃ©tacher la discussion',
+'Stick topic'			=>  'Ãpingler la discussion',
+'Moderate forum'		=>	'ModÃ©rer le forum',
+'Delete posts'			=>	'Supprimer plusieurs messages',
+'Debug table'			=>	'Informations de dÃ©bogue',
+ 
+// For extern.php RSS feed
+'RSS Desc Active'		=>	'Les discussions rÃ©cemment actives de',	// board_title will be appended to this string
+'RSS Desc New'			=>	'Les derniÃšres discussions de',					// board_title will be appended to this string
+'Posted'				=>	'Ãcrit le'	// The date/time a topic was started
+);
+ 
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/delete.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/delete.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/delete.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in delete.php
+$lang_delete = array(
+ 
+'Delete post'			=>	'Supprimer le message',
+'Warning'				=>	'Attention&#160;: S\'il s\'agit du premier message de la discussion, celle-ci sera entiÃšrement supprimÃ©e&#160;!',
+'Delete'				=>	'Supprimer',	// The submit button
+'Post del redirect'		=>	'Message supprimÃ©. Redirection ...',
+'Topic del redirect'	=>	'Discussion supprimÃ©e. Redirection ...'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/forum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/forum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/forum.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in viewforum.php
+$lang_forum = array(
+ 
+'Post topic'	=>	'Nouvelle discussion',
+'Views'			=>	'Vues',
+'Moved'			=>	'DÃ©placÃ©',
+'Sticky'		=>	'ÃpinglÃ©',
+'Empty forum'	=>	'Le forum est vide.'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/help.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/help.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/help.php	(revision 1)
@@ -0,0 +1,42 @@
+<?php
+
+// Language definitions used in help.php
+$lang_help = array(
+ 
+'Help'					=>	'Aide',
+'produces'				=>	'produit',
+ 
+'BBCode info 1'			=>	'Le BBCode est une collection de balises de formatage utilisÃ©es pour modifier l\'apparence du texte sur ces forums. BBCode est basÃ© sur le mÃªme principe -&#160;et y ressemble beaucoup&#160;- que le HTML. Ci-dessous la liste de tous les BBCodes disponibles et les instructions d\'utilisation.',
+'BBCode info 2'			=>	'Les administrateurs ont la possibilitÃ© d\'activer ou de dÃ©sactiver le systÃšme de BBCode. Vous pouvez vÃ©rifier si le BBCode est activÃ© ou non lorsque vous Ã©crivez un message ou lorsque vous modifiez votre signature.',
+ 
+'Text style'			=>	'Style du texte',
+'Text style info'		=>	'Les balises suivantes changent l\'apparence du texte&#160;:',
+'Bold text'				=>	'Texte en gras',
+'Underlined text'		=>	'Texte soulignÃ©',
+'Italic text'			=>	'Texte en italique',
+'Red text'				=>	'Texte rouge',
+'Blue text'				=>	'Texte bleu',
+ 
+'Links and images'		=>	'Liens et images',
+'Links info'			=>	'Vous pouvez crÃ©er des liens vers d\'autres documents ou vers des adresses e-mail en utilisant les balises suivantes&#160;:',
+'My e-mail address'		=>	'Mon adresse e-mail',
+'Images info'			=>	'Si vous souhaitez afficher une image, vous pouvez utiliser la balise <em>img</em> comme ceci&#160;:',
+ 
+'Quotes'				=>	'Citations',
+'Quotes info'			=>	'Si vous souhaitez rÃ©aliser une citation de quelqu\'un, vous devriez utiliser la balise <em>quote</em>.',
+'Quotes info 2'			=>	'Si vous ne souhaitez pas citer quelqu\'un en particulier, vous pouvez utiliser la balise <em>quote</em> sans spÃ©cifier de nom.',
+'Quote text'			=>	'Voici le texte que je veux citer.',
+'produces quote box'	=>	'produit une boite de citation comme ceci&#160;:',
+ 
+'Code'					=>	'Code',
+'Code info'				=>	'Lorsque vous affichez du code source vous devriez vous assurer que vous utilisez la balise <em>code</em>. Le texte affichÃ© entre les balises <em>code</em> utilise une police de caractÃšre Ã  chasse fixe et n\'est pas affectÃ© par les autres balises.',
+'Code text'				=>	'Voici un peu de code.',
+'produces code box'		=>	'produit une boite de code comme ceci&#160;:',
+ 
+'Nested tags'			=>	'Balises imbriquÃ©es',
+'Nested tags info'		=>	'Les balises BBCode peuvent s\'imbriquer afin de rÃ©aliser un formatage avancÃ©. Par exemple&#160;:',
+'Bold, underlined text'	=>	'Texte gras et soulignÃ©',
+ 
+'Smilies info'			=>	'Si vous le souhaitez (et si c\'est activÃ©), les forums peuvent convertir une sÃ©rie d\'Ã©moticÃŽnes en reprÃ©sentation graphique de ceux-ci. Les forums reconnaissent et remplacent les Ã©moticÃŽnes par des images comme ci-dessous&#160;:'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/index.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/index.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/index.php	(revision 1)
@@ -0,0 +1,21 @@
+<?php
+
+// Language definitions used in index.php
+$lang_index = array(
+ 
+'Topics'				=>  'Discussions',
+'Moderators'			=>  'ModÃ©rateurs',
+'Link to'				=>	'Lien vers',	// As in "Link to http://www.punbb.org/"
+'Empty board'			=>	'Les forums sont vides.',
+'Newest user'			=>	'Dernier utilisateur inscrit',
+'Users online'			=>	'Membres en ligne',
+'Guests online'			=>	'InvitÃ©s en ligne',
+'No of users'			=>	'Nombre total de membres',
+'No of topics'			=>	'Nombre total de discussions',
+'No of posts'			=>	'Nombre total de messages',
+'Online'				=>	'Actuellement en ligne',	// As in "Online: User A, User B etc."
+'Board info'			=>	'Informations Forums',
+'Board stats'			=>	'Statistiques Forums',
+'User info'				=>	'Informations utilisateurs'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/login.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/login.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/login.php	(revision 1)
@@ -0,0 +1,22 @@
+<?php
+
+// Language definitions used in delete.php
+$lang_login = array(
+ 
+// Miscellaneous
+'Wrong user/pass'		=>	'Identifiant et/ou mot de passe incorrect.',
+'Forgotten pass'		=>	'Mot de passe oubliÃ©&#160;?',
+'Login redirect'		=>	'Vous Ãªtes maintenant identifiÃ©. Redirection ...',
+'Logout redirect'		=>	'Vous Ãªtes maintenant dÃ©connectÃ©. Redirection ...',
+'No e-mail match'		=>	'Il n`y a pas d\'utilisateur inscrit avec l\'adresse e-mail',
+'Request pass'			=>	'Demande de mot de passe',
+'Request pass legend'	=>	'Saisissez l\'adresse e-mail avec laquelle vous vous Ãªtes inscrits',
+'Request pass info'		=>	'Un nouveau mot de passe ainsi que le lien pour activer ce nouveau mot de passe vont Ãªtre envoyÃ©s Ã  cette adresse e-mail.',
+'Not registered'		=>	'Toujours pas inscrit&#160;?',
+'Login legend'			=>	'Saisissez ci-dessous votre nom d\'utilisateur et votre mot de passe',
+'Login info'			=>	'Si vous ne vous Ãªtes jamais inscrits  ou si vous avez oubliÃ© votre mot de passe, veuillez cliquer ci-dessous sur le lien appropriÃ©.',
+ 
+// Forget password mail stuff
+'Forget mail'			=>	'Un e-mail avec les instructions pour changer de mot de passe vient d\'Ãªtre envoyÃ© Ã  l\'adresse indiquÃ©e. Si vous ne le recevez pas, vous pouvez contacter l\'administrateur des forums Ã '
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_email.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_email.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_email.tpl	(revision 1)
@@ -0,0 +1,12 @@
+Subject: Demande de changement d'adresse e-mail
+
+Bonjour <username>,
+
+Vous avez fait la demande d'avoir une nouvelle adresse e-mail assignÃ©e Ã  votre compte sur le forum de <base_url>. Si vous n'en avez pas fait la demande ou ne voulez pas en changer, veuillez ignorer ce message. Votre e-mail ne sera changÃ© que si vous visitez la page d'activation ci-dessous. Pour que la page d'activation fonctionne, vous devez Ãªtre identifiÃ© sur le forum.
+
+Pour changer votre adresse e-mail, merci de visiter la page suivante:
+<activation_url>
+
+-- 
+<board_mailer>
+(Ne pas rÃ©pondre a ce message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_password.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_password.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/activate_password.tpl	(revision 1)
@@ -0,0 +1,14 @@
+Subject: Demande de nouveau mot de passe
+
+Bonjour <username>,
+
+Vous avez fait la demande d'avoir un nouveau mot de passe assignÃ© Ã  votre compte sur le forum de <base_url>. Si vous n'en avez pas fait la demande ou ne voulez pas en changer, veuillez ignorer ce message. Votre mot de passe ne sera changÃ© qui si vous visitez la page d'activation ci-dessous. 
+
+Votre nouveau mot de passe est : <new_password>
+
+Pour changer votre mot de passe, merci de visiter la page suivante:
+<activation_url>
+
+-- 
+<board_mailer>
+(Ne pas rÃ©pondre a ce message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/form_email.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/form_email.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/form_email.tpl	(revision 1)
@@ -0,0 +1,13 @@
+Subject: <mail_subject>
+
+<sender> de <board_title> vous a envoyÃ© un message. Vous pouvez rÃ©pondre Ã  <sender> en rÃ©pondant Ã  cet e-mail.
+
+Contenu du message:
+-----------------------------------------------------------------------
+
+<mail_message>
+
+-----------------------------------------------------------------------
+
+-- 
+<board_mailer>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply.tpl	(revision 1)
@@ -0,0 +1,11 @@
+Subject: RÃ©ponse Ã  la discussion : <topic_subject>
+
+<replier> a rÃ©pondu Ã  la discussion <topic_subject> Ã  laquelle vous avez souscrit. Il se peut qu'il y ait plus de nouvelles rÃ©ponses, mais ce sera la seule notification d'ici Ã  ce que vous vous reconnectiez sur le forum.
+
+Le message est situÃ© <post_url>
+
+Vous pouvez vous dÃ©sabonner ici <unsubscribe_url>
+
+-- 
+<board_mailer>
+(Ne pas rÃ©pondre a ce message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply_full.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply_full.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/new_reply_full.tpl	(revision 1)
@@ -0,0 +1,18 @@
+Subject: RÃ©ponse Ã  la discussion: <topic_subject>
+
+<replier> a rÃ©pondu Ã  la discussion <topic_subject> Ã  laquelle vous avez souscrit. Il se peut qu'il y ait plus de nouvelles rÃ©ponses, mais ce sera la seule notification d'ici Ã  ce que vous vous reconnectiez sur le forum.
+
+Contenu du message:
+-----------------------------------------------------------------------
+
+<message>
+
+-----------------------------------------------------------------------
+
+Le message est situÃ© <post_url>
+
+Vous pouvez vous dÃ©sabonner ici <unsubscribe_url>
+
+-- 
+<board_mailer>
+(Ne pas rÃ©pondre a ce message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/welcome.tpl
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/welcome.tpl	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/mail_templates/welcome.tpl	(revision 1)
@@ -0,0 +1,12 @@
+Subject: Bienvenue sur <board_title> !
+
+Merci de vous Ãªtre inscrit sur les forums <base_url>. Les dÃ©tails de votre compte sont :
+
+Nom d'utilisateur : <username>
+Mot de passe      : <password>
+
+Allez Ã  <login_url> pour activer votre compte.
+
+-- 
+<board_mailer>
+(Ne pas rÃ©pondre a ce message)
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/misc.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/misc.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/misc.php	(revision 1)
@@ -0,0 +1,67 @@
+<?php
+
+// Language definitions used in various scripts
+$lang_misc = array(
+ 
+'Mark read redirect'    	=>	'Tous les messages et forums ont Ã©tÃ© marquÃ©s comme lus. Redirection ...',
+ 
+// Send e-mail
+'Form e-mail disabled'		=>	'L\'utilisateur Ã  qui vous essayez d\'envoyer un e-mail a dÃ©sactivÃ© le formulaire e-mail.',
+'No e-mail subject'			=>	'Vous devez saisir un sujet.',
+'No e-mail message'			=>	'Vous devez saisir un message.',
+'Too long e-mail message'	=>	'Les messages ne peuvent excÃ©der 65535 caractÃšres de long (64 ko).',
+'E-mail sent redirect'		=>	'E-mail envoyÃ©. Redirection ...',
+'Send e-mail to'			=>	'Envoyer un e-mail Ã ',
+'E-mail subject'			=>	'Sujet',
+'E-mail message'			=>	'Message',
+'E-mail disclosure note'	=>	'Veuillez noter qu\'en utilisant ce formulaire, votre adresse e-mail sera rÃ©vÃ©lÃ©e au destinataire.',
+'Write e-mail'				=>	'Ãcrivez et envoyez votre e-mail',
+ 
+// Report
+'No reason'					=>	'Vous devez saisir un motif.',
+'Report redirect'			=>	'Signalement envoyÃ©. Redirection ...',
+'Report post'				=>	'Signaler un message',
+'Reason'					=>	'Motif',
+'Reason desc'				=>	'Saisissez le motif du signalement de ce message.',
+ 
+// Subscriptions
+'Already subscribed'		=>	'Vous Ãªtes dÃ©jÃ  abonnÃ© Ã  cette discussion.',
+'Subscribe redirect'		=>	'Votre abonnement a Ã©tÃ© pris en compte. Redirection ...',
+'Not subscribed'			=>	'Vous n\'Ãªtes pas abonnÃ© Ã  cette discussion.',
+'Unsubscribe redirect'		=>	'Votre abonnement a Ã©tÃ© annulÃ©. Redirection ...',
+ 
+// General forum and topic moderation
+'Moderate'					=>	'ModÃ©rer',
+'Select'					=>	'SÃ©lectionner',  // the header of a column of checkboxes
+'Move'						=>	'DÃ©placer',
+'Delete'					=>	'Supprimer',
+ 
+// Moderate forum
+'Open'						=>	'Ouvrir',
+'Close'						=>	'Fermer',
+'Move topic'				=>	'DÃ©placer la discussion',
+'Move topics'				=>	'DÃ©placer les discussions',
+'Move legend'				=>	'Choisissez une destination',
+'Move to'					=>	'DÃ©placer vers',
+'Leave redirect'			=>	'Laisser un lien de redirection',
+'Move topic redirect'		=>	'Discussion dÃ©placÃ©e. Redirection ...',
+'Move topics redirect'		=>	'Discussions dÃ©placÃ©es. Redirection ...',
+'Confirm delete legend'		=>	'Veuillez confirmer la suppression',
+'Delete topics'				=>	'Supprimer des discussions',
+'Delete topics comply'		=>	'Ãtes-vous sÃ»r de vouloir supprimer les discussions sÃ©lectionnÃ©es&#160;?',
+'Delete topics redirect'	=>	'Discussions supprimÃ©es. Redirection ...',
+'Open topic redirect'       =>  'Discussion ouverte. Redirection ...',
+'Open topics redirect'      =>  'Discussions ouvertes. Redirection ...',
+'Close topic redirect'		=>	'Discussion fermÃ©e. Redirection ...',
+'Close topics redirect'		=>	'Discussions fermÃ©es. Redirection ...',
+'No topics selected'		=>	'Vous devez choisir au moins une discussion Ã  DÃ©placer/Supprimer/Ouvrir/Fermer.',
+'Stick topic redirect'		=>	'Discussion Ã©pinglÃ©e. Redirection ...',
+'Unstick topic redirect'	=>	'Discussion dÃ©tachÃ©e. Redirection ...',
+ 
+// Delete multiple posts in topic
+'Delete posts'				=>	'Supprimer les messages',
+'Delete posts comply'		=>	'Ãtes vous sÃ»r de vouloir supprimer les messages sÃ©lectionnÃ©s&#160;?',
+'Delete posts redirect'		=>	'Messages supprimÃ©s. Redirection ...',
+'No posts selected'			=>	'Vous devez choisir au moins un message Ã  supprimer.'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/post.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/post.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/post.php	(revision 1)
@@ -0,0 +1,33 @@
+<?php
+
+// Language definitions used in post.php and edit.php
+$lang_post = array(
+ 
+// Post validation stuff (many are similiar to those in edit.php)
+'No subject'			=>	'Vous devez saisir un sujet.',
+'Too long subject'		=>	'Le sujet ne peut contenir plus de 70 caractÃšres.',
+'No message'			=>	'Vous devez saisir un message.',
+'Too long message'		=>	'Les messages ne peuvent excÃ©der 65535 caractÃšres de long (64 ko).',
+ 
+// Posting
+'Post errors'			=>	'Erreurs',
+'Post errors info'		=>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es pour que le message puisse Ãªtre envoyÃ©&#160;:',
+'Post preview'			=>	'PrÃ©visualisation du message',
+'Guest name'			=>	'Nom',	// For guests (instead of Username)
+'Post redirect'			=>	'Message envoyÃ©. Redirection ...',
+'Post a reply'			=>	'Ãcrire une rÃ©ponse',
+'Post new topic'		=>	'Lancer une nouvelle discussion',
+'Hide smilies'			=>	'Ne pas convertir les Ã©moticÃŽnes sur ce message',
+'Subscribe'				=>	'S\'abonner Ã  cette discussion',
+'Topic review'			=>	'RÃ©sumÃ© de la discussion (messages les plus rÃ©cents en premier)',
+'Flood start'			=>	'Au moins',
+'flood end'				=>	'secondes doivent s\'Ã©couler entre deux messages. Merci de patienter quelques instants et essayer Ã  nouveau.',
+'Preview'				=>	'PrÃ©visualisation',	// submit button to preview message
+ 
+// Edit post
+'Edit post legend'		=>	'Modifier le message et valider les changements',
+'Silent edit'			=>	'Modification invisible (la mention "DerniÃšre modification par ..." ne s\'affichera pas)',
+'Edit post'				=>	'Modifier le message',
+'Edit redirect'			=>	'Message mis Ã  jour. Redirection ...'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/prof_reg.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/prof_reg.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/prof_reg.php	(revision 1)
@@ -0,0 +1,39 @@
+<?php
+
+// Language definitions used in both profile.php and register.php
+$lang_prof_reg = array(
+ 
+'E-mail legend'				=>	'Saisissez une adresse e-mail valide',
+'E-mail legend 2'			=>	'Saisissez et confirmez une adresse e-mail valide',
+'Localisation legend'		=>	'RÃ©glez vos options gÃ©ographiques',
+'Timezone'					=>	'Fuseau horaire&#160;',
+'Timezone info'				=>	'Afin que le forum affiche correctement l\'heure, vous devez sÃ©lectionner votre fuseau horaire.',
+'Language'					=>	'Langue&#160;',
+'Language info'				=>	'Vous pouvez choisir la langue dans laquelle vous souhaitez lire les forums.',
+'E-mail setting info'		=>	'Choisissez si vous voulez que votre adresse e-mail soit visible par les autres utilisateurs ou non et si vous voulez que les autres utilisateurs puissent vous envoyer des e-mails via ces forums (formulaire e-mail) ou non.',
+'E-mail setting 1'			=>	'Afficher votre adresse e-mail.',
+'E-mail setting 2'			=>	'Cacher votre adresse e-mail mais autoriser le formulaire e-mail.',
+'E-mail setting 3'			=>	'Cacher votre adresse e-mail et interdisez le formulaire e-mail.',
+'Privacy options legend'	=>	'RÃ©glez vos options de vie privÃ©e',
+'Save user/pass'			=>	'MÃ©moriser le nom d\'utilisateur et le mot de passe entre les visites.',
+'Save user/pass info'		=>	'Cette option dÃ©finit si le forum doit vous "mÃ©moriser" entre deux visites. Si vous l\'activez, vous n\'aurez pas Ã  vous identifier Ã  chaque fois que vous visitez les forums. Vous serez automatiquement connectÃ©s. RecommandÃ©.',
+'Confirm pass'				=>	'Confirmez votre mot de passe',
+ 
+'Username too short'		=>	'Les noms d\'utilisateur doivent Ãªtres constituÃ©s d\'au moins 2 caractÃšres. Veuillez choisir un autre nom d\'utilisateur.',
+'Username guest'			=>	'Le nom d\'utilisateur \'invitÃ©\' est rÃ©servÃ©. Veuillez choisir un autre nom d\'utilisateur.',
+'Username IP'				=>	'Les noms d\'utilisateur ne peuvent pas Ãªtres au format d\'une adresse IP. Veuillez choisir un autre nom d\'utilisateur.',
+'Username reserved chars'	=>	'Les noms d\'utilisateurs ne peuvent pas contenir les caractÃšres \', " et [ ou ]. Veuillez choisir un autre nom d\'utilisateur.',
+'Username BBCode'			=>	'Les noms d\'utilisateur ne peuvent pas contenir de balises (BBCode). Veuillez choisir un autre nom d\'utilisateur.',
+'Dupe username'				=>	'Ce nom d\'utilisateur est dÃ©jÃ  utilisÃ©. Veuillez choisir un autre nom d\'utilisateur.',
+'Pass too short'			=>	'Les mots de passe doivent Ãªtres constituÃ©s d\'au moins 4 caractÃšres. Veuillez choisir un autre mot de passe.',
+'Pass not match'			=>	'Les mots de passe ne correspondent pas. Veuillez recommencer.',
+'Banned e-mail'				=>	'L\'adresse e-mail saisie est bannie de ces forums. Veuillez en choisir une autre.',
+'Dupe e-mail'				=>	'Cette adresse e-mail est dÃ©jÃ  utilisÃ©e. Veuillez en choisir une autre.',
+'Sig too long'				=>	'Les signatures ne peuvent pas contenir plus de',
+'characters'				=>	'caractÃšres',
+'Sig too many lines'		=>	'Les signatures ne peuvent pas faire plus de',
+'lines'						=>	'lignes',
+'Signature quote/code'		=>	'Les balises BBCode \'QUOTE\' et \'CODE\' ne sont pas autorisÃ©es dans les signatures. Veuillez corriger.',
+'Bad ICQ'					=>	'Vous avez saisi un UIN ICQ invalide. Merci de corriger.'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/profile.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/profile.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/profile.php	(revision 1)
@@ -0,0 +1,144 @@
+<?php
+
+// Language definitions used in profile.php
+$lang_profile = array(
+ 
+// Navigation and sections
+'Profile menu'				=>	'Menu profil',
+'Section essentials'		=>	'GÃ©nÃ©ral',
+'Section personal'			=>	'Personnel',
+'Section messaging'			=>	'Messagerie',
+'Section personality'		=>	'Personnalisation',
+'Section display'			=>	'Affichage',
+'Section privacy'			=>	'Vie privÃ©e',
+'Section admin'				=>	'Administration',
+ 
+// Miscellaneous
+'Username and pass legend'	=>	'Nom d\'utilisateur et mot de passe',
+'Personal details legend'	=>	'Informations personnelles',
+'Contact details legend'	=>	'Informations de messageries instantanÃ©es',
+'Options display'			=>	'Options d\'affichage',
+'Options post'				=>	'Options de visualisation des messages',
+'User activity'				=>	'ActivitÃ© de l\'utilisateur',
+'Paginate info'				=>	'Nombres de discussions et de messages a afficher par page.',
+ 
+// Password stuff
+'Pass key bad'				=>	'La clef d\'activation du mot de passe est incorrecte ou a expirÃ©. Veuillez demander Ã  nouveau un mot de passe. Si cela Ã©choue, contactez l\'administrateur',
+'Pass updated'				=>	'Votre mot de passe a Ã©tÃ© mis Ã  jour. Vous pouvez vous identifier avec votre nouveau mot de passe.',
+'Pass updated redirect'		=>	'Mot de passe mis Ã  jour. Redirection ...',
+'Wrong pass'				=>	'Ancien mot de passe incorrect.',
+'Change pass'				=>	'Changer de mot de passe',
+'Change pass legend'		=>	'Saisissez et confirmez votre mot de passe',
+'Old pass'					=>	'Ancien mot de passe',
+'New pass'					=>	'Nouveau mot de passe',
+'Confirm new pass'			=>	'Confirmez le nouveau mot de passe',
+ 
+// E-mail stuff
+'E-mail key bad'			=>	'La clef d\'activation d\'adresse e-mail est incorrecte ou a expir&eacute. Veuillez demander Ã  nouveau un changement d\'adresse e-mail. Si cela Ã©choue, contactez l\'administrateur',
+'E-mail updated'			=>	'Votre adresse e-mail a Ã©tÃ© mise Ã  jour.',
+'Activate e-mail sent'		=>	'Un e-mail a Ã©tÃ© envoyÃ© avec les instructions pour activer la nouvelle adresse e-mail. S\'il n\'arrive pas, contactez l\'administrateur Ã ',
+'E-mail legend'				=>	'Saisissez la nouvelle adresse e-mail',
+'E-mail instructions'		=>	'Entrez la nouvelle adresse e-mail. Un e-mail y sera envoyÃ© avec un lien d\'activation. Vous devrez cliquer sur ce lien pour activer l\'adresse.',
+'Change e-mail'				=>	'Changer l\'adresse e-mail',
+'New e-mail'				=>	'Nouvelle adresse e-mail',
+ 
+// Avatar upload stuff
+'Avatars disabled'			=>	'Le support des avatars est dÃ©sactivÃ©.',
+'Too large ini'				=>	'Fichier trop gros. Le serveur refuse son tÃ©lÃ©chargement.',
+'Partial upload'			=>	'Fichier partiellement tÃ©lÃ©charg&eacute. Merci de reacute;essayer.',
+'No tmp directory'			=>	'Le serveur n\'a pas pu enregistrer le fichier envoyÃ© dans un rÃ©pertoire temporaire.',
+'No file'					=>	'Vous n\'avez pas sÃ©lectionnÃ© de fichier Ã  tÃ©lÃ©charger.',
+'Bad type'					=>	'Le type du fichier n\'est pas autorisÃ©. Les types autorisÃ©s sont le GIF, le JPG et le PNG.',
+'Too wide or high'			=>	'L\'image est plus large et/ou plus haute que le maximum autorisÃ©',
+'Too large'					=>	'La taille du fichier dÃ©passe le maximum autorisÃ©',
+'pixels'					=>	'pixels',
+'bytes'						=>	'octets',
+'Move failed'				=>	'Le serveur n\'a pas pu enregistrer le fichier tÃ©lÃ©charg&acute;. Contactez l\'administrateur',
+'Unknown failure'			=>	'Erreur inconnue. Merci de rÃ©essayer.',
+'Avatar upload redirect'	=>	'Avatar tÃ©lÃ©chargÃ©. Redirection ...',
+'Avatar deleted redirect'	=>	'Avatar effacÃ©. Redirection ...',
+'Avatar desc'				=>	'Un avatar est une petite image qui sera affichÃ©e sous votre nom d\'utilisateur dans vos messages. Il ne doit pas faire plus de',
+'Upload avatar'				=>	'TÃ©lÃ©charger un avatar',
+'Upload avatar legend'		=>	'SÃ©lectionnez un fichier avatar Ã  tÃ©lÃ©charger',
+'Delete avatar'				=>	'Effacer l\'avatar',	// only for admins
+'File'						=>	'Fichier',
+'Upload'					=>	'TÃ©lÃ©charger',	// submit button
+ 
+// Form validation stuff
+'Dupe username'				=>	'Ce nom d\'utilisateur est dÃ©jÃ  utilisÃ©. Essayez un autre nom d\'utilisateur.',
+'Forbidden title'			=>	'Votre titre contient un mot interdit. Choisissez un autre titre.',
+'Profile redirect'			=>	'Profil mis Ã  jour. Redirection ...',
+ 
+// Profile display stuff
+'Not activated'				=>	'Cet utilisateur n\'a pas activÃ© son compte. Le compte est activÃ© lors de la premiÃšre identification de l\'utilisateur.',
+'Unknown'					=>	'(Information inconnue)',	// This is displayed when a user hasn't filled out profile field (e.g. Location)
+'Private'					=>	'(Information privÃ©e)',	// This is displayed when a user does not want to receive e-mails
+'No avatar'					=>	'(Aucun avatar)',
+'Show posts'				=>	'Voir les messages de cet utilisateur',
+'Realname'					=>	'Nom',
+'Location'					=>	'Lieu',
+'Website'					=>	'Site web',
+'Jabber'					=>	'Jabber',
+'ICQ'						=>	'ICQ',
+'MSN'						=>	'MSN Messenger',
+'AOL IM'					=>	'AOL IM',
+'Yahoo'						=>	'Yahoo! Messenger',
+'Avatar'					=>	'Avatar',
+'Signature'					=>	'Signature',
+'Sig max length'			=>	'Longueur maximale',
+'Sig max lines'				=>	'Maximum de lignes',
+'Avatar legend'				=>	'DÃ©finissez vos options d\'affichage d\'avatar',
+'Avatar info'				=>	'Un avatar est une petite image qui sera affichÃ©e avec chacun de vos messages. Vous pouvez tÃ©lÃ©charger un avatar en cliquant sur le lien ci-dessous. La case \'Utiliser l\'avatar\' doit Ãªtre cochÃ©e pour que l\'avatar soit visible dans vos messages.',
+'Change avatar'				=>	'Modifier avatar',
+'Use avatar'				=>	'Utiliser l\'avatar.',
+'Signature legend'			=>	'RÃ©digez votre signature',
+'Signature info'			=>	'Une signature est un petit texte ajoutÃ© Ã  la suite de vos messages. Vous pouvez y mettre ce que vous voulez. Vous pouvez y utiliser des balises BBCode, selon la configuration du forum. Les fonctionnalitÃ©s actives apparaissent dans la marge lors de l\'Ã©dition de votre signature.',
+'Sig preview'				=>	'Apercu de la signature actuelle:',
+'No sig'					=>	'Pas de signature dans le profil.',
+'Topics per page'			=>	'Discussions par page',
+'Topics per page info'		=>	'ContrÃŽle le nombre de discussions affichÃ©es par page dans chaque forum. Vous pouvez laisser blanc et la valeur par dÃ©faut sera employÃ©e.',
+'Posts per page'			=>	'Messages par page',
+'Posts per page info'		=>	'ContrÃŽle le nombre de messages affichÃ©s par page dans chaque forum. Vous pouvez laisser blanc et la valeur par dÃ©faut sera employÃ©e.',
+'Leave blank'				=>	'Laisser blanc pour utiliser la valeur par dÃ©faut du forum.',
+'Notify full'				=>	'Inclure le message dans les e-mails d\'abonnement.',
+'Notify full info'			=>	'En activant cette option, une version en texte brut du nouveau message sera incluse dans l\'avis d\'abonnement par e-mail.',
+'Show smilies'				=>	'Afficher les smileys sous forme d\'icÃŽnes',
+'Show smilies info'			=>	'En activant cette option, de petites images seront affichÃ©es Ã  la place du texte.',
+'Show images'				=>	'Afficher les images.',
+'Show images info'			=>	'En dÃ©sactivant cette option, vous ne verez pas les images dans les message (c\'est-Ã -dire les images affichÃ©es avec la balise [img]).',
+'Show images sigs'			=>	'Afficher les images dans les signatures des utilisateurs.',
+'Show images sigs info'		=>	'DÃ©sactivez ceci si vous ne voulez pas voir les images dans les signatures (c\'est-Ã -dire les images affichÃ©es avec la balise [img]).',
+'Show avatars'				=>	'Afficher les avatars des utilisateurs.',
+'Show avatars info'			=>	'Cette option vous permet de dÃ©cider si les images des avatars des utilisateurs doivent Ãªtre affichÃ©es dans les messages ou non.',
+'Show sigs'					=>	'Afficher les signatures.',
+'Show sigs info'			=>	'Activez ceci si vous voulez voir les signatures ou non.',
+'Style legend'				=>	'SÃ©lectionnez votre style favori',
+'Style info'				=>	'Vous pouvez utiliser un style diffÃ©rent pour ce forum.',
+'Admin note'				=>	'Note de l\'administrateur',
+'Pagination legend'			=>	'DÃ©finissez vos options de pagination',
+'Post display legend'		=>	'DÃ©finissez vos options de visualisation des messages',
+'Post display info'			=>	'En dÃ©sactivant toutes les options d\'affichage des images dans les messages et les signatures vous augmenterez le temps de chargement des pages.',
+'Instructions'				=>	'AprÃšs avoir mis Ã  jour le profil vous serez redirigÃ©s sur cette page.',
+ 
+// Administration stuff
+'Group membership legend'	=>	'Choisissez un groupe d\'utilisateurs',
+'Save'						=>	'Enregistrer',
+'Set mods legend'			=>	'DÃ©finir l\'accÃšs modÃ©rateur',
+'Moderator in'				=>	'ModÃšre',
+'Moderator in info'			=>	'Veuillez choisir quels forums cet utilisateur peut modÃ©rer. Note: Ceci s\'applique seulement aux modÃ©rateurs. Les administrateurs ont toujours toutes les permissions pour tous les forums.',
+'Update forums'				=>	'Mettre Ã  jour',
+'Delete ban legend'			=>	'Supprimer (administrateurs seulement) ou exclure un utilisateur',
+'Delete user'				=>	'Supprimer l\'utilisateur',
+'Ban user'					=>	'Exclure l\'utilisateur',
+'Confirm delete legend'		=>	'Important&#160;: lisez avant de supprimer un utilisateur',
+'Confirm delete user'		=>	'Confirmer la suppression de l\'utilisateur',
+'Confirmation info'			=>	'Veuillez confirmer la suppression de l\'utilisateur',	// the username will be appended to this string
+'Delete warning'			=>	'Attention&#160;! Les utilisateurs et/ou messages supprimÃ©s ne peuvent Ãªtre restaurÃ©s. Si vous choisissez de ne pas supprimer les messages d\'un utilisateur, les messages ne pourront Ãªtre uniquement supprimÃ©s manuellement plus tard.',
+'Delete posts'				=>	'Supprimer tous les messages ou discussions de cet utilisateur.',
+'Delete'					=>	'Supprimer',		// submit button (confirm user delete)
+'User delete redirect'		=>	'Utilisateur supprimÃ©. Redirection ...',
+'Group membership redirect'	=>	'Appartenance Ã  un groupe enregistrÃ©e. Redirection ...',
+'Update forums redirect'	=>	'Droits du modÃ©rateur mis Ã  jour. Redirection ...',
+'Ban redirect'				=>	'Redirection ...'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/register.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/register.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/register.php	(revision 1)
@@ -0,0 +1,35 @@
+<?php
+
+// Language definitions used in register.php
+$lang_register = array(
+ 
+// Miscellaneous
+'No new regs'				=>	'Ce forum n\'accepte pas de nouveaux utilisateurs.',
+'Reg cancel redirect'		=>	'Inscription annulÃ©e. Redirection ...',
+'Forum rules'				=>	'Conditions d\'utilisation du forum',
+'Rules legend'				=>	'Vous devez accepter les conditions d\'utilisation suivantes pour vous inscrire sur ce forum.',
+'Agree'						=>	'J\'accepte',
+'Cancel'					=>	'Je refuse',
+'Register'					=>	'S\'inscrire',
+ 
+// Form validation stuff (some of these are also used in post.php)
+'Username censor'			=>	'Le nom d\'utilisateur que vous avez saisi contient des mots interdits. Veuillez choisir un autre nom d\'utilisateur.',
+'Username dupe 1'			=>	'Quelqu\'un est dÃ©jÃ  inscrit avec ce nom d\'utilisateur',
+'Username dupe 2'			=>	'Ce nom d\'utilisateur est trop ressemblant. Il doit diffÃ©rer par au moins un caractÃšre alpha-numÃ©rique (a-z ou 0-9). Veuillez essayer un autre nom d\'utilisateur.',
+'E-mail not match'			=>	'Les adresses e-mail ne correspondent pas. Veuiller retourner en arriÃšre et corriger cela.',
+ 
+// Registration e-mail stuff
+'Reg e-mail'				=>	'Merci de vous Ãªtre inscrits. Votre mot de passe a Ã©tÃ© envoyÃ© Ã  l\'adresse indiquÃ©e. S\'il n\'arrive pas, merci de contacter l\'administrateur Ã ',
+'Reg complete'				=>	'Inscription acceptÃ©e. Identification et redirection ...',
+ 
+// Register info
+'Desc 1'					=>	'L\'inscription vous accordera l\'accÃšs Ã  un certain nombre de fonctionnalitÃ©s et de possibilitÃ©s autrement indisponibles. Cela inclue la possibilitÃ© de modifier et d\'effacer des messages, de crÃ©er vos propres signatures, et autres encore. Pour toute question, contactez l\'administrateur.',
+'Desc 2'					=>	'Ci-dessous le formulaire Ã  remplir afin de vous inscrire. AprÃšs vous Ãªtres inscrits, vous pourrez regarder votre profil et vos prÃ©fÃ©rences. Les champs ci-dessous ne sont qu\'une toute petite partie de tous ce que vous pouvez changer dans votre profil.',
+'Username legend'			=>	'Veuillez saisir un nom d\'utilisateur entre 2 et 25 caractÃšres de long.',
+'Pass legend 1'				=>	'Veuillez saisir et confirmer le mot de passe que vous avez choisi',
+'Pass legend 2'				=>	'Veuillez lire les instructions ci-dessous',
+'Pass info'					=>	'Le mots de passe doit faire entre 4 et 16 caractÃšres de long (sensible Ã  la casse).',
+'E-mail info'				=>	'Vous devez saisir une adresse e-mail valide,. Vous pouvez choisir de ne pas rÃ©veler votre adresse aux autres utilisateurs (voir ci-dessous).',
+'Confirm e-mail'			=>	'Confirmez votre adresse e-mail',
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/search.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/search.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/search.php	(revision 1)
@@ -0,0 +1,47 @@
+<?php
+
+// Language definitions used in search.php
+$lang_search = array(
+ 
+// The search form
+'User search'				=>	'Rechercher un utilisateur',
+'No search permission'		=>	'Vous n\'avez pas accÃšs Ã  la fonctionnalitÃ© de recherche',
+'Search'					=>	'Rechercher',
+'Search criteria legend'	=>	'SÃ©lectionnez vos critÃšres de recherche',
+'Search info'				=>	'Pour effectuer une recherche par mots-clef, saisissez le ou les termes Ã  rechercher. SÃ©parez chaque terme avec des espaces. Utilisez AND, OR, NOT pour affiner votre recherche. Pour rechercher par auteur, saisissez le nom d\'utilisateur auquel les messages appartiennent. Utilisez le joker * pour des recherches sur des mots incomplets.',
+'Keyword search'			=>	'Mots-clef',
+'Author search'				=>	'Rechercher un auteur',
+'Search in legend'			=>	'SÃ©lectionnez oÃ¹ vous souhaitez chercher',
+'Search in info'			=>	'Choisissez dans quel forum vous souhaitez lancer votre recherche et si vous souhaitez rechercher dans les sujets des discussions ou les textes des messages ou bien les deux Ã  la fois.',
+'Forum search'				=>	'Forum',
+'All forums'				=>	'Tous les forums',
+'Search in'					=>	'Rechercher dans',
+'Message and subject'		=>	'Texte du message et du sujet',
+'Message only'				=>	'Texte du message seulement',
+'Topic only'				=>	'Texte du sujet seulement',
+'Sort by'					=>	'Trier par',
+'Sort order'				=>	'Ordre',
+'Search results legend'		=>	'Selectionnez le mode d\'affichage des rÃ©sultats',
+'Search results info'		=>	'Vous pouvez choisir comment vous voulez classer et afficher les rÃ©sultats.',
+'Sort by post time'			=>	'Date du message',
+'Sort by author'			=>	'Auteur',
+'Sort by subject'			=>	'Sujet',
+'Sort by forum'				=>	'Forum',
+'Ascending'					=>	'Croissant',
+'Descending'				=>	'DÃ©croissant',
+'Show as'					=>	'Voir les rÃ©sultats',
+'Show as topics'			=>	'Discussions',
+'Show as posts'				=>	'Messages',
+ 
+// Results
+'Search results'			=>	'RÃ©sultats de la recherche',
+'No terms'					=>	'Vous devez entrer au moins un mot-clef et/ou un auteur Ã  rechercher.',
+'No hits'					=>	'Votre recherche n\'a renvoyÃ© aucun rÃ©sultat.',
+'No user posts'				=>	'Il n\'y a pas de message de cet utilisateur dans ce forum.',
+'No subscriptions'			=>	'Vous n\'Ãªtes abonnÃ© Ã  aucune discussion.',
+'No new posts'				=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis votre derniÃšre visite.',
+'No recent posts'			=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis les derniÃšres 24 heures.',
+'No unanswered'				=>	'Il n\'y a pas de message sans rÃ©ponse dans ce forum.',
+'Go to post'				=>	'Aller au message'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/smilies.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/smilies.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/smilies.php	(revision 1)
@@ -0,0 +1,57 @@
+<?php
+
+// Language definitions used in the smilies mpanager
+$lang_smiley = array(
+
+'Create Smiley Code None'	=>	'Vous devez saisir un code texte.',
+'Create Smiley Image None'	=>	'Vous devez saisir le nom de fichier d\'une image.',
+'Code already exists'		=>	'Le code texte existe dÃ©jÃ .',
+'Images affected'			=>	'Les images suivantes ne peuvent pas Ãªtres supprimÃ©s car elles sont utilisÃ©es: %s <br />Pour les supprimer retirez-les de la liste des smileys',
+'Images not deleted'		=>	'Pour une raison inconnue les images suivantes n\'ont pas Ã©tÃ© supprimÃ©es : %s',
+'Description'				=>	'Ce plugin permet de gÃ©rer les smilies de votre forum.',
+'Submit New Smiley'			=>	'CrÃ©er un nouveau smiley',
+'Add Images Smilies'		=>	'Ajouter une nouvelle image',
+'Smiley Code'				=>	'Code texte',
+'Smiley Image'				=>	'Nom du fichier image',
+'Smiley Code Description'	=>	'Saisissez le code texte que vous voulez qui sera remplacÃ© par l\'image du smiley. (ex. :O)).',
+'Smiley Image Description'	=>	'Saisissez le nom du fichier image correspondant au code texte (ex. grosnez.png).',
+'Submit Smiley'				=>	'CrÃ©er le smiley',
+'Upload'					=>	'TÃ©lÃ©charger',
+'Delete Smiley Redirect'	=>	'Les smileys ont Ã©tÃ© retirÃ©s avec succÃšs. Redirection ...',
+'Images deleted'			=>	'Les images ont Ã©tÃ© supprimÃ©es avec succÃšs. Redirection ...',
+'Successful Creation'		=>	'Vous avez crÃ©Ã© avec succÃšs un nouveau smiley. Redirection ...',
+'Successful Upload'			=>	'Vous avez tÃ©lÃ©chargÃ© avec succÃšs la nouvelle image. Redirection ...',
+'Current Smilies'			=>	'Smilies actuels',
+'List Current Smilies'		=>	'Liste des smilies actuels',
+'List Images Smilies'		=>	'Liste des images actuelles',
+'Code'						=>	'Code',
+'Image'						=>	'Image',
+'Image Filename'			=>	'Nom du fichier image',
+'Delete'					=>	'Supprimer',
+'Delete Selected'			=>	'Supprimer sÃ©lection',
+'Remove'					=>	'Retirer',
+'Remove Selected'			=>	'Retirer sÃ©lection',
+'No smiley'					=>	'Il n\'y a pas de smiley',
+'Too large ini'				=>	'Fichier trop gros. Le serveur refuse son tÃ©lÃ©chargement.',
+'Partial upload'			=>	'Fichier partiellement tÃ©lÃ©chargÃ©. Merci de rÃ©-essayer.',
+'No tmp directory'			=>	'Le serveur n\'a pas pu enregistrer le fichier envoyÃ© dans un rÃ©pertoire temporaire.',
+'No file'					=>	'Vous n\'avez pas sÃ©lectionnÃ© de fichier Ã  tÃ©lÃ©charger.',
+'Bad type'					=>	'Le type du fichier n\'est pas autorisÃ©. Les types autorisÃ©s sont le GIF, le JPG et le PNG.',
+'Too wide or high'			=>	'L\'image est plus large et/ou plus haute que le maximum autorisÃ©',
+'Too large'					=>	'La taille du fichier dÃ©passe le maximum autorisÃ©',
+'pixels'					=>	'pixels',
+'bytes'						=>	'octets',
+'Move failed'				=>	'Le serveur n\'a pas pu enregistrer le fichier tÃ©lÃ©chargÃ©.',
+'Unknown failure'			=>	'Une erreur inconnue s\'est produite. Merci de rÃ©essayer.',
+
+'Image file'				=>	'Fichier image',
+
+'Position'					=>	'Position',
+'Change position'			=>	'Changer positions',
+'Must int'					=>	'La position doit Ãªtre un nombre entier.',
+'Positions changed'			=>	'Les positions ont Ã©tÃ© modifiÃ©es avec succÃšs. Redirection ...',
+
+
+);
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/stopwords.txt
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/stopwords.txt	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/stopwords.txt	(revision 1)
@@ -0,0 +1,130 @@
+afin
+ainsi
+alors
+aprÃšs
+aucun
+aucune
+auprÃšs
+auquel
+aussi
+autant
+aux
+avec
+car
+ceci
+cela
+celle
+celles
+celui
+cependant
+ces
+cet
+cette
+ceux
+chacun
+chacune
+chaque
+chez
+comme
+comment
+dans
+des
+donc
+donnÃ©
+dont
+duquel
+dÃšs
+dÃ©jÃ 
+elle
+elles
+encore
+entre
+Ã©tant
+etc
+Ã©tÃ©
+eux
+furent
+grÃ¢ce
+hors
+ici
+ils
+jusqu
+les
+leur
+leurs
+lors
+lui
+mais
+malgrÃ©
+mes
+mien
+mienne
+miennes
+miens
+moins
+moment
+mon
+mÃªme
+mÃªmes
+non
+nos
+notre
+notres
+nous
+notre
+oui
+par
+parce
+parmi
+plus
+pour
+prÃšs
+puis
+puisque
+quand
+quant
+que
+quel
+quelle
+quelque
+quelquun
+quelques
+quels
+qui
+quoi
+sans
+sauf
+selon
+ses
+sien
+sienne
+siennes
+siens
+soi
+soit
+sont
+sous
+suis
+sur
+tandis
+tant
+tes
+tienne
+tiennes
+tiens
+toi
+ton
+tous
+tout
+toute
+toutes
+trop
+trÃšs
+une
+vos
+votre
+vous
+Ã©taient
+Ã©tait
+Ã©tant
+Ãªtre
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/topic.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/topic.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/topic.php	(revision 1)
@@ -0,0 +1,26 @@
+<?php
+
+// Language definitions used in viewtopic.php
+$lang_topic = array(
+ 
+'Post reply'		=>	'Ãcrire une rÃ©ponse',
+'Topic closed'		=>	'Discussion fermÃ©e',
+'From'				=>	'Lieu',				// User location
+'Note'				=>	'Note',				// Admin note
+'Website'			=>	'Site web',
+'Guest'				=>	'InvitÃ©',
+'Online'			=>	'En ligne',
+'Offline'			=>	'Hors ligne',
+'Last edit'			=>	'DerniÃšre modification par',
+'Report'			=>	'Signaler',
+'Delete'			=>	'Supprimer',
+'Edit'				=>	'Modifier',
+'Quote'				=>	'Citer',
+'Is subscribed'		=>	'Vous Ãªtes abonnÃ© Ã  cette discussion',
+'Unsubscribe'		=>	'DÃ©sabonner',
+'Subscribe'			=>	'S\'abonner Ã  cette discussion',
+'Quick post'		=>	'RÃ©ponse rapide',
+'Link separator'	=>	' | ',	// The text that separates links in posts (website, e-mail, report, edit etc.)
+'Mod controls'		=>	'ModÃ©ration'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/French/userlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/French/userlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/French/userlist.php	(revision 1)
@@ -0,0 +1,12 @@
+<?php
+
+// Language definitions used in userlist.php
+$lang_ul = array(
+ 
+'User find legend'		=>	'Chercher et trier les utilisateurs',
+'User search info'		=>	'Saisissez un nom d\'utilisateur pour rechercher un utilisateur et le trier par groupe d\'utilisateurs. Le champ nom d\'utilisateur peut rester vide. Utilisez le joker * pour des recherches partielles. Triez les utilisateurs par nom, date d\'inscription ou nombre de messages et en ordre croissant ou dÃ©croissant.',
+'User group'			=>	'Groupe d\'utilisateurs',
+'No of posts'			=>	'Nombre de messages',
+'All users'				=>	'Tous les utilisateurs'
+ 
+);
Index: /branches/rsr.v5.1.dev/web/punbb/lang/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/lang/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/lang/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/login.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/login.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/login.php	(revision 1)
@@ -0,0 +1,226 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+if (isset($_GET['action']))
+	define('PUN_QUIET_VISIT', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+// Load the login.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
+
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+
+if (isset($_POST['form_sent']) && $action == 'in')
+{
+	$form_username = trim($_POST['req_username']);
+	$form_password = trim($_POST['req_password']);
+
+	$username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
+
+	$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
+
+	$authorized = false;
+
+	if (!empty($db_password_hash))
+	{
+		$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+		$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
+
+		$form_password_hash = pun_hash($form_password);	// This could result in either an SHA-1 or an MD5 hash (depends on $sha1_available)
+
+		if ($sha1_in_db && $sha1_available && $db_password_hash == $form_password_hash)
+			$authorized = true;
+		else if (!$sha1_in_db && $db_password_hash == md5($form_password))
+		{
+			$authorized = true;
+
+			if ($sha1_available)	// There's an MD5 hash in the database, but SHA1 hashing is available, so we update the DB
+				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\' WHERE id='.$user_id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
+		}
+	}
+
+	if (!$authorized)
+		message($lang_login['Wrong user/pass'].' <a href="login.php?action=forget">'.$lang_login['Forgotten pass'].'</a>');
+
+	// Update the status if this is the first time the user logged in
+	if ($group_id == PUN_UNVERIFIED)
+		$db->query('UPDATE '.$db->prefix.'users SET group_id='.$pun_config['o_default_user_group'].' WHERE id='.$user_id) or error('Uimpossible de modifier le statut utilisateur', __FILE__, __LINE__, $db->error());
+
+	// Remove this users guest entry from the online list
+	$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+
+	$expire = ($save_pass == '1') ? time() + 31536000 : 0;
+	pun_setcookie($user_id, $form_password_hash, $expire);
+
+	redirect($_POST['redirect_url'], $lang_login['Login redirect']);
+}
+
+
+else if ($action == 'out')
+{
+	if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id'])
+	{
+		header('Location: index.php');
+		exit;
+	}
+
+	// Remove user from "users online" list.
+	$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+
+	// Update last_visit (make sure there's something to update it with)
+	if (isset($pun_user['logged']))
+		$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de modifier les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+
+	pun_setcookie(1, random_pass(8), time() + 31536000);
+
+	redirect('index.php', $lang_login['Logout redirect']);
+}
+
+
+else if ($action == 'forget' || $action == 'forget_2')
+{
+	if (!$pun_user['is_guest'])
+		header('Location: index.php');
+
+	if (isset($_POST['form_sent']))
+	{
+		require PUN_ROOT.'include/email.php';
+
+		// Validate the email-address
+		$email = strtolower(trim($_POST['req_email']));
+		if (!is_valid_email($email))
+			message($lang_common['Invalid e-mail']);
+
+		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+
+		if ($db->num_rows($result))
+		{
+			// Load the "activate password" template
+			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_password.tpl'));
+
+			// The first row contains the subject
+			$first_crlf = strpos($mail_tpl, "\n");
+			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+			$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+			// Do the generic replacements first (they apply to all e-mails sent out here)
+			$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+			// Loop through users we found
+			while ($cur_hit = $db->fetch_assoc($result))
+			{
+				// Generate a new password and a new password activation code
+				$new_password = random_pass(8);
+				$new_password_key = random_pass(8);
+
+				$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.pun_hash($new_password).'\', activate_key=\''.$new_password_key.'\' WHERE id='.$cur_hit['id']) or error('Impossible de modifier les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
+
+				// Do the user specific replacements to the template
+				$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
+				$cur_mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
+				$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
+
+				pun_mail($email, $mail_subject, $cur_mail_message);
+			}
+
+			message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
+		}
+		else
+			message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
+	}
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_login['Request pass'];
+	$required_fields = array('req_email' => $lang_common['E-mail']);
+	$focus_element = array('request_pass', 'req_email');
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_login['Request pass'] ?></span></h2>
+	<div class="box">
+		<form id="request_pass" method="post" action="login.php?action=forget_2" onsubmit="this.request_pass.disabled=true;if(process_form(this)){return true;}else{this.request_pass.disabled=false;return false;}">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_login['Request pass legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="form_sent" value="1" />
+						<input id="req_email" type="text" name="req_email" size="50" maxlength="50" />
+						<p><?php echo $lang_login['Request pass info'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="request_pass" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+if (!$pun_user['is_guest'])
+	header('Location: index.php');
+
+// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
+$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];
+$required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);
+$focus_element = array('login', 'req_username');
+require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_common['Login'] ?></span></h2>
+	<div class="box">
+		<form id="login" method="post" action="login.php?action=in" onsubmit="return process_form(this)">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_login['Login legend'] ?></legend>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
+							<label class="conl"><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
+							<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" tabindex="2" /><br /></label>
+							<p class="clearb"><?php echo $lang_login['Login info'] ?></p>
+							<p><a href="register.php" tabindex="4"><?php echo $lang_login['Not registered'] ?></a>&#160;&#160;
+							<a href="login.php?action=forget" tabindex="5"><?php echo $lang_login['Forgotten pass'] ?></a></p>
+						</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" tabindex="3" /></p>
+		</form>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/misc.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/misc.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/misc.php	(revision 1)
@@ -0,0 +1,285 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+if (isset($_GET['action']))
+	define('PUN_QUIET_VISIT', 1);
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+// Load the misc.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
+
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+
+
+if ($action == 'rules')
+{
+	// Load the register.php language file
+	require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Forum rules'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="block">
+	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><?php echo $pun_config['o_rules_message'] ?></p>
+		</div>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if ($action == 'markread')
+{
+	if ($pun_user['is_guest'])
+		message($lang_common['No permission']);
+
+	$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de modifier les donnÃ©es de derniÃšre visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+
+	redirect('index.php', $lang_misc['Mark read redirect']);
+}
+
+
+else if (isset($_GET['email']))
+{
+	if ($pun_user['is_guest'])
+		message($lang_common['No permission']);
+
+	$recipient_id = intval($_GET['email']);
+	if ($recipient_id < 2)
+		message($lang_common['Bad request']);
+
+	$result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_common['Bad request']);
+
+	list($recipient, $recipient_email, $email_setting) = $db->fetch_row($result);
+
+	if ($email_setting == 2 && $pun_user['g_id'] > PUN_MOD)
+		message($lang_misc['Form e-mail disabled']);
+
+
+	if (isset($_POST['form_sent']))
+	{
+		// Clean up message and subject from POST
+		$subject = pun_trim($_POST['req_subject']);
+		$message = pun_trim($_POST['req_message']);
+
+		if ($subject == '')
+			message($lang_misc['No e-mail subject']);
+		else if ($message == '')
+			message($lang_misc['No e-mail message']);
+		else if (strlen($message) > 65535)
+			message($lang_misc['Too long e-mail message']);
+
+		// Load the "form e-mail" template
+		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/form_email.tpl'));
+
+		// The first row contains the subject
+		$first_crlf = strpos($mail_tpl, "\n");
+		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+		$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+		$mail_subject = str_replace('<mail_subject>', $subject, $mail_subject);
+		$mail_message = str_replace('<sender>', $pun_user['username'], $mail_message);
+		$mail_message = str_replace('<board_title>', $pun_config['o_board_title'], $mail_message);
+		$mail_message = str_replace('<mail_message>', $message, $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+		require_once PUN_ROOT.'include/email.php';
+
+		pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');
+
+		redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);
+	}
+
+
+	// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to the users profile after the e-mail is sent)
+	$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php';
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Send e-mail to'].' '.pun_htmlspecialchars($recipient);
+	$required_fields = array('req_subject' => $lang_misc['E-mail subject'], 'req_message' => $lang_misc['E-mail message']);
+	$focus_element = array('email', 'req_subject');
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_misc['Send e-mail to'] ?> <?php echo pun_htmlspecialchars($recipient) ?></span></h2>
+	<div class="box">
+		<form id="email" method="post" action="misc.php?email=<?php echo $recipient_id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_misc['Write e-mail'] ?></legend>
+					<div class="infldset txtarea">
+						<input type="hidden" name="form_sent" value="1" />
+						<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
+						<label><strong><?php echo $lang_misc['E-mail subject'] ?></strong><br />
+						<input class="longinput" type="text" name="req_subject" size="75" maxlength="70" tabindex="1" /><br /></label>
+						<label><strong><?php echo $lang_misc['E-mail message'] ?></strong><br />
+						<textarea name="req_message" rows="10" cols="75" tabindex="2"></textarea><br /></label>
+						<p><?php echo $lang_misc['E-mail disclosure note'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="3" accesskey="s" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if (isset($_GET['report']))
+{
+	if ($pun_user['is_guest'])
+		message($lang_common['No permission']);
+
+	$post_id = intval($_GET['report']);
+	if ($post_id < 1)
+		message($lang_common['Bad request']);
+
+	if (isset($_POST['form_sent']))
+	{
+		// Clean up reason from POST
+		$reason = pun_linebreaks(pun_trim($_POST['req_reason']));
+		if ($reason == '')
+			message($lang_misc['No reason']);
+
+		// Get the topic ID
+		$result = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id='.$post_id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+		if (!$db->num_rows($result))
+			message($lang_common['Bad request']);
+
+		$topic_id = $db->result($result);
+
+		// Get the subject and forum ID
+		$result = $db->query('SELECT subject, forum_id FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Impossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
+		if (!$db->num_rows($result))
+			message($lang_common['Bad request']);
+
+		list($subject, $forum_id) = $db->fetch_row($result);
+
+		// Should we use the internal report handling?
+		if ($pun_config['o_report_method'] == 0 || $pun_config['o_report_method'] == 2)
+			$db->query('INSERT INTO '.$db->prefix.'reports (post_id, topic_id, forum_id, reported_by, created, message) VALUES('.$post_id.', '.$topic_id.', '.$forum_id.', '.$pun_user['id'].', '.time().', \''.$db->escape($reason).'\')' ) or error('Unable to create report', __FILE__, __LINE__, $db->error());
+
+		// Should we e-mail the report?
+		if ($pun_config['o_report_method'] == 1 || $pun_config['o_report_method'] == 2)
+		{
+			// We send it to the complete mailing-list in one swoop
+			if ($pun_config['o_mailing_list'] != '')
+			{
+				$mail_subject = 'Report('.$forum_id.') - \''.$subject.'\'';
+				$mail_message = 'User \''.$pun_user['username'].'\' has reported the following message:'."\n".$pun_config['o_base_url'].'/viewtopic.php?pid='.$post_id.'#p'.$post_id."\n\n".'Reason:'."\n".$reason;
+
+				require PUN_ROOT.'include/email.php';
+
+				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+			}
+		}
+
+		redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_misc['Report redirect']);
+	}
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Report post'];
+	$required_fields = array('req_reason' => $lang_misc['Reason']);
+	$focus_element = array('report', 'req_reason');
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_misc['Report post'] ?></span></h2>
+	<div class="box">
+		<form id="report" method="post" action="misc.php?report=<?php echo $post_id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_misc['Reason desc'] ?></legend>
+					<div class="infldset txtarea">
+						<input type="hidden" name="form_sent" value="1" />
+						<label><strong><?php echo $lang_misc['Reason'] ?></strong><br /><textarea name="req_reason" rows="5" cols="60"></textarea><br /></label>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if (isset($_GET['subscribe']))
+{
+	if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
+		message($lang_common['No permission']);
+
+	$topic_id = intval($_GET['subscribe']);
+	if ($topic_id < 1)
+		message($lang_common['Bad request']);
+
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+		message($lang_misc['Already subscribed']);
+
+	$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$topic_id.')') or error('UImpossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$topic_id, $lang_misc['Subscribe redirect']);
+}
+
+
+else if (isset($_GET['unsubscribe']))
+{
+	if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
+		message($lang_common['No permission']);
+
+	$topic_id = intval($_GET['unsubscribe']);
+	if ($topic_id < 1)
+		message($lang_common['Bad request']);
+
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_misc['Not subscribed']);
+
+	$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$topic_id, $lang_misc['Unsubscribe redirect']);
+}
+
+
+else
+	message($lang_common['Bad request']);
Index: /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode.php	(revision 1)
@@ -0,0 +1,156 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+if (!isset($bbcode_form))
+	$bbcode_form = 'post';
+if (!isset($bbcode_field))
+	$bbcode_field = 'req_message';
+	
+function isNotIE_option($balise) {
+  $browser = $_SERVER['HTTP_USER_AGENT'];
+  if ((eregi("opera", $browser)) || (eregi("firefox", $browser)) || (eregi("netscape", $browser)) )
+    echo "onClick=".'"'."insert_text('[$balise='+(this.value)+']','[/$balise]', 'false')".'"';
+}
+
+function isIE_select($balise) {
+  $browser = $_SERVER['HTTP_USER_AGENT'];
+  if ((eregi("msie", $browser)) && (!eregi("opera", $browser)) && (!eregi("firefox", $browser)) && (!eregi("netscape", $browser)) )
+    echo "onchange=".'"'."insert_text('[$balise='+(this.options[this.selectedIndex].value)+']','[/$balise]')".'"';
+}
+
+?>
+						<script type="text/javascript">
+						<!--
+						  function fonction() {
+						    element.onclick = insert_text('[font='+(this.value)+']','[/font]', 'false');
+						  }
+						  
+							function insert_text(open, close, isSmiley)
+							{
+								msgfield = (document.all) ? document.all.req_message : document.forms['<?php echo $bbcode_form ?>']['<?php echo $bbcode_field ?>'];
+
+								// IE support
+								if (document.selection && document.selection.createRange)
+								{
+									msgfield.focus();
+									sel = document.selection.createRange();
+									sel.text = open + sel.text + close;
+									msgfield.focus();
+								}
+
+								// Moz support
+								else if (msgfield.selectionStart || msgfield.selectionStart == '0')
+								{
+									var startPos = msgfield.selectionStart;
+									var endPos = msgfield.selectionEnd;
+
+									msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
+									if (isSmiley == 'true') {
+                    msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
+                  }
+                  else {
+                    msgfield.selectionStart = startPos;
+                    msgfield.selectionEnd = endPos + open.length + close.length;
+                  }
+									msgfield.focus();
+								}
+
+								// Fallback support for other browsers
+								else
+								{
+									msgfield.value += open + close;
+									msgfield.focus();
+								}
+
+								return;
+							}
+						-->
+						</script>
+						<div style="padding-top: 4px">
+							<select name='ffont' class='codebuttons' <?php isIE_select("font"); ?> >
+	                                                         <option value='0'>Police</option>
+	                                                         <option value='Arial' style='font-family:Arial' <?php isNotIE_option("font"); ?> >Arial</option>
+	                                                         <option value='Times' style='font-family:Times' <?php isNotIE_option("font"); ?> >Times</option>
+	                                                         <option value='Courier' style='font-family:Courier' <?php isNotIE_option("font"); ?> >Courier</option>
+	                                                         <option value='Impact' style='font-family:Impact' <?php isNotIE_option("font"); ?> >Impact</option>
+	                                                         <option value='Geneva' style='font-family:Geneva' <?php isNotIE_option("font"); ?> >Geneva</option>
+	                                                         <option value='Optima' style='font-family:Optima' <?php isNotIE_option("font"); ?> >Optima</option>
+                                                        </select>
+							<select name='fcolor' class='codebuttons' <?php isIE_select("color"); ?> >
+	                                                        <option value='0'>Couleur</option>
+                                                          <option value='blue' style='color:blue' <?php isNotIE_option("color"); ?> >Bleu</option>
+	                                                        <option value='red' style='color:red' <?php isNotIE_option("color"); ?> >Rouge</option>
+                                                          <option value='purple' style='color:purple' <?php isNotIE_option("color"); ?> >Violet</option>
+	                                                        <option value='orange' style='color:orange' <?php isNotIE_option("color"); ?> >Orange</option>
+	                                                        <option value='yellow' style='color:yellow' <?php isNotIE_option("color"); ?> >Jaune</option>
+	                                                        <option value='gray' style='color:gray' <?php isNotIE_option("color"); ?> >Gris</option>
+	                                                        <option value='green' style='color:green' <?php isNotIE_option("color"); ?> >Vert</option>
+                                                        </select>
+							<select name='fsize' class='codebuttons' <?php isIE_select("align"); ?> >
+	                                                         <option value='0'>Alignement</option>
+	                                                         <option value='left' <?php isNotIE_option("align"); ?> >Gauche</option>
+	                                                         <option value='center' <?php isNotIE_option("align"); ?> >Centre</option>
+	                                                         <option value='right' <?php isNotIE_option("align"); ?> >Droite</option>
+                                                        </select>
+							<select name='fsize' class='codebuttons' <?php isIE_select("size"); ?> >
+	                                                         <option value='0'>Taille</option>
+	                                                         <option value='5' <?php isNotIE_option("size"); ?> >Petit</option>
+	                                                         <option value='15' <?php isNotIE_option("size"); ?> >Large</option>
+	                                                         <option value='25' <?php isNotIE_option("size"); ?> >Plus large</option>
+                                                        </select><br />
+							<input type="button" value=" B " name="B" onClick="insert_text('[b]','[/b]', 'false')" /> 
+							<input type="button" value=" I " name="I" onClick="insert_text('[i]','[/i]', 'false')" />
+							<input type="button" value=" U " name="U" onClick="insert_text('[u]','[/u]', 'false')" />
+							<input type="button" value="BarrÃ©" name="S" onClick="insert_text('[s]','[/s]', 'false')" />
+							<input type="button" value="SurlignÃ©" name="H" onClick="insert_text('[h]','[/h]', 'false')" />
+							<input type="button" value="Tracer Ligne" name="HR" onClick="insert_text('[hr /]','', 'false')" /><br />
+							<input type="button" value="http://" name="Url" onClick="insert_text('[url]','[/url]', 'false')" />
+							<input type="button" value="mailto:" name="EMAIL" onClick="insert_text('[email]','[/email]', 'false')" />
+							<input type="button" value="Img" name="Img" onClick="insert_text('[img]','[/img]', 'false')" />
+							<input type="button" value="Code" name="Code" onClick="insert_text('[code]','[/code]', 'false')" />
+							<input type="button" value="Quote" name="Quote" onClick="insert_text('[quote]','[/quote]', 'false')" />
+						</div>
+						<div style="padding-top: 4px">
+<?php
+
+// Display the smiley set
+require_once PUN_ROOT.'include/parser.php';
+
+$smiley_dups = array();
+$num_smilies = count($smiley_text);
+for ($i = 0; $i < $num_smilies; ++$i)
+{
+	// Is there a smiley at the current index?
+	if (!isset($smiley_text[$i]))
+		continue;
+
+	if (!in_array($smiley_img[$i], $smiley_dups))
+		echo "\t\t\t\t\t\t\t".'<a href="javascript:insert_text(\''.$smiley_text[$i].'\', \'\', \'true\');"><img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'" /></a>'."\n";
+
+	$smiley_dups[] = $smiley_img[$i];
+}
+
+?>
+						</div>
Index: /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode_lite.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode_lite.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/mod_easy_bbcode_lite.php	(revision 1)
@@ -0,0 +1,109 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+if (!isset($bbcode_form))
+	$bbcode_form = 'post';
+if (!isset($bbcode_field))
+	$bbcode_field = 'req_message';
+	
+?>
+						<script type="text/javascript">
+						<!--
+						  function fonction() {
+						    element.onclick = insert_text('[font='+(this.value)+']','[/font]', 'false');
+						  }
+						  
+							function insert_text(open, close, isSmiley)
+							{
+								msgfield = (document.all) ? document.all.req_message : document.forms['<?php echo $bbcode_form ?>']['<?php echo $bbcode_field ?>'];
+
+								// IE support
+								if (document.selection && document.selection.createRange)
+								{
+									msgfield.focus();
+									sel = document.selection.createRange();
+									sel.text = open + sel.text + close;
+									msgfield.focus();
+								}
+
+								// Moz support
+								else if (msgfield.selectionStart || msgfield.selectionStart == '0')
+								{
+									var startPos = msgfield.selectionStart;
+									var endPos = msgfield.selectionEnd;
+
+									msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
+									if (isSmiley == 'true') {
+                    msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
+                  }
+                  else {
+                    msgfield.selectionStart = startPos;
+                    msgfield.selectionEnd = endPos + open.length + close.length;
+                  }
+									msgfield.focus();
+								}
+
+								// Fallback support for other browsers
+								else
+								{
+									msgfield.value += open + close;
+									msgfield.focus();
+								}
+
+								return;
+							}
+						-->
+						</script>
+						<div style="padding-top: 4px">
+							<input type="button" value=" B " name="B" onClick="insert_text('[b]','[/b]', 'false')" /> 
+							<input type="button" value=" I " name="I" onClick="insert_text('[i]','[/i]', 'false')" />
+							<input type="button" value=" U " name="U" onClick="insert_text('[u]','[/u]', 'false')" />
+							<input type="button" value="http://" name="Url" onClick="insert_text('[url]','[/url]', 'false')" />
+							<input type="button" value="Img" name="Img" onClick="insert_text('[img]','[/img]', 'false')" />
+							<input type="button" value="Code" name="Code" onClick="insert_text('[code]','[/code]', 'false')" />
+							<input type="button" value="Quote" name="Quote" onClick="insert_text('[quote]','[/quote]', 'false')" />
+						</div>
+						<div style="padding-top: 4px">
+<?php
+
+// Display the smiley set
+require_once PUN_ROOT.'include/parser.php';
+
+$smiley_dups = array();
+$num_smilies = count($smiley_text);
+for ($i = 0; $i < $num_smilies; ++$i)
+{
+	// Is there a smiley at the current index?
+	if (!isset($smiley_text[$i]))
+		continue;
+
+	if (!in_array($smiley_img[$i], $smiley_dups))
+		echo "\t\t\t\t\t\t\t".'<a href="javascript:insert_text(\''.$smiley_text[$i].'\', \'\', \'true\');"><img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'" /></a>'."\n";
+
+	$smiley_dups[] = $smiley_img[$i];
+}
+
+?>
+						</div>
Index: /branches/rsr.v5.1.dev/web/punbb/moderate.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/moderate.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/moderate.php	(revision 1)
@@ -0,0 +1,698 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+// This particular function doesn't require forum-based moderator access. It can be used
+// by all moderators and admins.
+if (isset($_GET['get_host']))
+{
+	if ($pun_user['g_id'] > PUN_MOD)
+		message($lang_common['No permission']);
+
+	// Is get_host an IP address or a post ID?
+	if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
+		$ip = $_GET['get_host'];
+	else
+	{
+		$get_host = intval($_GET['get_host']);
+		if ($get_host < 1)
+			message($lang_common['Bad request']);
+
+		$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE id='.$get_host) or error('Impossible de retrouver l\'adresse IP', __FILE__, __LINE__, $db->error());
+		if (!$db->num_rows($result))
+			message($lang_common['Bad request']);
+
+		$ip = $db->result($result);
+	}
+
+	message('L\'adresse IP est : '.$ip.'<br />Le nom de l\'hÃŽte est : '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Voir plus d\'utilisateurs pour cette IP</a>');
+}
+
+
+// All other functions require moderator/admin access
+$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
+if ($fid < 1)
+	message($lang_common['Bad request']);
+
+$result = $db->query('SELECT moderators FROM '.$db->prefix.'forums WHERE id='.$fid) or error('UImpossible de retrouver les informations des forums', __FILE__, __LINE__, $db->error());
+
+$moderators = $db->result($result);
+$mods_array = ($moderators != '') ? unserialize($moderators) : array();
+
+if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_id'] != PUN_MOD || !array_key_exists($pun_user['username'], $mods_array)))
+	message($lang_common['No permission']);
+
+
+// Load the misc.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
+
+
+// All other topic moderation features require a topic id in GET
+if (isset($_GET['tid']))
+{
+	$tid = intval($_GET['tid']);
+	if ($tid < 1)
+		message($lang_common['Bad request']);
+
+	// Fetch some info about the topic
+	$result = $db->query('SELECT t.subject, t.num_replies, f.id AS forum_id, forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid.' AND t.id='.$tid.' AND t.moved_to IS NULL') or error('UImpossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_common['Bad request']);
+
+	$cur_topic = $db->fetch_assoc($result);
+
+
+	// Delete one or more posts
+	if (isset($_POST['delete_posts']) || isset($_POST['delete_posts_comply']))
+	{
+		$posts = $_POST['posts'];
+		if (empty($posts))
+			message($lang_misc['No posts selected']);
+
+		if (isset($_POST['delete_posts_comply']))
+		{
+			confirm_referrer('moderate.php');
+
+			if (preg_match('/[^0-9,]/', $posts))
+				message($lang_common['Bad request']);
+
+			// Delete the posts
+			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
+
+			require PUN_ROOT.'include/search_idx.php';
+			strip_search_index($posts);
+
+			// Get last_post, last_post_id, and last_poster for the topic after deletion
+			$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+			$last_post = $db->fetch_assoc($result);
+
+			// How many posts did we just delete?
+			$num_posts_deleted = substr_count($posts, ',') + 1;
+
+			// Update the topic
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$last_post['posted'].', last_post_id='.$last_post['id'].', last_poster=\''.$db->escape($last_post['poster']).'\', num_replies=num_replies-'.$num_posts_deleted.' WHERE id='.$tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
+
+			update_forum($fid);
+
+			redirect('viewtopic.php?id='.$tid, $lang_misc['Delete posts redirect']);
+		}
+
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
+		require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_misc['Delete posts'] ?></span></h2>
+	<div class="box">
+		<form method="post" action="moderate.php?fid=<?php echo $fid ?>&amp;tid=<?php echo $tid ?>">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_misc['Confirm delete legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="posts" value="<?php echo implode(',', array_keys($posts)) ?>" />
+						<p><?php echo $lang_misc['Delete posts comply'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="delete_posts_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+		require PUN_ROOT.'footer.php';
+	}
+
+
+	// Show the delete multiple posts view
+
+	// Load the viewtopic.php language file
+	require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
+
+	// Used to disable the Move and Delete buttons if there are no replies to this topic
+	$button_status = ($cur_topic['num_replies'] == 0) ? ' disabled' : '';
+
+
+	// Determine the post offset (based on $_GET['p'])
+	$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
+
+	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+	$start_from = $pun_user['disp_posts'] * ($p - 1);
+
+	// Generate paging links
+	$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'moderate.php?fid='.$fid.'&amp;tid='.$tid);
+
+
+	if ($pun_config['o_censoring'] == '1')
+		$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$cur_topic['subject'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
+		<div class="clearer"></div>
+	</div>
+</div>
+
+<form method="post" action="moderate.php?fid=<?php echo $fid ?>&amp;tid=<?php echo $tid ?>">
+<?php
+
+	require PUN_ROOT.'include/parser.php';
+
+	$bg_switch = true;	// Used for switching background color in posts
+	$post_count = 0;	// Keep track of post numbers
+
+	// Retrieve the posts (and their respective poster)
+	$result = $db->query('SELECT u.title, u.num_posts, g.g_id, g.g_user_title, p.id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE p.topic_id='.$tid.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+
+	while ($cur_post = $db->fetch_assoc($result))
+	{
+		$post_count++;
+
+		// If the poster is a registered user.
+		if ($cur_post['poster_id'] > 1)
+		{
+			$poster = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>';
+
+			// get_title() requires that an element 'username' be present in the array
+			$cur_post['username'] = $cur_post['poster'];
+			$user_title = get_title($cur_post);
+
+			if ($pun_config['o_censoring'] == '1')
+				$user_title = censor_words($user_title);
+		}
+		// If the poster is a guest (or a user that has been deleted)
+		else
+		{
+			$poster = pun_htmlspecialchars($cur_post['poster']);
+			$user_title = $lang_topic['Guest'];
+		}
+
+		// Switch the background color for every message.
+		$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+		$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
+
+		// Perform the main parsing of the message (BBCode, smilies, censor words etc)
+		$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
+
+?>
+
+<div class="blockpost<?php echo $vtbg ?>">
+	<a name="<?php echo $cur_post['id'] ?>"></a>
+	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&#160;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo $poster ?></strong></dt>
+					<dd><strong><?php echo $user_title ?></strong></dd>
+				</dl>
+			</div>
+			<div class="postright">
+				<h3 class="nosize"><?php echo $lang_common['Message'] ?></h3>
+				<div class="postmsg">
+					<?php echo $cur_post['message']."\n" ?>
+<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
+				</div>
+				<?php if ($start_from + $post_count > 1) echo '<p class="multidelete"><label><strong>'.$lang_misc['Select'].'</strong>&#160;&#160;<input type="checkbox" name="posts['.$cur_post['id'].']" value="1" /></label></p>'."\n" ?>
+			</div>
+			<div class="clearer"></div>
+		</div>
+	</div>
+</div>
+
+
+
+
+<?php
+
+	}
+
+?>
+<div class="postlinksb">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="conr"><input type="submit" name="delete_posts" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> /></p>
+		<div class="clearer"></div>
+	</div>
+</div>
+</form>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+// Move one or more topics
+if (isset($_REQUEST['move_topics']) || isset($_POST['move_topics_to']))
+{
+	if (isset($_POST['move_topics_to']))
+	{
+		confirm_referrer('moderate.php');
+
+		if (preg_match('/[^0-9,]/', $_POST['topics']))
+			message($lang_common['Bad request']);
+
+		$topics = explode(',', $_POST['topics']);
+		$move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0;
+		if (empty($topics) || $move_to_forum < 1)
+			message($lang_common['Bad request']);
+
+		// Delete any redirect topics if there are any (only if we moved/copied the topic back to where it where it was once moved from)
+		$db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Impossible de supprimer les redirections', __FILE__, __LINE__, $db->error());
+
+		// Move the topic(s)
+		$db->query('UPDATE '.$db->prefix.'topics SET forum_id='.$move_to_forum.' WHERE id IN('.implode(',',$topics).')') or error('Impossible de dÃ©placer la discussion', __FILE__, __LINE__, $db->error());
+
+		// Should we create redirect topics?
+		if (isset($_POST['with_redirect']))
+		{
+			while (list(, $cur_topic) = @each($topics))
+			{
+				// Fetch info for the redirect topic
+				$result = $db->query('SELECT poster, subject, posted, last_post FROM '.$db->prefix.'topics WHERE id='.$cur_topic) or error('Impossible de retrouver les informations de la discussions', __FILE__, __LINE__, $db->error());
+				$moved_to = $db->fetch_assoc($result);
+
+				// Create the redirect topic
+				$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, moved_to, forum_id) VALUES(\''.$db->escape($moved_to['poster']).'\', \''.$db->escape($moved_to['subject']).'\', '.$moved_to['posted'].', '.$moved_to['last_post'].', '.$cur_topic.', '.$fid.')') or error('Impossible de crÃ©er une redirection', __FILE__, __LINE__, $db->error());
+			}
+		}
+
+		update_forum($fid);				// Update the forum FROM which the topic was moved
+		update_forum($move_to_forum);	// Update the forum TO which the topic was moved
+
+		$redirect_msg = (count($topics) > 1) ? $lang_misc['Move topics redirect'] : $lang_misc['Move topic redirect'];
+		redirect('viewforum.php?id='.$move_to_forum, $redirect_msg);
+	}
+
+	if (isset($_POST['move_topics']))
+	{
+		$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
+		if (empty($topics))
+			message($lang_misc['No topics selected']);
+
+		$topics = implode(',', array_keys($topics));
+		$action = 'multi';
+	}
+	else
+	{
+		$topics = intval($_GET['move_topics']);
+		if ($topics < 1)
+			message($lang_common['Bad request']);
+
+		$action = 'single';
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo ($action == 'single') ? $lang_misc['Move topic'] : $lang_misc['Move topics'] ?></span></h2>
+	<div class="box">
+		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
+			<div class="inform">
+			<input type="hidden" name="topics" value="<?php echo $topics ?>" />
+				<fieldset>
+					<legend><?php echo $lang_misc['Move legend'] ?></legend>
+					<div class="infldset">
+						<label><?php echo $lang_misc['Move to'] ?>
+						<br /><select name="move_to_forum">
+<?php
+
+	$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+	
+	$cur_category = 0;
+	while ($cur_forum = $db->fetch_assoc($result))
+	{
+		if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+		{
+			if ($cur_category)
+				echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
+
+			echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
+			$cur_category = $cur_forum['cid'];
+		}
+
+		if ($cur_forum['fid'] != $fid)
+			echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
+	}
+
+?>
+							</optgroup>
+						</select>
+						<br /></label>
+						<div class="rbox">
+							<label><input type="checkbox" name="with_redirect" value="1"<?php if ($action == 'single') echo ' checked="checked"' ?> /><?php echo $lang_misc['Leave redirect'] ?><br /></label>
+						</div>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="move_topics_to" value="<?php echo $lang_misc['Move'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+// Delete one or more topics
+if (isset($_REQUEST['delete_topics']) || isset($_POST['delete_topics_comply']))
+{
+	$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
+	if (empty($topics))
+		message($lang_misc['No topics selected']);
+
+	if (isset($_POST['delete_topics_comply']))
+	{
+		confirm_referrer('moderate.php');
+
+		if (preg_match('/[^0-9,]/', $topics))
+			message($lang_common['Bad request']);
+
+		require PUN_ROOT.'include/search_idx.php';
+
+		// Delete the topics and any redirect topics
+		$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Impossible de supprimer la discussion', __FILE__, __LINE__, $db->error());
+
+		// Delete any subscriptions
+		$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id IN('.$topics.')') or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
+
+		// Create a list of the post ID's in this topic and then strip the search index
+		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
+
+		$post_ids = '';
+		while ($row = $db->fetch_row($result))
+			$post_ids .= ($post_ids != '') ? ','.$row[0] : $row[0];
+
+		// We have to check that we actually have a list of post ID's since we could be deleting just a redirect topic
+		if ($post_ids != '')
+			strip_search_index($post_ids);
+
+		// Delete posts
+		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
+
+		update_forum($fid);
+
+		redirect('viewforum.php?id='.$fid, $lang_misc['Delete topics redirect']);
+	}
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><?php echo $lang_misc['Delete topics'] ?></h2>
+	<div class="box">
+		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
+			<input type="hidden" name="topics" value="<?php echo implode(',', array_keys($topics)) ?>" />
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_misc['Confirm delete legend'] ?></legend>
+					<div class="infldset">
+						<p><?php echo $lang_misc['Delete topics comply'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="delete_topics_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+// Open or close one or more topics
+else if (isset($_REQUEST['open']) || isset($_REQUEST['close']))
+{
+	$action = (isset($_REQUEST['open'])) ? 0 : 1;
+
+	// There could be an array of topic ID's in $_POST
+	if (isset($_POST['open']) || isset($_POST['close']))
+	{
+		confirm_referrer('moderate.php');
+
+		$topics = isset($_POST['topics']) ? @array_map('intval', @array_keys($_POST['topics'])) : array();
+		if (empty($topics))
+			message($lang_misc['No topics selected']);
+
+		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).')') or error('Impossible de fermer les discussions', __FILE__, __LINE__, $db->error());
+
+		$redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];
+		redirect('moderate.php?fid='.$fid, $redirect_msg);
+	}
+	// Or just one in $_GET
+	else
+	{
+		confirm_referrer('viewtopic.php');
+
+		$topic_id = ($action) ? intval($_GET['close']) : intval($_GET['open']);
+		if ($topic_id < 1)
+			message($lang_common['Bad request']);
+
+		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id) or error('Impossible de fermer la discussion', __FILE__, __LINE__, $db->error());
+
+		$redirect_msg = ($action) ? $lang_misc['Close topic redirect'] : $lang_misc['Open topic redirect'];
+		redirect('viewtopic.php?id='.$topic_id, $redirect_msg);
+	}
+}
+
+
+// Stick a topic
+else if (isset($_GET['stick']))
+{
+	confirm_referrer('viewtopic.php');
+
+	$stick = intval($_GET['stick']);
+	if ($stick < 1)
+		message($lang_common['Bad request']);
+
+	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick) or error('Impossible d\'Ã©pingler la discussion', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$stick, $lang_misc['Stick topic redirect']);
+}
+
+
+// Unstick a topic
+else if (isset($_GET['unstick']))
+{
+	confirm_referrer('viewtopic.php');
+
+	$unstick = intval($_GET['unstick']);
+	if ($unstick < 1)
+		message($lang_common['Bad request']);
+
+	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick) or error('Impossible de dÃ©tacher la discussion', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$unstick, $lang_misc['Unstick topic redirect']);
+}
+
+
+// No specific forum moderation action was specified in the query string, so we'll display the moderator forum
+
+// Load the viewforum.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
+
+// Fetch some info about the forum
+$result = $db->query('SELECT f.forum_name, f.redirect_url, f.num_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Impossible de retrouver les informations de forums', __FILE__, __LINE__, $db->error());
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_forum = $db->fetch_assoc($result);
+
+// Is this a redirect forum? In that case, abort!
+if ($cur_forum['redirect_url'] != '')
+	message($lang_common['Bad request']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.pun_htmlspecialchars($cur_forum['forum_name']);
+require PUN_ROOT.'header.php';
+
+// Determine the topic offset (based on $_GET['p'])
+$num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
+
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$start_from = $pun_user['disp_topics'] * ($p - 1);
+
+// Generate paging links
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'moderate.php?fid='.$fid)
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
+		<div class="clearer"></div>
+	</div>
+</div>
+
+<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
+<div id="vf" class="blocktable">
+	<h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
+					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
+					<th class="tcr"><?php echo $lang_common['Last post'] ?></th>
+					<th class="tcmod" scope="col"><?php echo $lang_misc['Select'] ?></th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+// Select topics
+$result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$fid.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']) or error('Impossible de retrouver la liste des discussions du forum', __FILE__, __LINE__, $db->error());
+
+// If there are topics in this forum.
+if ($db->num_rows($result))
+{
+	$button_status = '';
+
+	while ($cur_topic = $db->fetch_assoc($result))
+	{
+
+		$icon_text = $lang_common['Normal icon'];
+		$item_status = '';
+		$icon_type = 'icon';
+
+		if ($cur_topic['moved_to'] == null)
+		{
+			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']);
+			$ghost_topic = false;
+		}
+		else
+		{
+			$last_post = '&#160;';
+			$ghost_topic = true;
+		}
+
+		if ($pun_config['o_censoring'] == '1')
+			$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+		if ($cur_topic['moved_to'] != 0)
+			$subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else if ($cur_topic['closed'] == '0')
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else
+		{
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+			$icon_text = $lang_common['Closed icon'];
+			$item_status = 'iclosed';
+		}
+
+		if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic)
+		{
+			$icon_text .= ' '.$lang_common['New icon'];
+			$item_status .= ' inew';
+			$icon_type = 'icon inew';
+			$subject = '<strong>'.$subject.'</strong>';
+			$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
+		}
+		else
+			$subject_new_posts = null;
+
+		// We won't display "the dot", but we add the spaces anyway
+		if ($pun_config['o_show_dot'] == '1')
+			$subject = '&#160;&#160;'.$subject;
+
+		if ($cur_topic['sticky'] == '1')
+		{
+			$subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
+			$item_status .= ' isticky';
+			$icon_text .= ' '.$lang_forum['Sticky'];
+		}
+
+		$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
+
+		if ($num_pages_topic > 1)
+			$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
+		else
+			$subject_multipage = null;
+
+		// Should we show the "New posts" and/or the multipage links?
+		if (!empty($subject_new_posts) || !empty($subject_multipage))
+		{
+			$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
+			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
+		}
+
+?>
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
+					<td class="tcl">
+						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
+						<div class="tclcon">
+							<?php echo $subject."\n" ?>
+						</div>
+					</td>
+					<td class="tc2"><?php echo (!$ghost_topic) ? $cur_topic['num_replies'] : '&#160;' ?></td>
+					<td class="tc3"><?php echo (!$ghost_topic) ? $cur_topic['num_views'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
+					<td class="tcmod"><input type="checkbox" name="topics[<?php echo $cur_topic['id'] ?>]" value="1" /></td>
+				</tr>
+<?php
+
+	}
+}
+else
+{
+	$button_status = ' disabled';
+	echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="5">'.$lang_forum['Empty forum'].'</td></tr>'."\n";
+}
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="conr"><input type="submit" name="move_topics" value="<?php echo $lang_misc['Move'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="delete_topics" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="open" value="<?php echo $lang_misc['Open'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="close" value="<?php echo $lang_misc['Close'] ?>"<?php echo $button_status ?> /></p>
+		<div class="clearer"></div>
+	</div>
+</div>
+</form>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/plugins/AMP_Exemple.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/plugins/AMP_Exemple.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/plugins/AMP_Exemple.php	(revision 1)
@@ -0,0 +1,142 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+##
+##
+##  Voici quelques notes intÃ©rrÃªssantes pour les aspirants auteurs de plugin :
+##
+##  1. Si vous voulez afficher un message par lÂintermÃ©diaire de la fonction 
+##     message(), vous devez le faire avant dÂappeler generate_admin_menu($plugin).
+##
+##  2. Les plugins sont chargÃ©s par admin_loader.php et ne doivent pas Ãªtre terminÃ©s 
+##     (par exemple en appelant exit()). AprÃšs que le script du plugin ait fini, le 
+##     script du chargeur affiche le pied de page, ainsi inutil de vous souciez de cela. 
+##     Cependant veuillez noter que terminer un plugin en appelant message() ou 
+##     redirect() est trÃšs bien.
+##
+##  3. LÂattribut action de toute balise <forme> et lÂURL cible pour la fonction 
+##     redirect() doit Ãªtre placÃ© Ã  la valeur de $_SERVER[ÂREQUEST_URIÂ]. Cette 
+##     URL peut cependant Ãªtre Ã©tendue pour inclure des variables supplÃ©mentaires 
+##     (comme lÂajout de &foo=bar dans le plugin exemple).
+##
+##  4. Si votre plugin est pour les administrateurs seulement, le nom de fichier 
+##     doit avoir le prÃ©fixe AP_. SÂil est pour les administrateurs et les modÃ©rateurs, 
+##     utilisez le prÃ©fixe AMP_. Le plugin exemple a le prÃ©fixe AMP_ et est donc 
+##     disponible dans le menu de navigation aux administrateurs et aux modÃ©rateurs.
+##
+##  5. Utilisez _ au lieu des espaces dans le nom de fichier.
+##
+##  6. Tant que les scripts de plugin sont inclus depuis le scripts admin_loader.php 
+##     de PunBB, vous avez accÃšs toutes les fonctions et variables globales de PunBB 
+##     (par exemple $db, $pun_config, $pun_user etc.).
+##
+##  7. Faites de votre mieux pour garder lÂaspect et lÂergonomie de votre interface 
+##     utilisateur de plugins semblable au reste des scripts dÂadministration. 
+##     NÂhÃ©sitez pas Ã  emprunter le marquage et le code aux scripts dÂadmin pour 
+##     lÂemployer dans vos plugins.
+##
+##  8. Les plugins doivent Ãªtres dÃ©livrÃ©s sous la licence dÂutilisation GNU/GPL ou 
+##     une licence compatible. Recopiez le prÃ©ambule GPL (situÃ© en haut des scripts 
+##     de PunBB) dans votre script de plugin et changez l e copyright pour quÂil 
+##     corresponde Ã  lÂauteur du plugin (cÂest Ã  dire vous).
+##
+##
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+// Tell admin_loader.php that this is indeed a plugin and that it is loaded
+define('PUN_PLUGIN_LOADED', 1);
+
+//
+// The rest is up to you!
+//
+
+// If the "Show text" button was clicked
+if (isset($_POST['show_text']))
+{
+	// Make sure something something was entered
+	if (trim($_POST['text_to_show']) == '')
+		message('You didn\'t enter anything!');
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+?>
+	<div class="block">
+		<h2><span>Plugin exemple</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Vous avez dit "<?php echo pun_htmlspecialchars($_POST['text_to_show']) ?>". Bon boulot.</p>
+				<p><a href="javascript: history.go(-1)">Retour</a></p>
+			</div>
+		</div>
+	</div>
+<?php
+
+}
+else	// If not, we show the "Show text" form
+{
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+?>
+	<div id="exampleplugin" class="blockform">
+		<h2><span>Plugin exemple</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Ce plugin ne fait rien de bien utile. D'oÃ¹ le nom &quot;Exemple&quot;.</p>
+				<p>Ce serait un bon endroit pour parler au sujet de votre plugin. DÃ©crivez ce qu'il fait et comment il devrait Ãªtre utilisÃ©. Soyez bref, mais instructif.</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>Un formulaire d'exemple</span></h2>
+		<div class="box">
+			<form id="example" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>&amp;foo=bar">
+				<div class="inform">
+					<fieldset>
+						<legend>Saisissez un bout de texte et cliquez "Afficher"&#160;!</legend>
+						<div class="infldset">
+						<table class="aligntop" cellspacing="0">
+							<tr>
+								<th scope="row">Texte Ã  afficher<div><input type="submit" name="show_text" value=" Afficher le texte " tabindex="2" /></div></th>
+								<td>
+									<input type="text" name="text_to_show" size="25" tabindex="1" />
+									<span>Le texte que vous voulez afficher.</span>
+								</td>
+							</tr>
+						</table>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+<?php
+
+}
+
+// Note that the script just ends here. The footer will be included by admin_loader.php.
Index: /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global.php	(revision 1)
@@ -0,0 +1,219 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2005  Terrell Russell (punbb@terrellrussell.com)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+// Tell admin_loader.php that this is indeed a plugin and that it is loaded
+define('PUN_PLUGIN_LOADED', 1);
+
+
+
+// --------------------------------------------------------------------
+
+// Confirm Page
+
+if (isset($_POST['confirm']))
+{
+	// Make sure message body was entered
+	if (trim($_POST['message_body']) == '')
+		message('Vous n\'avez pas Ã©crit de message!');
+
+	// Make sure message subject was entered
+	if (trim($_POST['message_subject']) == '')
+		message('Vous n\'avez pas prÃ©cisÃ© le sujet!');
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+	
+	$preview_message_body = nl2br(pun_htmlspecialchars($_POST['message_body']));
+	
+	$sql = "SELECT count(*) AS usercount
+				FROM ".$db->prefix."users
+				WHERE username != 'Guest'
+				ORDER BY username";	
+	$result = $db->query($sql) or error('Could not get user count from database', __FILE__, __LINE__, $db->error());
+   	$row = $db->fetch_assoc($result);
+
+?>
+	<div id="exampleplugin" class="blockform">
+		<h2><span>Email Global - Confirmation</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Merci de confirmer votre message ci-dessous.<br /><br />Pour d'Ã©ventuelles corrections: <a href="javascript: history.go(-1)">Retour</a>.</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>Confirmation Message</span></h2>
+		<div class="box">
+			<form id="broadcastemail" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
+				<div class="inform">
+					<input type="hidden" name="message_subject" value="<?php echo pun_htmlspecialchars($_POST['message_subject']) ?>" />
+					<input type="hidden" name="message_body" value="<?php echo pun_htmlspecialchars($_POST['message_body']) ?>" />
+					<fieldset>
+						<legend>Destinataires</legend>
+						<div class="infldset">
+							[ <strong><?php echo $row['usercount'] ?></strong> ] membres vont recevoir ce message (Administrateur inclu).
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Contenu du message</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Sujet</th>
+									<td>
+										<?php echo pun_htmlspecialchars($_POST['message_subject']) ?>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Corps du message</th>
+									<td>
+										<?php echo $preview_message_body ?>
+									</td>
+								</tr>
+							</table>
+							<div class="fsetsubmit"><input type="submit" name="send_message" value="Confirmer - Envoyer." tabindex="3" /></div>
+							<p class="topspace">A n'effectuer qu'une seule fois. La patience est une vertu.</p>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Send the Message
+
+else if (isset($_POST['send_message']))
+{
+
+	require_once PUN_ROOT.'include/email.php';
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+	$sql = "SELECT username, email
+				FROM ".$db->prefix."users
+				WHERE username != 'Guest'
+				ORDER BY username";	
+	$result = $db->query($sql) or error('Could not get users from the database', __FILE__, __LINE__, $db->error());
+   	while($row = $db->fetch_assoc($result))
+   	{
+   		$addresses[$row['username']] = $row['email'];
+   	}
+
+	$usercount = count($addresses);
+
+	foreach ($addresses as $recipientname => $recipientemail)
+	{
+	
+		$mail_to        = $recipientname." <".$recipientemail.">";
+		$mail_subject   = pun_htmlspecialchars($_POST['message_subject']);
+		$mail_message   = pun_htmlspecialchars($_POST['message_body']);
+
+		pun_mail($mail_to, $mail_subject, $mail_message);
+
+	}
+
+
+	
+?>
+	<div class="block">
+		<h2><span>Email Global - Message EnvoyÃ©</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Ce message a Ã©tÃ© envoyÃ© Ã  [ <strong><?php echo $usercount ?></strong> ] membres.</p>
+				<p>En tant qu'administrateur, vous allez recevoir une copie de celui-ci.</p>
+				<p>Vous pouvez considÃ©rer cette copie comme une confirmation de l'envoi.</p>
+			</div>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Display the Main Page
+
+else
+{
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+?>
+	<div id="exampleplugin" class="blockform">
+		<h2><span>Email Global</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Ce plugin permet Ã  l'administrateur d'envoyer un mail gÃ©nÃ©ral Ã  tous les membres du forum.</p>
+				<p>Une page rÃ©capitulative de confirmation succÃ©dera Ã  celle-ci.</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>RÃ©diger un Message</span></h2>
+		<div class="box">
+			<form id="broadcastemail" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
+				<div class="inform">
+					<fieldset>
+						<legend>Contenu du message</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Sujet</th>
+									<td>
+										<input type="text" name="message_subject" size="50" tabindex="1" />
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Corps du message</th>
+									<td>
+										<textarea name="message_body" rows="14" cols="48" tabindex="2"></textarea>
+									</td>
+								</tr>
+							</table>
+							<div class="fsetsubmit"><input type="submit" name="confirm" value="Continuer vers Confirmation" tabindex="3" /></div>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Note that the script just ends here. The footer will be included by admin_loader.php.
Index: /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global_Plus.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global_Plus.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Email_Global_Plus.php	(revision 1)
@@ -0,0 +1,276 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2005  Terrell Russell (punbb@terrellrussell.com)
+  
+  Copyright (C) 2006  FoxMaSk (foxmask@punbb.fr)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+/*********************************************************************** 
+18 Mai 2006 - Auteur FoxMask -  AP_Email_Global_Plus v 1.0
+
+adapteÃ© du plugin AP_Email_Global.php de Terrell Russell
+
+ce plugin permet d'envoyer des mails en masse Ã  un groupe d'utilisateurs donnÃ©
+et ajoute le groupe administrateur pour 'accuser' reception du mail de masse.
+
+************************************************************************/
+
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+	exit;
+
+// Tell admin_loader.php that this is indeed a plugin and that it is loaded
+define('PUN_PLUGIN_LOADED', 1);
+
+
+
+// --------------------------------------------------------------------
+
+// Confirm Page
+
+if (isset($_POST['confirm']))
+{
+	// Make sure message body was entered
+	if (trim($_POST['message_body']) == '')
+		message('Vous n\'avez pas Ã©crit de message!');
+
+	// Make sure message subject was entered
+	if (trim($_POST['message_subject']) == '')
+		message('Vous n\'avez pas prÃ©cisÃ© le sujet!');
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+	
+	$preview_message_body = nl2br(pun_htmlspecialchars($_POST['message_body']));
+	
+    if (! is_numeric($_POST['group_id']) ) message('tsss tsss tsss!!!');
+    
+    // envoi Ã  tous les groupes sauf invitÃ©
+    if ($_POST['group_id'] == '0' ) 
+	    $sql = "SELECT count(*) AS usercount
+				FROM ".$db->prefix."users
+				WHERE group_id <> '3' ORDER BY username";
+    else 
+    // envoi Ã  un groupe en particulier
+	    $sql = "SELECT count(*) AS usercount
+				FROM ".$db->prefix."users
+				WHERE group_id = '".$_POST['group_id']."'" .
+			" ORDER BY username";
+                
+	$result = $db->query($sql) or error('Ne peut trouver le nombre d\'utilisateur dans la base de donnÃ©es', __FILE__, __LINE__, $db->error());
+   	$row = $db->fetch_assoc($result);
+
+?>
+	<div id="exampleplugin" class="blockform">
+		<h2><span>Mail de Masse - Confirmation</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Merci de confirmer votre message ci-dessous.<br /><br />Pour d'Ã©ventuelles corrections: <a href="javascript: history.go(-1)">Retour</a>.</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>Confirmation de l'envoi du Message</span></h2>
+		<div class="box">
+			<form id="broadcastemail" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
+				<div class="inform">
+					<input type="hidden" name="message_subject" value="<?php echo pun_htmlspecialchars($_POST['message_subject']) ?>" />
+					<input type="hidden" name="message_body" value="<?php echo pun_htmlspecialchars($_POST['message_body']) ?>" />
+                    <input type="hidden" name="group_id" value="<?php echo $_POST['group_id']; ?>"/>
+					<fieldset>
+						<legend>Destinataires</legend>
+						<div class="infldset">
+							[ <strong><?php echo $row['usercount'] ?></strong> ] membres vont recevoir ce message (Administrateur inclu).
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Contenu du message</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Sujet</th>
+									<td>
+										<?php echo pun_htmlspecialchars($_POST['message_subject']) ?>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Corps du message</th>
+									<td>
+										<?php echo $preview_message_body ?>
+									</td>
+								</tr>
+							</table>
+							<div class="fsetsubmit"><input type="submit" name="send_message" value="Confirmer - Envoyer." tabindex="3" /></div>
+							<p class="topspace">A n'effectuer qu'une seule fois. La patience est une vertu.</p>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Send the Message
+
+else if (isset($_POST['send_message']))
+{
+
+	require_once PUN_ROOT.'include/email.php';
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+                
+    if (! is_numeric($_POST['group_id']) ) message ('tsss tsss tsss!!!');
+    
+    // envoi Ã  tous les groupes sauf invitÃ©
+    if ($_POST['group_id'] == '0' ) 
+	    $sql = "SELECT username, email
+				FROM ".$db->prefix."users
+				WHERE group_id <> '3' ORDER BY username";
+    
+    // envoi au groupe administrateur seulement
+    elseif ($_POST['group_id'] == '1' ) 
+    
+	    $sql = "SELECT username, email
+				FROM ".$db->prefix."users
+				WHERE group_id = '1'" .
+			" ORDER BY username";
+            
+    else 
+    // envoi Ã  un groupe en particulier + groupe administrateur
+	    $sql = "SELECT username, email
+				FROM ".$db->prefix."users
+				WHERE group_id = '".$_POST['group_id']."' or group_id = '1'" .
+			" ORDER BY username";
+            
+	$result = $db->query($sql) or error('Ne peut trouver les utilisateurs dans la base de donnÃ©es', __FILE__, __LINE__, $db->error());
+   	while($row = $db->fetch_assoc($result))
+   	{
+   		$addresses[$row['username']] = $row['email'];
+   	}
+
+	$usercount = count($addresses);
+    
+	foreach ($addresses as $recipientname => $recipientemail)
+	{
+	
+		$mail_to        = $recipientname." <".$recipientemail.">";
+		$mail_subject   = pun_htmlspecialchars($_POST['message_subject']);
+		$mail_message   = pun_htmlspecialchars($_POST['message_body']);
+        
+		pun_mail($mail_to, $mail_subject, $mail_message);
+	}
+
+
+	
+?>
+	<div class="block">
+		<h2><span>Mail de Masse - Message EnvoyÃ©</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Ce message a Ã©tÃ© envoyÃ© Ã  [ <strong><?php echo $usercount ?></strong> ] membres.</p>
+				<p>En tant qu'administrateur, vous allez recevoir une copie de celui-ci.</p>
+				<p>Vous pouvez considÃ©rer cette copie comme une confirmation de l'envoi.</p>
+			</div>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Display the Main Page
+
+else
+{
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+?>
+	<div id="exampleplugin" class="blockform">
+		<h2><span>Mail de Masse</span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p>Ce plugin permet Ã  l'administrateur d'envoyer un mail gÃ©nÃ©ral Ã  tous les membres d'un groupe du forum.</p>
+				<p>Une page rÃ©capitulative de confirmation succÃ©dera Ã  celle-ci.</p>
+			</div>
+		</div>
+
+		<h2 class="block2"><span>RÃ©diger un Message</span></h2>
+		<div class="box">
+			<form id="broadcastemail" method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
+				<div class="inform">
+					<fieldset>
+						<legend>Contenu du message</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+                                <tr>
+                                    <th scope="row">Groupe</th>
+                                    <td>
+                                        <select name="group_id">
+                                            <option value="0" select="selected">Tous</option>
+                                        <?php 
+                                        // on ne prend pas le groupe 'invitÃ©'.
+                                        $sql_group = "SELECT * FROM ".$db->prefix."groups WHERE g_id <> '3' ORDER BY g_id";
+                                        $result_group = $db->query($sql_group) or error('ne peut trouver la liste des groupes d\'utilisateurs',__FILE__, __LINE__, $db->error()); 
+                                        while ($row_group = $db->fetch_assoc($result_group)) {
+                                        ?>
+                                            <option value="<?php echo $row_group['g_id']; ?>"><?php echo $row_group['g_title']; ?></option>
+                                        <?php } ?>
+                                        </select>
+                                    </td>
+                                </tr>
+								<tr>
+									<th scope="row">Sujet</th>
+									<td>
+										<input type="text" name="message_subject" size="50" tabindex="1" />
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Corps du message</th>
+									<td>
+										<textarea name="message_body" rows="14" cols="48" tabindex="2"></textarea>
+									</td>
+								</tr>
+							</table>
+							<div class="fsetsubmit"><input type="submit" name="confirm" value="Continuer vers Confirmation" tabindex="3" /></div>
+						</div>
+					</fieldset>
+				</div>
+			</form>
+		</div>
+	</div>
+<?php
+
+}
+
+// --------------------------------------------------------------------
+
+// Note that the script just ends here. The footer will be included by admin_loader.php.
Index: /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Smilies.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Smilies.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/plugins/AP_Smilies.php	(revision 1)
@@ -0,0 +1,402 @@
+<?php
+/***********************************************************************
+  
+  Copyright (C) 2005  Vincent Garnier (vin100@forx.fr)
+
+  This software 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 2 of the License,
+  or (at your option) any later version.
+
+  This software 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+/************************************************************************\
+	Configuration des limites / Limits configuration
+\************************************************************************/
+
+$smilies_config_image_size = 10240;	// max upload image size in bytes
+$smilies_config_image_width = 20;	// max upload image width in pixels
+$smilies_config_image_height = 20;	// max upload image height in pixels
+
+
+/************************************************************************\
+	Ne pas modifier ci-dessous / Do not edit bellow
+\************************************************************************/
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+    exit;
+
+// Tell admin_loader.php that this is indeed a plugin and that it is loaded
+define('PUN_PLUGIN_LOADED', 1);
+define('PLUGIN_VERSION', '1.0');
+define('PLUGIN_URL', 'admin_loader.php?plugin=AP_Smilies.php');
+
+// Load the smilies language files
+require PUN_ROOT.'lang/'.$pun_user['language'].'/smilies.php';
+
+// Display the smiley set
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
+// Changer les positions
+if (isset($_POST['reord']))
+{
+	$smilies_order = $_POST['smilies_order'];
+	
+	$result = $db->query('SELECT id FROM '.$db->prefix.'smilies ORDER BY disp_position') or error('Unable to retrieve smilies', __FILE__, __LINE__, $db->error());
+	
+	while ($db_smilies = $db->fetch_assoc($result))
+	{
+		if (!preg_match('#^\d+$#', $smilies_order[$db_smilies['id']]))
+			message($lang_smiley['Must int']);
+		
+		$db->query('UPDATE '.$db->prefix.'smilies SET disp_position='.$smilies_order[$db_smilies['id']].' WHERE id='.$db_smilies['id']) or error('Unable to change smilies positions', __FILE__, __LINE__, $db->error());
+	}
+		
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+
+	redirect(PLUGIN_URL, $lang_smiley['Positions changed']);
+}
+
+// Retirer des smileys
+elseif (isset($_POST['remove']))
+{
+	$rem_smilies = array_map('trim', $_POST['rem_smilies']);
+	
+	foreach (array_keys($rem_smilies) as $id)
+		$db->query('DELETE FROM '.$db->prefix."smilies WHERE id = '".$id."'") or error('Unable to delete smiley', __FILE__, __LINE__, $db->error());
+		
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+
+	redirect(PLUGIN_URL, $lang_smiley['Delete Smiley Redirect']);
+}
+
+
+// Supprimer des images
+elseif (isset($_POST['delete']))
+{
+	$del_smilies = array_map('trim', $_POST['del_smilies']);
+	
+	$to_delete = array();
+	$images_affected = array();
+	$not_deleted = array();
+	
+	foreach (array_keys($del_smilies) as $img)
+	{
+		if (!in_array($img, $smiley_img))
+			$to_delete[] = $img;
+		else
+			$images_affected[] = $img;
+	}
+	
+	if (!empty($images_affected))
+		message(sprintf($lang_smiley['Images affected'], implode(', ', $images_affected)));
+
+	else {
+		foreach ($to_delete as $img)
+		{
+			if (!@unlink(PUN_ROOT.'img/smilies/'.$img))
+				$not_deleted[] = $img;
+		}
+	}
+		
+	if (!empty($not_deleted))
+		$message = sprintf($lang_smiley['Images not deleted'], implode(', ', $not_deleted));
+	else 
+		$message = $lang_smiley['Images deleted'];
+
+	redirect(PLUGIN_URL, $message);
+}
+
+// Ajouter une image
+elseif (isset($_POST['add_image']))
+{
+	if (!isset($_FILES['req_file']))
+		message($lang_smiley['No file']);
+			
+	$uploaded_file = $_FILES['req_file'];
+
+	// Make sure the upload went smooth
+	if (isset($uploaded_file['error']))
+	{
+		switch ($uploaded_file['error'])
+		{
+			case 1:	// UPLOAD_ERR_INI_SIZE
+			case 2:	// UPLOAD_ERR_FORM_SIZE
+				message($lang_smiley['Too large ini']);
+				break;
+	
+			case 3:	// UPLOAD_ERR_PARTIAL
+				message($lang_smiley['Partial upload']);
+				break;
+	
+			case 4:	// UPLOAD_ERR_NO_FILE
+				message($lang_smiley['No file']);
+				break;
+	
+			case 6:	// UPLOAD_ERR_NO_TMP_DIR
+				message($lang_smiley['No tmp directory']);
+				break;
+	
+			default:
+				// No error occured, but was something actually uploaded?
+				if ($uploaded_file['size'] == 0)
+					message($lang_smiley['No file']);
+				break;
+		}
+	}
+	
+	if (is_uploaded_file($uploaded_file['tmp_name']))
+	{
+		$filename = substr($uploaded_file['name'], 0, strpos($uploaded_file['name'], '.'));
+		
+		$allowed_types = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
+		if (!in_array($uploaded_file['type'], $allowed_types))
+			message($lang_smiley['Bad type']);
+
+		// Make sure the file isn't too big
+		if ($uploaded_file['size'] > $smilies_config_image_size)
+			message($lang_smiley['Too large'].' '.$smilies_config_image_size.' '.$lang_smiley['bytes'].'.');
+
+		// Determine type
+		$extensions = null;
+		if ($uploaded_file['type'] == 'image/gif')
+			$extensions = array('.gif', '.jpg', '.png');
+		else if ($uploaded_file['type'] == 'image/jpeg' || $uploaded_file['type'] == 'image/pjpeg')
+			$extensions = array('.jpg', '.gif', '.png');
+		else
+			$extensions = array('.png', '.gif', '.jpg');
+
+		// Move the file to the avatar directory. We do this before checking the width/height to circumvent open_basedir restrictions.
+		if (!@move_uploaded_file($uploaded_file['tmp_name'], PUN_ROOT.'img/smilies/'.$filename.'.tmp'))
+			message($lang_smiley['Move failed']);
+
+		// Now check the width/height
+		list($width, $height, $type,) = getimagesize(PUN_ROOT.'img/smilies/'.$filename.'.tmp');
+		if (empty($width) || empty($height) || $width > $smilies_config_image_width || $height > $smilies_config_image_height)
+		{
+			@unlink(PUN_ROOT.'img/smilies/'.$filename.'.tmp');
+			message($lang_smiley['Too wide or high'].' '.$smilies_config_image_width.'x'.$smilies_config_image_height.' '.$lang_profile['pixels'].'.');
+		}
+		else if ($type == 1 && $uploaded_file['type'] != 'image/gif')	// Prevent dodgy uploads
+		{
+			@unlink(PUN_ROOT.'img/smilies/'.$filename.'.tmp');
+			message($lang_smiley['Bad type']);
+		}			
+
+		// Delete any old avatars and put the new one in place
+		@unlink(PUN_ROOT.'img/smilies/'.$filename.$extensions[0]);
+		@unlink(PUN_ROOT.'img/smilies/'.$filename.$extensions[1]);
+		@unlink(PUN_ROOT.'img/smilies/'.$filename.$extensions[2]);
+		@rename(PUN_ROOT.'img/smilies/'.$filename.'.tmp', PUN_ROOT.'img/smilies/'.$filename.$extensions[0]);
+		@chmod(PUN_ROOT.'img/smilies/'.$filename.$extensions[0], 0644);
+	}
+	else
+		message($lang_smiley['Unknown failure']);
+
+	redirect(PLUGIN_URL, $lang_smiley['Successful Upload']);
+}
+
+// Ajouter un smiley Ã  la liste
+elseif (isset($_POST['add_smiley']))
+{
+	$smiley_code = trim($_POST['smiley_code']);
+	$smiley_image = trim($_POST['smiley_image']);
+	
+	if ($smiley_code == '')
+		message($lang_smiley['Create Smiley Code None']);
+
+	if ($smiley_image == '')
+		message($lang_smiley['Create Smiley Image None']);
+	
+	if (in_array($smiley_code, $smiley_text))
+		message($lang_smiley['Code already exists']);
+	
+	$db->query('INSERT INTO '.$db->prefix."smilies (image, text) VALUES ('".$smiley_image."', '".$db->escape($smiley_code)."')") or error('Unable to add smiley', __FILE__, __LINE__, $db->error());
+	
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+
+	redirect(PLUGIN_URL, $lang_smiley['Successful Creation']);
+}
+
+// Affichage
+else {
+
+	// Display the admin navigation menu
+	generate_admin_menu($plugin);
+
+?>
+	<div class="block">
+		<h2><span>Plugin Smilies v.<?php echo PLUGIN_VERSION; ?></span></h2>
+		<div class="box">
+			<div class="inbox">
+				<p><?php echo $lang_smiley['Description'] ?></p>
+			</div>
+		</div>
+	</div>
+
+	<div class="blockform">
+	
+		<h2 class="block2"><span><?php echo $lang_smiley['Current Smilies'] ?></span></h2>
+		<div class="box">
+	<?php
+	$result = $db->query('SELECT * FROM '.$db->prefix.'smilies ORDER BY disp_position') or error('Unable to retrieve smilies', __FILE__, __LINE__, $db->error());
+	
+	$num_db_smilies = $db->num_rows($result);
+	
+	if ($num_db_smilies > 0) : ?>
+			<form method="post" action="<?php echo PLUGIN_URL; ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_smiley['List Current Smilies'] ?></legend>
+						<div class="infldset">
+						<table>
+							<thead>
+							<tr>
+								<th scope="row"><?php echo $lang_smiley['Position']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Image Filename']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Code']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Image']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Remove']; ?></th>
+							</tr>
+							</thead>
+							<tbody>
+		<?php while ($db_smilies = $db->fetch_assoc($result)) : ?>
+							<tr>
+								<td><input type="text" name="smilies_order[<?php echo $db_smilies['id']; ?>]" value="<?php echo $db_smilies['disp_position']; ?>" size="3" maxlength="3" /></td>
+								<td><?php echo $db_smilies['image']; ?></td>
+								<td><?php echo $db_smilies['text']; ?></td>
+								<td><img src="img/smilies/<?php echo $db_smilies['image']; ?>" alt="<?php echo $db_smilies['text']; ?>" /></td>
+								<td><input name="rem_smilies[<?php echo $db_smilies['id']; ?>]" type="checkbox" value="1" /></td>
+							</tr>
+		<?php endwhile; ?>
+							</tbody>
+						</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input name="reord" type="submit" value="<?php echo $lang_smiley['Change position']; ?>" /> <input name="remove" type="submit" value="<?php echo $lang_smiley['Remove Selected']; ?>" /></p>
+			</form>
+	<?php else : ?>
+			<div class="fakeform">
+				<div class="inbox">
+					<p><?php echo $lang_smiley['No smiley']; ?></p>
+				</div>
+			</div>
+	<?php endif; ?>
+			
+			<form method="post" action="<?php echo PLUGIN_URL; ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_smiley['Submit New Smiley'] ?></legend>
+						<div class="infldset">
+						<table class="aligntop" cellspacing="0">
+							<tr>
+								<th scope="row"><?php echo $lang_smiley['Smiley Code'] ?></th>
+								<td>
+									<input type="text" name="smiley_code" size="25" tabindex="1" />
+									<span><?php echo $lang_smiley['Smiley Code Description'] ?></span>
+								</td>
+							</tr>
+							<tr>
+								<th scope="row"><?php echo $lang_smiley['Smiley Image'] ?></th>
+								<td>
+									<input type="text" name="smiley_image" size="25" tabindex="1" />
+									<span><?php echo $lang_smiley['Smiley Image Description'] ?></span>
+								</td>
+							</tr>
+						</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="add_smiley" value="<?php echo $lang_smiley['Submit Smiley'] ?>" /></p>
+			</form>
+		</div>		
+		
+		<h2 class="block2"><span>Liste des images actuellement disponibles</span></h2>
+		<div class="box">
+			<form method="post" action="<?php echo PLUGIN_URL; ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_smiley['List Images Smilies'] ?></legend>
+						<div class="infldset">
+	<?php
+	$img_smilies = array();
+	$d = dir(PUN_ROOT.'img/smilies');
+	while (($entry = $d->read()) !== false)
+	{
+		if ($entry != '.' && $entry != '..' && $entry != 'index.html')
+			$img_smilies[] = $entry;
+	}
+	$d->close();
+	@natsort($img_smilies);
+	?>
+						<table>
+							<thead>
+							<tr>
+								<th scope="row"><?php echo $lang_smiley['Image Filename']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Image']; ?></th>
+								<th scope="row"><?php echo $lang_smiley['Delete']; ?></th>
+							</tr>
+							</thead>
+							<tbody>
+<?php
+$i = 0;
+foreach ($img_smilies as $img) :
+?>
+							<tr>
+								<td><?php echo $img; ?></td>
+								<td><img src="img/smilies/<?php echo $img; ?>" alt="" /></td>
+								<td><input name="del_smilies[<?php echo $img; ?>]" type="checkbox" value="1" /></td>
+							</tr>
+<?php
+$i++;
+endforeach;
+?>
+							</tbody>
+						</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input name="delete" type="submit" value="<?php echo $lang_smiley['Delete Selected']; ?>" /></p>
+			</form>
+			
+			<form method="post" enctype="multipart/form-data"  action="<?php echo PLUGIN_URL; ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_smiley['Add Images Smilies'] ?></legend>
+						<div class="infldset">
+							<label><?php echo $lang_smiley['Images file'] ?><br /><input name="req_file" type="file" size="40" /><br /></label>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input name="add_image" type="submit" value="<?php echo $lang_smiley['Upload']; ?>" /></p>
+			</form>
+
+		</div>
+	</div>
+
+
+<?php
+
+}
Index: /branches/rsr.v5.1.dev/web/punbb/plugins/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/plugins/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/plugins/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/post.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/post.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/post.php	(revision 1)
@@ -0,0 +1,600 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+$tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
+$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
+if ($tid < 1 && $fid < 1 || $tid > 0 && $fid > 0)
+	message($lang_common['Bad request']);
+
+// Fetch some info about the topic and/or the forum
+if ($tid)
+	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
+else
+	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
+
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_posting = $db->fetch_assoc($result);
+
+// Is someone trying to post into a redirect forum?
+if ($cur_posting['redirect_url'] != '')
+	message($lang_common['Bad request']);
+
+// Sort out who the moderators are and if we are currently a moderator (or an admin)
+$mods_array = ($cur_posting['moderators'] != '') ? unserialize($cur_posting['moderators']) : array();
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Do we have permission to post?
+if ((($tid && (($cur_posting['post_replies'] == '' && $pun_user['g_post_replies'] == '0') || $cur_posting['post_replies'] == '0')) ||
+	($fid && (($cur_posting['post_topics'] == '' && $pun_user['g_post_topics'] == '0') || $cur_posting['post_topics'] == '0')) ||
+	(isset($cur_posting['closed']) && $cur_posting['closed'] == '1')) &&
+	!$is_admmod)
+	message($lang_common['No permission']);
+
+// Load the post.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
+
+// Start with a clean slate
+$errors = array();
+
+
+// Did someone just hit "Submit" or "Preview"?
+if (isset($_POST['form_sent']))
+{
+	// Make sure form_user is correct
+	if (($pun_user['is_guest'] && $_POST['form_user'] != 'InvitÃ©') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
+		message($lang_common['Bad request']);
+
+	// Flood protection
+	if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
+		$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];
+
+	// If it's a new topic
+	if ($fid)
+	{
+		$subject = pun_trim($_POST['req_subject']);
+
+		if ($subject == '')
+			$errors[] = $lang_post['No subject'];
+		else if (pun_strlen($subject) > 70)
+			$errors[] = $lang_post['Too long subject'];
+		else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
+			$subject = ucwords(strtolower($subject));
+	}
+
+	// If the user is logged in we get the username and e-mail from $pun_user
+	if (!$pun_user['is_guest'])
+	{
+		$username = $pun_user['username'];
+		$email = $pun_user['email'];
+	}
+	// Otherwise it should be in $_POST
+	else
+	{
+		$username = trim($_POST['req_username']);
+		$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
+
+		// Load the register.php/profile.php language files
+		require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
+		require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
+
+		// It's a guest, so we have to validate the username
+		if (strlen($username) < 2)
+			$errors[] = $lang_prof_reg['Username too short'];
+		else if (!strcasecmp($username, 'invitÃ©') || !strcasecmp($username, $lang_common['Guest']))
+			$errors[] = $lang_prof_reg['Username guest'];
+		else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+			$errors[] = $lang_prof_reg['Username IP'];
+
+		if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
+			$errors[] = $lang_prof_reg['Username reserved chars'];
+		if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+			$errors[] = $lang_prof_reg['Username BBCode'];
+
+		// Check username for any censored words
+		$temp = censor_words($username);
+		if ($temp != $username)
+			$errors[] = $lang_register['Username censor'];
+
+		// Check that the username (or a too similar username) is not already registered
+		$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+		{
+			$busy = $db->result($result);
+			$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
+		}
+
+		if ($pun_config['p_force_guest_email'] == '1' || $email != '')
+		{
+			require PUN_ROOT.'include/email.php';
+			if (!is_valid_email($email))
+				$errors[] = $lang_common['Invalid e-mail'];
+		}
+	}
+
+	// Clean up message from POST
+	$message = pun_linebreaks(pun_trim($_POST['req_message']));
+
+	if ($message == '')
+		$errors[] = $lang_post['No message'];
+	else if (strlen($message) > 65535)
+		$errors[] = $lang_post['Too long message'];
+	else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
+		$message = ucwords(strtolower($message));
+
+	// Validate BBCode syntax
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
+	{
+		require PUN_ROOT.'include/parser.php';
+		$message = preparse_bbcode($message, $errors);
+	}
+
+
+	require PUN_ROOT.'include/search_idx.php';
+
+	$hide_smilies = isset($_POST['hide_smilies']) ? 1 : 0;
+	$subscribe = isset($_POST['subscribe']) ? 1 : 0;
+
+	$now = time();
+
+	// Did everything go according to plan?
+	if (empty($errors) && !isset($_POST['preview']))
+	{
+		// If it's a reply
+		if ($tid)
+		{
+			if (!$pun_user['is_guest'])
+			{
+				// Insert the new post
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
+				$new_pid = $db->insert_id();
+
+				// To subscribe or not to subscribe, that ...
+				if ($pun_config['o_subscriptions'] == '1' && $subscribe)
+				{
+					$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$tid) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+					if (!$db->num_rows($result))
+						$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$tid.')') or error('Impossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
+				}
+			}
+			else
+			{
+				// It's a guest. Insert the new post
+				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
+				$new_pid = $db->insert_id();
+			}
+
+			// Count number of replies in the topic
+			$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid) or error('Impossible de retrouver le total de messages de la discussion', __FILE__, __LINE__, $db->error());
+			$num_replies = $db->result($result, 0) - 1;
+
+			// Update topic
+			$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', last_post='.$now.', last_post_id='.$new_pid.', last_poster=\''.$db->escape($username).'\' WHERE id='.$tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
+
+			update_search_index('post', $new_pid, $message);
+
+			update_forum($cur_posting['id']);
+
+			// Should we send out notifications?
+			if ($pun_config['o_subscriptions'] == '1')
+			{
+				// Get the post time for the previous post in this topic
+				$result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Impossible de retrouver les information de message', __FILE__, __LINE__, $db->error());
+				$previous_post_time = $db->result($result);
+
+				// Get any subscribed users that should be notified (banned users are excluded)
+				$result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+				if ($db->num_rows($result))
+				{
+					require_once PUN_ROOT.'include/email.php';
+
+					$notification_emails = array();
+
+					// Loop through subscribed users and send e-mails
+					while ($cur_subscriber = $db->fetch_assoc($result))
+					{
+						// Is the subscription e-mail for $cur_subscriber['language'] cached or not?
+						if (!isset($notification_emails[$cur_subscriber['language']]))
+						{
+							if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'))
+							{
+								// Load the "new reply" template
+								$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'));
+
+								// Load the "new reply full" template (with post included)
+								$mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl'));
+
+								// The first row contains the subject (it also starts with "Subject:")
+								$first_crlf = strpos($mail_tpl, "\n");
+								$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+								$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+								$first_crlf = strpos($mail_tpl_full, "\n");
+								$mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));
+								$mail_message_full = trim(substr($mail_tpl_full, $first_crlf));
+
+								$mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);
+								$mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);
+								$mail_message = str_replace('<replier>', $username, $mail_message);
+								$mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
+								$mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message);
+								$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+								$mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);
+								$mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);
+								$mail_message_full = str_replace('<replier>', $username, $mail_message_full);
+								$mail_message_full = str_replace('<message>', $message, $mail_message_full);
+								$mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
+								$mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full);
+								$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
+
+								$notification_emails[$cur_subscriber['language']][0] = $mail_subject;
+								$notification_emails[$cur_subscriber['language']][1] = $mail_message;
+								$notification_emails[$cur_subscriber['language']][2] = $mail_subject_full;
+								$notification_emails[$cur_subscriber['language']][3] = $mail_message_full;
+
+								$mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null;
+							}
+						}
+
+						// We have to double check here because the templates could be missing
+						if (isset($notification_emails[$cur_subscriber['language']]))
+						{
+							if ($cur_subscriber['notify_with_post'] == '0')
+								pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);
+							else
+								pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);
+						}
+					}
+				}
+			}
+		}
+		// If it's a new topic
+		else if ($fid)
+		{
+			// Create the topic
+			$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.')') or error('Impossible de crÃ©er la discussion', __FILE__, __LINE__, $db->error());
+			$new_tid = $db->insert_id();
+
+			if (!$pun_user['is_guest'])
+			{
+				// To subscribe or not to subscribe, that ...
+				if ($pun_config['o_subscriptions'] == '1' && (isset($_POST['subscribe']) && $_POST['subscribe'] == '1'))
+					$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$new_tid.')') or error('Impossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
+
+				// Create the post ("topic post")
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
+			}
+			else
+			{
+				// Create the post ("topic post")
+				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
+			}
+			$new_pid = $db->insert_id();
+
+			// Update the topic with last_post_id
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
+
+			update_search_index('post', $new_pid, $message, $subject);
+
+			update_forum($fid);
+		}
+
+		// If the posting user is logged in, increment his/her post count
+		if (!$pun_user['is_guest'])
+		{
+			$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
+			$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Impossible de modifier l\'utilisateur', __FILE__, __LINE__, $db->error());
+		}
+
+		redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);
+	}
+}
+
+
+// If a topic id was specified in the url (it's a reply).
+if ($tid)
+{
+	$action = $lang_post['Post a reply'];
+	$form = '<form id="post" method="post" action="post.php?action=post&amp;tid='.$tid.'" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">';
+
+	// If a quote-id was specified in the url.
+	if (isset($_GET['qid']))
+	{
+		$qid = intval($_GET['qid']);
+		if ($qid < 1)
+			message($lang_common['Bad request']);
+
+		$result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Impossible de retrouver les informations de citation', __FILE__, __LINE__, $db->error());
+		if (!$db->num_rows($result))
+			message($lang_common['Bad request']);
+
+		list($q_poster, $q_message) = $db->fetch_row($result);
+
+		// Mod: Flash MP3 Player (1 nouvelle ligne suit)
+		$q_message = preg_replace("/\[mp3 url=([^ ]+)\]/", "[url]$1[/url]", $q_message);
+
+		$q_message = str_replace('[img]', '[url]', $q_message);
+		$q_message = str_replace('[/img]', '[/url]', $q_message);
+		$q_message = pun_htmlspecialchars($q_message);
+
+		if ($pun_config['p_message_bbcode'] == '1')
+		{
+			// If username contains a square bracket, we add "" or '' around it (so we know when it starts and ends)
+			if (strpos($q_poster, '[') !== false || strpos($q_poster, ']') !== false)
+			{
+				if (strpos($q_poster, '\'') !== false)
+					$q_poster = '"'.$q_poster.'"';
+				else
+					$q_poster = '\''.$q_poster.'\'';
+			}
+			else
+			{
+				// Get the characters at the start and end of $q_poster
+				$ends = substr($q_poster, 0, 1).substr($q_poster, -1, 1);
+
+				// Deal with quoting "Username" or 'Username' (becomes '"Username"' or "'Username'")
+				if ($ends == '\'\'')
+					$q_poster = '"'.$q_poster.'"';
+				else if ($ends == '""')
+					$q_poster = '\''.$q_poster.'\'';
+			}
+
+			$quote = '[quote='.$q_poster.']'.$q_message.'[/quote]'."\n";
+		}
+		else
+			$quote = '> '.$q_poster.' '.$lang_common['wrote'].':'."\n\n".'> '.$q_message."\n";
+	}
+
+	$forum_name = '<a href="viewforum.php?id='.$cur_posting['id'].'">'.pun_htmlspecialchars($cur_posting['forum_name']).'</a>';
+}
+// If a forum_id was specified in the url (new topic).
+else if ($fid)
+{
+	$action = $lang_post['Post new topic'];
+	$form = '<form id="post" method="post" action="post.php?action=post&amp;fid='.$fid.'" onsubmit="return process_form(this)">';
+
+	$forum_name = pun_htmlspecialchars($cur_posting['forum_name']);
+}
+else
+	message($lang_common['Bad request']);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$action;
+$required_fields = array('req_email' => $lang_common['E-mail'], 'req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
+$focus_element = array('post');
+
+if (!$pun_user['is_guest'])
+	$focus_element[] = ($fid) ? 'req_subject' : 'req_message';
+else
+{
+	$required_fields['req_username'] = $lang_post['Guest name'];
+	$focus_element[] = 'req_username';
+}
+
+require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<?php echo $forum_name ?><?php if (isset($cur_posting['subject'])) echo '</li><li>&#160;&raquo;&#160;'.pun_htmlspecialchars($cur_posting['subject']) ?></li></ul>
+	</div>
+</div>
+
+<?php
+
+// If there are errors, we display them
+if (!empty($errors))
+{
+
+?>
+<div id="posterror" class="block">
+	<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><?php echo $lang_post['Post errors info'] ?></p>
+			<ul>
+<?php
+
+	while (list(, $cur_error) = each($errors))
+		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
+?>
+			</ul>
+		</div>
+	</div>
+</div>
+
+<?php
+
+}
+else if (isset($_POST['preview']))
+{
+	require_once PUN_ROOT.'include/parser.php';
+	$preview_message = parse_message($message, $hide_smilies);
+
+?>
+<div id="postpreview" class="blockpost">
+	<h2><span><?php echo $lang_post['Post preview'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $preview_message."\n" ?>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<?php
+
+}
+
+
+$cur_index = 1;
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $action ?></span></h2>
+	<div class="box">
+		<?php echo $form."\n" ?>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_common['Write message legend'] ?></legend>
+					<div class="infldset txtarea">
+						<input type="hidden" name="form_sent" value="1" />
+						<input type="hidden" name="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'InvitÃ©'; ?>" />
+<?php
+
+if ($pun_user['is_guest'])
+{
+	$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].'</strong>' : $lang_common['E-mail'];
+	$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
+
+?>						<label class="conl"><strong><?php echo $lang_post['Guest name'] ?></strong><br /><input type="text" name="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="25" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+						<label class="conl"><?php echo $email_label ?><br /><input type="text" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="50" maxlength="50" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+						<div class="clearer"></div>
+<?php
+
+}
+
+if ($fid): ?>
+						<label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+<?php endif; require PUN_ROOT.'mod_easy_bbcode.php'; ?>						<label><strong><?php echo $lang_common['Message'] ?></strong><br />
+
+						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>
+						<ul class="bblinks">
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+						</ul>
+					</div>
+				</fieldset>
+<?php
+
+$checkboxes = array();
+if (!$pun_user['is_guest'])
+{
+	if ($pun_config['o_smilies'] == '1')
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'];
+
+	if ($pun_config['o_subscriptions'] == '1')
+		$checkboxes[] = '<label><input type="checkbox" name="subscribe" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['subscribe']) ? ' checked="checked"' : '').' />'.$lang_post['Subscribe'];
+}
+else if ($pun_config['o_smilies'] == '1')
+	$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'];
+
+if (!empty($checkboxes))
+{
+
+?>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_common['Options'] ?></legend>
+					<div class="infldset">
+						<div class="rbox">
+							<?php echo implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
+						</div>
+					</div>
+				</fieldset>
+<?php
+
+}
+
+?>
+			</div>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+
+<?php
+
+// Check to see if the topic review is to be displayed.
+if ($tid && $pun_config['o_topic_review'] != '0')
+{
+	require_once PUN_ROOT.'include/parser.php';
+
+	$result = $db->query('SELECT poster, message, hide_smilies, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT '.$pun_config['o_topic_review']) or error('Impossible de retrouver le rÃ©sumÃ© de la discussion', __FILE__, __LINE__, $db->error());
+
+?>
+
+<div id="postreview" class="blockpost">
+	<h2><span><?php echo $lang_post['Topic review'] ?></span></h2>
+<?php
+
+	//Set background switching on
+	$bg_switch = true;
+	$post_count = 0;
+
+	while ($cur_post = $db->fetch_assoc($result))
+	{
+		// Switch the background color for every message.
+		$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+		$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
+		$post_count++;
+
+		$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
+
+?>
+	<div class="box<?php echo $vtbg ?>">
+		<div class="inbox">
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></dt>
+					<dd><?php echo format_time($cur_post['posted']) ?></dd>
+				</dl>
+			</div>
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $cur_post['message'] ?>
+				</div>
+			</div>
+			<div class="clearer"></div>
+		</div>
+	</div>
+<?php
+
+	}
+
+?>
+</div>
+<?php
+
+}
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/profile.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/profile.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/profile.php	(revision 1)
@@ -0,0 +1,1612 @@
+<?php
+
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+$section = isset($_GET['section']) ? $_GET['section'] : null;
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+if ($id < 2)
+	message($lang_common['Bad request']);
+
+if ($pun_user['g_read_board'] == '0' && ($action != 'change_pass' || !isset($_GET['key'])))
+	message($lang_common['No view']);
+
+// Load the profile.php/register.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
+
+// Load the profile.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/profile.php';
+
+
+if ($action == 'change_pass')
+{
+	if (isset($_GET['key']))
+	{
+		// If the user is already logged in we shouldn't be here :)
+		if (!$pun_user['is_guest'])
+		{
+			header('Location: index.php');
+			exit;
+		}
+
+		$key = $_GET['key'];
+
+		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver le nouveau mot de passe', __FILE__, __LINE__, $db->error());
+		list($new_password_hash, $new_password_key) = $db->fetch_row($result);
+
+		if ($key == '' || $key != $new_password_key)
+			message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
+		else
+		{
+			$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
+
+			message($lang_profile['Pass updated'], true);
+		}
+	}
+
+	// Make sure we are allowed to change this users password
+	if ($pun_user['id'] != $id)
+	{
+		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users password?
+			message($lang_common['No permission']);
+		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users password?
+		{
+			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+			if (!$db->num_rows($result))
+				message($lang_common['Bad request']);
+
+			if ($pun_config['p_mod_edit_users'] == '0' || $pun_config['p_mod_change_passwords'] == '0' || $db->result($result) < PUN_GUEST)
+				message($lang_common['No permission']);
+		}
+	}
+
+	if (isset($_POST['form_sent']))
+	{
+		$old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : '';
+		$new_password1 = trim($_POST['req_new_password1']);
+		$new_password2 = trim($_POST['req_new_password2']);
+
+		if ($new_password1 != $new_password2)
+			message($lang_prof_reg['Pass not match']);
+		if (strlen($new_password1) < 4)
+			message($lang_prof_reg['Pass too short']);
+
+		$result = $db->query('SELECT password, save_pass FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver le mot de passe', __FILE__, __LINE__, $db->error());
+		list($db_password_hash, $save_pass) = $db->fetch_row($result);
+
+		$authorized = false;
+
+		if (!empty($db_password_hash))
+		{
+			$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+			$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
+
+			$old_password_hash = pun_hash($old_password);	// This could result in either an SHA-1 or an MD5 hash
+
+			if (($sha1_in_db && $sha1_available && $db_password_hash == $old_password_hash) ||
+				(!$sha1_in_db && $db_password_hash == md5($old_password)) ||
+				$pun_user['g_id'] < PUN_GUEST)
+				$authorized = true;
+		}
+
+		if (!$authorized)
+			message($lang_profile['Wrong pass']);
+
+		$new_password_hash = pun_hash($new_password1);
+
+		$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\' WHERE id='.$id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
+
+		if ($pun_user['id'] == $id)
+		{
+			$expire = ($save_pass == '1') ? time() + 31536000 : 0;
+			pun_setcookie($pun_user['id'], $new_password_hash, $expire);
+		}
+
+		redirect('profile.php?section=essentials&amp;id='.$id, $lang_profile['Pass updated redirect']);
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	$required_fields = array('req_old_password' => $lang_profile['Old pass'], 'req_new_password1' => $lang_profile['New pass'], 'req_new_password2' => $lang_profile['Confirm new pass']);
+	$focus_element = array('change_pass', (($pun_user['g_id'] > PUN_MOD) ? 'req_old_password' : 'req_new_password1'));
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_profile['Change pass'] ?></span></h2>
+	<div class="box">
+		<form id="change_pass" method="post" action="profile.php?action=change_pass&amp;id=<?php echo $id ?>" onsubmit="return process_form(this)">
+			<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+				<fieldset>
+					<legend><?php echo $lang_profile['Change pass legend'] ?></legend>
+					<div class="infldset">
+<?php if ($pun_user['g_id'] > PUN_MOD): ?>						<label><strong><?php echo $lang_profile['Old pass'] ?></strong><br />
+						<input type="password" name="req_old_password" size="16" maxlength="16" /><br /></label>
+<?php endif; ?>						<label class="conl"><strong><?php echo $lang_profile['New pass'] ?></strong><br />
+						<input type="password" name="req_new_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong><?php echo $lang_profile['Confirm new pass'] ?></strong><br />
+						<input type="password" name="req_new_password2" size="16" maxlength="16" /><br /></label>
+						<div class="clearb"></div>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if ($action == 'change_email')
+{
+	// Make sure we are allowed to change this users e-mail
+	if ($pun_user['id'] != $id)
+	{
+		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users e-mail?
+			message($lang_common['No permission']);
+		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users e-mail?
+		{
+			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+			if (!$db->num_rows($result))
+				message($lang_common['Bad request']);
+
+			if ($pun_config['p_mod_edit_users'] == '0' || $db->result($result) < PUN_GUEST)
+				message($lang_common['No permission']);
+		}
+	}
+
+	if (isset($_GET['key']))
+	{
+		$key = $_GET['key'];
+
+		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
+		list($new_email, $new_email_key) = $db->fetch_row($result);
+
+		if ($key != $new_email_key)
+			message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
+		else
+		{
+			$db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Impossible de modifier l\'adresse e-mail', __FILE__, __LINE__, $db->error());
+
+			message($lang_profile['E-mail updated'], true);
+		}
+	}
+	else if (isset($_POST['form_sent']))
+	{
+		if (pun_hash($_POST['req_password']) !== $pun_user['password'])
+			message($lang_profile['Wrong pass']);
+
+		require PUN_ROOT.'include/email.php';
+
+		// Validate the email-address
+		$new_email = strtolower(trim($_POST['req_new_email']));
+		if (!is_valid_email($new_email))
+			message($lang_common['Invalid e-mail']);
+
+		// Check it it's a banned e-mail address
+		if (is_banned_email($new_email))
+		{
+			if ($pun_config['p_allow_banned_email'] == '0')
+				message($lang_prof_reg['Banned e-mail']);
+			else if ($pun_config['o_mailing_list'] != '')
+			{
+				$mail_subject = 'Alerte - Adresse e-mail bannis dÃ©tectÃ©e';
+				$mail_message = 'L\'utilisateur \''.$pun_user['username'].'\' a changÃ© son e-mail en une adresse interdite : '.$new_email."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+			}
+		}
+
+		// Check if someone else already has registered with that e-mail address
+		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+		{
+			if ($pun_config['p_allow_dupe_email'] == '0')
+				message($lang_prof_reg['Dupe e-mail']);
+			else if ($pun_config['o_mailing_list'] != '')
+			{
+				while ($cur_dupe = $db->fetch_assoc($result))
+					$dupe_list[] = $cur_dupe['username'];
+
+				$mail_subject = 'Alerte - Adresse e-mail en doublon dÃ©tectÃ©e';
+				$mail_message = 'L\'utilisateur \''.$pun_user['username'].'\' a changÃ© son e-mail pour une adresse qui appartient dÃ©jÃ  Ã  : '.implode(', ', $dupe_list)."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+			}
+		}
+
+
+		$new_email_key = random_pass(8);
+
+		$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Impossible de modifier les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
+
+		// Load the "activate e-mail" template
+		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));
+
+		// The first row contains the subject
+		$first_crlf = strpos($mail_tpl, "\n");
+		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+		$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+		$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
+		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'], $mail_message);
+		$mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+		pun_mail($new_email, $mail_subject, $mail_message);
+
+		message($lang_profile['Activate e-mail sent'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	$required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
+	$focus_element = array('change_email', 'req_new_email');
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_profile['Change e-mail'] ?></span></h2>
+	<div class="box">
+		<form id="change_email" method="post" action="profile.php?action=change_email&amp;id=<?php echo $id ?>" id="change_email" onsubmit="return process_form(this)">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_profile['E-mail legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="form_sent" value="1" />
+						<label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
+						<label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
+						<p><?php echo $lang_profile['E-mail instructions'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="new_email" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if ($action == 'upload_avatar' || $action == 'upload_avatar2')
+{
+	if ($pun_config['o_avatars'] == '0')
+		message($lang_profile['Avatars disabled']);
+
+	if ($pun_user['id'] != $id && $pun_user['g_id'] > PUN_MOD)
+		message($lang_common['No permission']);
+
+	if (isset($_POST['form_sent']))
+	{
+		if (!isset($_FILES['req_file']))
+			message($lang_profile['No file']);
+			
+		$uploaded_file = $_FILES['req_file'];
+
+		// Make sure the upload went smooth
+		if (isset($uploaded_file['error']))
+		{
+			switch ($uploaded_file['error'])
+			{
+				case 1:	// UPLOAD_ERR_INI_SIZE
+				case 2:	// UPLOAD_ERR_FORM_SIZE
+					message($lang_profile['Too large ini']);
+					break;
+
+				case 3:	// UPLOAD_ERR_PARTIAL
+					message($lang_profile['Partial upload']);
+					break;
+
+				case 4:	// UPLOAD_ERR_NO_FILE
+					message($lang_profile['No file']);
+					break;
+
+				case 6:	// UPLOAD_ERR_NO_TMP_DIR
+					message($lang_profile['No tmp directory']);
+					break;
+
+				default:
+					// No error occured, but was something actually uploaded?
+					if ($uploaded_file['size'] == 0)
+						message($lang_profile['No file']);
+					break;
+			}
+		}
+
+		if (is_uploaded_file($uploaded_file['tmp_name']))
+		{
+			$allowed_types = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
+			if (!in_array($uploaded_file['type'], $allowed_types))
+				message($lang_profile['Bad type']);
+
+			// Make sure the file isn't too big
+			if ($uploaded_file['size'] > $pun_config['o_avatars_size'])
+				message($lang_profile['Too large'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].'.');
+
+			// Determine type
+			$extensions = null;
+			if ($uploaded_file['type'] == 'image/gif')
+				$extensions = array('.gif', '.jpg', '.png');
+			else if ($uploaded_file['type'] == 'image/jpeg' || $uploaded_file['type'] == 'image/pjpeg')
+				$extensions = array('.jpg', '.gif', '.png');
+			else
+				$extensions = array('.png', '.gif', '.jpg');
+
+			// Move the file to the avatar directory. We do this before checking the width/height to circumvent open_basedir restrictions.
+			if (!@move_uploaded_file($uploaded_file['tmp_name'], $pun_config['o_avatars_dir'].'/'.$id.'.tmp'))
+				message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
+
+			// Now check the width/height
+			list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+			if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
+			{
+				@unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+				message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
+			}
+			else if ($type == 1 && $uploaded_file['type'] != 'image/gif')	// Prevent dodgy uploads
+			{
+				@unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+				message($lang_profile['Bad type']);
+			}			
+
+			// Delete any old avatars and put the new one in place
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[1]);
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[2]);
+			@rename($pun_config['o_avatars_dir'].'/'.$id.'.tmp', $pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
+			@chmod($pun_config['o_avatars_dir'].'/'.$id.$extensions[0], 0644);
+		}
+		else
+			message($lang_profile['Unknown failure']);
+
+		// Enable use_avatar (seems sane since the user just uploaded an avatar)
+		$db->query('UPDATE '.$db->prefix.'users SET use_avatar=1 WHERE id='.$id) or error('Impossible de modifier l\'Ã©tat de l\'avatar', __FILE__, __LINE__, $db->error());
+
+		redirect('profile.php?section=personality&amp;id='.$id, $lang_profile['Avatar upload redirect']);
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	$required_fields = array('req_file' => $lang_profile['File']);
+	$focus_element = array('upload_avatar', 'req_file');
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_profile['Upload avatar'] ?></span></h2>
+	<div class="box">
+		<form id="upload_avatar" method="post" enctype="multipart/form-data" action="profile.php?action=upload_avatar2&amp;id=<?php echo $id ?>" onsubmit="return process_form(this)">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_profile['Upload avatar legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="form_sent" value="1" />
+						<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" />
+						<label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label>
+						<p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="upload" value="<?php echo $lang_profile['Upload'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if ($action == 'delete_avatar')
+{
+	if ($pun_user['id'] != $id && $pun_user['g_id'] > PUN_MOD)
+		message($lang_common['No permission']);
+
+	confirm_referrer('profile.php');
+
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.jpg');
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.png');
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.gif');
+
+	// Disable use_avatar
+	$db->query('UPDATE '.$db->prefix.'users SET use_avatar=0 WHERE id='.$id) or error('Impossible de modifier l\'Ã©tat de l\'avatar', __FILE__, __LINE__, $db->error());
+
+	redirect('profile.php?section=personality&amp;id='.$id, $lang_profile['Avatar deleted redirect']);
+}
+
+
+else if (isset($_POST['update_group_membership']))
+{
+	if ($pun_user['g_id'] > PUN_ADMIN)
+		message($lang_common['No permission']);
+
+	confirm_referrer('profile.php');
+
+	$new_group_id = intval($_POST['group_id']);
+
+	$db->query('UPDATE '.$db->prefix.'users SET group_id='.$new_group_id.' WHERE id='.$id) or error('Impossible de change de groupe', __FILE__, __LINE__, $db->error());
+
+	// If the user was a moderator or an administrator, we remove him/her from the moderator list in all forums as well
+	if ($new_group_id > PUN_MOD)
+	{
+		$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+		while ($cur_forum = $db->fetch_assoc($result))
+		{
+			$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
+
+			if (in_array($id, $cur_moderators))
+			{
+				$username = array_search($id, $cur_moderators);
+				unset($cur_moderators[$username]);
+				$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
+
+				$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier le forum', __FILE__, __LINE__, $db->error());
+			}
+		}
+	}
+
+	redirect('profile.php?section=admin&amp;id='.$id, $lang_profile['Group membership redirect']);
+}
+
+
+else if (isset($_POST['update_forums']))
+{
+	if ($pun_user['g_id'] > PUN_ADMIN)
+		message($lang_common['No permission']);
+
+	confirm_referrer('profile.php');
+
+	// Get the username of the user we are processing
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	$username = $db->result($result);
+
+	$moderator_in = (isset($_POST['moderator_in'])) ? array_keys($_POST['moderator_in']) : array();
+
+	// Loop through all forums
+	$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+	while ($cur_forum = $db->fetch_assoc($result))
+	{
+		$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
+		// If the user should have moderator access (and he/she doesn't already have it)
+		if (in_array($cur_forum['id'], $moderator_in) && !in_array($id, $cur_moderators))
+		{
+			$cur_moderators[$username] = $id;
+			ksort($cur_moderators);
+
+			$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+		}
+		// If the user shouldn't have moderator access (and he/she already has it)
+		else if (!in_array($cur_forum['id'], $moderator_in) && in_array($id, $cur_moderators))
+		{
+			unset($cur_moderators[$username]);
+			$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
+
+			$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+		}
+	}
+
+	redirect('profile.php?section=admin&amp;id='.$id, $lang_profile['Update forums redirect']);
+}
+
+
+else if (isset($_POST['ban']))
+{
+	if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
+		message($lang_common['No permission']);
+
+	redirect('admin_bans.php?add_ban='.$id, $lang_profile['Ban redirect']);
+}
+
+
+else if (isset($_POST['delete_user']) || isset($_POST['delete_user_comply']))
+{
+	if ($pun_user['g_id'] > PUN_ADMIN)
+		message($lang_common['No permission']);
+
+	confirm_referrer('profile.php');
+
+	// Get the username and group of the user we are deleting
+	$result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	list($group_id, $username) = $db->fetch_row($result);
+	
+	if ($group_id == PUN_ADMIN)  
+		message('Les administrateurs ne peuvent Ãªtres supprimÃ©s. Afin de supprimer cet utilisateur vous devez d\'abord le dÃ©placer dans un autre groupe.');  
+
+	if (isset($_POST['delete_user_comply']))
+	{
+		// If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well
+		if ($group_id < PUN_GUEST)
+		{
+			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+			while ($cur_forum = $db->fetch_assoc($result))
+			{
+				$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
+
+				if (in_array($id, $cur_moderators))
+				{
+					unset($cur_moderators[$username]);
+					$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
+
+					$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+				}
+			}
+		}
+
+		// Delete any subscriptions
+		$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE user_id='.$id) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
+
+		// Remove him/her from the online list (if they happen to be logged in)
+		$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$id) or error('Impossible de retirer l\'utilisateur de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+		// Should we delete all posts made by this user?
+		if (isset($_POST['delete_posts']))
+		{
+			require PUN_ROOT.'include/search_idx.php';
+			@set_time_limit(0);
+
+			// Find all posts made by this user
+			$result = $db->query('SELECT p.id, p.topic_id, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE p.poster_id='.$id) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
+			if ($db->num_rows($result))
+			{
+				while ($cur_post = $db->fetch_assoc($result))
+				{
+					// Determine whether this post is the "topic post" or not
+					$result2 = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['topic_id'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+
+					if ($db->result($result2) == $cur_post['id'])
+						delete_topic($cur_post['topic_id']);
+					else
+						delete_post($cur_post['id'], $cur_post['topic_id']);
+
+					update_forum($cur_post['forum_id']);
+				}
+			}
+		}
+		else
+			// Set all his/her posts to guest
+			$db->query('UPDATE '.$db->prefix.'posts SET poster_id=1 WHERE poster_id='.$id) or error('Impossible de modifier les messages', __FILE__, __LINE__, $db->error());
+
+		// Delete the user
+		$db->query('DELETE FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de supprimer l\'utilisateur', __FILE__, __LINE__, $db->error());
+
+		redirect('index.php', $lang_profile['User delete redirect']);
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_profile['Confirm delete user'] ?></span></h2>
+	<div class="box">
+		<form id="confirm_del_user" method="post" action="profile.php?id=<?php echo $id ?>">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_profile['Confirm delete legend'] ?></legend>
+					<div class="infldset">
+						<p><?php echo $lang_profile['Confirmation info'].' '.pun_htmlspecialchars($username).'.' ?></p>
+						<div class="rbox">
+							<label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label>
+						</div>
+						<p class="warntext"><strong><?php echo $lang_profile['Delete warning'] ?></strong></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="delete_user_comply" value="<?php echo $lang_profile['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if (isset($_POST['form_sent']))
+{
+	// Fetch the user group of the user we are editing
+	$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_common['Bad request']);
+
+	$group_id = $db->result($result);
+
+	if ($pun_user['id'] != $id &&
+		($pun_user['g_id'] > PUN_MOD ||
+		($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') ||
+		($pun_user['g_id'] == PUN_MOD && $group_id < PUN_GUEST)))
+		message($lang_common['No permission']);
+
+	if ($pun_user['g_id'] < PUN_GUEST)
+		confirm_referrer('profile.php');
+
+	// Extract allowed elements from $_POST['form']
+	function extract_elements($allowed_elements)
+	{
+		$form = array();
+
+		while (list($key, $value) = @each($_POST['form']))
+		{
+		    if (in_array($key, $allowed_elements))
+		        $form[$key] = $value;
+		}
+
+		return $form;
+	}
+
+	$username_updated = false;
+
+	// Validate input depending on section
+	switch ($section)
+	{
+		case 'essentials':
+		{
+			$form = extract_elements(array('timezone', 'language'));
+
+			if ($pun_user['g_id'] < PUN_GUEST)
+			{
+				$form['admin_note'] = trim($_POST['admin_note']);
+
+				// Are we allowed to change usernames?
+				if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_rename_users'] == '1'))
+				{
+					$form['username'] = trim($_POST['req_username']);
+					$old_username = trim($_POST['old_username']);
+
+					if (strlen($form['username']) < 2)
+						message($lang_prof_reg['Username too short']);
+					else if (pun_strlen($form['username']) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
+					    message($lang_common['Bad request']);
+					else if (!strcasecmp($form['username'], 'invitÃ©') || !strcasecmp($form['username'], $lang_common['Guest']))
+						message($lang_prof_reg['Username guest']);
+					else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $form['username']))
+						message($lang_prof_reg['Username IP']);
+					else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $form['username']))
+						message($lang_prof_reg['Username BBCode']);
+
+					// Check that the username is not already registered
+					$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE username=\''.$db->escape($form['username']).'\' AND id!='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+					if ($db->num_rows($result))
+						message($lang_profile['Dupe username']);
+
+					if ($form['username'] != $old_username)
+						$username_updated = true;
+				}
+
+				// We only allow administrators to update the post count
+				if ($pun_user['g_id'] == PUN_ADMIN)
+					$form['num_posts'] = intval($_POST['num_posts']);
+			}
+
+			if ($pun_config['o_regs_verify'] == '0' || $pun_user['g_id'] < PUN_GUEST)
+			{
+				require PUN_ROOT.'include/email.php';
+
+				// Validate the email-address
+				$form['email'] = strtolower(trim($_POST['req_email']));
+				if (!is_valid_email($form['email']))
+					message($lang_common['Invalid e-mail']);
+			}
+			
+			// Make sure we got a valid language string
+			$form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']);
+			if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php'))
+				message($lang_common['Bad request']);
+			
+			break;
+		}
+
+		case 'personal':
+		{
+			$form = extract_elements(array('realname', 'url', 'location'));
+
+			if ($pun_user['g_id'] == PUN_ADMIN)
+				$form['title'] = trim($_POST['title']);
+			else if ($pun_user['g_set_title'] == '1')
+			{
+				$form['title'] = trim($_POST['title']);
+
+				if ($form['title'] != '')
+				{
+					// A list of words that the title may not contain
+					// If the language is English, there will be some duplicates, but it's not the end of the world
+					$forbidden = array('Member', 'Moderator', 'Administrator', 'Banned', 'Guest', $lang_common['Member'], $lang_common['Moderator'], $lang_common['Administrator'], $lang_common['Banned'], $lang_common['Guest']);
+
+					if (in_array($form['title'], $forbidden))
+						message($lang_profile['Forbidden title']);
+				}
+			}
+
+			// Add http:// if the URL doesn't contain it already
+			if ($form['url'] != '' && !stristr($form['url'], 'http://'))
+				$form['url'] = 'http://'.$form['url'];
+
+			break;
+		}
+
+		case 'messaging':
+		{
+			$form = extract_elements(array('jabber', 'icq', 'msn', 'aim', 'yahoo'));
+
+			// If the ICQ UIN contains anything other than digits it's invalid
+			if ($form['icq'] != '' && preg_match('/[^0-9]/', $form['icq']))
+				message($lang_prof_reg['Bad ICQ']);
+
+			break;
+		}
+
+		case 'personality':
+		{
+			$form = extract_elements(array('use_avatar'));
+
+			// Clean up signature from POST
+			$form['signature'] = pun_linebreaks(trim($_POST['signature']));
+
+			// Validate signature
+			if (pun_strlen($form['signature']) > $pun_config['p_sig_length'])
+				message($lang_prof_reg['Sig too long'].' '.$pun_config['p_sig_length'].' '.$lang_prof_reg['characters'].'.');
+			else if (substr_count($form['signature'], "\n") > ($pun_config['p_sig_lines']-1))
+				message($lang_prof_reg['Sig too many lines'].' '.$pun_config['p_sig_lines'].' '.$lang_prof_reg['lines'].'.');
+			else if ($form['signature'] && $pun_config['p_sig_all_caps'] == '0' && strtoupper($form['signature']) == $form['signature'] && $pun_user['g_id'] > PUN_MOD)
+				$form['signature'] = ucwords(strtolower($form['signature']));
+
+			// Validate BBCode syntax
+			if ($pun_config['p_sig_bbcode'] == '1' && strpos($form['signature'], '[') !== false && strpos($form['signature'], ']') !== false)
+			{
+				require PUN_ROOT.'include/parser.php';
+				$form['signature'] = preparse_bbcode($form['signature'], $foo, true);
+			}
+
+			if (!isset($form['use_avatar']) || $form['use_avatar'] != '1') $form['use_avatar'] = '0';
+
+			break;
+		}
+
+		case 'display':
+		{
+			$form = extract_elements(array('disp_topics', 'disp_posts', 'show_smilies', 'show_img', 'show_img_sig', 'show_avatars', 'show_sig', 'style'));
+
+			if ($form['disp_topics'] != '' && intval($form['disp_topics']) < 3) $form['disp_topics'] = 3;
+			if ($form['disp_topics'] != '' && intval($form['disp_topics']) > 75) $form['disp_topics'] = 75;
+			if ($form['disp_posts'] != '' && intval($form['disp_posts']) < 3) $form['disp_posts'] = 3;
+			if ($form['disp_posts'] != '' && intval($form['disp_posts']) > 75) $form['disp_posts'] = 75;
+
+			if (!isset($form['show_smilies']) || $form['show_smilies'] != '1') $form['show_smilies'] = '0';
+			if (!isset($form['show_img']) || $form['show_img'] != '1') $form['show_img'] = '0';
+			if (!isset($form['show_img_sig']) || $form['show_img_sig'] != '1') $form['show_img_sig'] = '0';
+			if (!isset($form['show_avatars']) || $form['show_avatars'] != '1') $form['show_avatars'] = '0';
+			if (!isset($form['show_sig']) || $form['show_sig'] != '1') $form['show_sig'] = '0';
+
+			break;
+		}
+
+		case 'privacy':
+		{
+			$form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));
+
+			$form['email_setting'] = intval($form['email_setting']);
+			if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;
+
+			if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';
+			if (!isset($form['notify_with_post']) || $form['notify_with_post'] != '1') $form['notify_with_post'] = '0';
+
+			// If the save_pass setting has changed, we need to set a new cookie with the appropriate expire date
+			if ($pun_user['id'] == $id && $form['save_pass'] != $pun_user['save_pass'])
+			{
+				$result = $db->query('SELECT password FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user password hash', __FILE__, __LINE__, $db->error());
+				pun_setcookie($id, $db->result($result), ($form['save_pass'] == '1') ? time() + 31536000 : 0);
+			}
+
+			break;
+		}
+
+		default:
+			message($lang_common['Bad request']);
+	}
+
+
+	// Singlequotes around non-empty values and NULL for empty values
+	$temp = array();
+	while (list($key, $input) = @each($form))
+	{
+		$value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL';
+
+		$temp[] = $key.'='.$value;
+	}
+
+	if (empty($temp))
+		message($lang_common['Bad request']);
+	
+	$db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Impossible de modifier le profil utilisateur', __FILE__, __LINE__, $db->error());
+
+	// If we changed the username we have to update some stuff
+	if ($username_updated)
+	{
+		$db->query('UPDATE '.$db->prefix.'posts SET poster=\''.$db->escape($form['username']).'\' WHERE poster_id='.$id) or error('Unable to update posts', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET poster=\''.$db->escape($form['username']).'\' WHERE poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les discussions', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les discussions', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'forums SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'online SET ident=\''.$db->escape($form['username']).'\' WHERE ident=\''.$db->escape($old_username).'\'') or error('Impossible de modifier la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+		// If the user is a moderator or an administrator we have to update the moderator lists
+		$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+		$group_id = $db->result($result);
+
+		if ($group_id < PUN_GUEST)
+		{
+			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+			while ($cur_forum = $db->fetch_assoc($result))
+			{
+				$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
+
+				if (in_array($id, $cur_moderators))
+				{
+					unset($cur_moderators[$old_username]);
+					$cur_moderators[$form['username']] = $id;
+					ksort($cur_moderators);
+
+					$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+				}
+			}
+		}
+	}
+
+	redirect('profile.php?section='.$section.'&amp;id='.$id, $lang_profile['Profile redirect']);
+}
+
+
+
+$result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$user = $db->fetch_assoc($result);
+
+$last_post = format_time($user['last_post']);
+
+if ($user['signature'] != '')
+{
+	require PUN_ROOT.'include/parser.php';
+	$parsed_signature = parse_signature($user['signature']);
+}
+
+
+// View or edit?
+if ($pun_user['id'] != $id &&
+	($pun_user['g_id'] > PUN_MOD ||
+	($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') ||
+	($pun_user['g_id'] == PUN_MOD && $user['g_id'] < PUN_GUEST)))
+{
+	if ($user['email_setting'] == '0' && !$pun_user['is_guest'])
+		$email_field = '<a href="mailto:'.$user['email'].'">'.$user['email'].'</a>';
+	else if ($user['email_setting'] == '1' && !$pun_user['is_guest'])
+		$email_field = '<a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a>';
+	else
+		$email_field = $lang_profile['Private'];
+
+	$user_title_field = get_title($user);
+
+	if ($user['url'] != '')
+	{
+		$user['url'] = pun_htmlspecialchars($user['url']);
+
+		if ($pun_config['o_censoring'] == '1')
+			$user['url'] = censor_words($user['url']);
+
+		$url = '<a href="'.$user['url'].'">'.$user['url'].'</a>';
+	}
+	else
+		$url = $lang_profile['Unknown'];
+
+	if ($pun_config['o_avatars'] == '1')
+	{
+		if ($user['use_avatar'] == '1')
+		{
+			if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.gif'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.gif" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.jpg'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.jpg" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.png'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.png" '.$img_size[3].' alt="" />';
+			else
+				$avatar_field = $lang_profile['No avatar'];
+		}
+		else
+			$avatar_field = $lang_profile['No avatar'];
+	}
+
+	$posts_field = '';
+	if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+		$posts_field = $user['num_posts'];
+	if ($pun_user['g_search'] == '1')
+		$posts_field .= (($posts_field != '') ? ' - ' : '').'<a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a>';
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	define('PUN_ALLOW_INDEX', 1);
+	require PUN_ROOT.'header.php';
+
+?>
+<div id="viewprofile" class="block">
+	<h2><span><?php echo $lang_common['Profile'] ?></span></h2>
+	<div class="box">
+		<div class="fakeform">
+			<div class="inform">
+				<fieldset>
+				<legend><?php echo $lang_profile['Section personal'] ?></legend>
+					<div class="infldset">
+						<dl>
+							<dt><?php echo $lang_common['Username'] ?>: </dt>
+							<dd><?php echo pun_htmlspecialchars($user['username']) ?></dd>
+							<dt><?php echo $lang_common['Title'] ?>: </dt>
+							<dd><?php echo ($pun_config['o_censoring'] == '1') ? censor_words($user_title_field) : $user_title_field; ?></dd>
+							<dt><?php echo $lang_profile['Realname'] ?>: </dt>
+							<dd><?php echo ($user['realname'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['realname']) : $user['realname']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Location'] ?>: </dt>
+							<dd><?php echo ($user['location'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['location']) : $user['location']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Website'] ?>: </dt>
+							<dd><?php echo $url ?>&#160;</dd>
+							<dt><?php echo $lang_common['E-mail'] ?>: </dt>
+							<dd><?php echo $email_field ?></dd>
+						</dl>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+				<legend><?php echo $lang_profile['Section messaging'] ?></legend>
+					<div class="infldset">
+						<dl>
+							<dt><?php echo $lang_profile['Jabber'] ?>: </dt>
+							<dd><?php echo ($user['jabber'] !='') ? pun_htmlspecialchars($user['jabber']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['ICQ'] ?>: </dt>
+							<dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['MSN'] ?>: </dt>
+							<dd><?php echo ($user['msn'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['msn']) : $user['msn']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['AOL IM'] ?>: </dt>
+							<dd><?php echo ($user['aim'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['aim']) : $user['aim']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Yahoo'] ?>: </dt>
+							<dd><?php echo ($user['yahoo'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['yahoo']) : $user['yahoo']) : $lang_profile['Unknown']; ?></dd>
+						</dl>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+				<legend><?php echo $lang_profile['Section personality'] ?></legend>
+					<div class="infldset">
+						<dl>
+<?php if ($pun_config['o_avatars'] == '1'): ?>							<dt><?php echo $lang_profile['Avatar'] ?>: </dt>
+							<dd><?php echo $avatar_field ?></dd>
+<?php endif; ?>							<dt><?php echo $lang_profile['Signature'] ?>: </dt>
+							<dd><div><?php echo isset($parsed_signature) ? $parsed_signature : $lang_profile['No sig']; ?></div></dd>
+						</dl>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+				<legend><?php echo $lang_profile['User activity'] ?></legend>
+					<div class="infldset">
+						<dl>
+<?php if ($posts_field != ''): ?>							<dt><?php echo $lang_common['Posts'] ?>: </dt>
+							<dd><?php echo $posts_field ?></dd>
+<?php endif; ?>							<dt><?php echo $lang_common['Last post'] ?>: </dt>
+							<dd><?php echo $last_post ?></dd>
+							<dt><?php echo $lang_common['Registered'] ?>: </dt>
+							<dd><?php echo format_time($user['registered'], true) ?></dd>
+						</dl>
+						<div class="clearer"></div>
+					</div>
+				</fieldset>
+			</div>
+		</div>
+	</div>
+</div>
+
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+else
+{
+	if (!$section || $section == 'essentials')
+	{
+		if ($pun_user['g_id'] < PUN_GUEST)
+		{
+			if ($pun_user['g_id'] == PUN_ADMIN || $pun_config['p_mod_rename_users'] == '1')
+				$username_field = '<input type="hidden" name="old_username" value="'.pun_htmlspecialchars($user['username']).'" /><label><strong>'.$lang_common['Username'].'</strong><br /><input type="text" name="req_username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25" /><br /></label>'."\n";
+			else
+				$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
+
+			$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label><p><a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a></p>'."\n";
+		}
+		else
+		{
+			$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
+
+			if ($pun_config['o_regs_verify'] == '1')
+				$email_field = '<p>'.$lang_common['E-mail'].': '.$user['email'].'&#160;-&#160;<a href="profile.php?action=change_email&amp;id='.$id.'">'.$lang_profile['Change e-mail'].'</a></p>'."\n";
+			else
+				$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label>'."\n";
+		}
+
+		if ($pun_user['g_id'] == PUN_ADMIN)
+			$posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+		else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+			$posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+		else
+			$posts_field = '<p><a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		$required_fields = array('req_username' => $lang_common['Username'], 'req_email' => $lang_common['E-mail']);
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('essentials');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section essentials'] ?></span></h2>
+		<div class="box">
+			<form id="profile1" method="post" action="profile.php?section=essentials&amp;id=<?php echo $id ?>" onsubmit="return process_form(this)">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Username and pass legend'] ?></legend>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<?php echo $username_field ?>
+<?php if ($pun_user['id'] == $id || $pun_user['g_id'] == PUN_ADMIN || ($user['g_id'] > PUN_MOD && $pun_config['p_mod_change_passwords'] == '1')): ?><p><a href="profile.php?action=change_pass&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Change pass'] ?></a></p>
+<?php endif; ?>					</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_prof_reg['E-mail legend'] ?></legend>
+						<div class="infldset">
+							<?php echo $email_field ?>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
+						<div class="infldset">
+							<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
+							<br /><select name="form[timezone]">
+								<option value="-12"<?php if ($user['timezone'] == -12) echo ' selected="selected"' ?>>-12</option>
+								<option value="-11"<?php if ($user['timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+								<option value="-10"<?php if ($user['timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+								<option value="-9.5"<?php if ($user['timezone'] == -9.5) echo ' selected="selected"' ?>>-09.5</option>
+								<option value="-9"<?php if ($user['timezone'] == -9) echo ' selected="selected"' ?>>-09</option>
+								<option value="-8.5"<?php if ($user['timezone'] == -8.5) echo ' selected="selected"' ?>>-08.5</option>
+								<option value="-8"<?php if ($user['timezone'] == -8) echo ' selected="selected"' ?>>-08 PST</option>
+								<option value="-7"<?php if ($user['timezone'] == -7) echo ' selected="selected"' ?>>-07 MST</option>
+								<option value="-6"<?php if ($user['timezone'] == -6) echo ' selected="selected"' ?>>-06 CST</option>
+								<option value="-5"<?php if ($user['timezone'] == -5) echo ' selected="selected"' ?>>-05 EST</option>
+								<option value="-4"<?php if ($user['timezone'] == -4) echo ' selected="selected"' ?>>-04 AST</option>
+								<option value="-3.5"<?php if ($user['timezone'] == -3.5) echo ' selected="selected"' ?>>-03.5</option>
+								<option value="-3"<?php if ($user['timezone'] == -3) echo ' selected="selected"' ?>>-03 ADT</option>
+								<option value="-2"<?php if ($user['timezone'] == -2) echo ' selected="selected"' ?>>-02</option>
+								<option value="-1"<?php if ($user['timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+								<option value="0"<?php if ($user['timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+								<option value="1"<?php if ($user['timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+								<option value="2"<?php if ($user['timezone'] == 2) echo ' selected="selected"' ?>>+02</option>
+								<option value="3"<?php if ($user['timezone'] == 3) echo ' selected="selected"' ?>>+03</option>
+								<option value="3.5"<?php if ($user['timezone'] == 3.5) echo ' selected="selected"' ?>>+03.5</option>
+								<option value="4"<?php if ($user['timezone'] == 4) echo ' selected="selected"' ?>>+04</option>
+								<option value="4.5"<?php if ($user['timezone'] == 4.5) echo ' selected="selected"' ?>>+04.5</option>
+								<option value="5"<?php if ($user['timezone'] == 5) echo ' selected="selected"' ?>>+05</option>
+								<option value="5.5"<?php if ($user['timezone'] == 5.5) echo ' selected="selected"' ?>>+05.5</option>
+								<option value="6"<?php if ($user['timezone'] == 6) echo ' selected="selected"' ?>>+06</option>
+								<option value="6.5"<?php if ($user['timezone'] == 6.5) echo ' selected="selected"' ?>>+06.5</option>
+								<option value="7"<?php if ($user['timezone'] == 7) echo ' selected="selected"' ?>>+07</option>
+								<option value="8"<?php if ($user['timezone'] == 8) echo ' selected="selected"' ?>>+08</option>
+								<option value="9"<?php if ($user['timezone'] == 9) echo ' selected="selected"' ?>>+09</option>
+								<option value="9.5"<?php if ($user['timezone'] == 9.5) echo ' selected="selected"' ?>>+09.5</option>
+								<option value="10"<?php if ($user['timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+								<option value="10.5"<?php if ($user['timezone'] == 10.5) echo ' selected="selected"' ?>>+10.5</option>
+								<option value="11"<?php if ($user['timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+								<option value="11.5"<?php if ($user['timezone'] == 11.5) echo ' selected="selected"' ?>>+11.5</option>
+								<option value="12"<?php if ($user['timezone'] == 12) echo ' selected="selected"' ?>>+12</option>
+								<option value="13"<?php if ($user['timezone'] == 13) echo ' selected="selected"' ?>>+13</option>
+								<option value="14"<?php if ($user['timezone'] == 14) echo ' selected="selected"' ?>>+14</option>
+							</select>
+							<br /></label>
+<?php
+
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
+
+		// Only display the language selection box if there's more than one language available
+		if (count($languages) > 1)
+		{
+			natsort($languages);
+
+?>
+							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
+							<br /><select name="form[language]">
+<?php
+
+			while (list(, $temp) = @each($languages))
+			{
+				if ($user['language'] == $temp)
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
+				else
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
+			}
+
+?>
+							</select>
+							<br /></label>
+<?php
+
+		}
+
+?>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['User activity'] ?></legend>
+						<div class="infldset">
+							<p><?php echo $lang_common['Registered'] ?>: <?php echo format_time($user['registered'], true); if ($pun_user['g_id'] < PUN_GUEST) echo ' (<a href="moderate.php?get_host='.pun_htmlspecialchars($user['registration_ip']).'">'.pun_htmlspecialchars($user['registration_ip']).'</a>)'; ?></p>
+							<p><?php echo $lang_common['Last post'] ?>: <?php echo $last_post ?></p>
+								<?php echo $posts_field ?>
+<?php if ($pun_user['g_id'] < PUN_GUEST): ?>							<label><?php echo $lang_profile['Admin note'] ?><br />
+							<input id="admin_note" type="text" name="admin_note" value="<?php echo pun_htmlspecialchars($user['admin_note']) ?>" size="30" maxlength="30" /><br /></label>
+						</div>
+<?php endif; ?>					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'personal')
+	{
+		if ($pun_user['g_set_title'] == '1')
+			$title_field = '<label>'.$lang_common['Title'].'&#160;&#160;(<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n";
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('personal');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section personal'] ?></span></h2>
+		<div class="box">
+			<form id="profile2" method="post" action="profile.php?section=personal&amp;id=<?php echo $id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Personal details legend'] ?></legend>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<label><?php echo $lang_profile['Realname'] ?><br /><input type="text" name="form[realname]" value="<?php echo pun_htmlspecialchars($user['realname']) ?>" size="40" maxlength="40" /><br /></label>
+<?php if (isset($title_field)): ?>					<?php echo $title_field ?>
+<?php endif; ?>							<label><?php echo $lang_profile['Location'] ?><br /><input type="text" name="form[location]" value="<?php echo pun_htmlspecialchars($user['location']) ?>" size="30" maxlength="30" /><br /></label>
+							<label><?php echo $lang_profile['Website'] ?><br /><input type="text" name="form[url]" value="<?php echo pun_htmlspecialchars($user['url']) ?>" size="50" maxlength="80" /><br /></label>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'messaging')
+	{
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('messaging');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section messaging'] ?></span></h2>
+		<div class="box">
+			<form id="profile3" method="post" action="profile.php?section=messaging&amp;id=<?php echo $id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Contact details legend'] ?></legend>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<label><?php echo $lang_profile['Jabber'] ?><br /><input id="jabber" type="text" name="form[jabber]" value="<?php echo pun_htmlspecialchars($user['jabber']) ?>" size="40" maxlength="75" /><br /></label>
+							<label><?php echo $lang_profile['ICQ'] ?><br /><input id="icq" type="text" name="form[icq]" value="<?php echo $user['icq'] ?>" size="12" maxlength="12" /><br /></label>
+							<label><?php echo $lang_profile['MSN'] ?><br /><input id="msn" type="text" name="form[msn]" value="<?php echo pun_htmlspecialchars($user['msn']) ?>" size="40" maxlength="50" /><br /></label>
+							<label><?php echo $lang_profile['AOL IM'] ?><br /><input id="aim" type="text" name="form[aim]" value="<?php echo pun_htmlspecialchars($user['aim']) ?>" size="20" maxlength="30" /><br /></label>
+							<label><?php echo $lang_profile['Yahoo'] ?><br /><input id="yahoo" type="text" name="form[yahoo]" value="<?php echo pun_htmlspecialchars($user['yahoo']) ?>" size="20" maxlength="30" /><br /></label>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'personality')
+	{
+		$avatar_field = '<a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Change avatar'].'</a>';
+		if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.gif'))
+			$avatar_format = 'gif';
+		else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.jpg'))
+			$avatar_format = 'jpg';
+		else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.png'))
+			$avatar_format = 'png';
+		else
+			$avatar_field = '<a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Upload avatar'].'</a>';
+
+		// Display the delete avatar link?
+		if ($img_size)
+			$avatar_field .= '&#160;&#160;&#160;<a href="profile.php?action=delete_avatar&amp;id='.$id.'">'.$lang_profile['Delete avatar'].'</a>';
+
+		if ($user['signature'] != '')
+			$signature_preview = '<p>'.$lang_profile['Sig preview'].'</p>'."\n\t\t\t\t\t".'<div class="postsignature">'."\n\t\t\t\t\t\t".'<hr />'."\n\t\t\t\t\t\t".$parsed_signature."\n\t\t\t\t\t".'</div>'."\n";
+		else
+			$signature_preview = '<p>'.$lang_profile['No sig'].'</p>'."\n";
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('personality');
+
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section personality'] ?></span></h2>
+		<div class="box">
+			<form id="profile4" method="post" action="profile.php?section=personality&amp;id=<?php echo $id ?>">
+				<div><input type="hidden" name="form_sent" value="1" /></div>
+<?php if ($pun_config['o_avatars'] == '1'): ?>				<div class="inform">
+					<fieldset id="profileavatar">
+						<legend><?php echo $lang_profile['Avatar legend'] ?></legend>
+						<div class="infldset">
+<?php if (isset($avatar_format)): ?>					<img src="<?php echo $pun_config['o_avatars_dir'].'/'.$id.'.'.$avatar_format ?>" <?php echo $img_size[3] ?> alt="" />
+<?php endif; ?>					<p><?php echo $lang_profile['Avatar info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[use_avatar]" value="1"<?php if ($user['use_avatar'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Use avatar'] ?><br /></label>
+							</div>
+							<p class="clearb"><?php echo $avatar_field ?></p>
+						</div>
+					</fieldset>
+				</div>
+<?php endif; ?>				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Signature legend'] ?></legend>
+						<div class="infldset">
+							<p><?php echo $lang_profile['Signature info'] ?></p>
+							<div class="txtarea">
+								<label><?php echo $lang_profile['Sig max length'] ?>: <?php echo $pun_config['p_sig_length'] ?> / <?php echo $lang_profile['Sig max lines'] ?>: <?php echo $pun_config['p_sig_lines'] ?><br />
+								<textarea name="signature" rows="4" cols="65"><?php echo pun_htmlspecialchars($user['signature']) ?></textarea><br /></label>
+							</div>
+							<ul class="bblinks">
+								<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_sig_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+								<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_sig_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+								<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies_sig'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							</ul>
+							<?php echo $signature_preview ?>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'display')
+	{
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('display');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section display'] ?></span></h2>
+		<div class="box">
+			<form id="profile5" method="post" action="profile.php?section=display&amp;id=<?php echo $id ?>">
+				<div><input type="hidden" name="form_sent" value="1" /></div>
+<?php
+
+		$styles = array();
+		$d = dir(PUN_ROOT.'style');
+		while (($entry = $d->read()) !== false)
+		{
+			if (substr($entry, strlen($entry)-4) == '.css')
+				$styles[] = substr($entry, 0, strlen($entry)-4);
+		}
+		$d->close();
+
+		// Only display the style selection box if there's more than one style available
+		if (count($styles) == 1)
+			echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n";
+		else if (count($styles) > 1)
+		{
+			natsort($styles);
+?>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Style legend'] ?></legend>
+						<div class="infldset">
+							<label><?php echo $lang_profile['Style info'] ?><br />
+
+							<select name="form[style]">
+<?php
+
+			while (list(, $temp) = @each($styles))
+			{
+				if ($user['style'] == $temp)
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
+				else
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
+			}
+
+?>
+							</select>
+							<br /></label>
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+		}
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Post display legend'] ?></legend>
+						<div class="infldset">
+							<p><?php echo $lang_profile['Post display info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[show_smilies]" value="1"<?php if ($user['show_smilies'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show smilies'] ?><br /></label>
+								<label><input type="checkbox" name="form[show_sig]" value="1"<?php if ($user['show_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show sigs'] ?><br /></label>
+<?php if ($pun_config['o_avatars'] == '1'): ?>							<label><input type="checkbox" name="form[show_avatars]" value="1"<?php if ($user['show_avatars'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show avatars'] ?><br /></label>
+<?php endif; ?>								<label><input type="checkbox" name="form[show_img]" value="1"<?php if ($user['show_img'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images'] ?><br /></label>
+								<label><input type="checkbox" name="form[show_img_sig]" value="1"<?php if ($user['show_img_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images sigs'] ?><br /></label>
+							</div>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Pagination legend'] ?></legend>
+						<div class="infldset">
+							<label class="conl"><?php echo $lang_profile['Topics per page'] ?><br /><input type="text" name="form[disp_topics]" value="<?php echo $user['disp_topics'] ?>" size="6" maxlength="3" /><br /></label>
+							<label class="conl"><?php echo $lang_profile['Posts per page'] ?><br /><input type="text" name="form[disp_posts]" value="<?php echo $user['disp_posts'] ?>" size="6" maxlength="3" /><br /></label>
+							<p class="clearb"><?php echo $lang_profile['Paginate info'] ?> <?php echo $lang_profile['Leave blank'] ?></p>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" />  <?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'privacy')
+	{
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('privacy');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section privacy'] ?></span></h2>
+		<div class="box">
+			<form id="profile6" method="post" action="profile.php?section=privacy&amp;id=<?php echo $id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
+							<div class="rbox">
+								<label><input type="radio" name="form[email_setting]" value="0"<?php if ($user['email_setting'] == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
+								<label><input type="radio" name="form[email_setting]" value="1"<?php if ($user['email_setting'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
+								<label><input type="radio" name="form[email_setting]" value="2"<?php if ($user['email_setting'] == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
+							</div>
+							<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[save_pass]" value="1"<?php if ($user['save_pass'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
+							</div>
+							<p><?php echo $lang_profile['Notify full info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[notify_with_post]" value="1"<?php if ($user['notify_with_post'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Notify full'] ?><br /></label>
+							</div>
+						</div>
+					</fieldset>
+				</div>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+	else if ($section == 'admin')
+	{
+		if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
+			message($lang_common['Bad request']);
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		require PUN_ROOT.'header.php';
+
+		generate_profile_menu('admin');
+
+?>
+	<div class="blockform">
+		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section admin'] ?></span></h2>
+		<div class="box">
+			<form id="profile7" method="post" action="profile.php?section=admin&amp;id=<?php echo $id ?>&amp;action=foo">
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+<?php
+
+		if ($pun_user['g_id'] == PUN_MOD)
+		{
+
+?>
+						<legend><?php echo $lang_profile['Delete ban legend'] ?></legend>
+						<div class="infldset">
+							<p><input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" /></p>
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+		}
+		else
+		{
+			if ($pun_user['id'] != $id)  
+			{  
+
+?>
+						<legend><?php echo $lang_profile['Group membership legend'] ?></legend>
+						<div class="infldset">
+							<select id="group_id" name="group_id">
+<?php
+
+					$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
+
+					while ($cur_group = $db->fetch_assoc($result))  
+					{  
+						if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == ''))
+							echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+						else  
+							echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+					}  
+
+?>
+							</select>
+							<input type="submit" name="update_group_membership" value="<?php echo $lang_profile['Save'] ?>" />
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+<?php  
+
+			}
+
+?>
+						<legend><?php echo $lang_profile['Delete ban legend'] ?></legend>
+						<div class="infldset">
+							<input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" />&#160;&#160;<input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" />
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+			if ($user['g_id'] == PUN_MOD || $user['g_id'] == PUN_ADMIN)
+			{
+
+?>
+				<div class="inform">
+					<fieldset>
+						<legend><?php echo $lang_profile['Set mods legend'] ?></legend>
+						<div class="infldset">
+							<p><?php echo $lang_profile['Moderator in info'] ?></p>
+<?php
+
+				$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.moderators FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+				$cur_category = 0;
+				while ($cur_forum = $db->fetch_assoc($result))
+				{
+					if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+					{
+						if ($cur_category)
+							echo "\n\t\t\t\t\t\t\t\t".'</div>';
+
+						if ($cur_category != 0)
+							echo "\n\t\t\t\t\t\t\t".'</div>'."\n";
+
+						echo "\t\t\t\t\t\t\t".'<div class="conl">'."\n\t\t\t\t\t\t\t\t".'<p><strong>'.$cur_forum['cat_name'].'</strong></p>'."\n\t\t\t\t\t\t\t\t".'<div class="rbox">';
+						$cur_category = $cur_forum['cid'];
+					}
+
+					$moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
+
+					echo "\n\t\t\t\t\t\t\t\t\t".'<label><input type="checkbox" name="moderator_in['.$cur_forum['fid'].']" value="1"'.((in_array($id, $moderators)) ? ' checked="checked"' : '').' />'.pun_htmlspecialchars($cur_forum['forum_name']).'<br /></label>'."\n";
+				}
+
+?>
+								</div>
+							</div>
+							<br class="clearb" /><input type="submit" name="update_forums" value="<?php echo $lang_profile['Update forums'] ?>" />
+						</div>
+					</fieldset>
+				</div>
+<?php
+
+			}
+		}
+
+?>
+			</form>
+		</div>
+	</div>
+<?php
+
+	}
+
+?>
+	<div class="clearer"></div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
Index: /branches/rsr.v5.1.dev/web/punbb/pun_integration.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/pun_integration.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/pun_integration.php	(revision 1)
@@ -0,0 +1,11 @@
+<?php
+  
+  # traitement de la requÃÂšte
+  require $env->path("app")."main.php";
+
+  # affichage
+  if($env->out_file_exists("index.php")) require $env->out_file("index.php");
+
+  exit;
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/register.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/register.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/register.php	(revision 1)
@@ -0,0 +1,395 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+// If we are logged in, we shouldn't be here
+if (!$pun_user['is_guest'])
+{
+	header('Location: index.php');
+	exit;
+}
+
+// Load the register.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
+
+// Load the register.php/profile.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
+
+if ($pun_config['o_regs_allow'] == '0')
+	message($lang_register['No new regs']);
+
+
+// User pressed the cancel button
+if (isset($_GET['cancel']))
+	redirect('index.php', $lang_register['Reg cancel redirect']);
+
+
+else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
+{
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
+	require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
+	<div class="box">
+		<form method="get" action="register.php">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_register['Rules legend'] ?></legend>
+					<div class="infldset">
+						<p><?php echo $pun_config['o_rules_message'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
+		</form>
+	</div>
+</div>
+<?php
+
+	require PUN_ROOT.'footer.php';
+}
+
+
+else if (isset($_POST['form_sent']))
+{
+	$username = pun_trim($_POST['req_username']);
+	$email1 = strtolower(trim($_POST['req_email1']));
+
+	if ($pun_config['o_regs_verify'] == '1')
+	{
+		$email2 = strtolower(trim($_POST['req_email2']));
+
+		$password1 = random_pass(8);
+		$password2 = $password1;
+	}
+	else
+	{
+		$password1 = trim($_POST['req_password1']);
+		$password2 = trim($_POST['req_password2']);
+	}
+
+	// Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
+	$username = preg_replace('#\s+#s', ' ', $username);
+
+	// Validate username and passwords
+	if (strlen($username) < 2)
+		message($lang_prof_reg['Username too short']);
+	else if (pun_strlen($username) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
+	    message($lang_common['Bad request']);
+	else if (strlen($password1) < 4)
+		message($lang_prof_reg['Pass too short']);
+	else if ($password1 != $password2)
+		message($lang_prof_reg['Pass not match']);
+	else if (!strcasecmp($username, 'invitÃ©') || !strcasecmp($username, $lang_common['Guest']))
+		message($lang_prof_reg['Username guest']);
+	else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+		message($lang_prof_reg['Username IP']);
+	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
+		message($lang_prof_reg['Username reserved chars']);
+	else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+		message($lang_prof_reg['Username BBCode']);
+
+	// Check username for any censored words
+	if ($pun_config['o_censoring'] == '1')
+	{
+		// If the censored username differs from the username
+		if (censor_words($username) != $username)
+			message($lang_register['Username censor']);
+	}
+
+	// Check that the username (or a too similar username) is not already registered
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+
+	if ($db->num_rows($result))
+	{
+		$busy = $db->result($result);
+		message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
+	}
+
+
+	// Validate e-mail
+	require PUN_ROOT.'include/email.php';
+
+	if (!is_valid_email($email1))
+		message($lang_common['Invalid e-mail']);
+	else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
+		message($lang_register['E-mail not match']);
+
+	// Check it it's a banned e-mail address
+	if (is_banned_email($email1))
+	{
+		if ($pun_config['p_allow_banned_email'] == '0')
+			message($lang_prof_reg['Banned e-mail']);
+
+		$banned_email = true;	// Used later when we send an alert e-mail
+	}
+	else
+		$banned_email = false;
+
+	// Check if someone else already has registered with that e-mail address
+	$dupe_list = array();
+
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+	{
+		if ($pun_config['p_allow_dupe_email'] == '0')
+			message($lang_prof_reg['Dupe e-mail']);
+
+		while ($cur_dupe = $db->fetch_assoc($result))
+			$dupe_list[] = $cur_dupe['username'];
+	}
+
+	$timezone = intval($_POST['timezone']);
+	$language = isset($_POST['language']) ? $_POST['language'] : $pun_config['o_default_lang'];
+	$save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
+
+	$email_setting = intval($_POST['email_setting']);
+	if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
+
+	// Insert the new user into the database. We do this now to get the last inserted id for later use.
+	$now = time();
+
+	$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
+	$password_hash = pun_hash($password1);
+
+	// Add the user
+	$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Impossible de crÃ©er un utilisateur', __FILE__, __LINE__, $db->error());
+	$new_uid = $db->insert_id();
+
+
+	// If we previously found out that the e-mail was banned
+	if ($banned_email && $pun_config['o_mailing_list'] != '')
+	{
+		$mail_subject = 'Alerte - Adresse e-mail bannis dÃ©tectÃ©e';
+		$mail_message = 'L\'utilisateur \''.$username.'\' s\est inscrit avec l\'adresse e-mail bannis : '.$email1."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// If we previously found out that the e-mail was a dupe
+	if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
+	{
+		$mail_subject = 'Alerte - Adresse e-mail en doublon dÃ©tÃ©ctÃ©e';
+		$mail_message = 'L\'utilisateur \''.$username.'\' s\'est inscrit avec l\'adresse qui appartient Ã©galement Ã  : '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// Should we alert people on the admin mailing list that a new user has registered?
+	if ($pun_config['o_regs_report'] == '1')
+	{
+		$mail_subject = 'Alerte - Nouvelle inscription';
+		$mail_message = 'L\'utilisateur \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// Must the user verify the registration or do we log him/her in right now?
+	if ($pun_config['o_regs_verify'] == '1')
+	{
+		// Load the "welcome" template
+		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
+
+		// The first row contains the subject
+		$first_crlf = strpos($mail_tpl, "\n");
+		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+		$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+		$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
+		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+		$mail_message = str_replace('<username>', $username, $mail_message);
+		$mail_message = str_replace('<password>', $password1, $mail_message);
+		$mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+		pun_mail($email1, $mail_subject, $mail_message);
+
+		message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+	}
+
+	pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);
+
+	redirect(isset($_GET["from"]) ? urldecode($_GET["from"]) : "index.php", $lang_register['Reg complete']);
+}
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
+$required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
+$focus_element = array('register', 'req_username');
+require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_register['Register'] ?></span></h2>
+	<div class="box">
+  <form id="register" method="post" action="register.php?action=register<?php echo isset($_GET["from"]) ? "&from=".$_GET["from"] : ""; ?>"
+                      onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
+			<div class="inform">
+				<div class="forminfo">
+					<h3><?php echo $lang_common['Important information'] ?></h3>
+					<p><?php echo $lang_register['Desc 1'] ?></p>
+					<p><?php echo $lang_register['Desc 2'] ?></p>
+				</div>
+				<fieldset>
+					<legend><?php echo $lang_register['Username legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="form_sent" value="1" />
+						<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
+					</div>
+				</fieldset>
+			</div>
+<?php if ($pun_config['o_regs_verify'] == '0'): ?>			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_register['Pass legend 1'] ?></legend>
+					<div class="infldset">
+						<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
+						<p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+<?php endif; ?>			<div class="inform">
+				<fieldset>
+					<legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
+					<div class="infldset">
+<?php if ($pun_config['o_regs_verify'] == '1'): ?>			<p><?php echo $lang_register['E-mail info'] ?></p>
+<?php endif; ?>					<label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
+						<input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
+<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
+						<input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
+<?php endif; ?>					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
+					<div class="infldset">
+						<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
+						<br /><select id="time_zone" name="timezone">
+							<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
+							<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+							<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+							<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
+							<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
+							<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
+							<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
+							<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
+							<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
+							<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
+							<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
+							<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
+							<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
+							<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
+							<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+							<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+							<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+							<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
+							<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
+							<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
+							<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
+							<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
+							<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
+							<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
+							<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
+							<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
+							<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
+							<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
+							<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
+							<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
+							<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+							<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
+							<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+							<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
+							<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
+							<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
+							<option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
+						</select>
+						<br /></label>
+<?php
+
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
+
+		// Only display the language selection box if there's more than one language available
+		if (count($languages) > 1)
+		{
+
+?>
+							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
+							<br /><select name="language">
+<?php
+
+			while (list(, $temp) = @each($languages))
+			{
+				if ($pun_config['o_default_lang'] == $temp)
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
+				else
+					echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
+			}
+
+?>
+							</select>
+							<br /></label>
+<?php
+
+		}
+?>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
+					<div class="infldset">
+						<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
+						<div class="rbox">
+							<label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
+							<label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
+							<label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
+						</div>
+						<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
+						<div class="rbox">
+							<label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
+						</div>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
+		</form>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/rss.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/rss.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/rss.php	(revision 1)
@@ -0,0 +1,210 @@
+<?php
+/**
+  * BLOG:CMS: PHP/MySQL Personal Content Management System 
+  * http://blogcms.com/
+  * http://forum.blogcms.com/
+  *
+  * 2003-2004, (c) Radek HULAN 
+  * http://hulan.cz/
+  *
+  * Mod by Bert Garcia for PunBB 1.2.1
+  * http://nupusi.com
+  *
+  * Additional changes Copyright 2005 by Alex King
+  * Now creates feeds for categories, forums, topics
+  * http://www.alexking.org/software/
+  *
+  * Please see the enclosed readme.txt file for usage
+  *
+  * 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 2
+  * 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. 
+// *****************************************************************
+
+**/
+
+
+define('PUN_ROOT', './');
+@include PUN_ROOT.'config.php';
+
+// If PUN isn't defined, config.php is missing or corrupt
+if (!defined('PUN'))
+	exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.');
+
+// Disable error reporting for uninitialized variables
+error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
+// Turn off magic_quotes_runtime
+set_magic_quotes_runtime(0);
+
+
+// Load the functions script
+require PUN_ROOT.'include/functions.php';
+require PUN_ROOT.'include/parser.php';
+
+// Load DB abstraction layer and try to connect
+require PUN_ROOT.'include/dblayer/common_db.php';
+
+// Get the forum config
+$result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
+while ($cur_config_item = $db->fetch_row($result))
+	$pun_config[$cur_config_item[0]] = $cur_config_item[1];
+
+// Make sure we (guests) have permission to read the forums
+$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
+if ($db->result($result) == '0')
+	exit('No permission');
+
+
+// Attempt to load the common language file
+@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
+if (!isset($lang_common)) exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.');
+
+// parse RSS
+ob_start();
+
+// make feed
+/* original query
+$result = $db->query(
+	"select p.id as id, p.message as message, p.posted as postposted, t.subject as subject ".
+	"from ".$db->prefix."posts as p, ".$db->prefix."topics as t ".
+	"where p.topic_id=t.id ".
+	"order by postposted desc ".
+	"limit 0,15") 
+	or error('Unable to fetch forum posts', __FILE__, __LINE__, $db->error());;
+*/
+
+if (!empty($_GET["cid"])) {
+	$where = "	AND c.id = '".intval($_GET['cid'])."'";
+	$title = 'cid';
+}
+else if (!empty($_GET["fid"])) {
+	$where = "	AND f.id = '".intval($_GET['fid'])."'";
+	$title = 'fid';
+}
+else if (!empty($_GET["tid"])) {
+	$where = "	AND t.id = '".intval($_GET['tid'])."'";
+	$title = 'tid';
+}
+else {
+	$where = '';
+	$title = '';
+}
+$query ="
+	SELECT p.id AS id, p.message AS message, p.posted AS postposted, t.subject AS subject, f.forum_name, c.cat_name 
+	FROM ".$db->prefix."posts p
+	LEFT JOIN ".$db->prefix."topics t 
+	ON p.topic_id=t.id 
+	INNER JOIN ".$db->prefix."forums AS f 
+	ON f.id=t.forum_id 
+	LEFT JOIN ".$db->prefix."categories AS c 
+	ON f.cat_id = c.id
+	LEFT JOIN ".$db->prefix."forum_perms AS fp 
+	ON (
+		fp.forum_id=f.id 
+		AND fp.group_id=3
+	)
+	WHERE (
+		fp.read_forum IS NULL 
+		OR fp.read_forum=0
+		OR fp.read_forum=1
+	) 
+	$where 
+	ORDER BY postposted DESC 
+	LIMIT 0,15";
+$result = $db->query($query) or error('Unable to fetch forum posts', __FILE__, __LINE__, $db->error());
+$i = 0;
+while ($cur = $db->fetch_assoc($result))
+{ if($i == 0) { putHeader($cur, $title); $i++; }
+  putPost($cur);
+}
+putEnd();
+
+// get feed into $feed
+$feed = ob_get_contents();
+ob_end_clean();
+
+header ("Content-type: application/rss+xml");
+echo $feed;
+
+/* entity to unicode decimal value */
+function entity_to_decimal_value($string){
+	static $entities_dec = false;
+	if (!is_array($entities_dec)) {
+		$entities_named	   = array("&nbsp;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&shy;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&yacute;","&thorn;","&yuml;","&fnof;","&Alpha;","&Beta;","&Gamma;","&Delta;","&Epsilon;","&Zeta;","&Eta;","&Theta;","&Iota;","&Kappa;","&Lambda;","&Mu;","&Nu;","&Xi;","&Omicron;","&Pi;","&Rho;","&Sigma;","&Tau;","&Upsilon;","&Phi;","&Chi;","&Psi;","&Omega;","&alpha;","&beta;","&gamma;","&delta;","&epsilon;","&zeta;","&eta;","&theta;","&iota;","&kappa;","&lambda;","&mu;","&nu;","&xi;","&omicron;","&pi;","&rho;","&sigmaf;","&sigma;","&tau;","&upsilon;","&phi;","&chi;","&psi;","&omega;","&thetasym;","&upsih;","&piv;","&bull;","&hellip;","&prime;","&Prime;","&oline;","&frasl;","&weierp;","&image;","&real;","&trade;","&alefsym;","&larr;","&uarr;","&rarr;","&darr;","&harr;","&crarr;","&lArr;","&uArr;","&rArr;","&dArr;","&hArr;","&forall;","&part;","&exist;","&empty;","&nabla;","&isin;","&notin;","&ni;","&prod;","&sum;","&minus;","&lowast;","&radic;","&prop;","&infin;","&ang;","&and;","&or;","&cap;","&cup;","&int;","&there4;","&sim;","&cong;","&asymp;","&ne;","&equiv;","&le;","&ge;","&sub;","&sup;","&nsub;","&sube;","&supe;","&oplus;","&otimes;","&perp;","&sdot;","&lceil;","&rceil;","&lfloor;","&rfloor;","&lang;","&rang;","&loz;","&spades;","&clubs;","&hearts;","&diams;","&quot;","&amp;","&lt;","&gt;","&OElig;","&oelig;","&Scaron;","&scaron;","&Yuml;","&circ;","&tilde;","&ensp;","&emsp;","&thinsp;","&zwnj;","&zwj;","&lrm;","&rlm;","&ndash;","&mdash;","&lsquo;","&rsquo;","&sbquo;","&ldquo;","&rdquo;","&bdquo;","&dagger;","&Dagger;","&permil;","&lsaquo;","&rsaquo;","&euro;","&apos;");
+		$entities_decimal	 = array("&#160;","&#161;","&#162;","&#163;","&#164;","&#165;","&#166;","&#167;","&#168;","&#169;","&#170;","&#171;","&#172;","&#173;","&#174;","&#175;","&#176;","&#177;","&#178;","&#179;","&#180;","&#181;","&#182;","&#183;","&#184;","&#185;","&#186;","&#187;","&#188;","&#189;","&#190;","&#191;","&#192;","&#193;","&#194;","&#195;","&#196;","&#197;","&#198;","&#199;","&#200;","&#201;","&#202;","&#203;","&#204;","&#205;","&#206;","&#207;","&#208;","&#209;","&#210;","&#211;","&#212;","&#213;","&#214;","&#215;","&#216;","&#217;","&#218;","&#219;","&#220;","&#221;","&#222;","&#223;","&#224;","&#225;","&#226;","&#227;","&#228;","&#229;","&#230;","&#231;","&#232;","&#233;","&#234;","&#235;","&#236;","&#237;","&#238;","&#239;","&#240;","&#241;","&#242;","&#243;","&#244;","&#245;","&#246;","&#247;","&#248;","&#249;","&#250;","&#251;","&#252;","&#253;","&#254;","&#255;","&#402;","&#913;","&#914;","&#915;","&#916;","&#917;","&#918;","&#919;","&#920;","&#921;","&#922;","&#923;","&#924;","&#925;","&#926;","&#927;","&#928;","&#929;","&#931;","&#932;","&#933;","&#934;","&#935;","&#936;","&#937;","&#945;","&#946;","&#947;","&#948;","&#949;","&#950;","&#951;","&#952;","&#953;","&#954;","&#955;","&#956;","&#957;","&#958;","&#959;","&#960;","&#961;","&#962;","&#963;","&#964;","&#965;","&#966;","&#967;","&#968;","&#969;","&#977;","&#978;","&#982;","&#8226;","&#8230;","&#8242;","&#8243;","&#8254;","&#8260;","&#8472;","&#8465;","&#8476;","&#8482;","&#8501;","&#8592;","&#8593;","&#8594;","&#8595;","&#8596;","&#8629;","&#8656;","&#8657;","&#8658;","&#8659;","&#8660;","&#8704;","&#8706;","&#8707;","&#8709;","&#8711;","&#8712;","&#8713;","&#8715;","&#8719;","&#8721;","&#8722;","&#8727;","&#8730;","&#8733;","&#8734;","&#8736;","&#8743;","&#8744;","&#8745;","&#8746;","&#8747;","&#8756;","&#8764;","&#8773;","&#8776;","&#8800;","&#8801;","&#8804;","&#8805;","&#8834;","&#8835;","&#8836;","&#8838;","&#8839;","&#8853;","&#8855;","&#8869;","&#8901;","&#8968;","&#8969;","&#8970;","&#8971;","&#9001;","&#9002;","&#9674;","&#9824;","&#9827;","&#9829;","&#9830;","&#34;","&#38;","&#60;","&#62;","&#338;","&#339;","&#352;","&#353;","&#376;","&#710;","&#732;","&#8194;","&#8195;","&#8201;","&#8204;","&#8205;","&#8206;","&#8207;","&#8211;","&#8212;","&#8216;","&#8217;","&#8218;","&#8220;","&#8221;","&#8222;","&#8224;","&#8225;","&#8240;","&#8249;","&#8250;","&#8364;","&#39;");
+		if (function_exists('array_combine')) 
+			$entities_dec=array_combine($entities_named,$entities_decimal);
+		else {
+			$i=0;
+			foreach ($entities_named as $_entities_named) $entities_dec[$_entities_named]=$entities_decimal[$i++];
+		}
+	}
+	return preg_replace( "/&[A-Za-z]+;/", " ", strtr($string,$entities_dec) );
+}
+
+function encode_xml($data){
+	// line breaks
+	$data=str_replace('<br(.*?)>',"\n",$data);
+	// ending html tags into line breaks
+	$data=preg_replace("/<\/(pre|ul|li|p|table|tr)>/","\n",$data);
+	// remove other html tags
+	$data=preg_replace("/<(.*?)>/","",$data);
+	// remove multiple newlines
+	$data=preg_replace("/\n\n+/","\n\n",$data);
+	return entity_to_decimal_value($data);
+}
+
+function putHeader($cur, $title) { 
+	switch ($title) {
+		case "cid":
+			$title = ' : '.$cur['cat_name'];
+			break;
+		case "fid":
+			$title = ' : '.$cur['cat_name'].' : '.$cur['forum_name'];
+			break;
+		case "tid":
+			$title = ' : '.$cur['cat_name'].' : '.$cur['forum_name'].' : '.$cur['subject'];
+			break;
+		default:
+			$title = '';
+			break;
+	}
+	global $lang_common,$pun_config;
+	echo '<'.'?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?'.'>'."\n";
+	echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
+	echo "<channel>\n";
+        echo "<atom:link href=\"http://www.revolutionsoundrecords.org/punbb/rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n";
+	echo "<title>".entity_to_decimal_value(htmlspecialchars($pun_config['o_board_title'].$title))."</title>\n";
+	echo "<link>".$pun_config['o_base_url']."</link>\n";
+	echo "<description>".entity_to_decimal_value(htmlspecialchars($rss_description.' '.$pun_config['o_board_title']))."</description>\n";
+	echo "<pubDate>".strval(date("r",$cur['postposted']))."</pubDate>\n";
+	echo "<lastBuildDate>".strval(date("r",$cur['postposted']))."</lastBuildDate>\n";
+} 
+
+function putPost($cur) {
+	global $pun_config;
+	echo "<item>\n";
+	echo "<title>".entity_to_decimal_value(htmlspecialchars($cur['subject'].' in '.$cur['cat_name'].' : '.$cur['forum_name']))."</title>\n";
+	$link = $pun_config['o_base_url'].'/viewtopic.php?pid='.strval($cur['id']).'#'.strval($cur['id']);
+	echo "<link>".entity_to_decimal_value(htmlspecialchars($link))."</link>\n";
+	echo '<guid isPermaLink="false">'.strval($cur['id']).'@'.$pun_config['o_base_url'].'</guid>'."\n";
+	$data = "Topic: ".parse_message($cur['subject'],0)."\n\nMessage: ".parse_message($cur['message'],0);
+	echo "<description>".encode_xml($data)."</description>\n";
+	echo "<pubDate>".strval(date("r",$cur['postposted']))."</pubDate>\n";
+	echo "</item>\n";
+}
+
+
+function putEnd() {
+	echo "</channel>\n";
+	echo "</rss>\n";
+} 
+
+?>
Index: /branches/rsr.v5.1.dev/web/punbb/search.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/search.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/search.php	(revision 1)
@@ -0,0 +1,781 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// The contents of this file are very much inspired by the file search.php
+// from the phpBB Group forum software phpBB2 (http://www.phpbb.com).
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+// Load the search.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/search.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+else if ($pun_user['g_search'] == '0')
+	message($lang_search['No search permission']);
+
+
+// Detect two byte character sets
+$multibyte = (isset($lang_common['lang_multibyte']) && $lang_common['lang_multibyte']) ? true : false;
+
+
+// Figure out what to do :-)
+if (isset($_GET['action']) || isset($_GET['search_id']))
+{
+	$action = (isset($_GET['action'])) ? $_GET['action'] : null;
+	$forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1;
+	$sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC';
+	if (isset($search_id)) unset($search_id);
+
+	// If a search_id was supplied
+	if (isset($_GET['search_id']))
+	{
+		$search_id = intval($_GET['search_id']);
+		if ($search_id < 1)
+			message($lang_common['Bad request']);
+	}
+	// If it's a regular search (keywords and/or author)
+	else if ($action == 'search')
+	{
+		$keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null;
+		$author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null;
+		
+		if (preg_match('#^[\*%]+$#', $keywords) || strlen(str_replace(array('*', '%'), '', $keywords)) < 3)
+			$keywords = '';
+
+		if (preg_match('#^[\*%]+$#', $author) || strlen(str_replace(array('*', '%'), '', $author)) < 3)
+			$author = '';
+
+		if (!$keywords && !$author)
+			message($lang_search['No terms']);
+
+		if ($author)
+			$author = str_replace('*', '%', $author);
+
+		$show_as = (isset($_GET['show_as'])) ? $_GET['show_as'] : 'posts';
+		$sort_by = (isset($_GET['sort_by'])) ? intval($_GET['sort_by']) : null;
+		$search_in = (!isset($_GET['search_in']) || $_GET['search_in'] == 'all') ? 0 : (($_GET['search_in'] == 'message') ? 1 : -1);
+	}
+	// If it's a user search (by id)
+	else if ($action == 'show_user')
+	{
+		$user_id = intval($_GET['user_id']);
+		if ($user_id < 2)
+			message($lang_common['Bad request']);
+	}
+	else
+	{
+		if ($action != 'show_new' && $action != 'show_24h' && $action != 'show_unanswered' && $action != 'show_subscriptions')
+			message($lang_common['Bad request']);
+	}
+
+
+	// If a valid search_id was supplied we attempt to fetch the search results from the db
+	if (isset($search_id))
+	{
+		$ident = ($pun_user['is_guest']) ? get_remote_address() : $pun_user['username'];
+
+		$result = $db->query('SELECT search_data FROM '.$db->prefix.'search_cache WHERE id='.$search_id.' AND ident=\''.$db->escape($ident).'\'') or error('Impossible de retrouver les rÃ©sultats de la recherche', __FILE__, __LINE__, $db->error());
+		if ($row = $db->fetch_assoc($result))
+		{
+			$temp = unserialize($row['search_data']);
+
+			$search_results = $temp['search_results'];
+			$num_hits = $temp['num_hits'];
+			$sort_by = $temp['sort_by'];
+			$sort_dir = $temp['sort_dir'];
+			$show_as = $temp['show_as'];
+
+			unset($temp);
+		}
+		else
+			message($lang_search['No hits']);
+	}
+	else
+	{
+		$keyword_results = $author_results = array();
+
+		// Search a specific forum?
+		$forum_sql = ($forum != -1) ? ' AND t.forum_id = '.$forum : '';
+
+		if (!empty($author) || !empty($keywords))
+		{
+			// If it's a search for keywords
+			if ($keywords)
+			{
+				$stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt');
+				$stopwords = array_map('trim', $stopwords);
+
+				// Are we searching for multibyte charset text?
+				if ($multibyte)
+				{
+					// Strip out excessive whitespace
+					$keywords = trim(preg_replace('#\s+#', ' ', $keywords));
+
+					$keywords_array = explode(' ', $keywords);
+				}
+				else
+				{
+					// Filter out non-alphabetical chars
+					$noise_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!', 'Â€');
+					$noise_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ',  ' ', ' ', ' ');
+					$keywords = str_replace($noise_match, $noise_replace, $keywords);
+
+					// Strip out excessive whitespace
+					$keywords = trim(preg_replace('#\s+#', ' ', $keywords));
+
+					// Fill an array with all the words
+					$keywords_array = explode(' ', $keywords);
+
+					if (empty($keywords_array))
+						message($lang_search['No hits']);
+
+					while (list($i, $word) = @each($keywords_array))
+					{
+						$num_chars = pun_strlen($word);
+
+						if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
+							unset($keywords_array[$i]);
+					}
+
+					// Should we search in message body or topic subject specifically?
+					$search_in_cond = ($search_in) ? (($search_in > 0) ? ' AND m.subject_match = 0' : ' AND m.subject_match = 1') : '';
+				}
+
+				$word_count = 0;
+				$match_type = 'and';
+				@reset($keywords_array);
+				while (list(, $cur_word) = @each($keywords_array))
+				{
+					switch ($cur_word)
+					{
+						case 'and':
+						case 'or':
+						case 'not':
+							$match_type = $cur_word;
+							break;
+
+						default:
+						{
+							// Are we searching for multibyte charset text?
+							if ($multibyte)
+							{
+								$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
+								$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
+
+								if ($search_in > 0)
+									$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
+								else if ($search_in < 0)
+									$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
+								else
+									$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
+							}
+							else
+							{
+								$cur_word = str_replace('*', '%', $cur_word);
+								$sql = 'SELECT m.post_id FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON m.word_id = w.id WHERE w.word LIKE \''.$cur_word.'\''.$search_in_cond;
+							}
+
+							$result = $db->query($sql, true) or error('Impossible de rechercher les messages', __FILE__, __LINE__, $db->error());
+
+							$row = array();
+							while ($temp = $db->fetch_row($result))
+							{
+								$row[$temp[0]] = 1;
+
+								if (!$word_count)
+									$result_list[$temp[0]] = 1;
+								else if ($match_type == 'or')
+									$result_list[$temp[0]] = 1;
+								else if ($match_type == 'not')
+									$result_list[$temp[0]] = 0;
+							}
+
+							if ($match_type == 'and' && $word_count)
+							{
+								@reset($result_list);
+								while (list($post_id,) = @each($result_list))
+								{
+									if (!isset($row[$post_id]))
+										$result_list[$post_id] = 0;
+								}
+							}
+
+							++$word_count;
+							$db->free_result($result);
+
+							break;
+						}
+					}
+				}
+
+				@reset($result_list);
+				while (list($post_id, $matches) = @each($result_list))
+				{
+					if ($matches)
+						$keyword_results[] = $post_id;
+				}
+
+				unset($result_list);
+			}
+
+			// If it's a search for author name (and that author name isn't Guest)
+			if ($author && strcasecmp($author, 'Guest') && strcasecmp($author, $lang_common['Guest']))
+			{
+				switch ($db_type)
+				{
+					case 'pgsql':
+						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username ILIKE \''.$db->escape($author).'\'') or error('Impossible de retrouver les membres', __FILE__, __LINE__, $db->error());
+						break;
+
+					default:
+						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username LIKE \''.$db->escape($author).'\'') or error('Impossible de retrouver les membres', __FILE__, __LINE__, $db->error());
+						break;
+				}
+
+				if ($db->num_rows($result))
+				{
+					$user_ids = '';
+					while ($row = $db->fetch_row($result))
+						$user_ids .= (($user_ids != '') ? ',' : '').$row[0];
+
+					$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE poster_id IN('.$user_ids.')') or error('Impossible de retrouver la liste des messages correspondants', __FILE__, __LINE__, $db->error());
+
+					$search_ids = array();
+					while ($row = $db->fetch_row($result))
+						$author_results[] = $row[0];
+
+					$db->free_result($result);
+				}
+			}
+
+
+			if ($author && $keywords)
+			{
+				// If we searched for both keywords and author name we want the intersection between the results
+				$search_ids = array_intersect($keyword_results, $author_results);
+				unset($keyword_results, $author_results);
+			}
+			else if ($keywords)
+				$search_ids = $keyword_results;
+			else
+				$search_ids = $author_results;
+
+			$num_hits = count($search_ids);
+			if (!$num_hits)
+				message($lang_search['No hits']);
+
+
+			if ($show_as == 'topics')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN('.implode(',', $search_ids).')'.$forum_sql.' GROUP BY t.id', true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+				$search_ids = array();
+				while ($row = $db->fetch_row($result))
+					$search_ids[] = $row[0];
+
+				$db->free_result($result);
+
+				$num_hits = count($search_ids);
+			}
+			else
+			{
+				$result = $db->query('SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN('.implode(',', $search_ids).')'.$forum_sql, true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+				$search_ids = array();
+				while ($row = $db->fetch_row($result))
+					$search_ids[] = $row[0];
+
+				$db->free_result($result);
+
+				$num_hits = count($search_ids);
+			}
+		}
+		else if ($action == 'show_new' || $action == 'show_24h' || $action == 'show_user' || $action == 'show_subscriptions' || $action == 'show_unanswered')
+		{
+			// If it's a search for new posts
+			if ($action == 'show_new')
+			{
+				if ($pun_user['is_guest'])
+					message($lang_common['No permission']);
+
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit']) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+				$num_hits = $db->num_rows($result);
+
+				if (!$num_hits)
+					message($lang_search['No new posts']);
+			}
+			// If it's a search for todays posts
+			else if ($action == 'show_24h')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400)) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+				$num_hits = $db->num_rows($result);
+
+				if (!$num_hits)
+					message($lang_search['No recent posts']);
+			}
+			// If it's a search for posts by a specific user ID
+			else if ($action == 'show_user')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' GROUP BY t.id') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+				$num_hits = $db->num_rows($result);
+
+				if (!$num_hits)
+					message($lang_search['No user posts']);
+			}
+			// If it's a search for subscribed topics
+			else if ($action == 'show_subscriptions')
+			{
+				if ($pun_user['is_guest'])
+					message($lang_common['Bad request']);
+
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1)') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+				$num_hits = $db->num_rows($result);
+
+				if (!$num_hits)
+					message($lang_search['No subscriptions']);
+			}
+			// If it's a search for unanswered posts
+			else
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+				$num_hits = $db->num_rows($result);
+
+				if (!$num_hits)
+					message($lang_search['No unanswered']);
+			}
+
+			// We want to sort things after last post
+			$sort_by = 4;
+
+			$search_ids = array();
+			while ($row = $db->fetch_row($result))
+				$search_ids[] = $row[0];
+
+			$db->free_result($result);
+
+			$show_as = 'topics';
+		}
+		else
+			message($lang_common['Bad request']);
+
+
+		// Prune "old" search results
+		$old_searches = array();
+		$result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Impossible de retrouver la liste de utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+
+		if ($db->num_rows($result))
+		{
+			while ($row = $db->fetch_row($result))
+				$old_searches[] = '\''.$db->escape($row[0]).'\'';
+
+			$db->query('DELETE FROM '.$db->prefix.'search_cache WHERE ident NOT IN('.implode(',', $old_searches).')') or error('Impossible de supprimer les rÃ©sultats de recherches', __FILE__, __LINE__, $db->error());
+		}
+
+		// Final search results
+		$search_results = implode(',', $search_ids);
+
+		// Fill an array with our results and search properties
+		$temp['search_results'] = $search_results;
+		$temp['num_hits'] = $num_hits;
+		$temp['sort_by'] = $sort_by;
+		$temp['sort_dir'] = $sort_dir;
+		$temp['show_as'] = $show_as;
+		$temp = serialize($temp);
+		$search_id = mt_rand(1, 2147483647);
+
+		$ident = ($pun_user['is_guest']) ? get_remote_address() : $pun_user['username'];
+
+		$db->query('INSERT INTO '.$db->prefix.'search_cache (id, ident, search_data) VALUES('.$search_id.', \''.$db->escape($ident).'\', \''.$db->escape($temp).'\')') or error('Impossible d\'insÃ©rer les rÃ©sultats de recherche', __FILE__, __LINE__, $db->error());
+
+		if ($action != 'show_new' && $action != 'show_24h')
+		{
+			$db->end_transaction();
+			$db->close();
+
+			// Redirect the user to the cached result page
+			header('Location: search.php?search_id='.$search_id);
+			exit;
+		}
+	}
+
+
+	// Fetch results to display
+	if ($search_results != '')
+	{
+		$group_by_sql = '';
+		switch ($sort_by)
+		{
+			case 1:
+				$sort_by_sql = ($show_as == 'topics') ? 't.poster' : 'p.poster';
+				break;
+
+			case 2:
+				$sort_by_sql = 't.subject';
+				break;
+
+			case 3:
+				$sort_by_sql = 't.forum_id';
+				break;
+
+			case 4:
+				$sort_by_sql = 't.last_post';
+				break;
+
+			default:
+			{
+				$sort_by_sql = ($show_as == 'topics') ? 't.posted' : 'p.posted';
+
+				if ($show_as == 'topics')
+					$group_by_sql = ', t.posted';
+
+				break;
+			}
+		}
+
+		if ($show_as == 'posts')
+		{
+			$substr_sql = ($db_type != 'sqlite') ? 'SUBSTRING' : 'SUBSTR';
+			$sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;
+		}
+		else
+			$sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql;
+
+
+		// Determine the topic or post offset (based on $_GET['p'])
+		$per_page = ($show_as == 'posts') ? $pun_user['disp_posts'] : $pun_user['disp_topics'];
+		$num_pages = ceil($num_hits / $per_page);
+
+		$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+		$start_from = $per_page * ($p - 1);
+
+		// Generate paging links
+		$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'search.php?search_id='.$search_id);
+
+
+		$sql .= ' '.$sort_dir.' LIMIT '.$start_from.', '.$per_page;
+
+		$result = $db->query($sql) or error('Impossible de retrouver les rÃ©sultats de recherches', __FILE__, __LINE__, $db->error());
+
+		$search_set = array();
+		while ($row = $db->fetch_assoc($result))
+			$search_set[] = $row;
+
+		$db->free_result($result);
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_search['Search results'];
+		require PUN_ROOT.'header.php';
+
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
+	</div>
+</div>
+
+<?php
+
+		//Set background switching on for show as posts
+		$bg_switch = true;
+
+		if ($show_as == 'topics')
+		{
+
+?>
+<div id="vf" class="blocktable">
+	<h2><span><?php echo $lang_search['Search results']; ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th>
+					<th class="tc2" scope="col"><?php echo $lang_common['Forum'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_common['Replies'] ?></th>
+					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+		}
+
+		// Fetch the list of forums
+		$result = $db->query('SELECT id, forum_name FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+		$forum_list = array();
+		while ($forum_list[] = $db->fetch_row($result))
+			;
+
+		// Finally, lets loop through the results and output them
+		for ($i = 0; $i < count($search_set); ++$i)
+		{
+			@reset($forum_list);
+			while (list(, $temp) = @each($forum_list))
+			{
+				if ($temp[0] == $search_set[$i]['forum_id'])
+					$forum = '<a href="viewforum.php?id='.$temp[0].'">'.pun_htmlspecialchars($temp[1]).'</a>';
+			}
+
+			if ($pun_config['o_censoring'] == '1')
+				$search_set[$i]['subject'] = censor_words($search_set[$i]['subject']);
+
+
+			if ($show_as == 'posts')
+			{
+				$icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n";
+				$subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>';
+
+				if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit'])
+					$icon = '<div class="icon inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n";
+
+
+				if ($pun_config['o_censoring'] == '1')
+					$search_set[$i]['message'] = censor_words($search_set[$i]['message']);
+
+				$message = str_replace("\n", '<br />', pun_htmlspecialchars($search_set[$i]['message']));
+				$pposter = pun_htmlspecialchars($search_set[$i]['pposter']);
+
+				if ($search_set[$i]['poster_id'] > 1)
+					$pposter = '<strong><a href="profile.php?id='.$search_set[$i]['poster_id'].'">'.$pposter.'</a></strong>';
+
+				if (pun_strlen($message) >= 1000)
+					$message .= ' &hellip;';
+
+				$vtpost1 = ($i == 0) ? ' vtp1' : '';
+
+				// Switch the background color for every message.
+				$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+				$vtbg = ($bg_switch) ? ' rowodd' : ' roweven';
+
+
+?>
+<div class="blockpost searchposts<?php echo $vtbg ?>">
+	<h2><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $subject ?>&#160;&raquo;&#160;<a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo format_time($search_set[$i]['pposted']) ?></a></h2>
+	<div class="box">
+		<div class="inbox">
+			<div class="postleft">
+				<dl>
+					<dt><?php echo $pposter ?></dt>
+					<dd>Replies: <?php echo $search_set[$i]['num_replies'] ?></dd>
+					<dd><?php echo $icon; ?></dd>
+					<dd><p class="clearb"><a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo $lang_search['Go to post'] ?></a></p></dd>
+				</dl>
+			</div>
+			<div class="postright">
+				<div class="postmsg">
+					<p><?php echo $message ?></p>
+				</div>
+			</div>
+			<div class="clearer"></div>
+		</div>
+	</div>
+</div>
+<?php
+
+			}
+			else
+			{
+				$icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n";
+
+				$icon_text = $lang_common['Normal icon'];
+				$item_status = '';
+				$icon_type = 'icon';
+
+
+				$subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($search_set[$i]['poster']).'</span>';
+
+				if ($search_set[$i]['closed'] != '0')
+				{
+					$icon_text = $lang_common['Closed icon'];
+					$item_status = 'iclosed';
+				}
+
+				if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit'])
+				{
+					$icon_text .= ' '.$lang_common['New icon'];
+					$item_status .= ' inew';
+					$icon_type = 'icon inew';
+					$subject = '<strong>'.$subject.'</strong>';
+					$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$search_set[$i]['tid'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
+				}
+				else
+					$subject_new_posts = null;
+
+				$num_pages_topic = ceil(($search_set[$i]['num_replies'] + 1) / $pun_user['disp_posts']);
+
+				if ($num_pages_topic > 1)
+					$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$search_set[$i]['tid']).' ]';
+				else
+					$subject_multipage = null;
+
+				// Should we show the "New posts" and/or the multipage links?
+				if (!empty($subject_new_posts) || !empty($subject_multipage))
+				{
+					$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
+					$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
+				}
+
+?>
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
+					<td class="tcl">
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
+							<div class="tclcon">
+								<?php echo $subject."\n" ?>
+							</div>
+						</div>
+					</td>
+					<td class="tc2"><?php echo $forum ?></td>
+					<td class="tc3"><?php echo $search_set[$i]['num_replies'] ?></td>
+					<td class="tcr"><?php echo '<a href="viewtopic.php?pid='.$search_set[$i]['last_post_id'].'#p'.$search_set[$i]['last_post_id'].'">'.format_time($search_set[$i]['last_post']).'</a> '.$lang_common['by'].'&#160;'.pun_htmlspecialchars($search_set[$i]['last_poster']) ?></td>
+				</tr>
+<?php
+
+			}
+		}
+
+		if ($show_as == 'topics')
+			echo "\t\t\t".'</tbody>'."\n\t\t\t".'</table>'."\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n\n";
+
+?>
+<div class="<?php echo ($show_as == 'topics') ? 'linksb' : 'postlinksb'; ?>">
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
+	</div>
+</div>
+<?php
+
+		$footer_style = 'search';
+		require PUN_ROOT.'footer.php';
+	}
+	else
+		message($lang_search['No hits']);
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_search['Search'];
+$focus_element = array('search', 'keywords');
+require PUN_ROOT.'header.php';
+
+?>
+<div id="searchform" class="blockform">
+	<h2><span><?php echo $lang_search['Search'] ?></span></h2>
+	<div class="box">
+		<form id="search" method="get" action="search.php">
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_search['Search criteria legend'] ?></legend>
+					<div class="infldset">
+						<input type="hidden" name="action" value="search" />
+						<label class="conl"><?php echo $lang_search['Keyword search'] ?><br /><input type="text" name="keywords" size="40" maxlength="100" /><br /></label>
+						<label class="conl"><?php echo $lang_search['Author search'] ?><br /><input id="author" type="text" name="author" size="25" maxlength="25" /><br /></label>
+						<p class="clearb"><?php echo $lang_search['Search info'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_search['Search in legend'] ?></legend>
+					<div class="infldset">
+						<label class="conl"><?php echo $lang_search['Forum search'] ?>
+						<br /><select id="forum" name="forum">
+<?php
+
+if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+	echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n";
+
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+$cur_category = 0;
+while ($cur_forum = $db->fetch_assoc($result))
+{
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
+	{
+		if ($cur_category)
+			echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
+
+		echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
+		$cur_category = $cur_forum['cid'];
+	}
+
+	echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
+}
+
+?>
+							</optgroup>
+						</select>
+						<br /></label>
+						<label class="conl"><?php echo $lang_search['Search in'] ?>
+						<br /><select id="search_in" name="search_in">
+							<option value="all"><?php echo $lang_search['Message and subject'] ?></option>
+							<option value="message"><?php echo $lang_search['Message only'] ?></option>
+							<option value="topic"><?php echo $lang_search['Topic only'] ?></option>
+						</select>
+						<br /></label>
+						<p class="clearb"><?php echo $lang_search['Search in info'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_search['Search results legend'] ?></legend>
+					<div class="infldset">
+						<label class="conl"><?php echo $lang_search['Sort by'] ?>
+						<br /><select name="sort_by">
+							<option value="0"><?php echo $lang_search['Sort by post time'] ?></option>
+							<option value="1"><?php echo $lang_search['Sort by author'] ?></option>
+							<option value="2"><?php echo $lang_search['Sort by subject'] ?></option>
+							<option value="3"><?php echo $lang_search['Sort by forum'] ?></option>
+						</select>
+						<br /></label>
+						<label class="conl"><?php echo $lang_search['Sort order'] ?>
+						<br /><select name="sort_dir">
+							<option value="DESC"><?php echo $lang_search['Descending'] ?></option>
+							<option value="ASC"><?php echo $lang_search['Ascending'] ?></option>
+						</select>
+						<br /></label>
+						<label class="conl"><?php echo $lang_search['Show as'] ?>
+						<br /><select name="show_as">
+							<option value="topics"><?php echo $lang_search['Show as topics'] ?></option>
+							<option value="posts"><?php echo $lang_search['Show as posts'] ?></option>
+						</select>
+						<br /></label>
+						<p class="clearb"><?php echo $lang_search['Search results info'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
+		</form>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/style/Mercury.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/Mercury.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/Mercury.css	(revision 1)
@@ -0,0 +1,258 @@
+/****************************************************************/
+/* 1. IMPORTED STYLESHEETS */
+/****************************************************************/
+
+/* Import the basic setup styles */
+@import url(imports/base.css);
+/* Import the colour scheme */
+@import url(imports/Mercury_cs.css);
+
+/****************************************************************/
+/* 2. TEXT SETTINGS */
+/****************************************************************/
+
+/* 2.1 This sets the default Font Group */
+
+.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
+	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
+}
+
+.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}
+
+/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
+* HTML .pun {FONT-SIZE: 68.75%}
+/* End IE Win Font Size */
+
+/* Set font size for tables because IE requires it */
+.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}
+
+/* 2.2 Set the font-size for preformatted text i.e in code boxes */
+
+.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}
+
+/* 2.3 Font size for headers */
+
+.pun H2, .pun H4 {FONT-SIZE: 1em}
+.pun H3 {FONT-SIZE: 1.1em}
+#brdtitle H1 {FONT-SIZE: 1.4em}
+
+/* 2.4 Larger text for particular items */
+DIV.postmsg P {LINE-HEIGHT: 1.4}
+DIV.postleft DT {FONT-SIZE: 1.1em}
+.pun PRE {FONT-SIZE: 1.2em}
+
+/* 2.5 Bold text */
+
+DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
+DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}
+
+/****************************************************************/
+/* 3. LINKS */
+/****************************************************************/
+
+/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */
+
+#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
+.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
+.blockmenu A:link, .blockmenu A:visited {
+	TEXT-DECORATION: none
+}
+
+/* 3.2 Underline on hover for links in headers and main menu */
+
+#brdmenu A:hover, .blockpost H2 A:hover {TEXT-DECORATION: underline}
+
+/****************************************************************/
+/* 4. BORDER WIDTH AND STYLE */
+/****************************************************************/
+
+/* 4.1 By default borders are 1px solid */
+
+DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/* 4.2 Special settings for the board header. */
+
+#brdheader DIV.box {BORDER-TOP-WIDTH: 4px}
+
+/* 4.3 Borders for table cells */
+
+.pun TD, .pun TH {
+	BORDER-BOTTOM: none;
+	BORDER-RIGHT: none
+}
+
+.pun .tcl {BORDER-LEFT: none}
+
+/* 4.4 Special setting for fieldsets to preserve IE defaults */
+
+DIV>FIELDSET {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/****************************************************************/
+/* 5. VERTICAL AND PAGE SPACING */
+/****************************************************************/
+
+/* 5.1 Page margins */
+
+HTML, BODY {MARGIN: 0; PADDING: 0}
+#punwrap {margin:12px 20px}
+
+/* 5.2 Creates vertical space between main board elements (Margins) */
+
+DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
+#punindex DIV.blocktable, DIV.blockpost {MARGIN-BOTTOM: 6px}
+DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}
+
+/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */
+
+DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
+DIV.postlinksb {MARGIN-TOP: -6px}
+
+/* 5.4 Put a 12px gap above the board information box in index because the category tables only
+have a 6px space beneath them */
+
+#brdstats {MARGIN-TOP: 12px}
+
+/****************************************************************/
+/* 6. SPACING AROUND CONTENT */
+/****************************************************************/
+
+/* 6.1 Default padding for main items */
+
+DIV.block DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
+.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}
+.pun H2 {PADDING: 4px 6px}
+
+/* 6.2 Special spacing for various elements */
+
+.pun H1 {PADDING: 3px 0px 0px 0}
+#brdtitle P {PADDING-TOP: 0px}
+DIV.linkst {PADDING: 8px 6px 3px 6px}
+DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
+#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
+#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}
+
+/* 6.4 Create some horizontal spacing for various elements */
+
+#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}
+
+/****************************************************************/
+/* 7. SPACING FOR TABLES */
+/****************************************************************/
+
+.pun TH, .pun TD {PADDING: 4px 6px}
+.pun TD P {PADDING: 5px 0 0 0}
+
+/****************************************************************/
+/* 8. SPACING FOR POSTS */
+/****************************************************************/
+
+/* 8.1 Padding around left and right columns in viewtopic */
+
+DIV.postleft DL, DIV.postright {PADDING: 6px}
+
+/* 8.2 Extra spacing for poster contact details and avatar */
+
+DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
+DD.postavatar {MARGIN-BOTTOM: 5px}
+
+/* 8.3 Extra top spacing for signatures and edited by */
+
+DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}
+
+/* 8.4 Spacing for code and quote boxes */
+
+DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
+.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}
+
+/* 8.5 Padding for the action links and online indicator in viewtopic */
+
+DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}
+
+/* 8.6 This is the input on moderators multi-delete view */
+
+DIV.blockpost INPUT, DIV.blockpost LABEL {
+	PADDING: 3px;
+	DISPLAY: inline
+}
+
+P.multidelete {
+	PADDING-TOP: 15px;
+	PADDING-BOTTOM: 5px
+}
+
+/* 8.7 Make sure paragraphs in posts don't get any padding */
+
+DIV.postmsg P {PADDING: 0}
+
+/****************************************************************/
+/* 9. SPECIAL SPACING FOR FORMS */
+/****************************************************************/
+
+/* 9.1 Padding around fieldsets */
+
+DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
+DIV.inform {PADDING-BOTTOM: 12px}
+
+/* 9.2 Padding inside fieldsets */
+
+.pun FIELDSET {PADDING: 0px 12px 0px 12px}
+DIV.infldset {PADDING: 9px 0px 12px 0}
+.pun LEGEND {PADDING: 0px 6px}
+
+/* 9.3 The information box at the top of the registration form and elsewhere */
+
+DIV.forminfo {
+	MARGIN-BOTTOM: 12px;
+	PADDING: 9px 10px
+}
+
+/* 9.4 BBCode help links in post forms */
+
+UL.bblinks LI {PADDING-RIGHT: 20px}
+
+UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}
+
+/* 9.5 Horizontal positioning for the submit button on forms */
+
+DIV.blockform P INPUT {MARGIN-LEFT: 12px}
+
+/****************************************************************/
+/* 10. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* 10.1 These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.isticky = sticky topics. By default only .inew is different from the default.*/
+
+DIV.icon {
+	FLOAT: left;
+	MARGIN-TOP: 0.1em;
+	MARGIN-LEFT: 0.2em;
+	DISPLAY: block;
+	BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em;
+	BORDER-STYLE: solid
+}
+
+DIV.searchposts DIV.icon {MARGIN-LEFT: 0}
+
+/* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The
+margin creates space for the post status indicator */
+
+TD DIV.tclcon {MARGIN-LEFT: 2.3em}
+
+
+
+
+
+
+
+
+
+
+
Index: /branches/rsr.v5.1.dev/web/punbb/style/Rsr.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/Rsr.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/Rsr.css	(revision 1)
@@ -0,0 +1,257 @@
+/****************************************************************/
+/* 1. IMPORTED STYLESHEETS */
+/****************************************************************/
+
+/* Import the basic setup styles */
+@import url(imports/base.css);
+/* Import the colour scheme */
+@import url(imports/Mercury_cs.css);
+
+/****************************************************************/
+/* 2. TEXT SETTINGS */
+/****************************************************************/
+
+/* 2.1 This sets the default Font Group */
+
+.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
+	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
+}
+
+.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}
+
+/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
+* HTML .pun {FONT-SIZE: 68.75%}
+/* End IE Win Font Size */
+
+/* Set font size for tables because IE requires it */
+.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}
+
+/* 2.2 Set the font-size for preformatted text i.e in code boxes */
+
+.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}
+
+/* 2.3 Font size for headers */
+
+.pun H2, .pun H4 {FONT-SIZE: 1em}
+.pun H3 {FONT-SIZE: 1.1em}
+#brdtitle H1 {FONT-SIZE: 1.4em}
+
+/* 2.4 Larger text for particular items */
+DIV.postmsg P {LINE-HEIGHT: 1.4}
+DIV.postleft DT {FONT-SIZE: 1.1em}
+.pun PRE {FONT-SIZE: 1.2em}
+
+/* 2.5 Bold text */
+
+DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
+DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}
+
+/****************************************************************/
+/* 3. LINKS */
+/****************************************************************/
+
+/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */
+
+#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
+.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
+.blockmenu A:link, .blockmenu A:visited {
+	TEXT-DECORATION: none
+}
+
+/* 3.2 Underline on hover for links in headers and main menu */
+
+#brdmenu A:hover, .blockpost H2 A:hover {TEXT-DECORATION: none}
+
+/****************************************************************/
+/* 4. BORDER WIDTH AND STYLE */
+/****************************************************************/
+
+/* 4.1 By default borders are 1px solid */
+
+DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/* 4.2 Special settings for the board header. */
+
+#brdheader DIV.box {BORDER-TOP-WIDTH: 1px}
+
+/* 4.3 Borders for table cells */
+
+.pun TD, .pun TH {
+	BORDER-BOTTOM: none;
+	BORDER-RIGHT: none
+}
+
+.pun .tcl {BORDER-LEFT: none}
+
+/* 4.4 Special setting for fieldsets to preserve IE defaults */
+
+DIV>FIELDSET {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/****************************************************************/
+/* 5. VERTICAL AND PAGE SPACING */
+/****************************************************************/
+
+/* 5.1 Page margins */
+
+HTML, BODY {MARGIN: 0; PADDING: 0}
+#punwrap {margin:12px 20px;}
+
+/* 5.2 Creates vertical space between main board elements (Margins) */
+
+DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
+#punindex DIV.blocktable, DIV.blockpost {
+	MARGIN-BOTTOM: 6px;}
+DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}
+
+/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */
+
+DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
+DIV.postlinksb {MARGIN-TOP: -6px}
+
+/* 5.4 Put a 12px gap above the board information box in index because the category tables only
+have a 6px space beneath them */
+
+#brdstats {MARGIN-TOP: 12px}
+
+/****************************************************************/
+/* 6. SPACING AROUND CONTENT */
+/****************************************************************/
+
+/* 6.1 Default padding for main items */
+
+DIV.
+ DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
+.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}
+.pun H2 {PADDING: 4px 6px}
+
+/* 6.2 Special spacing for various elements */
+
+.pun H1 {PADDING: 3px 0px 0px 0}
+#brdtitle P {PADDING-TOP: 0px}
+DIV.linkst {PADDING: 8px 6px 3px 6px}
+DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
+#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
+#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}
+
+/* 6.4 Create some horizontal spacing for various elements */
+
+#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}
+
+/****************************************************************/
+/* 7. SPACING FOR TABLES */
+/****************************************************************/
+
+.pun TH, .pun TD {PADDING: 4px 6px}
+.pun TD P {PADDING: 5px 0 0 0}
+
+/****************************************************************/
+/* 8. SPACING FOR POSTS */
+/****************************************************************/
+
+/* 8.1 Padding around left and right columns in viewtopic */
+
+DIV.postleft DL, DIV.postright {PADDING: 6px}
+
+/* 8.2 Extra spacing for poster contact details and avatar */
+
+DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
+DD.postavatar {MARGIN-BOTTOM: 5px}
+
+/* 8.3 Extra top spacing for signatures and edited by */
+
+DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}
+
+/* 8.4 Spacing for code and quote boxes */
+
+DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
+.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}
+
+/* 8.5 Padding for the action links and online indicator in viewtopic */
+
+DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}
+
+/* 8.6 This is the input on moderators multi-delete view */
+
+DIV.blockpost INPUT, DIV.blockpost LABEL {
+	PADDING: 3px;
+	DISPLAY: inline
+}
+
+P.multidelete {
+	PADDING-TOP: 15px;
+	PADDING-BOTTOM: 5px
+}
+
+/* 8.7 Make sure paragraphs in posts don't get any padding */
+
+DIV.postmsg P {PADDING: 0}
+
+/****************************************************************/
+/* 9. SPECIAL SPACING FOR FORMS */
+/****************************************************************/
+
+/* 9.1 Padding around fieldsets */
+
+DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
+DIV.inform {PADDING-BOTTOM: 12px}
+
+/* 9.2 Padding inside fieldsets */
+
+.pun FIELDSET {PADDING: 0px 12px 0px 12px}
+DIV.infldset {PADDING: 9px 0px 12px 0}
+.pun LEGEND {PADDING: 0px 6px}
+
+/* 9.3 The information box at the top of the registration form and elsewhere */
+
+DIV.forminfo {
+	MARGIN-BOTTOM: 12px;
+	PADDING: 9px 10px
+}
+
+/* 9.4 BBCode help links in post forms */
+
+UL.bblinks LI {PADDING-RIGHT: 20px}
+
+UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}
+
+/* 9.5 Horizontal positioning for the submit button on forms */
+
+DIV.blockform P INPUT {MARGIN-LEFT: 12px}
+
+/****************************************************************/
+/* 10. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* 10.1 These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.isticky = sticky topics. By default only .inew is different from the default.*/
+
+DIV.icon {
+	FLOAT: left;
+	MARGIN-TOP: 0.1em;
+	MARGIN-LEFT: 0.2em;
+	DISPLAY: block;
+	BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em;
+	BORDER-STYLE: solid
+}
+
+DIV.searchposts DIV.icon {MARGIN-LEFT: 0}
+
+/* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The
+margin creates space for the post status indicator */
+
+TD DIV.tclcon {MARGIN-LEFT: 2.3em}
+
+
+
+
+
+
+
+
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/Mercury_cs.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/Mercury_cs.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/Mercury_cs.css	(revision 1)
@@ -0,0 +1,117 @@
+/****************************************************************/
+/* 1. BACKGROUND AND TEXT COLOURS */
+/****************************************************************/
+
+/* 1.1 Default background colour and text colour */
+
+/*BODY {BACKGROUND-COLOR: #ffffff}*/
+
+.pun {COLOR: #D4D4D4}
+
+DIV.box,  #adminconsole FIELDSET TH, .rowodd, .roweven {BACKGROUND-COLOR: #383838}
+#adminconsole TD, #adminconsole TH {BORDER-COLOR: #383838}
+
+/* 1. 2 Darker background colours */
+
+TD.tc2, TD.tc3, TD.tcmod, #brdfooter DIV.box {BACKGROUND-COLOR: #424242}
+#adminconsole FIELDSET TD, #viewprofile DD, DIV.forminfo, DIV.blockmenu DIV.box, #adstats DD {BACKGROUND-COLOR: #484848}
+
+.pun BLOCKQUOTE, DIV.codebox {BACKGROUND-COLOR: #353533}
+
+/* 1.3 Main headers and navigation bar background and text colour */
+
+.pun H2, #brdmenu {BACKGROUND-COLOR: #565656; COLOR: #D4D4D4}
+
+/* 1.4 Table header rows */
+
+.pun TH {BACKGROUND-COLOR: #484848}
+
+/* 1.5 Fieldset legend text colour */
+
+.pun LEGEND {COLOR: #F6B620}
+
+/* 1.6 Highlighted text for various items */
+
+.pun DIV.blockmenu LI.isactive A, #posterror LI STRONG {COLOR: #D4D4D4}
+
+/* 1.7 Dark background for form elements */
+
+.pun TEXTAREA, .pun INPUT, .pun SELECT {BACKGROUND-COLOR: #2A2A2A; COLOR: #D4D4D4}
+
+/****************************************************************/
+/* 2. POST BACKGROUNDS AND TEXT */
+/****************************************************************/
+
+/* 2.1 This is the setup for posts. */
+
+DIV.blockpost DIV.box, DIV.postright, DIV.postfootright, #postpreview {BACKGROUND-COLOR: #383838}
+DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #424242}
+DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #424242}
+
+/* 2.2 Background for post headers and text colour for post numbers in viewtopic */
+
+DIV.blockpost H2 {BACKGROUND-COLOR: #565656}
+DIV.blockpost H2 SPAN.conr {COLOR: #A19E96}
+
+/* 2.3 This is the line above the signature in posts. Colour and background should be the same */
+
+.pun HR {BACKGROUND-COLOR: #606060;	COLOR: #606060}
+
+/****************************************************************/
+/* 3. BORDER COLOURS */
+/****************************************************************/
+
+/* 3.1 All external borders (H1 is the board title) */
+
+DIV.box {BORDER-COLOR: #565656}
+
+/* 3.2 Makes the top border of posts match the colour used for post headers */
+
+DIV.blockpost DIV.box {BORDER-COLOR: #565656 #525252 #525252}
+
+/* 3.3 Table internal borders. By default TH is same as background so border is invisible */
+
+.pun TD {BORDER-COLOR: #565656}
+.pun TH {BORDER-COLOR: #484848}
+
+/* 3.4 Creates the inset border for quote boxes, code boxes and form info boxes */
+
+.pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {BORDER-COLOR: #565656}
+
+/* 3.5 Gecko's default fieldset borders are really nasty so this gives them a colour
+without interferring with IE's rather nice default */
+
+.pun DIV>FIELDSET {BORDER-COLOR: #909090}
+
+/****************************************************************/
+/* 4. LINK COLOURS */
+/****************************************************************/
+
+/* 4.1 This is the default for all links */
+
+.pun A:link, .pun A:visited {COLOR: #F6B620}
+.pun A:hover {COLOR: #FFEE40}
+
+/* 4.2 This is the colour for links in header rows and the navigation bar */
+
+.pun H2 A:link, .pun H2 A:visited {COLOR: #D4D4D4}
+.pun H2 A:hover {COLOR: #D4D4D4}
+
+/* 4.3 This is for closed topics and "hot" links */
+
+LI.postreport A:link, LI.postreport A:visited, TR.iclosed TD.tcl A:link, TR.iclosed TD.tcl A:visited {COLOR: #888}
+LI.postreport A:hover, TR.iclosed TD.tcl A:hover {COLOR: #AAA}
+LI.maintenancelink A:link, LI.maintenancelink A:visited {COLOR: #FF4000}
+LI.maintenancelink A:hover {COLOR: #FF5010}
+
+/****************************************************************/
+/* 5. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.isticky = sticky topics. The default is "icon". By default only .inew is different.*/
+
+DIV.icon {BORDER-COLOR: #484848 #404040 #3C3C3C #444444}
+TR.iredirect DIV.icon {BORDER-COLOR: #383838 #383838 #383838 #383838}
+DIV.inew {BORDER-COLOR: #F6B620 #ECAE1F #D09A1B #E1A61D}
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/base.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/base.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/base.css	(revision 1)
@@ -0,0 +1,265 @@
+/****************************************************************/
+/* 1. INITIAL SETTINGS */
+/****************************************************************/
+
+.pun TABLE, .pun DIV, .pun FORM, .pun P, .pun H1, .pun H2, .pun H3,
+.pun H4, .pun PRE, .pun BLOCKQUOTE, .pun UL, .pun OL, .pun LI, .pun DL,
+.pun DT, .pun DD, .pun TH, .pun TD, .pun FIELDSET, .pun IMG {
+	MARGIN: 0px;
+	PADDING: 0px;
+	FONT-WEIGHT: normal;
+	LIST-STYLE: none;
+}
+
+.pun IMG {BORDER: none}
+
+.pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {MARGIN: 0}
+
+/****************************************************************/
+/* 2. STRUCTURAL SETTINGS - VERY IMPORTANT - DO NOT CHANGE */
+/****************************************************************/
+
+/* 2.1 Clearing floats and invisible items */
+.pun .clearer, .pun .nosize {
+	HEIGHT: 0;
+	WIDTH: 0;
+	LINE-HEIGHT: 0;
+	FONT-SIZE: 0;
+	OVERFLOW: hidden
+}
+
+.pun .clearer, .pun .clearb {CLEAR: both}
+.pun .nosize {POSITION: absolute; LEFT: -10000px}
+
+/* 2.2 Overflow settings for posts */
+
+DIV.blockpost DIV.box, DIV.postleft, DIV.postsignature, DIV.postmsg {OVERFLOW: hidden}
+
+/****************************************************************/
+/* 3. BUG FIXES - VERY IMPORTANT - DO NOT CHANGE */
+/****************************************************************/
+
+/* 3.1 This attempts to eliminate rounding errors in Gecko browsers. */
+
+DIV>DIV>DIV.postfootleft, DIV>DIV>DIV.postfootright {PADDING-TOP: 1px; MARGIN-TOP: -1px}
+
+/* 3.2 This is only visible to IE Windows and cures various bugs. Do not alter comments */
+
+/* Begin IEWin Fix \*/
+* HTML .inbox, * HTML .inform, * HTML .pun, * HTML .intd, * HTML .tclcon {HEIGHT: 1px}
+* HTML .inbox DIV.postmsg {WIDTH: 98%}
+/* End of IEWin Fix */
+
+/****************************************************************/
+/* 4. HIDDEN ELEMENTS */
+/****************************************************************/
+
+/* These are hidden in normal display. Add comments to make them visible */
+
+#brdfooter H2, #brdstats H2, #brdstats .conl DT, #brdstats .conr DT,
+#modcontrols DT, #searchlinks DT, DIV.postright H3 {
+	POSITION: absolute;
+	DISPLAY: block;
+	OVERFLOW: hidden;
+	WIDTH: 1em;
+	LEFT: -999em
+}
+
+/****************************************************************/
+/* 5. BOX CONTAINERS AND FLOATS */
+/****************************************************************/
+
+/* 5.1. Setup all left and right content using floats. */  
+
+.conr {
+	FLOAT: right;
+	TEXT-ALIGN: right;
+	CLEAR: right;
+	WIDTH: 40%
+}
+
+.conl {
+	FLOAT: left;
+	WIDTH: 55%;
+	OVERFLOW: hidden;
+	WHITE-SPACE: nowrap
+}
+
+LABEL.conl {
+	WIDTH: auto;
+	OVERFLOW: visible;
+	MARGIN-RIGHT: 10px
+}
+
+/* 5.2 Set up page numbering and posts links */
+
+DIV.linkst .conl, DIV.linksb .conl, DIV.postlinksb .conl {WIDTH:18em}
+
+DIV.linkst .conr, DIV.linksb .conr, DIV.postlinksb .conr {WIDTH:16em}
+
+FORM DIV.linksb .conr {WIDTH: 32em}
+
+/* 5.3 Keep breadcrumbs from shifting to the right when wrapping */
+
+.linkst UL, linksb UL, .postlinksb UL {MARGIN-LEFT: 18em}
+
+/* 5.4 Settings for Profile and Admin interface.*/
+
+DIV.block2col {PADDING-BOTTOM: 1px}
+
+DIV.block2col DIV.blockform, DIV.block2col DIV.block, #viewprofile DD {MARGIN-LEFT: 14em}
+
+DIV.blockmenu, #viewprofile DT {
+	FLOAT:left;
+	WIDTH: 13em
+}
+
+#profileavatar IMG {
+	FLOAT: right;
+	MARGIN-LEFT: 1em
+}
+
+#viewprofile DL {FLOAT: left; WIDTH: 100%; OVERFLOW: hidden}
+
+/****************************************************************/
+/* 6. TABLE SETUP */
+/****************************************************************/
+
+/* 6.1 Table Basic Setup */
+
+.pun TABLE {WIDTH: 100%}
+
+/* 6.2 Fixed Table Setup */
+
+#punindex TABLE, #vf TABLE {TABLE-LAYOUT: fixed}
+
+.tcl {TEXT-ALIGN: left; WIDTH: 50%}
+
+.tc2, .tc3, .tcmod {WIDTH: 9%; TEXT-ALIGN: center}
+
+.tcr {WIDTH: 32%; TEXT-ALIGN: left}
+
+#punsearch #vf .tcl, #punmoderate #vf .tcl {WIDTH: 41%}
+
+#punsearch #vf .tc2 {WIDTH: 18%; TEXT-ALIGN: left}
+
+.tcl, .tcr {OVERFLOW: HIDDEN}
+
+/* 6.3 Other Table Setup */
+
+#users1 .tcl {WIDTH: 40%}
+
+#users1 .tcr {WIDTH: 25%}
+
+#users1 .tc2 {WIDTH: 25%; TEXT-ALIGN: left}
+
+#users1 .tc3 {WIDTH: 10%; TEXT-ALIGN: center}
+
+#debug .tcr {WIDTH: 85%; WHITE-SPACE: normal}
+
+#punindex TD.tcr SPAN.byuser {DISPLAY: block}
+
+/****************************************************************/
+/* 7. VIEWTOPIC SETUP */
+/****************************************************************/
+
+/* 7.1 This is the basic structure. */
+
+DIV.postleft, DIV.postfootleft {
+	FLOAT:left;
+	WIDTH: 18em;
+	OVERFLOW: hidden
+}
+	
+DIV.postright, DIV.postfootright {
+	BORDER-LEFT-WIDTH: 18em;
+	BORDER-LEFT-STYLE: solid
+}
+
+DIV.postfootright, P.multidelete {TEXT-ALIGN: right}
+
+DIV.blockpost>DIV>DIV.inbox {PADDING-BOTTOM: 1px}
+
+/* 7.3 This is the div which actually contains the post and is inside .postright */
+
+DIV.postmsg {WIDTH:100%}
+
+/* 7.4 These items control overflow and scrolling within posts. */
+
+DIV.incqbox {WIDTH: 100%; OVERFLOW: hidden}
+DIV.scrollbox {WIDTH: 100%; OVERFLOW: auto}
+IMG.postimg {max-width: 100%}
+A .postimg {max-width: 100%}
+
+/* 7.5 Turn off the poster information column for preview */
+
+#postpreview DIV.postright {BORDER-LEFT: none}
+
+/* 7.6 Create the horizontal line above signatures */
+
+DIV.postsignature HR {
+	MARGIN-LEFT: 0px;
+	WIDTH: 200px;
+	TEXT-ALIGN: left;
+	HEIGHT: 1px;
+	BORDER:none
+}
+
+/* 7.7 Maximum height for search results as posts. Position go to post link */
+
+DIV.searchposts DIV.postmsg {HEIGHT: 8em}
+DIV.searchposts DD P {PADDING-TOP: 3em}
+
+/* 7.8 Class for bbcode [u] */
+
+SPAN.bbu {TEXT-DECORATION: underline}
+
+/****************************************************************/
+/* 8. LISTS SPECIAL SETTINGS */
+/****************************************************************/
+
+/* 8.1 Horizontal display of online list, main navigation menu and breadcrumbs */
+
+#onlinelist DD, #onlinelist DT, #brdmenu LI, DIV.linkst LI, DIV.linksb LI, DIV.postlinksb LI,
+DIV.postfootright LI, UL.bblinks LI {
+	DISPLAY: inline;
+	HEIGHT: 0
+}
+
+/* 8.2 Turn on square icon for posterror list */
+
+#posterror UL LI {LIST-STYLE: square inside}
+
+/* 8.3 Right alignment of descriptions in ordinary member view of other members profiles */
+
+#viewprofile DT {TEXT-ALIGN: right}
+
+/****************************************************************/
+/* 9. FORM SETTINGS */
+/****************************************************************/
+
+/* 9.1 Makes textareas and long text inputs shrink with page */
+
+DIV.txtarea {WIDTH: 75%}
+
+DIV.txtarea TEXTAREA, INPUT.longinput {WIDTH: 100%}
+
+.pun LABEL {DISPLAY: block}
+
+#qjump SELECT {WIDTH: 50%}
+
+/****************************************************************/
+/* 10. HELP FILES AND MISC. */
+/****************************************************************/
+
+/* 10.1 Put some space between sections of the help file */
+
+#helpfile H2 {MARGIN-TOP: 12px}
+
+/* 10.2 Internal padding */
+
+#helpfile DIV.box {PADDING: 10px}
+
+/* 10.3 Other templates */
+
+#punredirect DIV.block, #punmaint DIV.block {MARGIN: 50px 20% 12px 20%}
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/base_admin.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/base_admin.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/base_admin.css	(revision 1)
@@ -0,0 +1,45 @@
+#adminconsole .block2 {MARGIN-TOP: 12px}
+
+/*** Admin Main Content ***/
+* HTML #adstats DD {HEIGHT: 1%}
+#adstats DD {MARGIN-LEFT: 14em; PADDING: 3px; MARGIN-BOTTOM: 5px; LINE-HEIGHT: 1.5em}
+#adstats DT {FLOAT:left; WIDTH: 13em; PADDING: 3px; line-height: 1.5em}
+#adstats {PADDING: 15px 15px 5px 10px}
+#adintro {PADDING: 5px}
+#adintro P {PADDING: 10px}
+#adstats DL {PADDING: 5px 0 10px 5px}
+
+#adminconsole FIELDSET TD {TEXT-ALIGN: left; PADDING: 4px; WHITE-SPACE: normal}
+#adminconsole FIELDSET TH {TEXT-ALIGN: left; PADDING: 4px; WHITE-SPACE: normal}
+#adminconsole FIELDSET TD SPAN, #adminconsole FIELDSET TH SPAN {DISPLAY: block; FONT-SIZE: 1em; FONT-WEIGHT: normal}
+#adminconsole TH {WIDTH: 15em; FONT-WEIGHT: bold}
+#adminconsole INPUT, #adminconsole SELECT, #adminconsole TEXTAREA {MARGIN-BOTTOM: 0; MARGIN-TOP: 0; FONT-WEIGHT: normal}
+#adminconsole TABLE.aligntop TH, #adminconsole TABLE.aligntop TD {VERTICAL-ALIGN: top}
+#adminconsole TABLE.aligntop TH {PADDING-TOP: 0.7em}
+#adminconsole TD, #adminconsole TH {BORDER-STYLE: solid; BORDER-WIDTH: 3px 0px 3px 0px}
+#adminconsole P {PADDING-BOTTOM: 6px}
+#adminconsole .topspace {PADDING-TOP: 6px}
+#adminconsole P.submittop, #adminconsole P.submitend {TEXT-ALIGN: center}
+#adminconsole TH.hidehead {COLOR: #f1f1f1}
+#adminconsole THEAD TH {PADDING-BOTTOM: 0px}
+#adminconsole P.linkactions {FONT-WEIGHT: bold; PADDING-LEFT: 5px}
+#adminconsole TH INPUT, #adminconsole DIV.fsetsubmit {MARGIN-TOP: 6px}
+
+/*** Particular table settings ***/
+#categoryedit .tcl {WIDTH: 25%}
+#censoring .tcl, #censoring .tc2, #ranks .tcl, #ranks .tc2 {WIDTH: 20%}
+TABLE#forumperms TH, TABLE#forumperms TD {WHITE-SPACE: normal; WIDTH: auto; TEXT-ALIGN: center}
+TABLE#forumperms .atcl {TEXT-ALIGN: left; WIDTH: 15em; WHITE-SPACE: nowrap}
+#adminconsole TD.nodefault {BACKGROUND-COLOR: #D59B9B}
+
+/*** User Search Result Tables ***/
+#users2 TH, #users2 TH {TEXT-ALIGN: left}
+#users2 .tcl, #users2 .tc3, #users2 .tc5 {WIDTH: 15%; TEXT-ALIGN: left}
+#users2 .tc2 {WIDTH: 22%; TEXT-ALIGN: left}
+#users2 .tc4 {WIDTH: 8%}
+#users2 .tc4 {TEXT-ALIGN: center}
+#users2 .tcr {WHITE-SPACE: nowrap}
+#adminconsole #linkst, #adminconsole #linksb A {FONT-WEIGHT: bold}
+
+/*** Plugins ***/
+#exampleplugin .inbox {PADDING: 6px 6px 0px 6px}
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/minmax.js
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/minmax.js	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/minmax.js	(revision 1)
@@ -0,0 +1,84 @@
+// minmax.js - written by Andrew Clover <and@doxdesk.com>
+// Adapted for PunBB by Rickard Andersson and Paul Sullivan
+
+/*@cc_on
+@if (@_win32 && @_jscript_version>4)
+
+var minmax_elements;
+
+function minmax_bind(el) {
+	var em, ms;
+	var st= el.style, cs= el.currentStyle;
+
+	if (minmax_elements==window.undefined) {
+		if (!document.body || !document.body.currentStyle) return;
+		minmax_elements= new Array();
+		window.attachEvent('onresize', minmax_delayout);
+	}
+
+	if (cs['max-width'])
+		st['maxWidth']= cs['max-width'];
+
+	ms= cs['maxWidth'];
+	if (ms && ms!='auto' && ms!='none' && ms!='0' && ms!='') {
+		st.minmaxWidth= cs.width;
+		minmax_elements[minmax_elements.length]= el;
+		minmax_delayout();
+	}
+}
+
+var minmax_delaying= false;
+function minmax_delayout() {
+	if (minmax_delaying) return;
+	minmax_delaying= true;
+	window.setTimeout(minmax_layout, 0);
+}
+
+function minmax_stopdelaying() {
+	minmax_delaying= false;
+}
+
+function minmax_layout() {
+	window.setTimeout(minmax_stopdelaying, 100);
+	var i, el, st, cs, optimal, inrange;
+	for (i= minmax_elements.length; i-->0;) {
+		el= minmax_elements[i]; st= el.style; cs= el.currentStyle;
+
+		st.width= st.minmaxWidth; optimal= el.offsetWidth;
+		inrange= true;
+		if (inrange && cs.minWidth && cs.minWidth!='0' && cs.minWidth!='auto' && cs.minWidth!='') {
+			st.width= cs.minWidth;
+			inrange= (el.offsetWidth<optimal);
+		}
+		if (inrange && cs.maxWidth && cs.maxWidth!='none' && cs.maxWidth!='auto' && cs.maxWidth!='') {
+			st.width= cs.maxWidth;
+			inrange= (el.offsetWidth>optimal);
+		}
+		if (inrange) st.width= st.minmaxWidth;
+	}
+}
+
+var minmax_SCANDELAY= 500;
+
+function minmax_scan() {
+	var el;
+	for (var i= 0; i<document.all.length; i++) {
+		el= document.all[i];
+		if (!el.minmax_bound) {
+			el.minmax_bound= true;
+			minmax_bind(el);
+		}
+	}
+}
+
+var minmax_scanner;
+function minmax_stop() {
+	window.clearInterval(minmax_scanner);
+	minmax_scan();
+}
+
+minmax_scan();
+minmax_scanner= window.setInterval(minmax_scan, minmax_SCANDELAY);
+window.attachEvent('onload', minmax_stop);
+
+@end @*/
Index: /branches/rsr.v5.1.dev/web/punbb/style/imports/vgn2_cs.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/imports/vgn2_cs.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/imports/vgn2_cs.css	(revision 1)
@@ -0,0 +1,133 @@
+/****************************************************************/
+/* 1. BACKGROUND AND TEXT COLOURS */
+/****************************************************************/
+
+/* 1.1 Default background colour and text colour */
+
+BODY {BACKGROUND-COLOR: #000000; BACKGROUND-IMAGE:url('/forums/img/bg.jpg'); BACKGROUND-ATTACHMENT: fixed;}
+
+.pun {COLOR: #555555}
+
+DIV.box,  #adminconsole FIELDSET TH, .rowodd, .roweven {BACKGROUND-COLOR: #FFFFFF}
+#adminconsole TD, #adminconsole TH {BORDER-COLOR: #FFFFFF}
+
+/* 1. 2 Darker background colours */
+
+TD.tc2, TD.tc3, TD.tcmod, #brdfooter DIV.box {BACKGROUND-COLOR: #FFFFFF}
+#adminconsole FIELDSET TD, #viewprofile DD, DIV.forminfo, DIV.blockmenu DIV.box, #adstats DD {BACKGROUND-COLOR: #FFFFFF}
+
+.pun BLOCKQUOTE, DIV.codebox {BACKGROUND-COLOR: #FFFFFF}
+
+/* 1.3 Main headers and navigation bar background and text colour */
+
+.pun H2, #brdmenu {BACKGROUND-COLOR: #AAAAAA; COLOR: #000000}
+
+/* 1.4 Table header rows */
+
+.pun TH {BACKGROUND-COLOR: #888888}
+
+/* 1.5 Fieldset legend text colour */
+
+.pun LEGEND {COLOR: #000000}
+
+/* 1.6 Highlighted text for various items */
+
+.showhot, .pun DIV.blockmenu LI.isactive A, #posterror LI STRONG {COLOR: #000000}
+
+/* 1.7 Dark background for form elements */
+
+.pun TEXTAREA, .pun INPUT, .pun SELECT {BACKGROUND-COLOR: #000000; COLOR: #D4D4D4}
+
+/****************************************************************/
+/* 2. POST BACKGROUNDS AND TEXT */
+/****************************************************************/
+
+/* 2.1 This is the setup for posts. */
+
+DIV.blockpost DIV.box, DIV.postright, DIV.postfootright, #postpreview {BACKGROUND-COLOR: #FFFFFF}
+DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #000000}
+DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #888888}
+
+/* 2.2 Background for post headers and text colour for post numbers in viewtopic */
+
+DIV.blockpost H2 {BACKGROUND-COLOR: #AAAAAA}
+DIV.blockpost H2 SPAN.conr {COLOR: #000000}
+
+/* 2.3 This is the line above the signature in posts. Colour and background should be the same */
+
+.pun HR {BACKGROUND-COLOR: #000000;	COLOR: #000000}
+
+/****************************************************************/
+/* 3. BORDER COLOURS */
+/****************************************************************/
+
+/* 3.1 All external borders (H1 is the board title) */
+
+DIV.box {BORDER-COLOR: #000000}
+
+/* 3.2 Makes the top border of posts match the colour used for post headers */
+
+DIV.blockpost DIV.box {BORDER-COLOR: #565656 #525252 #525252}
+
+/* 3.3 Table internal borders. By default TH is same as background so border is invisible */
+
+.pun TD {BORDER-COLOR: #565656}
+.pun TH {BORDER-COLOR: #484848}
+
+/* 3.4 Creates the inset border for quote boxes, code boxes and form info boxes */
+
+.pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {BORDER-COLOR: #565656}
+
+/* 3.5 Gecko's default fieldset borders are really nasty so this gives them a colour
+without interferring with IE's rather nice default */
+
+.pun DIV>FIELDSET {BORDER-COLOR: #909090}
+
+/****************************************************************/
+/* 4. LINK COLOURS */
+/****************************************************************/
+
+/* 4.1 This is the default for all links */
+
+.pun A:link, .pun A:visited {COLOR: #990000}
+.pun A:hover {COLOR: #BB0000}
+
+/* 4.2 This is the colour for links in header rows and the navigation bar */
+
+.pun H2 A:link, .pun H2 A:visited {COLOR: #D4D4D4}
+.pun H2 A:hover {COLOR: #D4D4D4}
+
+/* 4.3 This is for closed topics and "hot" links */
+
+A:link.showclosed,  A:visited.showclosed {COLOR: #900}
+A:hover.showclosed {COLOR: #B00}
+A:link.showhot,  A:visited.showhot {COLOR: #990000}
+A:hover.showhot {COLOR: #BB0000}
+
+/****************************************************************/
+/* 5. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* 5.1 These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.inormal = everything else. By default only .inew and .inormal are visible.*/
+
+DIV.inew, DIV.inormal, DIV.iclosed, DIV.iredirect {
+	FLOAT: left;
+	MARGIN-TOP: 0.2em;
+	MARGIN-LEFT: 0.2em;
+	DISPLAY: block;
+	BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em;
+	BORDER-STYLE: solid
+}
+
+DIV.searchposts DIV.inew, DIV.searchposts DIV.inormal {MARGIN-LEFT: 0}
+
+DIV.iredirect {BORDER-COLOR: #383838 #383838 #383838 #383838}
+DIV.inormal, DIV.iclosed {BORDER-COLOR: #CC0000 #AA0000 #880000 #660000}
+DIV.inew {BORDER-COLOR: #FF0000 #DD0000 #BB0000 #990000}
+
+/* 5.2 Class .tclcon is a div inside the first column of tables with post indicators. The
+margin creates space for the post status indicator */
+
+TD DIV.tclcon {MARGIN-LEFT: 2.3em}
Index: /branches/rsr.v5.1.dev/web/punbb/style/index.html
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/index.html	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/index.html	(revision 1)
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /branches/rsr.v5.1.dev/web/punbb/style/vgn2.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/style/vgn2.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/style/vgn2.css	(revision 1)
@@ -0,0 +1,233 @@
+/****************************************************************/
+/* 1. IMPORTED STYLESHEETS */
+/****************************************************************/
+
+/* Import the basic setup styles */
+@import url(imports/base.css);
+/* Import the colour scheme */
+@import url(imports/vgn2_cs.css);
+
+/****************************************************************/
+/* 2. TEXT SETTINGS */
+/****************************************************************/
+
+/* 2.1 This sets the default Font Group */
+
+.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
+	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
+}
+
+.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}
+
+/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
+* HTML .pun {FONT-SIZE: 68.75%}
+/* End IE Win Font Size */
+
+/* Set font size for tables because IE requires it */
+.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}
+
+/* 2.2 Set the font-size for preformatted text i.e in code boxes */
+
+.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}
+
+/* 2.3 Font size for headers */
+
+.pun H2, .pun H4 {FONT-SIZE: 1em}
+.pun H3 {FONT-SIZE: 1.1em}
+#brdtitle H1 {FONT-SIZE: 1.4em}
+
+/* 2.4 Larger text for particular items */
+
+DIV.postmsg P {LINE-HEIGHT: 1.4}
+DIV.postleft DT {FONT-SIZE: 1.1em}
+.pun PRE {FONT-SIZE: 1.2em}
+
+/* 2.5 Bold text */
+
+DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
+DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}
+
+/****************************************************************/
+/* 3. LINKS */
+/****************************************************************/
+
+.pun A:link, .pun A:visited {
+text-decoration: none;
+border-bottom: 1px solid #888888 }
+.pun A:hover {
+text-decoration: none;
+border-bottom: 1px solid #000000 }
+
+/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */
+
+#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
+.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
+.blockmenu A:link, .blockmenu A:visited {
+text-decoration: none }
+
+/* 3.2 Underline on hover for links in headers and main menu */
+
+#brdmenu A:hover, .blockpost H2 A:hover {
+text-decoration: none;
+border-bottom: 1px solid #000000 }
+
+/****************************************************************/
+/* 4. BORDER WIDTH AND STYLE */
+/****************************************************************/
+
+/* 4.1 By default borders are 1px solid */
+
+DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/* 4.2 Special settings for the board header. */
+
+#brdheader DIV.box {BORDER-TOP-WIDTH: 4px}
+
+/* 4.3 Borders for table cells */
+
+.pun TD, .pun TH {
+	BORDER-BOTTOM: none;
+	BORDER-RIGHT: none
+}
+
+.pun .tcl {BORDER-LEFT: none}
+
+/* 4.4 Special setting for fieldsets to preserve IE defaults */
+
+DIV>FIELDSET {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/****************************************************************/
+/* 5. VERTICAL AND PAGE SPACING */
+/****************************************************************/
+
+/* 5.1 Page margins */
+
+HTML, BODY {MARGIN: 0; PADDING: 0}
+#punwrap {margin:12px 75px}
+
+/* 5.2 Creates vertical space between main board elements (Margins) */
+
+DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
+#punindex DIV.blocktable, DIV.blockpost {MARGIN-BOTTOM: 6px}
+DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}
+
+/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */
+
+DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
+DIV.postlinksb {MARGIN-TOP: -6px}
+
+/* 5.4 Put a 12px gap above the board information box in index because the category tables only
+have a 6px space beneath them */
+
+#brdstats {MARGIN-TOP: 12px}
+
+/****************************************************************/
+/* 6. SPACING AROUND CONTENT */
+/****************************************************************/
+
+/* 6.1 Default padding for main items */
+
+DIV.block DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
+.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}
+.pun H2 {PADDING: 4px 6px}
+
+/* 6.2 Special spacing for various elements */
+
+.pun H1 {PADDING: 3px 0px 0px 0}
+#brdtitle P {PADDING-TOP: 0px}
+DIV.linkst {PADDING: 8px 6px 3px 6px}
+DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
+#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
+#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}
+
+/* 6.4 Create some horizontal spacing for various elements */
+
+#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}
+
+/****************************************************************/
+/* 7. SPACING FOR TABLES */
+/****************************************************************/
+
+.pun TH, .pun TD {PADDING: 4px 6px}
+.pun TD P {PADDING: 5px 0 0 0}
+
+/****************************************************************/
+/* 8. SPACING FOR POSTS */
+/****************************************************************/
+
+/* 8.1 Padding around left and right columns in viewtopic */
+
+DIV.postleft DL, DIV.postright {PADDING: 6px}
+
+/* 8.2 Extra spacing for poster contact details and avatar */
+
+DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
+DD.postavatar {MARGIN-BOTTOM: 5px}
+
+/* 8.3 Extra top spacing for signatures and edited by */
+
+DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}
+
+/* 8.4 Spacing for code and quote boxes */
+
+DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
+.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}
+
+/* 8.5 Padding for the action links and online indicator in viewtopic */
+
+DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}
+
+/* 8.6 This is the input on moderators multi-delete view */
+
+DIV.blockpost INPUT, DIV.blockpost LABEL {
+	PADDING: 3px;
+	DISPLAY: inline
+}
+
+P.multidelete {
+	PADDING-TOP: 15px;
+	PADDING-BOTTOM: 5px
+}
+
+/* 8.7 Make sure paragraphs in posts don't get any padding */
+
+DIV.postmsg P {PADDING: 0}
+
+/****************************************************************/
+/* 9. SPECIAL SPACING FOR FORMS */
+/****************************************************************/
+
+/* 9.1 Padding around fieldsets */
+
+DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
+DIV.inform {PADDING-BOTTOM: 12px}
+
+/* 9.2 Padding inside fieldsets */
+
+.pun FIELDSET {PADDING: 0px 12px 0px 12px}
+DIV.infldset {PADDING: 9px 0px 12px 0}
+.pun LEGEND {PADDING: 0px 6px}
+
+/* 9.3 The information box at the top of the registration form and elsewhere */
+
+DIV.forminfo {
+	MARGIN-BOTTOM: 12px;
+	PADDING: 9px 10px
+}
+
+/* 9.4 BBCode help links in post forms */
+
+UL.bblinks LI {PADDING-RIGHT: 20px}
+
+UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}
+
+/* 9.5 Horizontal positioning for the submit button on forms */
+
+DIV.blockform P INPUT {MARGIN-LEFT: 12px}
+
Index: /branches/rsr.v5.1.dev/web/punbb/theme/style/imports/vgn2_cs.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/theme/style/imports/vgn2_cs.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/theme/style/imports/vgn2_cs.css	(revision 1)
@@ -0,0 +1,133 @@
+/****************************************************************/
+/* 1. BACKGROUND AND TEXT COLOURS */
+/****************************************************************/
+
+/* 1.1 Default background colour and text colour */
+
+BODY {BACKGROUND-COLOR: #000000; BACKGROUND-IMAGE:url('/forums/img/bg.jpg'); BACKGROUND-ATTACHMENT: fixed;}
+
+.pun {COLOR: #555555}
+
+DIV.box,  #adminconsole FIELDSET TH, .rowodd, .roweven {BACKGROUND-COLOR: #FFFFFF}
+#adminconsole TD, #adminconsole TH {BORDER-COLOR: #FFFFFF}
+
+/* 1. 2 Darker background colours */
+
+TD.tc2, TD.tc3, TD.tcmod, #brdfooter DIV.box {BACKGROUND-COLOR: #FFFFFF}
+#adminconsole FIELDSET TD, #viewprofile DD, DIV.forminfo, DIV.blockmenu DIV.box, #adstats DD {BACKGROUND-COLOR: #FFFFFF}
+
+.pun BLOCKQUOTE, DIV.codebox {BACKGROUND-COLOR: #FFFFFF}
+
+/* 1.3 Main headers and navigation bar background and text colour */
+
+.pun H2, #brdmenu {BACKGROUND-COLOR: #AAAAAA; COLOR: #000000}
+
+/* 1.4 Table header rows */
+
+.pun TH {BACKGROUND-COLOR: #888888}
+
+/* 1.5 Fieldset legend text colour */
+
+.pun LEGEND {COLOR: #000000}
+
+/* 1.6 Highlighted text for various items */
+
+.showhot, .pun DIV.blockmenu LI.isactive A, #posterror LI STRONG {COLOR: #000000}
+
+/* 1.7 Dark background for form elements */
+
+.pun TEXTAREA, .pun INPUT, .pun SELECT {BACKGROUND-COLOR: #000000; COLOR: #D4D4D4}
+
+/****************************************************************/
+/* 2. POST BACKGROUNDS AND TEXT */
+/****************************************************************/
+
+/* 2.1 This is the setup for posts. */
+
+DIV.blockpost DIV.box, DIV.postright, DIV.postfootright, #postpreview {BACKGROUND-COLOR: #FFFFFF}
+DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #000000}
+DIV.postleft, DIV.postfootleft, DIV.blockpost LABEL {BACKGROUND-COLOR: #888888}
+
+/* 2.2 Background for post headers and text colour for post numbers in viewtopic */
+
+DIV.blockpost H2 {BACKGROUND-COLOR: #AAAAAA}
+DIV.blockpost H2 SPAN.conr {COLOR: #000000}
+
+/* 2.3 This is the line above the signature in posts. Colour and background should be the same */
+
+.pun HR {BACKGROUND-COLOR: #000000;	COLOR: #000000}
+
+/****************************************************************/
+/* 3. BORDER COLOURS */
+/****************************************************************/
+
+/* 3.1 All external borders (H1 is the board title) */
+
+DIV.box {BORDER-COLOR: #000000}
+
+/* 3.2 Makes the top border of posts match the colour used for post headers */
+
+DIV.blockpost DIV.box {BORDER-COLOR: #565656 #525252 #525252}
+
+/* 3.3 Table internal borders. By default TH is same as background so border is invisible */
+
+.pun TD {BORDER-COLOR: #565656}
+.pun TH {BORDER-COLOR: #484848}
+
+/* 3.4 Creates the inset border for quote boxes, code boxes and form info boxes */
+
+.pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {BORDER-COLOR: #565656}
+
+/* 3.5 Gecko's default fieldset borders are really nasty so this gives them a colour
+without interferring with IE's rather nice default */
+
+.pun DIV>FIELDSET {BORDER-COLOR: #909090}
+
+/****************************************************************/
+/* 4. LINK COLOURS */
+/****************************************************************/
+
+/* 4.1 This is the default for all links */
+
+.pun A:link, .pun A:visited {COLOR: #990000}
+.pun A:hover {COLOR: #BB0000}
+
+/* 4.2 This is the colour for links in header rows and the navigation bar */
+
+.pun H2 A:link, .pun H2 A:visited {COLOR: #D4D4D4}
+.pun H2 A:hover {COLOR: #D4D4D4}
+
+/* 4.3 This is for closed topics and "hot" links */
+
+A:link.showclosed,  A:visited.showclosed {COLOR: #900}
+A:hover.showclosed {COLOR: #B00}
+A:link.showhot,  A:visited.showhot {COLOR: #990000}
+A:hover.showhot {COLOR: #BB0000}
+
+/****************************************************************/
+/* 5. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* 5.1 These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.inormal = everything else. By default only .inew and .inormal are visible.*/
+
+DIV.inew, DIV.inormal, DIV.iclosed, DIV.iredirect {
+	FLOAT: left;
+	MARGIN-TOP: 0.2em;
+	MARGIN-LEFT: 0.2em;
+	DISPLAY: block;
+	BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em;
+	BORDER-STYLE: solid
+}
+
+DIV.searchposts DIV.inew, DIV.searchposts DIV.inormal {MARGIN-LEFT: 0}
+
+DIV.iredirect {BORDER-COLOR: #383838 #383838 #383838 #383838}
+DIV.inormal, DIV.iclosed {BORDER-COLOR: #CC0000 #AA0000 #880000 #660000}
+DIV.inew {BORDER-COLOR: #FF0000 #DD0000 #BB0000 #990000}
+
+/* 5.2 Class .tclcon is a div inside the first column of tables with post indicators. The
+margin creates space for the post status indicator */
+
+TD DIV.tclcon {MARGIN-LEFT: 2.3em}
Index: /branches/rsr.v5.1.dev/web/punbb/theme/style/vgn2.css
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/theme/style/vgn2.css	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/theme/style/vgn2.css	(revision 1)
@@ -0,0 +1,233 @@
+/****************************************************************/
+/* 1. IMPORTED STYLESHEETS */
+/****************************************************************/
+
+/* Import the basic setup styles */
+@import url(imports/base.css);
+/* Import the colour scheme */
+@import url(imports/vgn2_cs.css);
+
+/****************************************************************/
+/* 2. TEXT SETTINGS */
+/****************************************************************/
+
+/* 2.1 This sets the default Font Group */
+
+.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
+	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
+}
+
+.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}
+
+/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
+* HTML .pun {FONT-SIZE: 68.75%}
+/* End IE Win Font Size */
+
+/* Set font size for tables because IE requires it */
+.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}
+
+/* 2.2 Set the font-size for preformatted text i.e in code boxes */
+
+.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}
+
+/* 2.3 Font size for headers */
+
+.pun H2, .pun H4 {FONT-SIZE: 1em}
+.pun H3 {FONT-SIZE: 1.1em}
+#brdtitle H1 {FONT-SIZE: 1.4em}
+
+/* 2.4 Larger text for particular items */
+
+DIV.postmsg P {LINE-HEIGHT: 1.4}
+DIV.postleft DT {FONT-SIZE: 1.1em}
+.pun PRE {FONT-SIZE: 1.2em}
+
+/* 2.5 Bold text */
+
+DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
+DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}
+
+/****************************************************************/
+/* 3. LINKS */
+/****************************************************************/
+
+.pun A:link, .pun A:visited {
+text-decoration: none;
+border-bottom: 1px solid #888888 }
+.pun A:hover {
+text-decoration: none;
+border-bottom: 1px solid #000000 }
+
+/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */
+
+#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
+.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
+.blockmenu A:link, .blockmenu A:visited {
+text-decoration: none }
+
+/* 3.2 Underline on hover for links in headers and main menu */
+
+#brdmenu A:hover, .blockpost H2 A:hover {
+text-decoration: none;
+border-bottom: 1px solid #000000 }
+
+/****************************************************************/
+/* 4. BORDER WIDTH AND STYLE */
+/****************************************************************/
+
+/* 4.1 By default borders are 1px solid */
+
+DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/* 4.2 Special settings for the board header. */
+
+#brdheader DIV.box {BORDER-TOP-WIDTH: 4px}
+
+/* 4.3 Borders for table cells */
+
+.pun TD, .pun TH {
+	BORDER-BOTTOM: none;
+	BORDER-RIGHT: none
+}
+
+.pun .tcl {BORDER-LEFT: none}
+
+/* 4.4 Special setting for fieldsets to preserve IE defaults */
+
+DIV>FIELDSET {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/****************************************************************/
+/* 5. VERTICAL AND PAGE SPACING */
+/****************************************************************/
+
+/* 5.1 Page margins */
+
+HTML, BODY {MARGIN: 0; PADDING: 0}
+#punwrap {margin:12px 75px}
+
+/* 5.2 Creates vertical space between main board elements (Margins) */
+
+DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
+#punindex DIV.blocktable, DIV.blockpost {MARGIN-BOTTOM: 6px}
+DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}
+
+/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */
+
+DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
+DIV.postlinksb {MARGIN-TOP: -6px}
+
+/* 5.4 Put a 12px gap above the board information box in index because the category tables only
+have a 6px space beneath them */
+
+#brdstats {MARGIN-TOP: 12px}
+
+/****************************************************************/
+/* 6. SPACING AROUND CONTENT */
+/****************************************************************/
+
+/* 6.1 Default padding for main items */
+
+DIV.block DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
+.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}
+.pun H2 {PADDING: 4px 6px}
+
+/* 6.2 Special spacing for various elements */
+
+.pun H1 {PADDING: 3px 0px 0px 0}
+#brdtitle P {PADDING-TOP: 0px}
+DIV.linkst {PADDING: 8px 6px 3px 6px}
+DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
+#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
+#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}
+
+/* 6.4 Create some horizontal spacing for various elements */
+
+#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}
+
+/****************************************************************/
+/* 7. SPACING FOR TABLES */
+/****************************************************************/
+
+.pun TH, .pun TD {PADDING: 4px 6px}
+.pun TD P {PADDING: 5px 0 0 0}
+
+/****************************************************************/
+/* 8. SPACING FOR POSTS */
+/****************************************************************/
+
+/* 8.1 Padding around left and right columns in viewtopic */
+
+DIV.postleft DL, DIV.postright {PADDING: 6px}
+
+/* 8.2 Extra spacing for poster contact details and avatar */
+
+DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
+DD.postavatar {MARGIN-BOTTOM: 5px}
+
+/* 8.3 Extra top spacing for signatures and edited by */
+
+DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}
+
+/* 8.4 Spacing for code and quote boxes */
+
+DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
+.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}
+
+/* 8.5 Padding for the action links and online indicator in viewtopic */
+
+DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}
+
+/* 8.6 This is the input on moderators multi-delete view */
+
+DIV.blockpost INPUT, DIV.blockpost LABEL {
+	PADDING: 3px;
+	DISPLAY: inline
+}
+
+P.multidelete {
+	PADDING-TOP: 15px;
+	PADDING-BOTTOM: 5px
+}
+
+/* 8.7 Make sure paragraphs in posts don't get any padding */
+
+DIV.postmsg P {PADDING: 0}
+
+/****************************************************************/
+/* 9. SPECIAL SPACING FOR FORMS */
+/****************************************************************/
+
+/* 9.1 Padding around fieldsets */
+
+DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
+DIV.inform {PADDING-BOTTOM: 12px}
+
+/* 9.2 Padding inside fieldsets */
+
+.pun FIELDSET {PADDING: 0px 12px 0px 12px}
+DIV.infldset {PADDING: 9px 0px 12px 0}
+.pun LEGEND {PADDING: 0px 6px}
+
+/* 9.3 The information box at the top of the registration form and elsewhere */
+
+DIV.forminfo {
+	MARGIN-BOTTOM: 12px;
+	PADDING: 9px 10px
+}
+
+/* 9.4 BBCode help links in post forms */
+
+UL.bblinks LI {PADDING-RIGHT: 20px}
+
+UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}
+
+/* 9.5 Horizontal positioning for the submit button on forms */
+
+DIV.blockform P INPUT {MARGIN-LEFT: 12px}
+
Index: /branches/rsr.v5.1.dev/web/punbb/userlist.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/userlist.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/userlist.php	(revision 1)
@@ -0,0 +1,193 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+// Load the userlist.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/userlist.php';
+
+// Load the search.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/search.php';
+
+
+// Determine if we are allowed to view post counts
+$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;
+
+$username = (isset($_GET['username']) && $pun_user['g_search_users'] == '1') ? $_GET['username'] : '';
+$show_group = (!isset($_GET['show_group']) || intval($_GET['show_group']) < -1 && intval($_GET['show_group']) > 2) ? -1 : intval($_GET['show_group']);
+$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
+$sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list'];
+if ($pun_user['g_search_users'] == '1')
+	$focus_element = array('userlist', 'username');
+
+define('PUN_ALLOW_INDEX', 1);
+require PUN_ROOT.'header.php';
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_search['User search'] ?></span></h2>
+	<div class="box">
+	<form id="userlist" method="get" action="userlist.php">
+		<div class="inform">
+			<fieldset>
+				<legend><?php echo $lang_ul['User find legend'] ?></legend>
+				<div class="infldset">
+<?php if ($pun_user['g_search_users'] == '1'): ?>					<label class="conl"><?php echo $lang_common['Username'] ?><br /><input type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
+<?php endif; ?>					<label class="conl"><?php echo $lang_ul['User group']."\n" ?>
+					<br /><select name="show_group">
+						<option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
+<?php
+
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
+
+while ($cur_group = $db->fetch_assoc($result))
+{
+	if ($cur_group['g_id'] == $show_group)
+		echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+	else
+		echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+}
+
+?>
+					</select>
+					<br /></label>
+					<label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
+					<br /><select name="sort_by">
+						<option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
+						<option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
+<?php if ($show_post_count): ?>						<option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
+<?php endif; ?>					</select>
+					<br /></label>
+					<label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
+					<br /><select name="sort_dir">
+						<option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
+						<option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
+					</select>
+					<br /></label>
+					<p class="clearb"><?php echo $lang_ul['User search info'] ?></p>
+				</div>
+			</fieldset>
+		</div>
+		<p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
+	</form>
+	</div>
+</div>
+<?php
+
+
+// Create any SQL for the WHERE clause
+$where_sql = array();
+$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
+
+if ($pun_user['g_search_users'] == '1' && $username != '')
+	$where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
+if ($show_group > -1)
+	$where_sql[] = 'u.group_id='.$show_group;
+
+// Fetch user count
+$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE u.id>1 AND '.implode(' AND ', $where_sql) : '')) or error('Impossible de retrouver le nombre total de membres', __FILE__, __LINE__, $db->error());
+$num_users = $db->result($result);
+
+
+// Determine the user offset (based on $_GET['p'])
+$num_pages = ceil($num_users / 50);
+
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$start_from = 50 * ($p - 1);
+
+// Generate paging links
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&amp;show_group='.$show_group.'&amp;sort_by='.$sort_by.'&amp;sort_dir='.strtoupper($sort_dir));
+
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
+	</div>
+</div>
+
+<div id="users1" class="blocktable">
+	<h2><span><?php echo $lang_common['User list'] ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+		<table cellspacing="0">
+		<thead>
+			<tr>
+				<th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
+				<th class="tc2" scope="col"><?php echo $lang_common['Title'] ?></th>
+<?php if ($show_post_count): ?>				<th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
+<?php endif; ?>				<th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
+			</tr>
+		</thead>
+		<tbody>
+<?php
+
+// Grab the users
+$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Impossible de retrouver la liste des membres', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+	while ($user_data = $db->fetch_assoc($result))
+	{
+		$user_title_field = get_title($user_data);
+
+?>
+				<tr>
+					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
+					<td class="tc2"><?php echo $user_title_field ?></td>
+<?php if ($show_post_count): ?>					<td class="tc3"><?php echo $user_data['num_posts'] ?></td>
+<?php endif; ?>
+					<td class="tcr"><?php echo format_time($user_data['registered'], true) ?></td>
+				</tr>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t".'<tr>'."\n\t\t\t\t\t".'<td class="tcl" colspan="'.(($show_post_count) ? 4 : 3).'">'.$lang_search['No hits'].'</td></tr>'."\n";
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
+	</div>
+</div>
+<?php
+
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1.dev/web/punbb/v.5/out/dist/js/iepngfix.htc
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/v.5/out/dist/js/iepngfix.htc	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/v.5/out/dist/js/iepngfix.htc	(revision 1)
@@ -0,0 +1,103 @@
+<public:component>
+<public:attach event="onpropertychange" onevent="iePNGFix(0)" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0
+// (c) 2004-2008 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+
+// This must be a path to a blank image, relative to the HTML document(s).
+// In production use I suggest '/images/blank.gif' or similar. That's all!
+if (typeof blankImg == 'undefined') var blankImg = 'v.5/out/dist/images/blank.gif';
+
+
+
+function filt(s, b)
+{
+ var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+ var sM = (currentStyle.backgroundRepeat == 'no-repeat') ? 'crop' : 'scale';
+ s = (s || '').replace(/\(/g, '%28').replace(/\)/g, '%29');
+
+ if (s && !(/IMG|INPUT/.test(nodeName) && !b) &&
+  currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ {
+  style.width = offsetWidth + 'px';
+  style.height = clientHeight + 'px';
+  if (currentStyle.display == 'inline') style.display = 'inline-block';
+ }
+
+ if (filters[f])
+ {
+  filters[f].enabled = s ? true : false;
+  if (s) with (filters[f]) { src = s }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="' + sM + '")';
+}
+
+function iePNGFix(init)
+{
+ if (!/MSIE (5\.5|6)/.test(navigator.userAgent) || typeof filters == 'unknown') return;
+ var evt = init ? { propertyName: 'src,background' } : event;
+ var isSrc = /src/.test(evt.propertyName);
+ var isBg = /background/.test(evt.propertyName);
+ var isClass = !init &&
+  ((this.className != this._png_class) && (this.className || this._png_class));
+ if (!(isSrc || isBg || isClass)) return;
+ this._png_class = this.className;
+ var blank = blankImg.match(/([^\/]+)$/)[1];
+
+ // Required for Whatever:hover support - erase any set BG if className changes.
+ if (isClass && ((style.backgroundImage.indexOf('url(') == -1) ||
+     (style.backgroundImage.indexOf(blank) > -1)))
+ {
+  setTimeout(function() { this.style.backgroundImage = '' }, 0);
+  return;
+ }
+
+ if (isSrc && this.src && /IMG|INPUT/.test(nodeName))
+ {
+  if ((/\.png/i).test(src))
+  {
+   filt(src, 1);
+   src = blankImg;
+  }
+  else if (src.indexOf(blank) == -1) filt();
+ }
+
+ var bgSrc = currentStyle.backgroundImage || style.backgroundImage;
+ if ((bgSrc + this.src).indexOf(blank) == -1)
+ {
+  var bgPNG = bgSrc.match(/^url[("']+(.*\.png[^\)"']*)[\)"']+[^\)]*$/i);
+
+  if (bgPNG)
+  {
+   style.backgroundImage = 'url("' + blankImg + '")';
+   filt(bgPNG[1], 0);
+   // Unclickable elements inside PNG backgrounds.
+   var tags = ['a', 'input', 'select', 'textarea', 'iframe', 'object'],
+    t = tags.length, tFix = [];
+   while (t--)
+   {
+    var elms = all.tags(tags[t]), e = elms.length;
+    while (e--) tFix.push(elms[e]);
+   }
+   var t = tFix.length;
+   if (t && (/relative|absolute/i).test(currentStyle.position))
+    alert('IEPNGFix: Children of positioned element are unclickable:\n\n<' +
+     nodeName + (id && ' id=' + id) + '>');
+    while (t--)
+     if (!(/relative|absolute/i).test(tFix[t].currentStyle.position))
+      tFix[t].style.position = 'relative';
+  }
+  else filt();
+ }
+}
+
+iePNGFix(1);
+
+</script>
+</public:component>
Index: /branches/rsr.v5.1.dev/web/punbb/viewforum.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/viewforum.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/viewforum.php	(revision 1)
@@ -0,0 +1,256 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+if ($id < 1)
+	message($lang_common['Bad request']);
+
+// Load the viewforum.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
+
+// Fetch some info about the forum
+$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_forum = $db->fetch_assoc($result);
+
+// Is this a redirect forum? In that case, redirect!
+if ($cur_forum['redirect_url'] != '')
+{
+	header('Location: '.$cur_forum['redirect_url']);
+	exit;
+}
+
+// Sort out who the moderators are and if we are currently a moderator (or an admin)
+$mods_array = array();
+if ($cur_forum['moderators'] != '')
+	$mods_array = unserialize($cur_forum['moderators']);
+
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Can we or can we not post new topics?
+if (($cur_forum['post_topics'] == '' && $pun_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod)
+	$post_link = "\t\t".'<p class="postlink conr"><a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a></p>'."\n";
+else
+	$post_link = '';
+
+
+// Determine the topic offset (based on $_GET['p'])
+$num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
+
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$start_from = $pun_user['disp_topics'] * ($p - 1);
+
+// Generate paging links
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_forum['forum_name']);
+define('PUN_ALLOW_INDEX', 1);
+require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+<?php echo $post_link ?>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
+		<div class="clearer"></div>
+	</div>
+</div>
+
+<div id="vf" class="blocktable">
+	<h2><span><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<table cellspacing="0">
+			<thead>
+				<tr>
+					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
+					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
+					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
+				</tr>
+			</thead>
+			<tbody>
+<?php
+
+// Fetch list of topics to display on this page
+if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
+{
+	// Without "the dot"
+	$sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+}
+else
+{
+	// With "the dot"
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+			break;
+
+		case 'sqlite':
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.id IN(SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'].') GROUP BY t.id ORDER BY t.sticky DESC, t.last_post DESC';
+			break;
+
+		default:
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+			break;
+
+	}
+}
+
+$result = $db->query($sql) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+// If there are topics in this forum.
+if ($db->num_rows($result))
+{
+	while ($cur_topic = $db->fetch_assoc($result))
+	{
+		$icon_text = $lang_common['Normal icon'];
+		$item_status = '';
+		$icon_type = 'icon';
+
+		if ($cur_topic['moved_to'] == null)
+			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
+		else
+			$last_post = '&#160;';
+
+		if ($pun_config['o_censoring'] == '1')
+			$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+		if ($cur_topic['moved_to'] != 0)
+			$subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else if ($cur_topic['closed'] == '0')
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else
+		{
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+			$icon_text = $lang_common['Closed icon'];
+			$item_status = 'iclosed';
+		}
+
+		if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
+		{
+			$icon_text .= ' '.$lang_common['New icon'];
+			$item_status .= ' inew';
+			$icon_type = 'icon inew';
+			$subject = '<strong>'.$subject.'</strong>';
+			$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
+		}
+		else
+			$subject_new_posts = null;
+
+		// Should we display the dot or not? :)
+		if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
+		{
+			if ($cur_topic['has_posted'] == $pun_user['id'])
+				$subject = '<strong>&middot;</strong>&#160;'.$subject;
+			else
+				$subject = '&#160;&#160;'.$subject;
+		}
+
+		if ($cur_topic['sticky'] == '1')
+		{
+			$subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
+			$item_status .= ' isticky';
+			$icon_text .= ' '.$lang_forum['Sticky'];
+		}
+
+		$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
+
+		if ($num_pages_topic > 1)
+			$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
+		else
+			$subject_multipage = null;
+
+		// Should we show the "New posts" and/or the multipage links?
+		if (!empty($subject_new_posts) || !empty($subject_multipage))
+		{
+			$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
+			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
+		}
+
+?>
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
+					<td class="tcl">
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
+							<div class="tclcon">
+								<?php echo $subject."\n" ?>
+							</div>
+						</div>
+					</td>
+					<td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : '&#160;' ?></td>
+					<td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
+				</tr>
+<?php
+
+	}
+}
+else
+{
+
+?>
+				<tr>
+					<td class="tcl" colspan="4"><?php echo $lang_forum['Empty forum'] ?></td>
+				</tr>
+<?php
+
+}
+
+?>
+			</tbody>
+			</table>
+		</div>
+	</div>
+</div>
+
+<div class="linksb">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+<?php echo $post_link ?>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
+		<div class="clearer"></div>
+	</div>
+</div>
+<?php
+
+$forum_id = $id;
+$footer_style = 'viewforum';
+require PUN_ROOT.'footer.php';
+
Index: /branches/rsr.v5.1.dev/web/punbb/viewtopic.php
===================================================================
--- /branches/rsr.v5.1.dev/web/punbb/viewtopic.php	(revision 1)
+++ /branches/rsr.v5.1.dev/web/punbb/viewtopic.php	(revision 1)
@@ -0,0 +1,411 @@
+<?php
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
+require PUN_ROOT.'include/common.php';
+
+if ($pun_user['g_read_board'] == '0')
+	message($lang_common['No view']);
+
+
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
+$pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
+if ($id < 1 && $pid < 1)
+	message($lang_common['Bad request']);
+
+// Load the viewtopic.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
+
+
+// If a post ID is specified we determine topic ID and page number so we can redirect to the correct message
+if ($pid)
+{
+	$result = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id='.$pid) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_common['Bad request']);
+
+	$id = $db->result($result);
+
+	// Determine on what page the post is located (depending on $pun_user['disp_posts'])
+	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	$num_posts = $db->num_rows($result);
+
+	for ($i = 0; $i < $num_posts; ++$i)
+	{
+		$cur_id = $db->result($result, $i);
+		if ($cur_id == $pid)
+			break;
+	}
+	++$i;	// we started at 0
+
+	$_GET['p'] = ceil($i / $pun_user['disp_posts']);
+}
+
+// If action=new, we redirect to the first new post (if any)
+else if ($action == 'new' && !$pun_user['is_guest'])
+{
+	$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted>'.$pun_user['last_visit']) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	$first_new_post_id = $db->result($result);
+
+	if ($first_new_post_id)
+		header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id);
+	else	// If there is no new post, we go to the last post
+		header('Location: viewtopic.php?id='.$id.'&action=last');
+
+	exit;
+}
+
+// If action=last, we redirect to the last post
+else if ($action == 'last')
+{
+	$result = $db->query('SELECT MAX(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	$last_post_id = $db->result($result);
+
+	if ($last_post_id)
+	{
+		header('Location: viewtopic.php?pid='.$last_post_id.'#p'.$last_post_id);
+		exit;
+	}
+}
+
+
+// Fetch some info about the topic
+if (!$pun_user['is_guest'])
+	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());
+else
+	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());
+
+if (!$db->num_rows($result))
+	message($lang_common['Bad request']);
+
+$cur_topic = $db->fetch_assoc($result);
+
+// Sort out who the moderators are and if we are currently a moderator (or an admin)
+$mods_array = ($cur_topic['moderators'] != '') ? unserialize($cur_topic['moderators']) : array();
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Can we or can we not post replies?
+if ($cur_topic['closed'] == '0')
+{
+	if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1' || $is_admmod)
+		$post_link = '<a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
+	else
+		$post_link = '&#160;';
+}
+else
+{
+	$post_link = $lang_topic['Topic closed'];
+
+	if ($is_admmod)
+		$post_link .= ' / <a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
+}
+
+
+// Determine the post offset (based on $_GET['p'])
+$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
+
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$start_from = $pun_user['disp_posts'] * ($p - 1);
+
+// Generate paging links
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewtopic.php?id='.$id);
+
+
+if ($pun_config['o_censoring'] == '1')
+	$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+
+$quickpost = false;
+if ($pun_config['o_quickpost'] == '1' &&
+	!$pun_user['is_guest'] &&
+	($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) &&
+	($cur_topic['closed'] == '0' || $is_admmod))
+{
+	$required_fields = array('req_message' => $lang_common['Message']);
+	$quickpost = true;
+}
+
+if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == '1')
+{
+	if ($cur_topic['is_subscribed'])
+		// I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
+		$subscraction = '<p class="subscribelink clearb">'.$lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n";
+	else
+		$subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n";
+}
+else
+	$subscraction = '<div class="clearer"></div>'."\n";
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_topic['subject']);
+define('PUN_ALLOW_INDEX', 1);
+require PUN_ROOT.'header.php';
+
+?>
+<div class="linkst">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="postlink conr"><?php echo $post_link ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
+		<div class="clearer"></div>
+	</div>
+</div>
+
+<?php
+
+
+require PUN_ROOT.'include/parser.php';
+
+$bg_switch = true;	// Used for switching background color in posts
+$post_count = 0;	// Keep track of post numbers
+
+// Retrieve the posts (and their respective poster/online status)
+$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+while ($cur_post = $db->fetch_assoc($result))
+{
+	$post_count++;
+	$user_avatar = '';
+	$user_info = array();
+	$user_contacts = array();
+	$post_actions = array();
+	$is_online = '';
+	$signature = '';
+
+	// If the poster is a registered user.
+	if ($cur_post['poster_id'] > 1)
+	{
+		$username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';
+		$user_title = get_title($cur_post);
+
+		if ($pun_config['o_censoring'] == '1')
+			$user_title = censor_words($user_title);
+
+		// Format the online indicator
+		$is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline'];
+
+		if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
+		{
+			if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
+		}
+		else
+			$user_avatar = '';
+
+		// We only show location, register date, post count and the contact links if "Show user info" is enabled
+		if ($pun_config['o_show_user_info'] == '1')
+		{
+			if ($cur_post['location'] != '')
+			{
+				if ($pun_config['o_censoring'] == '1')
+					$cur_post['location'] = censor_words($cur_post['location']);
+
+				$user_info[] = '<dd>'.$lang_topic['From'].': '.pun_htmlspecialchars($cur_post['location']);
+			}
+
+			$user_info[] = '<dd>'.$lang_common['Registered'].': '.date($pun_config['o_date_format'], $cur_post['registered']);
+
+			if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+				$user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];
+
+			// Now let's deal with the contact links (E-mail and URL)
+			if (($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['g_id'] < PUN_GUEST)
+				$user_contacts[] = '<a href="mailto:'.$cur_post['email'].'">'.$lang_common['E-mail'].'</a>';
+			else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'])
+				$user_contacts[] = '<a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['E-mail'].'</a>';
+
+			if ($cur_post['url'] != '')
+				$user_contacts[] = '<a href="'.pun_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a>';
+		}
+
+		if ($pun_user['g_id'] < PUN_GUEST)
+		{
+			$user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
+
+			if ($cur_post['admin_note'] != '')
+				$user_info[] = '<dd>'.$lang_topic['Note'].': <strong>'.pun_htmlspecialchars($cur_post['admin_note']).'</strong>';
+		}
+	}
+	// If the poster is a guest (or a user that has been deleted)
+	else
+	{
+		$username = pun_htmlspecialchars($cur_post['username']);
+		$user_title = get_title($cur_post);
+
+		if ($pun_user['g_id'] < PUN_GUEST)
+			$user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
+
+		if ($pun_config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$pun_user['is_guest'])
+			$user_contacts[] = '<a href="mailto:'.$cur_post['poster_email'].'">'.$lang_common['E-mail'].'</a>';
+	}
+
+	// Generation post action array (quote, edit, delete etc.)
+	if (!$is_admmod)
+	{
+		if (!$pun_user['is_guest'])
+			$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';
+
+		if ($cur_topic['closed'] == '0')
+		{
+			if ($cur_post['poster_id'] == $pun_user['id'])
+			{
+				if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1'))
+					$post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>';
+				if ($pun_user['g_edit_posts'] == '1')
+					$post_actions[] = '<li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>';
+			}
+
+			if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1')
+				$post_actions[] = '<li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
+		}
+	}
+	else
+		$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
+
+
+	// Switch the background color for every message.
+	$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+	$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
+
+
+	// Perform the main parsing of the message (BBCode, smilies, censor words etc)
+
+// ----------------------------------------------------
+// ajout dj3c1t 01/2008
+//
+// pour pouvoir poster des players dans les ÃÂ©ditos et les news, on autorise le code html
+// lorsque c'est la team RSR qui poste.
+//
+
+	if($cur_post['g_id'] == 1)
+        { $cur_post['message'] = str_replace
+          ( array("&gt;", "&lt;", "&quot;"),
+            array(">", "<", "\""),
+            parse_message($cur_post['message'], $cur_post['hide_smilies'])
+          );
+        }
+        else $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
+
+	// Do signature parsing/caching
+	if ($cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
+	{
+		if (isset($signature_cache[$cur_post['poster_id']]))
+			$signature = $signature_cache[$cur_post['poster_id']];
+		else
+		{
+			$signature = parse_signature($cur_post['signature']);
+			$signature_cache[$cur_post['poster_id']] = $signature;
+		}
+	}
+
+?>
+<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo $vtbg ?><?php if (($post_count + $start_from) == 1) echo ' firstpost'; ?>">
+	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&#160;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
+	<div class="box">
+		<div class="inbox">
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo $username ?></strong></dt>
+					<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
+					<dd class="postavatar"><?php echo $user_avatar ?></dd>
+<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
+<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('&#160;&#160;', $user_contacts).'</dd>'."\n"; ?>
+				</dl>
+			</div>
+			<div class="postright">
+				<h3><?php if (($post_count + $start_from) > 1) echo ' Re: '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>
+				<div class="postmsg">
+					<?php echo $cur_post['message']."\n" ?>
+<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
+				</div>
+<?php if ($signature != '') echo "\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?>
+			</div>
+			<div class="clearer"></div>
+			<div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div>
+			<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($lang_topic['Link separator'].'</li>', $post_actions).'</li></ul></div>'."\n" : '<div>&#160;</div></div>'."\n" ?>
+		</div>
+	</div>
+</div>
+
+<?php
+
+}
+
+?>
+<div class="postlinksb">
+	<div class="inbox">
+		<p class="postlink conr"><?php echo $post_link ?></p>
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
+		<?php echo $subscraction ?>
+	</div>
+</div>
+
+<?php
+
+// Display quick post if enabled
+if ($quickpost)
+{
+
+?>
+<div class="blockform">
+	<h2><span><?php echo $lang_topic['Quick post'] ?></span></h2>
+	<div class="box">
+		<form id="post" method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
+
+			<div class="inform">
+				<fieldset>
+					<legend><?php echo $lang_common['Write message legend'] ?></legend>
+					<div class="infldset txtarea">
+						<input type="hidden" name="form_sent" value="1" />
+						<input type="hidden" name="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
+						<?php require PUN_ROOT.'mod_easy_bbcode.php'; ?>
+						<label><textarea name="req_message" rows="7" cols="75" tabindex="1"></textarea></label>
+						<ul class="bblinks">
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+						</ul>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="submit" tabindex="2" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
+		</form>
+	</div>
+</div>
+<?php
+
+}
+
+// Increment "num_views" for topic
+$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
+$db->query('UPDATE '.$low_prio.$db->prefix.'topics SET num_views=num_views+1 WHERE id='.$id) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
+
+$forum_id = $cur_topic['forum_id'];
+$footer_style = 'viewtopic';
+require PUN_ROOT.'footer.php';
Index: /branches/rsr.v5.1/web/app/out/dist/views/footer.php
===================================================================
--- /branches/rsr.v5.1/web/app/out/dist/views/footer.php	(revision 10)
+++ /branches/rsr.v5.1/web/app/out/dist/views/footer.php	(revision 1)
@@ -42,5 +42,5 @@
     <ul>
       <li><a href="<?= $env->url(array("e" => "contact")) ?>">Contactez-nous</a></li>
-      <li><a href="http://www.revolutionsoundrecords.org/trac">rsr - v.5 (trac)</a></li>
+      <li><a href="http://wiki.rsr.free.fr/wiki">rsr - v.5</a></li>
     </ul>
   </div>
Index: /branches/rsr.v5.1/web/install/dist/sql/content.sql
===================================================================
--- /branches/rsr.v5.1/web/install/dist/sql/content.sql	(revision 10)
+++ /branches/rsr.v5.1/web/install/dist/sql/content.sql	(revision 1)
@@ -11,5 +11,5 @@
 (143, 'news', 'accueil_droite_bas', 'Les autres news', 'news.php', '', 186, '2009-09-01 19:57:51', 186, '2010-08-05 01:48:55', '2009-09-06 17:16:52', 1, 2),
 (152, 'forum_interne', 'interne_gauche', 'Forum', 'accueil_forum.php', '<p>Ce bloc affiche les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:46:30', 186, '2011-11-12 15:52:34', '2009-09-06 19:48:57', 0, 4),
-(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://www.revolutionsoundrecords.org/trac">le trac</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
+(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://wiki.rsr.free.fr/wiki">le wiki</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
 (128, 'administration', NULL, 'Administration', 'admin.php', '', 186, '2009-08-10 10:27:12', 186, '2009-09-06 00:13:40', '2009-09-06 00:13:40', 1, 4),
 (155, '', 'interne_gauche', 'News', 'menu_news.php', '<p>Affiche les 2 derni&egrave;res news et un menu pour acc&eacute;der aux autres news.</p>', 186, '2010-01-15 22:39:32', 186, '2011-11-12 16:10:38', NULL, 1, 1),
Index: /trunk/web/app/data/modules/data_users.php
===================================================================
--- /trunk/web/app/data/modules/data_users.php	(revision 10)
+++ /trunk/web/app/data/modules/data_users.php	(revision 1)
@@ -99,13 +99,10 @@
        'username=\''.$db->escape($form_username).'\''
       :'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
-      $_sql = 
-       'SELECT id, group_id, password'
-      .' FROM '.$db->prefix.'users'
-      .' WHERE '.$username_sql;
       $result = $db->query
-      ( $_sql
+      ( 'SELECT id, group_id, password, save_pass'
+       .' FROM '.$db->prefix.'users'
+       .' WHERE '.$username_sql
       ) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
-      list($user_id, $group_id, $db_password_hash) = $db->fetch_row($result);
-      $save_pass = 1;
+      list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
       $authorized = false;
       if(!empty($db_password_hash))
Index: /trunk/web/app/out/dist/content/set_artistes/e_add_user_artiste.php
===================================================================
--- /trunk/web/app/out/dist/content/set_artistes/e_add_user_artiste.php	(revision 10)
+++ /trunk/web/app/out/dist/content/set_artistes/e_add_user_artiste.php	(revision 1)
@@ -32,5 +32,5 @@
     </td>
   </tr>
-  <!-- tr>
+  <tr>
     <td>
       <p><strong>dossier personnel</p></strong>
@@ -38,5 +38,5 @@
       <input type="text" name="dossier_personnel" size="50" value="" />
     </td>
-  </tr -->
+  </tr>
   <tr>
     <td colspan="2" align="right">
Index: /trunk/web/app/out/dist/content/set_artistes/e_set_user_artiste.php
===================================================================
--- /trunk/web/app/out/dist/content/set_artistes/e_set_user_artiste.php	(revision 10)
+++ /trunk/web/app/out/dist/content/set_artistes/e_set_user_artiste.php	(revision 1)
@@ -36,5 +36,5 @@
     </td>
   </tr>
-  <!-- tr>
+  <tr>
     <td>
       <p><strong>dossier personnel</p></strong>
@@ -42,5 +42,5 @@
       <input type="text" name="dossier_personnel" size="50" value="<?= $env->out["artiste"]["dossier_personnel"] ?>" />
     </td>
-  </tr -->
+  </tr>
   <tr>
     <td colspan="2" align="right">
Index: /trunk/web/app/out/dist/views/footer.php
===================================================================
--- /trunk/web/app/out/dist/views/footer.php	(revision 10)
+++ /trunk/web/app/out/dist/views/footer.php	(revision 1)
@@ -42,5 +42,5 @@
     <ul>
       <li><a href="<?= $env->url(array("e" => "contact")) ?>">Contactez-nous</a></li>
-      <li><a href="http://www.revolutionsoundrecords.org/trac">rsr - v.5 (trac)</a></li>
+      <li><a href="http://wiki.rsr.free.fr/wiki">rsr - v.5</a></li>
     </ul>
   </div>
Index: /trunk/web/install/app/01_utils.php
===================================================================
--- /trunk/web/install/app/01_utils.php	(revision 10)
+++ /trunk/web/install/app/01_utils.php	(revision 1)
@@ -13,5 +13,3 @@
   }
 
-  function error($message) {}
-
 ?>
Index: /trunk/web/install/dist/sql/champs_content.txt
===================================================================
--- /trunk/web/install/dist/sql/champs_content.txt	(revision 1)
+++ /trunk/web/install/dist/sql/champs_content.txt	(revision 1)
@@ -0,0 +1,3 @@
+[site_name]
+[email_admin]
+[pun_url]
Index: /trunk/web/install/dist/sql/content.sql
===================================================================
--- /trunk/web/install/dist/sql/content.sql	(revision 10)
+++ /trunk/web/install/dist/sql/content.sql	(revision 1)
@@ -11,5 +11,5 @@
 (143, 'news', 'accueil_droite_bas', 'Les autres news', 'news.php', '', 186, '2009-09-01 19:57:51', 186, '2010-08-05 01:48:55', '2009-09-06 17:16:52', 1, 2),
 (152, 'forum_interne', 'interne_gauche', 'Forum', 'accueil_forum.php', '<p>Ce bloc affiche les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:46:30', 186, '2011-11-12 15:52:34', '2009-09-06 19:48:57', 0, 4),
-(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://www.revolutionsoundrecords.org/trac">le trac</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
+(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://wiki.rsr.free.fr/wiki">le wiki</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
 (128, 'administration', NULL, 'Administration', 'admin.php', '', 186, '2009-08-10 10:27:12', 186, '2009-09-06 00:13:40', '2009-09-06 00:13:40', 1, 4),
 (155, '', 'interne_gauche', 'News', 'menu_news.php', '<p>Affiche les 2 derni&egrave;res news et un menu pour acc&eacute;der aux autres news.</p>', 186, '2010-01-15 22:39:32', 186, '2011-11-12 16:10:38', NULL, 1, 1),
@@ -88,4 +88,5 @@
 INSERT INTO `[prefix]contenus` (`id`, `nom`, `categorie`, `titre`, `description`, `contenu`, `auteur_creation`, `date_creation`, `auteur_modification`, `date_modification`, `date_publication`, `public`, `ordre`) VALUES
 (919, '', 1, 'Nouvelle installation', '', '<p>Bienvenue sur votre installation de rsr v.5.</p>\r\n<p>Pensez &agrave; effacer le dossier <strong>install</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Bonnes publications !</p>', 186, '2011-09-04 15:03:09', 186, '2011-11-12 22:07:24', '2011-09-04 00:00:00', 1, NULL);
+
 # --
 INSERT INTO `[prefix]formats` (`id`, `nom`, `content_type`) VALUES
@@ -119,12 +120,12 @@
 # --
 INSERT INTO `[prefix]pun_config` (`conf_name`, `conf_value`) VALUES
-('o_cur_version', '1.4.7'),
+('o_cur_version', '1.2.10'),
 ('o_cur_version_fr', '1.2.10'),
 ('o_board_title', 'Forums'),
 ('o_board_desc', NULL),
-('o_default_timezone', '0'),
+('o_server_timezone', '0'),
 ('o_time_format', 'H:i:s'),
 ('o_date_format', 'd-m-Y'),
-('o_timeout_visit', '1800'),
+('o_timeout_visit', '600'),
 ('o_timeout_online', '300'),
 ('o_redirect_delay', '1'),
@@ -162,5 +163,5 @@
 ('o_admin_email', '[email_admin]'),
 ('o_webmaster_email', '[email_admin]'),
-('o_topic_subscriptions', '1'),
+('o_subscriptions', '1'),
 ('o_smtp_host', NULL),
 ('o_smtp_user', NULL),
@@ -176,5 +177,8 @@
 ('o_maintenance', '0'),
 ('o_maintenance_message', 'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Nous vous prions de bien vouloir nous excuser pour cette gÃšne. Veuillez essayer Ã  nouveau d''ici quelques minutes.<br />\n<br />\nRevolution Sound Records'),
-('o_forum_subscriptions', '1'),
+('p_mod_edit_users', '1'),
+('p_mod_rename_users', '0'),
+('p_mod_change_passwords', '0'),
+('p_mod_ban_users', '0'),
 ('p_message_bbcode', '1'),
 ('p_message_img_tag', '1'),
@@ -188,16 +192,5 @@
 ('p_allow_banned_email', '1'),
 ('p_allow_dupe_email', '0'),
-('p_force_guest_email', '1'),
-('o_database_revision', '15'),
-('o_searchindex_revision', '2'),
-('o_parser_revision', '2'),
-('o_default_email_setting', '1'),
-('o_topic_views', '1'),
-('o_signatures', '1'),
-('o_smtp_ssl', '0'),
-('o_default_dst', '0'),
-('o_quote_depth', '3'),
-('o_feed_type', '2'),
-('o_feed_ttl', '0');
+('p_force_guest_email', '1');
 # --
 INSERT INTO `[prefix]pun_forum_perms` (`group_id`, `forum_id`, `read_forum`, `post_replies`, `post_topics`) VALUES
@@ -227,14 +220,14 @@
 (6, 80, 0, 0, 0);
 # --
-INSERT INTO `[prefix]pun_groups` (`g_id`, `g_title`, `g_user_title`, `g_moderator`, `g_mod_edit_users`, `g_mod_rename_users`, `g_mod_change_passwords`, `g_mod_ban_users`, `g_read_board`, `g_view_users`, `g_post_replies`, `g_post_topics`, `g_edit_posts`, `g_delete_posts`, `g_delete_topics`, `g_set_title`, `g_search`, `g_search_users`, `g_send_email`, `g_post_flood`, `g_search_flood`, `g_email_flood`, `g_report_flood`) VALUES
-(1, 'Admin', 'Admin', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0),
-(2, 'ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0),
-(3, 'Touriste', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0),
-(4, 'Membres', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60),
-(5, 'Artiste', 'Artiste', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 10, 10, 60, 60),
-(6, '100 eme Membre', '100 eme Membre', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60);
-# --
-INSERT INTO `[prefix]pun_online` (`user_id`, `ident`, `logged`, `idle`, `last_post`, `last_search`) VALUES
-(1, '192.168.10.13', 1321306351, 0, NULL, NULL);
+INSERT INTO `[prefix]pun_groups` (`g_id`, `g_title`, `g_user_title`, `g_read_board`, `g_post_replies`, `g_post_topics`, `g_post_polls`, `g_edit_posts`, `g_delete_posts`, `g_delete_topics`, `g_set_title`, `g_search`, `g_search_users`, `g_edit_subjects_interval`, `g_post_flood`, `g_search_flood`) VALUES
+(1, 'Admin', 'Admin', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
+(2, 'ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
+(3, 'Touriste', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0),
+(4, 'Membres', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30),
+(5, 'Artiste', 'Artiste', 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 10, 10),
+(6, '100 eme Membre', '100 eme Membre', 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30);
+# --
+INSERT INTO `[prefix]pun_online` (`user_id`, `ident`, `logged`, `idle`) VALUES
+(1, '192.168.10.13', 1321118546, 0);
 # --
 INSERT INTO `[prefix]pun_ranks` (`id`, `rank`, `min_posts`) VALUES
@@ -261,5 +254,5 @@
 (87, 'terminator.png', ':terminator:', 0);
 # --
-INSERT INTO `[prefix]pun_users` (`id`, `group_id`, `username`, `password`, `email`, `title`, `realname`, `url`, `jabber`, `icq`, `msn`, `aim`, `yahoo`, `location`, `signature`, `disp_topics`, `disp_posts`, `email_setting`, `notify_with_post`, `auto_notify`, `show_smilies`, `show_img`, `show_img_sig`, `show_avatars`, `show_sig`, `timezone`, `dst`, `date_format`, `time_format`, `language`, `style`, `num_posts`, `last_post`, `last_search`, `last_email_sent`, `last_report_sent`, `registered`, `registration_ip`, `last_visit`, `admin_note`, `activate_string`, `activate_key`) VALUES
-(186, 1, 'admin', '90f1b3c6cf62b05606b215265803f553e22bc657', '[email_admin]', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 'French', 'Rsr', 1382, 1321043538, NULL, NULL, NULL, 1156702867, '82.243.194.97', 1321305012, NULL, NULL, NULL),
-(1, 3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 'English', 'Oxygen', 0, NULL, NULL, NULL, NULL, 0, '0.0.0.0', 0, NULL, NULL, NULL);
+INSERT INTO `[prefix]pun_users` (`id`, `group_id`, `username`, `password`, `email`, `title`, `realname`, `url`, `jabber`, `icq`, `msn`, `aim`, `yahoo`, `location`, `use_avatar`, `signature`, `disp_topics`, `disp_posts`, `email_setting`, `save_pass`, `notify_with_post`, `show_smilies`, `show_img`, `show_img_sig`, `show_avatars`, `show_sig`, `timezone`, `language`, `style`, `num_posts`, `last_post`, `registered`, `registration_ip`, `last_visit`, `admin_note`, `activate_string`, `activate_key`) VALUES
+(186, 1, 'admin', '90f1b3c6cf62b05606b215265803f553e22bc657', '[email_admin]', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 1, 1, 0, 1, 1, 1, 1, 1, 0, 'French', 'Rsr', 1382, 1321043538, 1156702867, '82.243.194.97', 1321118443, NULL, NULL, NULL),
+(1, 3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 1, 1, 0, 1, 1, 1, 1, 1, 0, 'English', 'Oxygen', 0, NULL, 0, '0.0.0.0', 0, NULL, NULL, NULL);
Index: /trunk/web/install/dist/sql/raz.sql
===================================================================
--- /trunk/web/install/dist/sql/raz.sql	(revision 10)
+++ /trunk/web/install/dist/sql/raz.sql	(revision 1)
@@ -27,5 +27,5 @@
 DROP TABLE IF EXISTS `[prefix]playlists`;
 # --
-DROP TABLE IF EXISTS `[prefix]playlist_download`;
+DROP TABLE IF EXISTS `[prefix]playlis[prefix]download`;
 # --
 DROP TABLE IF EXISTS `[prefix]pun_bans`;
@@ -40,6 +40,4 @@
 # --
 DROP TABLE IF EXISTS `[prefix]pun_forum_perms`;
-# --
-DROP TABLE IF EXISTS `[prefix]pun_forum_subscriptions`;
 # --
 DROP TABLE IF EXISTS `[prefix]pun_groups`;
@@ -61,7 +59,7 @@
 DROP TABLE IF EXISTS `[prefix]pun_smilies`;
 # --
+DROP TABLE IF EXISTS `[prefix]pun_subscriptions`;
+# --
 DROP TABLE IF EXISTS `[prefix]pun_topics`;
-# --
-DROP TABLE IF EXISTS `[prefix]pun_topic_subscriptions`;
 # --
 DROP TABLE IF EXISTS `[prefix]pun_users`;
Index: unk/web/install/dist/sql/rsr.v5.all.sql
===================================================================
--- /trunk/web/install/dist/sql/rsr.v5.all.sql	(revision 10)
+++ 	(revision )
@@ -1,1165 +1,0 @@
--- phpMyAdmin SQL Dump
--- version 3.2.2.1deb1
--- http://www.phpmyadmin.net
---
--- Serveur: localhost
--- GÃ©nÃ©rÃ© le : Lun 14 Novembre 2011 Ã  22:36
--- Version du serveur: 5.1.37
--- Version de PHP: 5.2.10-2ubuntu6.10
-
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-
---
--- Base de donnÃ©es: `rsr_v5`
---
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_albums`
---
-
-DROP TABLE IF EXISTS `rsrv5_albums`;
-CREATE TABLE `rsrv5_albums` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `id_artiste` int(11) NOT NULL,
-  `titre` varchar(255) DEFAULT NULL,
-  `image` varchar(255) NOT NULL,
-  `description` text,
-  `url` varchar(255) DEFAULT NULL,
-  `format` int(11) DEFAULT NULL,
-  `taille` int(11) DEFAULT NULL,
-  `date_creation` date DEFAULT NULL,
-  `date_publication` date DEFAULT NULL,
-  `compteur` int(11) NOT NULL DEFAULT '0',
-  `actif` tinyint(4) NOT NULL DEFAULT '1',
-  `ordre` int(11) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_albums`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_artistes`
---
-
-DROP TABLE IF EXISTS `rsrv5_artistes`;
-CREATE TABLE `rsrv5_artistes` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(255) DEFAULT NULL,
-  `presentation` text,
-  `style` varchar(255) DEFAULT NULL,
-  `image` varchar(255) DEFAULT NULL,
-  `pays` varchar(255) DEFAULT NULL,
-  `site` varchar(255) DEFAULT NULL,
-  `email_contact` varchar(255) DEFAULT NULL,
-  `hide_email` tinyint(4) NOT NULL DEFAULT '1',
-  `contact_form` tinyint(4) NOT NULL DEFAULT '1',
-  `identifiant_paypal` varchar(255) DEFAULT NULL,
-  `lien_boutique` varchar(255) DEFAULT NULL,
-  `pun_forum` int(11) DEFAULT NULL,
-  `pun_user` int(11) DEFAULT NULL,
-  `compteur` int(11) NOT NULL DEFAULT '0',
-  `lien_facebook` varchar(255) DEFAULT NULL,
-  `lien_flickr` varchar(255) DEFAULT NULL,
-  `lien_twitter` varchar(255) DEFAULT NULL,
-  `lien_youtube` varchar(255) DEFAULT NULL,
-  `dossier_personnel` varchar(255) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_artistes`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_artistes_admins`
---
-
-DROP TABLE IF EXISTS `rsrv5_artistes_admins`;
-CREATE TABLE `rsrv5_artistes_admins` (
-  `id_artiste` int(11) NOT NULL,
-  `pun_user` int(11) NOT NULL,
-  PRIMARY KEY (`id_artiste`,`pun_user`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_artistes_admins`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_boxes`
---
-
-DROP TABLE IF EXISTS `rsrv5_boxes`;
-CREATE TABLE `rsrv5_boxes` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(64) DEFAULT NULL,
-  `emplacement` varchar(255) DEFAULT NULL,
-  `titre` varchar(255) DEFAULT NULL,
-  `fichier` varchar(255) DEFAULT NULL,
-  `contenu` text,
-  `auteur_creation` int(11) DEFAULT NULL,
-  `date_creation` datetime DEFAULT NULL,
-  `auteur_modification` int(11) DEFAULT NULL,
-  `date_modification` datetime DEFAULT NULL,
-  `date_publication` datetime DEFAULT NULL,
-  `public` tinyint(4) DEFAULT NULL,
-  `ordre` int(11) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=162 ;
-
---
--- Contenu de la table `rsrv5_boxes`
---
-
-INSERT INTO `rsrv5_boxes` (`id`, `nom`, `emplacement`, `titre`, `fichier`, `contenu`, `auteur_creation`, `date_creation`, `auteur_modification`, `date_modification`, `date_publication`, `public`, `ordre`) VALUES
-(141, 'navigation', NULL, '', 'navigation.php', '<p>Affiche le menu principal dans l''ent&ecirc;te du site.</p>\r\n<p>Les &eacute;l&eacute;ments du menu sont &eacute;ditables dans l''administration du site, menu :</p>\r\n<p><strong>Contenus</strong> &gt; <strong>menus</strong></p>', 186, '2009-08-30 21:48:09', 186, '2011-11-12 16:14:42', '2009-09-05 23:35:21', 1, 0),
-(150, 'accueil_forum', 'accueil_gauche', 'Forum : derniers messages', 'accueil_forum.php', '<p>Ce bloc affiche des liens vers les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:08:59', 186, '2011-11-12 15:56:53', '2009-09-06 19:10:21', 1, 3),
-(127, 'spotlight', 'accueil_gauche', 'Spotlight', 'spotlight.php', '<p>Ce bloc affiche le dernier spotlight, &eacute;dit&eacute; dans l''administration :</p>\r\n<p><strong>La redaction</strong> &gt; <strong>spotlights</strong></p>', 186, '2009-08-10 10:26:40', 186, '2011-11-12 16:05:10', '2009-09-06 17:16:40', 0, 2),
-(126, 'playlists_accueil', 'accueil_petite_gauche', 'Playlists', 'playlists.php', '', 186, '2009-08-09 23:15:00', 186, '2010-08-05 01:48:25', '2009-09-06 19:45:23', 1, 1),
-(142, 'edito', 'accueil_gauche', 'Edito', 'edito.php', '<p>Affiche le dernier &eacute;dito.</p>\r\n<p>Pour l''&eacute;dition des &eacute;ditos, menu :</p>\r\n<p><strong>La redaction</strong> &gt; <strong>&eacute;ditos</strong></p>', 186, '2009-09-01 19:49:18', 186, '2011-11-12 16:12:08', '2009-09-06 17:16:14', 1, 1),
-(151, 'playlists_interne', 'interne_gauche', 'Playlists', 'playlists.php', '', 186, '2009-09-06 19:45:02', 186, '2010-08-05 01:48:15', '2009-09-06 19:45:58', 1, 2),
-(124, 'identification', NULL, '', 'login.php', '', 186, '2009-08-09 22:16:57', 186, '2009-09-05 23:39:50', '2009-09-05 23:39:50', 1, 1),
-(130, 'nous_y_etions', 'accueil_petite_droite', 'Nous y Ã©tions', 'nous_y_etions.php', '<p>Ce bloc affiche un lien vers un sujet au hasard pris dans une section du forum. RSR utilise ce bloc pour faire un lien vers son forum des &eacute;v&eacute;nements pass&eacute;s.</p>\r\n<p>Avant d''utiliser ce bloc, modifiez le fichier <strong>data/modules/data_forum.php</strong> pour y renseigner l''identifiant du forum li&eacute; (variable <em>$forum_id</em>, ligne. 37).</p>\r\n<p>pour trouver l''identifiant d''un forum, rendez-vous avec votre navigateur sur le forum en question et regardez son URL, qui devrait se terminer par :</p>\r\n<p><em>viewforum.php?id=<strong>XX</strong></em></p>\r\n<p><em><strong>XX</strong></em> : identifiant du forum &agrave; modifier dans <strong>data/modules/data_forum.php</strong></p>', 186, '2009-08-10 11:49:58', 186, '2011-11-12 17:07:52', '2009-09-06 19:07:21', 0, 2),
-(140, 'artistes_au_hasard', 'accueil_droite_haut', 'Artistes au hasard', 'artistes_au_hasard.php', '', 186, '2009-08-30 21:44:32', 186, '2011-11-12 15:25:33', '2009-09-06 17:16:26', 0, 1),
-(143, 'news', 'accueil_droite_bas', 'Les autres news', 'news.php', '', 186, '2009-09-01 19:57:51', 186, '2010-08-05 01:48:55', '2009-09-06 17:16:52', 1, 2),
-(152, 'forum_interne', 'interne_gauche', 'Forum', 'accueil_forum.php', '<p>Ce bloc affiche les 7 derniers messages du forum.</p>', 186, '2009-09-06 19:46:30', 186, '2011-11-12 15:52:34', '2009-09-06 19:48:57', 0, 4),
-(149, '', 'accueil_footer', 'Bloc en bas de la page d''accueil', '', '<p>Plus de docs sur <a href="http://www.revolutionsoundrecords.org/trac">le trac</a>.</p>\r\n<ul>\r\n</ul>\r\n<p>Pour les questions, les retours (...) vous &ecirc;tes invit&eacute;s &agrave; venir en parler sur le <a href="http://www.revolutionsoundrecords.org/punbb">forum de l''association Revolution Sound Records</a>.</p>', 186, '2009-09-06 16:41:15', 186, '2011-11-12 22:36:42', '2009-09-06 19:07:34', 1, 6),
-(128, 'administration', NULL, 'Administration', 'admin.php', '', 186, '2009-08-10 10:27:12', 186, '2009-09-06 00:13:40', '2009-09-06 00:13:40', 1, 4),
-(155, '', 'interne_gauche', 'News', 'menu_news.php', '<p>Affiche les 2 derni&egrave;res news et un menu pour acc&eacute;der aux autres news.</p>', 186, '2010-01-15 22:39:32', 186, '2011-11-12 16:10:38', NULL, 1, 1),
-(156, 'last_news', 'accueil_droite_bas', 'News', 'last_news.php', '<p>Ce bloc affiche une news au hazard parmis les 5 derni&egrave;res.</p>', 186, '2010-04-06 15:58:29', 186, '2011-11-12 16:07:40', NULL, 1, 1),
-(157, 'last_albums', 'interne_gauche', 'Album au hasard', 'last_albums.php', '<p>Ce bloc affiche un album au hazard.</p>', 186, '2010-04-06 17:19:27', 186, '2011-11-12 15:56:10', NULL, 1, 3),
-(158, '', 'accueil_droite_bas', 'Soutenir notre action', 'soutenir.php', '<p>Ce bloc affiche un bouton de don PayPal et, &eacute;ventuellement, un lien vers une boutique de vente en ligne.</p>\r\n<p>Avant d''utiliser ce bloc, rendez-vous dans l''administration du site, menu :</p>\r\n<p><strong>G&eacute;n&eacute;ral</strong> &gt; <strong>dons et achats</strong></p>\r\n<p>Pour y renseigner votre identifiant s&eacute;curis&eacute; PayPal et/ou le lien vers la boutique en ligne.</p>', 3, '2010-08-03 13:05:44', 186, '2011-11-12 15:54:58', NULL, 0, 3),
-(159, '', 'accueil_droite_haut', 'Administrer le site', '', '<p>Les blocs affich&eacute;s sur cette page sont des exemples d''utilisation.</p>\r\n<p>Identifiez-vous avec votre compte admin et suivez le lien <a title="administration du site" href="index.php?e=set_config">admin</a> pour vous rendre dans l''administration du site et commencer &agrave; &eacute;diter les blocs, les contenus, les comptes artistes...</p>\r\n<p>&nbsp;</p>', 186, '2010-08-04 13:54:50', 186, '2011-11-12 22:17:47', NULL, 1, 0),
-(161, '', 'accueil_gauche', 'En images', 'flickr.php', '<p>Ce bloc affiche 4 images prises au hazard sur un compte Flickr.</p>\r\n<p>Avant d''utiliser ce bloc, modifiez le fichier</p>\r\n<p><strong>boxes/flickr.php</strong></p>\r\n<p>du template pour y indiquer vos informations de connexion sur l''API Flickr.</p>', 186, '2010-08-05 15:19:23', 186, '2011-11-12 15:50:41', NULL, 0, 4);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_categories`
---
-
-DROP TABLE IF EXISTS `rsrv5_categories`;
-CREATE TABLE `rsrv5_categories` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(64) DEFAULT NULL,
-  `titre` varchar(255) DEFAULT NULL,
-  `icone` varchar(255) DEFAULT NULL,
-  `description` text,
-  `contenu` text,
-  `ordre` int(11) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
-
---
--- Contenu de la table `rsrv5_categories`
---
-
-INSERT INTO `rsrv5_categories` (`id`, `nom`, `titre`, `icone`, `description`, `contenu`, `ordre`) VALUES
-(4, 'artistes', NULL, NULL, NULL, NULL, 0),
-(5, 'presentation', NULL, NULL, NULL, NULL, 0),
-(7, 'menus', NULL, NULL, NULL, NULL, 0),
-(22, 'Nav', 'menu top', NULL, NULL, '', 0),
-(30, '', 'Accueil', NULL, NULL, 'index.php?e=edito', 0),
-(29, '', 'Forum', NULL, NULL, 'punbb', 2),
-(33, '', 'Le son', NULL, NULL, '', 1),
-(38, '', 'Les artistes', NULL, NULL, 'index.php?e=artistes', 1),
-(40, '', 'Rechercher...', NULL, NULL, 'index.php?e=rechercher', 2),
-(63, '74', NULL, NULL, NULL, '', 0),
-(1, 'editos', 'Editos', NULL, NULL, NULL, 0),
-(2, 'news', NULL, NULL, NULL, NULL, 0),
-(0, 'root', NULL, NULL, NULL, NULL, 0),
-(6, 'news', NULL, NULL, NULL, NULL, 0),
-(3, 'spotlights', 'Spotlights', NULL, NULL, NULL, 0),
-(79, 'boxes', NULL, NULL, NULL, NULL, 0),
-(80, 'accueil_left', 'accueil - colonne de gauche', NULL, NULL, NULL, 0),
-(81, 'accueil_right', 'accueil - colonne de droite', NULL, NULL, NULL, 0),
-(82, '64', NULL, NULL, NULL, '', 0),
-(83, 'pages', NULL, NULL, NULL, NULL, 0),
-(85, 'links', NULL, NULL, NULL, NULL, 0),
-(93, 'interne_left', 'pages internes - colonne de gauche', NULL, NULL, NULL, 0),
-(94, 'accueil_small_left', 'accueil - petite colonne gauche', NULL, NULL, NULL, 0),
-(95, 'accueil_small_right', 'accueil - petite colonne droite', NULL, NULL, NULL, 0),
-(99, '54', NULL, NULL, NULL, '', 0),
-(100, '3', NULL, NULL, NULL, '', 0),
-(101, '73', NULL, NULL, NULL, '', 0),
-(102, '34', NULL, NULL, NULL, '', 0);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_categories_tree`
---
-
-DROP TABLE IF EXISTS `rsrv5_categories_tree`;
-CREATE TABLE `rsrv5_categories_tree` (
-  `parent` int(11) NOT NULL,
-  `child` int(11) NOT NULL,
-  PRIMARY KEY (`parent`,`child`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_categories_tree`
---
-
-INSERT INTO `rsrv5_categories_tree` (`parent`, `child`) VALUES
-(0, 1),
-(0, 2),
-(0, 3),
-(0, 4),
-(0, 7),
-(0, 79),
-(0, 83),
-(0, 85),
-(4, 5),
-(4, 6),
-(6, 82),
-(6, 99),
-(6, 100),
-(6, 101),
-(6, 102),
-(7, 22),
-(22, 29),
-(22, 30),
-(22, 33),
-(33, 38),
-(33, 40),
-(79, 80),
-(79, 81),
-(79, 93),
-(79, 94),
-(79, 95);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_concerts`
---
-
-DROP TABLE IF EXISTS `rsrv5_concerts`;
-CREATE TABLE `rsrv5_concerts` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `id_artiste` int(11) DEFAULT NULL,
-  `nom` varchar(255) DEFAULT NULL,
-  `date` datetime DEFAULT NULL,
-  `lieu` varchar(255) DEFAULT NULL,
-  `paf` int(11) DEFAULT NULL,
-  `description` text,
-  `pun_forum` int(11) DEFAULT NULL,
-  `affiche` varchar(255) DEFAULT NULL,
-  `flyer` varchar(255) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_concerts`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_configuration`
---
-
-DROP TABLE IF EXISTS `rsrv5_configuration`;
-CREATE TABLE `rsrv5_configuration` (
-  `key` varchar(255) NOT NULL,
-  `value` text NOT NULL,
-  PRIMARY KEY (`key`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_configuration`
---
-
-INSERT INTO `rsrv5_configuration` (`key`, `value`) VALUES
-('site_name', 'rsr - v.5.1.1'),
-('email_contact', 'admin@domain.tld'),
-('out', 'app/out/dist/'),
-('max_list', '10'),
-('identifiant_paypal', ''),
-('lien_boutique', '');
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_contenus`
---
-
-DROP TABLE IF EXISTS `rsrv5_contenus`;
-CREATE TABLE `rsrv5_contenus` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(64) DEFAULT NULL,
-  `categorie` int(11) DEFAULT NULL,
-  `titre` varchar(255) DEFAULT NULL,
-  `description` text,
-  `contenu` text,
-  `auteur_creation` int(11) DEFAULT NULL,
-  `date_creation` datetime DEFAULT NULL,
-  `auteur_modification` int(11) DEFAULT NULL,
-  `date_modification` datetime DEFAULT NULL,
-  `date_publication` datetime DEFAULT NULL,
-  `public` tinyint(4) DEFAULT NULL,
-  `ordre` int(11) DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=935 ;
-
---
--- Contenu de la table `rsrv5_contenus`
---
-
-INSERT INTO `rsrv5_contenus` (`id`, `nom`, `categorie`, `titre`, `description`, `contenu`, `auteur_creation`, `date_creation`, `auteur_modification`, `date_modification`, `date_publication`, `public`, `ordre`) VALUES
-(919, '', 1, 'Nouvelle installation', '', '<p>Bienvenue sur votre installation de rsr v.5.</p>\r\n<p>Pensez &agrave; effacer le dossier <strong>install</strong></p>\r\n<p>&nbsp;</p>\r\n<p>Bonnes publications !</p>', 186, '2011-09-04 15:03:09', 186, '2011-11-12 22:07:24', '2011-09-04 00:00:00', 1, NULL);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_downloads`
---
-
-DROP TABLE IF EXISTS `rsrv5_downloads`;
-CREATE TABLE `rsrv5_downloads` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `id_artiste` int(11) DEFAULT NULL,
-  `id_album` int(11) DEFAULT NULL,
-  `id_licence` int(11) DEFAULT NULL,
-  `nom` varchar(255) DEFAULT NULL,
-  `date_creation` date DEFAULT NULL,
-  `style` varchar(255) DEFAULT NULL,
-  `description` text,
-  `ordre` int(11) DEFAULT NULL,
-  `actif` tinyint(4) NOT NULL DEFAULT '1',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_downloads`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_download_urls`
---
-
-DROP TABLE IF EXISTS `rsrv5_download_urls`;
-CREATE TABLE `rsrv5_download_urls` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `id_download` int(11) DEFAULT NULL,
-  `id_format` int(11) DEFAULT NULL,
-  `qualite` int(11) DEFAULT NULL,
-  `url` varchar(255) DEFAULT NULL,
-  `taille` int(11) DEFAULT NULL,
-  `date_publication` date DEFAULT NULL,
-  `compteur` int(11) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_download_urls`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_formats`
---
-
-DROP TABLE IF EXISTS `rsrv5_formats`;
-CREATE TABLE `rsrv5_formats` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(32) DEFAULT NULL,
-  `content_type` varchar(64) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
-
---
--- Contenu de la table `rsrv5_formats`
---
-
-INSERT INTO `rsrv5_formats` (`id`, `nom`, `content_type`) VALUES
-(1, 'ogg', 'audio/ogg'),
-(2, 'mp3', 'audio/mpeg'),
-(3, 'rar', 'application/x-rar-compressed'),
-(4, 'zip', 'application/x-zip'),
-(5, 'jpg', 'image/jpeg'),
-(6, 'pdf', 'application/pdf'),
-(7, 'avi', 'video/avi'),
-(8, 'gz', 'application/x-gzip'),
-(9, 'wav', 'audio/wav');
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_licences`
---
-
-DROP TABLE IF EXISTS `rsrv5_licences`;
-CREATE TABLE `rsrv5_licences` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `nom` varchar(255) NOT NULL DEFAULT '',
-  `lien` varchar(255) NOT NULL DEFAULT '',
-  `icone` varchar(255) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
-
---
--- Contenu de la table `rsrv5_licences`
---
-
-INSERT INTO `rsrv5_licences` (`id`, `nom`, `lien`, `icone`) VALUES
-(1, 'Creative Commons by-nc-nd 2.0', 'http://creativecommons.org/licenses/by-nc-nd/2.0/', 'icons/licences/cc.by.nc.nd.png'),
-(2, 'Creative Commons by-nc-nd 2.5', 'http://creativecommons.org/licenses/by-nc-nd/2.5/', 'icons/licences/cc.by.nc.nd.png'),
-(3, 'Creative Commons by-nc-sa 2.0', 'http://creativecommons.org/licenses/by-nc-sa/2.0/', 'icons/licences/cc.by.nc.sa.png'),
-(4, 'Creative Commons by-nc-sa 2.5', 'http://creativecommons.org/licenses/by-nc-sa/2.5/', 'icons/licences/cc.by.nc.sa.png'),
-(5, 'Creative Commons by-nc 2.0', 'http://creativecommons.org/licenses/by-nc/2.0/', 'icons/licences/cc.by.nc.png'),
-(6, 'Creative Commons by-nc 2.5', 'http://creativecommons.org/licenses/by-nc/2.5/', 'icons/licences/cc.by.nc.png'),
-(7, 'Creative Commons by-nd 2.0', 'http://creativecommons.org/licenses/by-nd/2.0/', 'icons/licences/cc.by.nd.png'),
-(8, 'Creative Commons by-nd 2.5', 'http://creativecommons.org/licenses/by-nd/2.5/', 'icons/licences/cc.by.nd.png'),
-(9, 'Creative Commons by-sa 2.0', 'http://creativecommons.org/licenses/by-sa/2.0/', 'icons/licences/cc.by.sa.png'),
-(10, 'Creative Commons by-sa 2.5', 'http://creativecommons.org/licenses/by-sa/2.5/', 'icons/licences/cc.by.sa.png'),
-(11, 'Creative Commons by 2.0', 'http://creativecommons.org/licenses/by/2.0/', 'icons/licences/cc.by.png'),
-(12, 'Creative Commons by 2.5', 'http://creativecommons.org/licenses/by/2.5/', 'icons/licences/cc.by.png'),
-(13, 'Licence Art Libre', 'http://artlibre.org/licence/lal/', ''),
-(14, 'Licence C Reaction', 'http://morne.free.fr/Necktar7/creactionfr.htm', ''),
-(15, 'Domaine Public', '', ''),
-(16, 'Licence GNU GPL (GNUArt)', 'http://gnuart.org/francais/gnugpl.html', '');
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_playlists`
---
-
-DROP TABLE IF EXISTS `rsrv5_playlists`;
-CREATE TABLE `rsrv5_playlists` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `pun_user` int(11) NOT NULL,
-  `titre` varchar(255) NOT NULL,
-  `description` text NOT NULL,
-  `creation` datetime NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_playlists`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_playlist_download`
---
-
-DROP TABLE IF EXISTS `rsrv5_playlist_download`;
-CREATE TABLE `rsrv5_playlist_download` (
-  `id` int(11) NOT NULL,
-  `id_download` int(11) NOT NULL,
-  PRIMARY KEY (`id`,`id_download`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_playlist_download`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_bans`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_bans`;
-CREATE TABLE `rsrv5_pun_bans` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `username` varchar(200) DEFAULT NULL,
-  `ip` varchar(255) DEFAULT NULL,
-  `email` varchar(80) DEFAULT NULL,
-  `message` varchar(255) DEFAULT NULL,
-  `expire` int(10) unsigned DEFAULT NULL,
-  `ban_creator` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`),
-  KEY `rsrv5_pun_bans_username_idx` (`username`(25))
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
-
---
--- Contenu de la table `rsrv5_pun_bans`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_categories`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_categories`;
-CREATE TABLE `rsrv5_pun_categories` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `cat_name` varchar(80) NOT NULL DEFAULT 'New Category',
-  `disp_position` int(10) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;
-
---
--- Contenu de la table `rsrv5_pun_categories`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_censoring`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_censoring`;
-CREATE TABLE `rsrv5_pun_censoring` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `search_for` varchar(60) NOT NULL DEFAULT '',
-  `replace_with` varchar(60) NOT NULL DEFAULT '',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_pun_censoring`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_config`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_config`;
-CREATE TABLE `rsrv5_pun_config` (
-  `conf_name` varchar(255) NOT NULL DEFAULT '',
-  `conf_value` text,
-  PRIMARY KEY (`conf_name`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_config`
---
-
-INSERT INTO `rsrv5_pun_config` (`conf_name`, `conf_value`) VALUES
-('o_cur_version', '1.4.7'),
-('o_cur_version_fr', '1.2.10'),
-('o_board_title', 'Forums'),
-('o_board_desc', NULL),
-('o_default_timezone', '0'),
-('o_time_format', 'H:i:s'),
-('o_date_format', 'd-m-Y'),
-('o_timeout_visit', '1800'),
-('o_timeout_online', '300'),
-('o_redirect_delay', '1'),
-('o_show_version', '1'),
-('o_show_user_info', '1'),
-('o_show_post_count', '1'),
-('o_smilies', '1'),
-('o_smilies_sig', '0'),
-('o_make_links', '1'),
-('o_default_lang', 'French'),
-('o_default_style', 'Rsr'),
-('o_default_user_group', '4'),
-('o_topic_review', '15'),
-('o_disp_topics_default', '30'),
-('o_disp_posts_default', '25'),
-('o_indent_num_spaces', '4'),
-('o_quickpost', '1'),
-('o_users_online', '1'),
-('o_censoring', '0'),
-('o_ranks', '1'),
-('o_show_dot', '0'),
-('o_quickjump', '1'),
-('o_gzip', '0'),
-('o_additional_navlinks', NULL),
-('o_report_method', '2'),
-('o_regs_report', '1'),
-('o_mailing_list', 'admin@domain.tld'),
-('o_avatars', '1'),
-('o_avatars_dir', 'img/avatars'),
-('o_avatars_width', '128'),
-('o_avatars_height', '128'),
-('o_avatars_size', '25000'),
-('o_search_all_forums', '1'),
-('o_base_url', 'http://rsr.v5.dev/punbb'),
-('o_admin_email', 'admin@domain.tld'),
-('o_webmaster_email', 'admin@domain.tld'),
-('o_topic_subscriptions', '1'),
-('o_smtp_host', NULL),
-('o_smtp_user', NULL),
-('o_smtp_pass', NULL),
-('o_regs_allow', '1'),
-('o_regs_verify', '0'),
-('o_announcement', '0'),
-('o_announcement_message', 'Saisissez votre annonce ici.'),
-('o_regs_captchabox', '1'),
-('o_guest_post_captchabox', '0'),
-('o_rules', '0'),
-('o_rules_message', 'Saisissez vos rÃšgles d''utilisation ici.'),
-('o_maintenance', '0'),
-('o_maintenance_message', 'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Nous vous prions de bien vouloir nous excuser pour cette gÃšne. Veuillez essayer Ã  nouveau d''ici quelques minutes.<br />\n<br />\nRevolution Sound Records'),
-('o_forum_subscriptions', '1'),
-('p_message_bbcode', '1'),
-('p_message_img_tag', '1'),
-('p_message_all_caps', '1'),
-('p_subject_all_caps', '0'),
-('p_sig_all_caps', '0'),
-('p_sig_bbcode', '1'),
-('p_sig_img_tag', '1'),
-('p_sig_length', '400'),
-('p_sig_lines', '4'),
-('p_allow_banned_email', '1'),
-('p_allow_dupe_email', '0'),
-('p_force_guest_email', '1'),
-('o_database_revision', '15'),
-('o_searchindex_revision', '2'),
-('o_parser_revision', '2'),
-('o_default_email_setting', '1'),
-('o_topic_views', '1'),
-('o_signatures', '1'),
-('o_smtp_ssl', '0'),
-('o_default_dst', '0'),
-('o_quote_depth', '3'),
-('o_feed_type', '2'),
-('o_feed_ttl', '0');
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_forums`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_forums`;
-CREATE TABLE `rsrv5_pun_forums` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `forum_name` varchar(80) NOT NULL DEFAULT 'New forum',
-  `forum_desc` text,
-  `redirect_url` varchar(100) DEFAULT NULL,
-  `moderators` text,
-  `num_topics` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  `num_posts` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  `last_post` int(10) unsigned DEFAULT NULL,
-  `last_post_id` int(10) unsigned DEFAULT NULL,
-  `last_poster` varchar(200) DEFAULT NULL,
-  `sort_by` tinyint(1) NOT NULL DEFAULT '0',
-  `disp_position` int(10) NOT NULL DEFAULT '0',
-  `cat_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
-
---
--- Contenu de la table `rsrv5_pun_forums`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_forum_perms`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_forum_perms`;
-CREATE TABLE `rsrv5_pun_forum_perms` (
-  `group_id` int(10) NOT NULL DEFAULT '0',
-  `forum_id` int(10) NOT NULL DEFAULT '0',
-  `read_forum` tinyint(1) NOT NULL DEFAULT '1',
-  `post_replies` tinyint(1) NOT NULL DEFAULT '1',
-  `post_topics` tinyint(1) NOT NULL DEFAULT '1',
-  PRIMARY KEY (`group_id`,`forum_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_forum_perms`
---
-
-INSERT INTO `rsrv5_pun_forum_perms` (`group_id`, `forum_id`, `read_forum`, `post_replies`, `post_topics`) VALUES
-(3, 48, 0, 0, 0),
-(4, 48, 0, 0, 0),
-(5, 48, 0, 0, 0),
-(6, 48, 0, 0, 0),
-(3, 75, 0, 0, 0),
-(4, 75, 0, 0, 0),
-(5, 75, 0, 0, 0),
-(6, 75, 0, 0, 0),
-(3, 77, 0, 0, 0),
-(4, 77, 0, 0, 0),
-(5, 77, 0, 0, 0),
-(6, 77, 0, 0, 0),
-(3, 78, 0, 0, 0),
-(4, 78, 0, 0, 0),
-(5, 78, 0, 0, 0),
-(6, 78, 0, 0, 0),
-(3, 79, 0, 0, 0),
-(4, 79, 0, 0, 0),
-(5, 79, 0, 0, 0),
-(6, 79, 0, 0, 0),
-(3, 80, 0, 0, 0),
-(4, 80, 0, 0, 0),
-(5, 80, 0, 0, 0),
-(6, 80, 0, 0, 0);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_forum_subscriptions`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_forum_subscriptions`;
-CREATE TABLE `rsrv5_pun_forum_subscriptions` (
-  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`user_id`,`forum_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_forum_subscriptions`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_groups`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_groups`;
-CREATE TABLE `rsrv5_pun_groups` (
-  `g_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `g_title` varchar(50) NOT NULL DEFAULT '',
-  `g_user_title` varchar(50) DEFAULT NULL,
-  `g_moderator` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_edit_users` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_rename_users` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_change_passwords` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_ban_users` tinyint(1) NOT NULL DEFAULT '0',
-  `g_read_board` tinyint(1) NOT NULL DEFAULT '1',
-  `g_view_users` tinyint(1) NOT NULL DEFAULT '1',
-  `g_post_replies` tinyint(1) NOT NULL DEFAULT '1',
-  `g_post_topics` tinyint(1) NOT NULL DEFAULT '1',
-  `g_edit_posts` tinyint(1) NOT NULL DEFAULT '1',
-  `g_delete_posts` tinyint(1) NOT NULL DEFAULT '1',
-  `g_delete_topics` tinyint(1) NOT NULL DEFAULT '1',
-  `g_set_title` tinyint(1) NOT NULL DEFAULT '1',
-  `g_search` tinyint(1) NOT NULL DEFAULT '1',
-  `g_search_users` tinyint(1) NOT NULL DEFAULT '1',
-  `g_send_email` tinyint(1) NOT NULL DEFAULT '1',
-  `g_post_flood` smallint(6) NOT NULL DEFAULT '30',
-  `g_search_flood` smallint(6) NOT NULL DEFAULT '30',
-  `g_email_flood` smallint(6) NOT NULL DEFAULT '60',
-  `g_report_flood` smallint(6) NOT NULL DEFAULT '60',
-  PRIMARY KEY (`g_id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
-
---
--- Contenu de la table `rsrv5_pun_groups`
---
-
-INSERT INTO `rsrv5_pun_groups` (`g_id`, `g_title`, `g_user_title`, `g_moderator`, `g_mod_edit_users`, `g_mod_rename_users`, `g_mod_change_passwords`, `g_mod_ban_users`, `g_read_board`, `g_view_users`, `g_post_replies`, `g_post_topics`, `g_edit_posts`, `g_delete_posts`, `g_delete_topics`, `g_set_title`, `g_search`, `g_search_users`, `g_send_email`, `g_post_flood`, `g_search_flood`, `g_email_flood`, `g_report_flood`) VALUES
-(1, 'Admin', 'Admin', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0),
-(2, 'ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0),
-(3, 'Touriste', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0),
-(4, 'Membres', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60),
-(5, 'Artiste', 'Artiste', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 10, 10, 60, 60),
-(6, '100 eme Membre', '100 eme Membre', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_online`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_online`;
-CREATE TABLE `rsrv5_pun_online` (
-  `user_id` int(10) unsigned NOT NULL DEFAULT '1',
-  `ident` varchar(200) NOT NULL DEFAULT '',
-  `logged` int(10) unsigned NOT NULL DEFAULT '0',
-  `idle` tinyint(1) NOT NULL DEFAULT '0',
-  `last_post` int(10) unsigned DEFAULT NULL,
-  `last_search` int(10) unsigned DEFAULT NULL,
-  UNIQUE KEY `rsrv5_pun_online_user_id_ident_idx` (`user_id`,`ident`(25)),
-  KEY `pun_online_user_id_idx` (`user_id`),
-  KEY `rsrv5_pun_online_ident_idx` (`ident`(25)),
-  KEY `rsrv5_pun_online_logged_idx` (`logged`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_online`
---
-
-INSERT INTO `rsrv5_pun_online` (`user_id`, `ident`, `logged`, `idle`, `last_post`, `last_search`) VALUES
-(1, '192.168.10.13', 1321306351, 0, NULL, NULL);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_posts`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_posts`;
-CREATE TABLE `rsrv5_pun_posts` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `poster` varchar(200) NOT NULL DEFAULT '',
-  `poster_id` int(10) unsigned NOT NULL DEFAULT '1',
-  `poster_ip` varchar(39) DEFAULT NULL,
-  `poster_email` varchar(80) DEFAULT NULL,
-  `message` mediumtext,
-  `hide_smilies` tinyint(1) NOT NULL DEFAULT '0',
-  `posted` int(10) unsigned NOT NULL DEFAULT '0',
-  `edited` int(10) unsigned DEFAULT NULL,
-  `edited_by` varchar(200) DEFAULT NULL,
-  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`),
-  KEY `pun_posts_topic_id_idx` (`topic_id`),
-  KEY `pun_posts_multi_idx` (`poster_id`,`topic_id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21233 ;
-
---
--- Contenu de la table `rsrv5_pun_posts`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_ranks`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_ranks`;
-CREATE TABLE `rsrv5_pun_ranks` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `rank` varchar(50) NOT NULL DEFAULT '',
-  `min_posts` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
-
---
--- Contenu de la table `rsrv5_pun_ranks`
---
-
-INSERT INTO `rsrv5_pun_ranks` (`id`, `rank`, `min_posts`) VALUES
-(1, 'Apprenti posteur', 0),
-(3, 'Posteur', 100),
-(4, 'Posteur chef', 200),
-(5, 'Serial posteur', 300),
-(7, 'Les doigts greffÃ©s au clavier', 1000);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_reports`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_reports`;
-CREATE TABLE `rsrv5_pun_reports` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `post_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `reported_by` int(10) unsigned NOT NULL DEFAULT '0',
-  `created` int(10) unsigned NOT NULL DEFAULT '0',
-  `message` text NOT NULL,
-  `zapped` int(10) unsigned DEFAULT NULL,
-  `zapped_by` int(10) unsigned DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  KEY `pun_reports_zapped_idx` (`zapped`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
-
---
--- Contenu de la table `rsrv5_pun_reports`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_search_cache`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_search_cache`;
-CREATE TABLE `rsrv5_pun_search_cache` (
-  `id` int(10) unsigned NOT NULL DEFAULT '0',
-  `ident` varchar(200) NOT NULL DEFAULT '',
-  `search_data` mediumtext,
-  PRIMARY KEY (`id`),
-  KEY `pun_search_cache_ident_idx` (`ident`(8))
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_search_cache`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_search_matches`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_search_matches`;
-CREATE TABLE `rsrv5_pun_search_matches` (
-  `post_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `word_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  `subject_match` tinyint(1) NOT NULL DEFAULT '0',
-  KEY `pun_search_matches_word_id_idx` (`word_id`),
-  KEY `pun_search_matches_post_id_idx` (`post_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_search_matches`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_search_words`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_search_words`;
-CREATE TABLE `rsrv5_pun_search_words` (
-  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
-  `word` varchar(20) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
-  PRIMARY KEY (`word`),
-  KEY `pun_search_words_id_idx` (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_pun_search_words`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_smilies`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_smilies`;
-CREATE TABLE `rsrv5_pun_smilies` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `image` varchar(60) NOT NULL DEFAULT '',
-  `text` varchar(60) NOT NULL DEFAULT '',
-  `disp_position` int(10) NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=89 ;
-
---
--- Contenu de la table `rsrv5_pun_smilies`
---
-
-INSERT INTO `rsrv5_pun_smilies` (`id`, `image`, `text`, `disp_position`) VALUES
-(45, 'canon.gif', ':top:', 0),
-(10, 'big_smile.png', ':D', 0),
-(11, 'cool.png', ':cool:', 0),
-(21, 'hmm.png', ':/', 0),
-(24, 'mad.png', ':mad2:', 0),
-(25, 'neutral.png', ':|', 0),
-(26, 'roll.png', ':roll:', 0),
-(29, 'sad.png', ':(', 3),
-(31, 'smile.png', ':)', 4),
-(33, 'tongue.png', ':p', 6),
-(35, 'wink.png', ';)', 7),
-(37, 'yikes.png', ':d', 0),
-(56, 'whaouh6na.gif', 'whaou', 0),
-(87, 'terminator.png', ':terminator:', 0);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_topics`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_topics`;
-CREATE TABLE `rsrv5_pun_topics` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `poster` varchar(200) NOT NULL DEFAULT '',
-  `subject` varchar(255) NOT NULL DEFAULT '',
-  `posted` int(10) unsigned NOT NULL DEFAULT '0',
-  `first_post_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `last_post` int(10) unsigned NOT NULL DEFAULT '0',
-  `last_post_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `last_poster` varchar(200) DEFAULT NULL,
-  `num_views` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  `num_replies` mediumint(8) unsigned NOT NULL DEFAULT '0',
-  `closed` tinyint(1) NOT NULL DEFAULT '0',
-  `sticky` tinyint(1) NOT NULL DEFAULT '0',
-  `moved_to` int(10) unsigned DEFAULT NULL,
-  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`),
-  KEY `pun_topics_forum_id_idx` (`forum_id`),
-  KEY `pun_topics_moved_to_idx` (`moved_to`),
-  KEY `rsrv5_pun_topics_last_post_idx` (`last_post`),
-  KEY `rsrv5_pun_topics_first_post_id_idx` (`first_post_id`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2441 ;
-
---
--- Contenu de la table `rsrv5_pun_topics`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_topic_subscriptions`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_topic_subscriptions`;
-CREATE TABLE `rsrv5_pun_topic_subscriptions` (
-  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`user_id`,`topic_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_pun_topic_subscriptions`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_pun_users`
---
-
-DROP TABLE IF EXISTS `rsrv5_pun_users`;
-CREATE TABLE `rsrv5_pun_users` (
-  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `group_id` int(10) unsigned NOT NULL DEFAULT '4',
-  `username` varchar(200) NOT NULL DEFAULT '',
-  `password` varchar(40) NOT NULL DEFAULT '',
-  `email` varchar(80) NOT NULL DEFAULT '',
-  `title` varchar(50) DEFAULT NULL,
-  `realname` varchar(40) DEFAULT NULL,
-  `url` varchar(100) DEFAULT NULL,
-  `jabber` varchar(80) DEFAULT NULL,
-  `icq` varchar(12) DEFAULT NULL,
-  `msn` varchar(80) DEFAULT NULL,
-  `aim` varchar(30) DEFAULT NULL,
-  `yahoo` varchar(30) DEFAULT NULL,
-  `location` varchar(30) DEFAULT NULL,
-  `signature` text,
-  `disp_topics` tinyint(3) unsigned DEFAULT NULL,
-  `disp_posts` tinyint(3) unsigned DEFAULT NULL,
-  `email_setting` tinyint(1) NOT NULL DEFAULT '1',
-  `notify_with_post` tinyint(1) NOT NULL DEFAULT '0',
-  `auto_notify` tinyint(1) NOT NULL DEFAULT '0',
-  `show_smilies` tinyint(1) NOT NULL DEFAULT '1',
-  `show_img` tinyint(1) NOT NULL DEFAULT '1',
-  `show_img_sig` tinyint(1) NOT NULL DEFAULT '1',
-  `show_avatars` tinyint(1) NOT NULL DEFAULT '1',
-  `show_sig` tinyint(1) NOT NULL DEFAULT '1',
-  `timezone` float NOT NULL DEFAULT '0',
-  `dst` tinyint(1) NOT NULL DEFAULT '0',
-  `date_format` tinyint(1) NOT NULL DEFAULT '0',
-  `time_format` tinyint(1) NOT NULL DEFAULT '0',
-  `language` varchar(25) NOT NULL DEFAULT 'English',
-  `style` varchar(25) NOT NULL DEFAULT 'Oxygen',
-  `num_posts` int(10) unsigned NOT NULL DEFAULT '0',
-  `last_post` int(10) unsigned DEFAULT NULL,
-  `last_search` int(10) unsigned DEFAULT NULL,
-  `last_email_sent` int(10) unsigned DEFAULT NULL,
-  `last_report_sent` int(10) unsigned DEFAULT NULL,
-  `registered` int(10) unsigned NOT NULL DEFAULT '0',
-  `registration_ip` varchar(39) NOT NULL DEFAULT '0.0.0.0',
-  `last_visit` int(10) unsigned NOT NULL DEFAULT '0',
-  `admin_note` varchar(30) DEFAULT NULL,
-  `activate_string` varchar(80) DEFAULT NULL,
-  `activate_key` varchar(8) DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `rsrv5_pun_users_username_idx` (`username`(25)),
-  KEY `pun_users_registered_idx` (`registered`),
-  KEY `pun_users_username_idx` (`username`(8))
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1559 ;
-
---
--- Contenu de la table `rsrv5_pun_users`
---
-
-INSERT INTO `rsrv5_pun_users` (`id`, `group_id`, `username`, `password`, `email`, `title`, `realname`, `url`, `jabber`, `icq`, `msn`, `aim`, `yahoo`, `location`, `signature`, `disp_topics`, `disp_posts`, `email_setting`, `notify_with_post`, `auto_notify`, `show_smilies`, `show_img`, `show_img_sig`, `show_avatars`, `show_sig`, `timezone`, `dst`, `date_format`, `time_format`, `language`, `style`, `num_posts`, `last_post`, `last_search`, `last_email_sent`, `last_report_sent`, `registered`, `registration_ip`, `last_visit`, `admin_note`, `activate_string`, `activate_key`) VALUES
-(186, 1, 'admin', '90f1b3c6cf62b05606b215265803f553e22bc657', 'admin@domain.tld', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 'French', 'Rsr', 1382, 1321043538, NULL, NULL, NULL, 1156702867, '82.243.194.97', 1321305012, NULL, NULL, NULL),
-(1, 3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 'English', 'Oxygen', 0, NULL, NULL, NULL, NULL, 0, '0.0.0.0', 0, NULL, NULL, NULL);
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_super_admins`
---
-
-DROP TABLE IF EXISTS `rsrv5_super_admins`;
-CREATE TABLE `rsrv5_super_admins` (
-  `id_pun_user` int(11) NOT NULL,
-  PRIMARY KEY (`id_pun_user`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
---
--- Contenu de la table `rsrv5_super_admins`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_thumbs`
---
-
-DROP TABLE IF EXISTS `rsrv5_thumbs`;
-CREATE TABLE `rsrv5_thumbs` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `src` varchar(255) NOT NULL DEFAULT '',
-  `src_width` int(11) NOT NULL DEFAULT '0',
-  `src_height` int(11) NOT NULL DEFAULT '0',
-  `max_width` int(11) NOT NULL DEFAULT '0',
-  `max_height` int(11) NOT NULL DEFAULT '0',
-  `thumb_file` varchar(255) NOT NULL,
-  `thumb_width` int(11) NOT NULL DEFAULT '0',
-  `thumb_height` int(11) NOT NULL DEFAULT '0',
-  `creation_date` datetime NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_thumbs`
---
-
-
--- --------------------------------------------------------
-
---
--- Structure de la table `rsrv5_videos`
---
-
-DROP TABLE IF EXISTS `rsrv5_videos`;
-CREATE TABLE `rsrv5_videos` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `id_artiste` int(11) DEFAULT NULL,
-  `titre` varchar(255) DEFAULT NULL,
-  `description` text,
-  `url` varchar(255) DEFAULT NULL,
-  `id_licence` int(11) DEFAULT NULL,
-  `date_creation` date DEFAULT NULL,
-  `date_publication` date DEFAULT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Contenu de la table `rsrv5_videos`
---
-
Index: /trunk/web/install/dist/sql/tables.sql
===================================================================
--- /trunk/web/install/dist/sql/tables.sql	(revision 10)
+++ /trunk/web/install/dist/sql/tables.sql	(revision 1)
@@ -1,3 +1,3 @@
-CREATE TABLE `[prefix]albums` (
+CREATE TABLE IF NOT EXISTS `[prefix]albums` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id_artiste` int(11) NOT NULL,
@@ -16,5 +16,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]artistes` (
+CREATE TABLE IF NOT EXISTS `[prefix]artistes` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(255) DEFAULT NULL,
@@ -40,5 +40,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]artistes_admins` (
+CREATE TABLE IF NOT EXISTS `[prefix]artistes_admins` (
   `id_artiste` int(11) NOT NULL,
   `pun_user` int(11) NOT NULL,
@@ -46,5 +46,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]boxes` (
+CREATE TABLE IF NOT EXISTS `[prefix]boxes` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(64) DEFAULT NULL,
@@ -63,5 +63,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=162 ;
 # --
-CREATE TABLE `[prefix]categories` (
+CREATE TABLE IF NOT EXISTS `[prefix]categories` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(64) DEFAULT NULL,
@@ -74,5 +74,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
 # --
-CREATE TABLE `[prefix]categories_tree` (
+CREATE TABLE IF NOT EXISTS `[prefix]categories_tree` (
   `parent` int(11) NOT NULL,
   `child` int(11) NOT NULL,
@@ -80,5 +80,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]concerts` (
+CREATE TABLE IF NOT EXISTS `[prefix]concerts` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id_artiste` int(11) DEFAULT NULL,
@@ -94,5 +94,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]configuration` (
+CREATE TABLE IF NOT EXISTS `[prefix]configuration` (
   `key` varchar(255) NOT NULL,
   `value` text NOT NULL,
@@ -100,5 +100,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]contenus` (
+CREATE TABLE IF NOT EXISTS `[prefix]contenus` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(64) DEFAULT NULL,
@@ -117,5 +117,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=935 ;
 # --
-CREATE TABLE `[prefix]downloads` (
+CREATE TABLE IF NOT EXISTS `[prefix]downloads` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id_artiste` int(11) DEFAULT NULL,
@@ -131,5 +131,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]download_urls` (
+CREATE TABLE IF NOT EXISTS `[prefix]download_urls` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id_download` int(11) DEFAULT NULL,
@@ -143,5 +143,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]formats` (
+CREATE TABLE IF NOT EXISTS `[prefix]formats` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(32) DEFAULT NULL,
@@ -150,5 +150,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
 # --
-CREATE TABLE `[prefix]licences` (
+CREATE TABLE IF NOT EXISTS `[prefix]licences` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `nom` varchar(255) NOT NULL DEFAULT '',
@@ -158,5 +158,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
 # --
-CREATE TABLE `[prefix]playlists` (
+CREATE TABLE IF NOT EXISTS `[prefix]playlists` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `pun_user` int(11) NOT NULL,
@@ -167,5 +167,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]playlist_download` (
+CREATE TABLE IF NOT EXISTS `[prefix]playlist_download` (
   `id` int(11) NOT NULL,
   `id_download` int(11) NOT NULL,
@@ -173,17 +173,15 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]pun_bans` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_bans` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `username` varchar(200) DEFAULT NULL,
   `ip` varchar(255) DEFAULT NULL,
-  `email` varchar(80) DEFAULT NULL,
+  `email` varchar(50) DEFAULT NULL,
   `message` varchar(255) DEFAULT NULL,
   `expire` int(10) unsigned DEFAULT NULL,
-  `ban_creator` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`id`),
-  KEY `[prefix]pun_bans_username_idx` (`username`(25))
+  PRIMARY KEY (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
 # --
-CREATE TABLE `[prefix]pun_categories` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_categories` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `cat_name` varchar(80) NOT NULL DEFAULT 'New Category',
@@ -192,5 +190,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=22 ;
 # --
-CREATE TABLE `[prefix]pun_censoring` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_censoring` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `search_for` varchar(60) NOT NULL DEFAULT '',
@@ -199,5 +197,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]pun_config` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_config` (
   `conf_name` varchar(255) NOT NULL DEFAULT '',
   `conf_value` text,
@@ -205,5 +203,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]pun_forums` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_forums` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `forum_name` varchar(80) NOT NULL DEFAULT 'New forum',
@@ -222,5 +220,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=103 ;
 # --
-CREATE TABLE `[prefix]pun_forum_perms` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_forum_perms` (
   `group_id` int(10) NOT NULL DEFAULT '0',
   `forum_id` int(10) NOT NULL DEFAULT '0',
@@ -231,23 +229,12 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]pun_forum_subscriptions` (
-  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `forum_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`user_id`,`forum_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-# --
-CREATE TABLE `[prefix]pun_groups` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_groups` (
   `g_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `g_title` varchar(50) NOT NULL DEFAULT '',
   `g_user_title` varchar(50) DEFAULT NULL,
-  `g_moderator` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_edit_users` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_rename_users` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_change_passwords` tinyint(1) NOT NULL DEFAULT '0',
-  `g_mod_ban_users` tinyint(1) NOT NULL DEFAULT '0',
   `g_read_board` tinyint(1) NOT NULL DEFAULT '1',
-  `g_view_users` tinyint(1) NOT NULL DEFAULT '1',
   `g_post_replies` tinyint(1) NOT NULL DEFAULT '1',
   `g_post_topics` tinyint(1) NOT NULL DEFAULT '1',
+  `g_post_polls` tinyint(1) NOT NULL DEFAULT '1',
   `g_edit_posts` tinyint(1) NOT NULL DEFAULT '1',
   `g_delete_posts` tinyint(1) NOT NULL DEFAULT '1',
@@ -256,32 +243,25 @@
   `g_search` tinyint(1) NOT NULL DEFAULT '1',
   `g_search_users` tinyint(1) NOT NULL DEFAULT '1',
-  `g_send_email` tinyint(1) NOT NULL DEFAULT '1',
+  `g_edit_subjects_interval` smallint(6) NOT NULL DEFAULT '300',
   `g_post_flood` smallint(6) NOT NULL DEFAULT '30',
   `g_search_flood` smallint(6) NOT NULL DEFAULT '30',
-  `g_email_flood` smallint(6) NOT NULL DEFAULT '60',
-  `g_report_flood` smallint(6) NOT NULL DEFAULT '60',
   PRIMARY KEY (`g_id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
 # --
-CREATE TABLE `[prefix]pun_online` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_online` (
   `user_id` int(10) unsigned NOT NULL DEFAULT '1',
   `ident` varchar(200) NOT NULL DEFAULT '',
   `logged` int(10) unsigned NOT NULL DEFAULT '0',
   `idle` tinyint(1) NOT NULL DEFAULT '0',
-  `last_post` int(10) unsigned DEFAULT NULL,
-  `last_search` int(10) unsigned DEFAULT NULL,
-  UNIQUE KEY `[prefix]pun_online_user_id_ident_idx` (`user_id`,`ident`(25)),
-  KEY `pun_online_user_id_idx` (`user_id`),
-  KEY `[prefix]pun_online_ident_idx` (`ident`(25)),
-  KEY `[prefix]pun_online_logged_idx` (`logged`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-# --
-CREATE TABLE `[prefix]pun_posts` (
+  KEY `pun_online_user_id_idx` (`user_id`)
+) ENGINE=MEMORY DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_posts` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `poster` varchar(200) NOT NULL DEFAULT '',
   `poster_id` int(10) unsigned NOT NULL DEFAULT '1',
-  `poster_ip` varchar(39) DEFAULT NULL,
-  `poster_email` varchar(80) DEFAULT NULL,
-  `message` mediumtext,
+  `poster_ip` varchar(15) DEFAULT NULL,
+  `poster_email` varchar(50) DEFAULT NULL,
+  `message` text NOT NULL,
   `hide_smilies` tinyint(1) NOT NULL DEFAULT '0',
   `posted` int(10) unsigned NOT NULL DEFAULT '0',
@@ -294,5 +274,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21233 ;
 # --
-CREATE TABLE `[prefix]pun_ranks` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_ranks` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `rank` varchar(50) NOT NULL DEFAULT '',
@@ -301,5 +281,5 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
 # --
-CREATE TABLE `[prefix]pun_reports` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_reports` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `post_id` int(10) unsigned NOT NULL DEFAULT '0',
@@ -315,13 +295,13 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
 # --
-CREATE TABLE `[prefix]pun_search_cache` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_cache` (
   `id` int(10) unsigned NOT NULL DEFAULT '0',
   `ident` varchar(200) NOT NULL DEFAULT '',
-  `search_data` mediumtext,
+  `search_data` text NOT NULL,
   PRIMARY KEY (`id`),
   KEY `pun_search_cache_ident_idx` (`ident`(8))
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]pun_search_matches` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_matches` (
   `post_id` int(10) unsigned NOT NULL DEFAULT '0',
   `word_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
@@ -331,5 +311,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]pun_search_words` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_search_words` (
   `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
   `word` varchar(20) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
@@ -338,5 +318,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]pun_smilies` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_smilies` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `image` varchar(60) NOT NULL DEFAULT '',
@@ -346,10 +326,15 @@
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=89 ;
 # --
-CREATE TABLE `[prefix]pun_topics` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_subscriptions` (
+  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`user_id`,`topic_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+# --
+CREATE TABLE IF NOT EXISTS `[prefix]pun_topics` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `poster` varchar(200) NOT NULL DEFAULT '',
   `subject` varchar(255) NOT NULL DEFAULT '',
   `posted` int(10) unsigned NOT NULL DEFAULT '0',
-  `first_post_id` int(10) unsigned NOT NULL DEFAULT '0',
   `last_post` int(10) unsigned NOT NULL DEFAULT '0',
   `last_post_id` int(10) unsigned NOT NULL DEFAULT '0',
@@ -363,36 +348,29 @@
   PRIMARY KEY (`id`),
   KEY `pun_topics_forum_id_idx` (`forum_id`),
-  KEY `pun_topics_moved_to_idx` (`moved_to`),
-  KEY `[prefix]pun_topics_last_post_idx` (`last_post`),
-  KEY `[prefix]pun_topics_first_post_id_idx` (`first_post_id`)
+  KEY `pun_topics_moved_to_idx` (`moved_to`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2441 ;
 # --
-CREATE TABLE `[prefix]pun_topic_subscriptions` (
-  `user_id` int(10) unsigned NOT NULL DEFAULT '0',
-  `topic_id` int(10) unsigned NOT NULL DEFAULT '0',
-  PRIMARY KEY (`user_id`,`topic_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-# --
-CREATE TABLE `[prefix]pun_users` (
+CREATE TABLE IF NOT EXISTS `[prefix]pun_users` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `group_id` int(10) unsigned NOT NULL DEFAULT '4',
   `username` varchar(200) NOT NULL DEFAULT '',
   `password` varchar(40) NOT NULL DEFAULT '',
-  `email` varchar(80) NOT NULL DEFAULT '',
+  `email` varchar(50) NOT NULL DEFAULT '',
   `title` varchar(50) DEFAULT NULL,
   `realname` varchar(40) DEFAULT NULL,
   `url` varchar(100) DEFAULT NULL,
-  `jabber` varchar(80) DEFAULT NULL,
+  `jabber` varchar(75) DEFAULT NULL,
   `icq` varchar(12) DEFAULT NULL,
-  `msn` varchar(80) DEFAULT NULL,
+  `msn` varchar(50) DEFAULT NULL,
   `aim` varchar(30) DEFAULT NULL,
   `yahoo` varchar(30) DEFAULT NULL,
   `location` varchar(30) DEFAULT NULL,
+  `use_avatar` tinyint(1) NOT NULL DEFAULT '0',
   `signature` text,
   `disp_topics` tinyint(3) unsigned DEFAULT NULL,
   `disp_posts` tinyint(3) unsigned DEFAULT NULL,
   `email_setting` tinyint(1) NOT NULL DEFAULT '1',
+  `save_pass` tinyint(1) NOT NULL DEFAULT '1',
   `notify_with_post` tinyint(1) NOT NULL DEFAULT '0',
-  `auto_notify` tinyint(1) NOT NULL DEFAULT '0',
   `show_smilies` tinyint(1) NOT NULL DEFAULT '1',
   `show_img` tinyint(1) NOT NULL DEFAULT '1',
@@ -401,32 +379,25 @@
   `show_sig` tinyint(1) NOT NULL DEFAULT '1',
   `timezone` float NOT NULL DEFAULT '0',
-  `dst` tinyint(1) NOT NULL DEFAULT '0',
-  `date_format` tinyint(1) NOT NULL DEFAULT '0',
-  `time_format` tinyint(1) NOT NULL DEFAULT '0',
   `language` varchar(25) NOT NULL DEFAULT 'English',
   `style` varchar(25) NOT NULL DEFAULT 'Oxygen',
   `num_posts` int(10) unsigned NOT NULL DEFAULT '0',
   `last_post` int(10) unsigned DEFAULT NULL,
-  `last_search` int(10) unsigned DEFAULT NULL,
-  `last_email_sent` int(10) unsigned DEFAULT NULL,
-  `last_report_sent` int(10) unsigned DEFAULT NULL,
   `registered` int(10) unsigned NOT NULL DEFAULT '0',
-  `registration_ip` varchar(39) NOT NULL DEFAULT '0.0.0.0',
+  `registration_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0',
   `last_visit` int(10) unsigned NOT NULL DEFAULT '0',
   `admin_note` varchar(30) DEFAULT NULL,
-  `activate_string` varchar(80) DEFAULT NULL,
+  `activate_string` varchar(50) DEFAULT NULL,
   `activate_key` varchar(8) DEFAULT NULL,
   PRIMARY KEY (`id`),
-  UNIQUE KEY `[prefix]_pun_users_username_idx` (`username`(25)),
   KEY `pun_users_registered_idx` (`registered`),
   KEY `pun_users_username_idx` (`username`(8))
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1559 ;
 # --
-CREATE TABLE `[prefix]super_admins` (
+CREATE TABLE IF NOT EXISTS `[prefix]super_admins` (
   `id_pun_user` int(11) NOT NULL,
   PRIMARY KEY (`id_pun_user`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 # --
-CREATE TABLE `[prefix]thumbs` (
+CREATE TABLE IF NOT EXISTS `[prefix]thumbs` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `src` varchar(255) NOT NULL DEFAULT '',
@@ -442,5 +413,5 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 # --
-CREATE TABLE `[prefix]videos` (
+CREATE TABLE IF NOT EXISTS `[prefix]videos` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `id_artiste` int(11) DEFAULT NULL,
Index: /trunk/web/install/mods/e_install.php
===================================================================
--- /trunk/web/install/mods/e_install.php	(revision 10)
+++ /trunk/web/install/mods/e_install.php	(revision 1)
@@ -123,34 +123,21 @@
 
   function install_db($env)
-  { $flag = 0;
-    try
-    { $env->data->sql->query("USE ".$_POST["db_base"]);
-      if(($sql = file_get_contents("dist/sql/init.sql")) !== false)
-      { $flag = 1;
-        if($sql) try
-        { $flag = 2;
-          $env->data->sql->query($sql);
-          $flag = 3;
+  { try
+    { if(($sql = file_get_contents("dist/sql/init.sql")) !== false)
+      { if($sql) try
+        { $env->data->sql->query($sql);
           if(($sql = file_get_contents("dist/sql/raz.sql")) !== false)
-          { $flag = 4;
-            if($sql) try
-            { $flag = 5;
-              $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
+          { if($sql) try
+            { $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
               $v_sql = explode("# --", $sql);
               foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
-              $flag = 6;
               if(($sql = file_get_contents("dist/sql/tables.sql")) !== false)
-              { $flag = 7;
-                if($sql) try
-                { $flag = 8;
-                  $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
+              { if($sql) try
+                { $sql = str_replace("[prefix]", $_POST["db_prefix"], $sql);
                   $v_sql = explode("# --", $sql);
                   foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
-                  $flag = 9;
                   if(($sql = file_get_contents("dist/sql/content.sql")) !== false)
-                  { $flag = 10;
-                    if($sql) try
-                    { $flag = 11;
-                      $punbb_url = "http://".$_SERVER["SERVER_NAME"];
+                  { if($sql) try
+                    { $punbb_url = "http://".$_SERVER["SERVER_NAME"];
                       $v_path = explode("/", $_SERVER["SCRIPT_NAME"]);
                       $path = "";
@@ -174,5 +161,4 @@
                       $v_sql = explode("# --", $sql);
                       foreach($v_sql as $_sql) if($_sql) $env->data->sql->query($_sql);
-                      $flag = 12;
                     }
                     catch(Exception $_e)
@@ -187,10 +173,5 @@
                   ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
                 }
-                catch(Exception $_e)
-                { $env->message =
-                   "Impossible d'executer les requetes du fichier tables.sql"
-                  ."<br/>erreur dans la requete sql:<br/>".$_sql;
-                  return;
-                }
+                catch(Exception $_e) { $env->message = "Impossible d'executer les requetes du fichier tables.sql"; return; }
               }
               else $env->message .=
@@ -204,10 +185,5 @@
           ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
         }
-        catch(Exception $_e)
-        { $env->message =
-           "Impossible d'executer les requetes du fichier init.sql (flag ".$flag.")"
-          ."<br>V&eacute;rifiez que vous avez indiqu&eacute; les bon param&egrave;tres de connection &agrave la base de donn&eacute;es";
-          return;
-        }
+        catch(Exception $_e) { $env->message = "Impossible d'executer les requetes du fichier init.sql"; return; }
       }
       else $env->message .=
@@ -215,10 +191,10 @@
       ."<br/>v&eacute;rifiez que vous avez bien upload&eacute; tous les fichiers";
     }
-    catch(Exception $_e) { $env->message .= "impossible d'acc&eacute;der &agrave; la base de donn&eacute;es"; }
+    catch(Exception $_e) { $env->message .= "<br/>impossible d'acc&eacute;der &agrave; la base de donn&eacute;es"; }
   }
 
   function clear_pun_cache()
   { if(is_dir("../punbb/cache/") && ($dh = opendir("../punbb/cache/")))
-    { while(($file = readdir($dh)) !== false) if(strpos($file, "cache_") === 0) @unlink("../punbb/cache/".$file);
+    { while(($file = readdir($dh)) !== false) if(strpos($file, "cache_") === 0 && $file !== "cache_smilies.php") @unlink("../punbb/cache/".$file);
       closedir($dh);
     }
Index: unk/web/punbb/COPYING
===================================================================
--- /trunk/web/punbb/COPYING	(revision 10)
+++ 	(revision )
@@ -1,345 +1,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  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
-this service 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 make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  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.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-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
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the 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 a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE 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.
-
-		     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
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 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, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision 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, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This 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 Library General
-Public License instead of this License.
Index: unk/web/punbb/README
===================================================================
--- /trunk/web/punbb/README	(revision 10)
+++ 	(revision )
@@ -1,31 +1,0 @@
-	=====================
-	  FluxBB 1.4 Readme
-	=====================
-
-	   About
-	----------------
-FluxBB is an open source forum application released under the GNU General Public
-Licence. It is free to download and use and will remain so. FluxBB was conceived and
-designed to be fast and light with less of the "not so essential" features that some
-of the other forums have whilst not sacrificing essential functionality or usability.
-
-	  Requirements
-	----------------
- - A webserver
- - PHP 4.4.0 or later
- - A database such as MySQL 4.1.2 or later, PostgreSQL 7.0 or later, or SQLite 2
-
-	  Recommendations
-	-------------------
- - Make use of a PHP accelerator such as APC or XCache
- - Make sure PHP has the zlib module installed to allow FluxBB to gzip output
-
-	  Links
-	---------
-
- - Homepage: http://fluxbb.org
- - Documentation: http://fluxbb.org/docs/
- - Community: http://fluxbb.org/forums/
- - Resources: http://fluxbb.org/resources/
- - IRC: irc://irc.freenode.net/fluxbb
- - Development: http://github.com/fluxbb/fluxbb
Index: /trunk/web/punbb/admin_bans.php
===================================================================
--- /trunk/web/punbb/admin_bans.php	(revision 10)
+++ /trunk/web/punbb/admin_bans.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] != '1' || $pun_user['g_mod_ban_users'] == '0'))
+if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
 	message($lang_common['No permission']);
 
-// Load the admin_bans.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_bans.php';
 
 // Add/edit a ban (stage 1)
@@ -26,60 +41,47 @@
 	if (isset($_GET['add_ban']) || isset($_POST['add_ban']))
 	{
-		// If the ID of the user to ban was provided through GET (a link from profile.php)
+		// If the id of the user to ban was provided through GET (a link from profile.php)
 		if (isset($_GET['add_ban']))
 		{
-			$user_id = intval($_GET['add_ban']);
-			if ($user_id < 2)
+			$add_ban = intval($_GET['add_ban']);
+			if ($add_ban < 2)
 				message($lang_common['Bad request']);
 
-			$result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+			$user_id = $add_ban;
+
+			$result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 			if ($db->num_rows($result))
 				list($group_id, $ban_user, $ban_email) = $db->fetch_row($result);
 			else
-				message($lang_admin_bans['No user ID message']);
+				message('Aucun utilisateur enregistrÃ© sous cet identifiant (ID).');
 		}
-		else // Otherwise the username is in POST
+		else	// Otherwise the username is in POST
 		{
-			$ban_user = pun_trim($_POST['new_ban_user']);
+			$ban_user = trim($_POST['new_ban_user']);
 
 			if ($ban_user != '')
 			{
-				$result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 				if ($db->num_rows($result))
 					list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result);
 				else
-					message($lang_admin_bans['No user message']);
+					message('Aucun utilisateur enregistrÃ© sous ce nom d\'utilisateur. Si vous souhaitez ajouter un bannissement qui ne soit pas liÃ© Ã  un nom d\'utilisateur particulier, laissez la case vide.');
 			}
 		}
 
-		// Make sure we're not banning an admin or moderator
-		if (isset($group_id))
-		{
-			if ($group_id == PUN_ADMIN)
-				message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
-
-			$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-			$is_moderator_group = $db->result($result);
-
-			if ($is_moderator_group)
-				message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
-		}
+		// Make sure we're not banning an admin
+		if (isset($group_id) && $group_id == PUN_ADMIN)
+			message('L\'utilisateur '.pun_htmlspecialchars($ban_user).' est un administrateur, il ne peut Ãªtre bannis. Si vous souhaitez bannir un administrateur, vous devez d\'abord le rÃ©trograder soit modÃ©rateur soit utilisateur.');
 
 		// If we have a $user_id, we can try to find the last known IP of that user
 		if (isset($user_id))
 		{
-			$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 			$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
-
-			if ($ban_ip == '')
-			{
-				$result = $db->query('SELECT registration_ip FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-				$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
-			}
 		}
 
 		$mode = 'add';
 	}
-	else // We are editing a ban
+	else	// We are editing a ban
 	{
 		$ban_id = intval($_GET['edit_ban']);
@@ -87,5 +89,5 @@
 			message($lang_common['Bad request']);
 
-		$result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to fetch ban info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de retrouver les informations de bannissement', __FILE__, __LINE__, $db->error());
 		if ($db->num_rows($result))
 			list($ban_user, $ban_ip, $ban_email, $ban_message, $ban_expire) = $db->fetch_row($result);
@@ -93,20 +95,19 @@
 			message($lang_common['Bad request']);
 
-		$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-		$ban_expire = ($ban_expire != '') ? gmdate('Y-m-d', $ban_expire + $diff) : '';
+		$ban_expire = ($ban_expire != '') ? date('Y-m-d', $ban_expire) : '';
 
 		$mode = 'edit';
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissements';
 	$focus_element = array('bans2', 'ban_user');
-	define('PUN_ACTIVE_PAGE', 'admin');
 	require PUN_ROOT.'header.php';
 
 	generate_admin_menu('bans');
+
 
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_bans['Ban advanced head'] ?></span></h2>
+		<h2><span>RÃ©glages de bannissement avancÃ©s</span></h2>
 		<div class="box">
 			<form id="bans2" method="post" action="admin_bans.php">
@@ -115,30 +116,30 @@
 <?php if ($mode == 'edit'): ?>				<input type="hidden" name="ban_id" value="<?php echo $ban_id ?>" />
 <?php endif; ?>				<fieldset>
-						<legend><?php echo $lang_admin_bans['Ban advanced subhead'] ?></legend>
+						<legend>Bannissement supplÃ©mentaire avec <acronym title="Internet Protocol" lang="en">IP</acronym> est adresse e-mail</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
+									<th scope="row">Nom d'utilisateur</th>
 									<td>
 										<input type="text" name="ban_user" size="25" maxlength="25" value="<?php if (isset($ban_user)) echo pun_htmlspecialchars($ban_user); ?>" tabindex="1" />
-										<span><?php echo $lang_admin_bans['Username help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
+										<span>Le nom d'utilisateur Ã  bannir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Adresses <acronym title="Internet Protocol" lang="en">IP</acronym></th>
 									<td>
 										<input type="text" name="ban_ip" size="45" maxlength="255" value="<?php if (isset($ban_ip)) echo $ban_ip; ?>" tabindex="2" />
-										<span><?php echo $lang_admin_bans['IP help'] ?><?php if ($ban_user != '' && isset($user_id)) printf(' '.$lang_admin_bans['IP help link'], '<a href="admin_users.php?ip_stats='.$user_id.'">'.$lang_admin_common['here'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
-									<td>
-										<input type="text" name="ban_email" size="40" maxlength="80" value="<?php if (isset($ban_email)) echo $ban_email; ?>" tabindex="3" />
-										<span><?php echo $lang_admin_bans['E-mail help'] ?></span>
+										<span>Une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> 150.11.110.1 ou 150.11.110). SÃ©parez les adresses par des espaces. Si une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> apparaÃ®t dÃ©jÃ , il s'agit de la derniÃšre adresse IP connue de l'utilisateur dans la base de donnÃ©es.<?php if ($ban_user != '' && isset($user_id)) echo ' <a href="admin_users.php?ip_stats='.$user_id.'">Cliquez ici</a> pour voir les statistiques <acronym title="Internet Protocol" lang="en">IP</acronym> de cet utilisateur.' ?></span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail/domaine</th>
+									<td>
+										<input type="text" name="ban_email" size="40" maxlength="50" value="<?php if (isset($ban_email)) echo strtolower($ban_email); ?>" tabindex="3" />
+										<span>L'adresse e-mail ou le domaine e-mail que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com ou domaine.com). Pour plus d'informations, voir "Autoriser les adresses e-mail bannies" Ã  la page des Permissions.</span>
 									</td>
 								</tr>
 							</table>
-							<p class="topspace"><strong class="warntext"><?php echo $lang_admin_bans['Ban IP range info'] ?></strong></p>
+							<p class="topspace"><strong class="warntext">Vous devez Ãªtres trÃšs vigilant lorsque vous bannissez une plage d'<acronym title="Internet Protocol" lang="en">IP</acronym> car il y a fort probablement plusieurs utilisateurs qui correspondent Ã  la mÃªme <acronym title="Internet Protocol" lang="en">IP</acronym> partielle.</strong></p>
 						</div>
 					</fieldset>
@@ -146,19 +147,19 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Message expiry subhead'] ?></legend>
+						<legend>Message et Ã©chÃ©ance d'interdiction</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Ban message label'] ?></th>
+									<th scope="row">Message d'interdiction</th>
 									<td>
 										<input type="text" name="ban_message" size="50" maxlength="255" value="<?php if (isset($ban_message)) echo pun_htmlspecialchars($ban_message); ?>" tabindex="4" />
-										<span><?php echo $lang_admin_bans['Ban message help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire date label'] ?></th>
+										<span>Le  message qui sera affichÃ© Ã  l'utilisateur banni lorsqu'il visitera les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃchÃ©ance d'interdiction</th>
 									<td>
 										<input type="text" name="ban_expire" size="17" maxlength="10" value="<?php if (isset($ban_expire)) echo $ban_expire; ?>" tabindex="5" />
-										<span><?php echo $lang_admin_bans['Expire date help'] ?></span>
+										<span>La date Ã  laquelle ce bannissement sera automatiquement supprimÃ© (format: AAAA-MM-JJ). Pour supprimer manuellement, laissez ce champ vide.</span>
 									</td>
 								</tr>
@@ -167,5 +168,5 @@
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="add_edit_ban" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="6" /></p>
+				<p class="submitend"><input type="submit" name="add_edit_ban" value=" Enregistrer " tabindex="6" /></p>
 			</form>
 		</div>
@@ -178,4 +179,5 @@
 }
 
+
 // Add/edit a ban (stage 2)
 else if (isset($_POST['add_edit_ban']))
@@ -183,73 +185,34 @@
 	confirm_referrer('admin_bans.php');
 
-	$ban_user = pun_trim($_POST['ban_user']);
+	$ban_user = trim($_POST['ban_user']);
 	$ban_ip = trim($_POST['ban_ip']);
 	$ban_email = strtolower(trim($_POST['ban_email']));
-	$ban_message = pun_trim($_POST['ban_message']);
+	$ban_message = trim($_POST['ban_message']);
 	$ban_expire = trim($_POST['ban_expire']);
 
 	if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
-		message($lang_admin_bans['Must enter message']);
-	else if (strtolower($ban_user) == 'guest')
-		message($lang_admin_bans['Cannot ban guest message']);
-
-	// Make sure we're not banning an admin or moderator
-	if (!empty($ban_user))
-	{
-		$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-		if ($db->num_rows($result))
-		{
-			$group_id = $db->result($result);
-
-			if ($group_id == PUN_ADMIN)
-				message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
-
-			$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-			$is_moderator_group = $db->result($result);
-
-			if ($is_moderator_group)
-				message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
-		}
-	}
+		message('Vous devez saisir au moins soit un nom d\'utilisateur, soit une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail.');
 
 	// Validate IP/IP range (it's overkill, I know)
 	if ($ban_ip != '')
 	{
-		$ban_ip = preg_replace('%\s{2,}%S', ' ', $ban_ip);
+		$ban_ip = preg_replace('/[\s]{2,}/', ' ', $ban_ip);
 		$addresses = explode(' ', $ban_ip);
-		$addresses = array_map('pun_trim', $addresses);
+		$addresses = array_map('trim', $addresses);
 
 		for ($i = 0; $i < count($addresses); ++$i)
 		{
-			if (strpos($addresses[$i], ':') !== false)
+			$octets = explode('.', $addresses[$i]);
+
+			for ($c = 0; $c < count($octets); ++$c)
 			{
-				$octets = explode(':', $addresses[$i]);
-
-				for ($c = 0; $c < count($octets); ++$c)
-				{
-					$octets[$c] = ltrim($octets[$c], "0");
-
-					if ($c > 7 || (!empty($octets[$c]) && !ctype_xdigit($octets[$c])) || intval($octets[$c], 16) > 65535)
-						message($lang_admin_bans['Invalid IP message']);
-				}
-
-				$cur_address = implode(':', $octets);
-				$addresses[$i] = $cur_address;
+				$octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
+
+				if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255)
+					message('Vous avez saisi une <acronym title="Internet Protocol" lang="en">IP</acronym>/plage d\'<acronym title="Internet Protocol" lang="en">IP</acronym> incorrecte.');
 			}
-			else
-			{
-				$octets = explode('.', $addresses[$i]);
-
-				for ($c = 0; $c < count($octets); ++$c)
-				{
-					$octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
-
-					if ($c > 3 || preg_match('%[^0-9]%', $octets[$c]) || intval($octets[$c]) > 255)
-						message($lang_admin_bans['Invalid IP message']);
-				}
-
-				$cur_address = implode('.', $octets);
-				$addresses[$i] = $cur_address;
-			}
+
+			$cur_address = implode('.', $octets);
+			$addresses[$i] = $cur_address;
 		}
 
@@ -260,20 +223,14 @@
 	if ($ban_email != '' && !is_valid_email($ban_email))
 	{
-		if (!preg_match('%^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$%', $ban_email))
-			message($lang_admin_bans['Invalid e-mail message']);
+		if (!preg_match('/^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $ban_email))
+			message('L\'adresse e-mail (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com) ou le domaine d\'adresse e-mail (<abbr title="exemple">ex.</abbr> domaine.com) que vous avez saisi est incorrect.');
 	}
 
 	if ($ban_expire != '' && $ban_expire != 'Never')
 	{
-		$ban_expire = strtotime($ban_expire.' GMT');
-
-		if ($ban_expire == -1 || !$ban_expire)
-			message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
-
-		$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-		$ban_expire -= $diff;
-
-		if ($ban_expire <= time())
-			message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
+		$ban_expire = strtotime($ban_expire);
+
+		if ($ban_expire == -1 || $ban_expire <= time())
+			message('Vous avez saisi une date d\'Ã©chÃ©ance incorrecte. Le format doit Ãªtre AAAA-MM-JJ et la date doit-Ãªtre d\'au moins un jour dans le futur.');
 	}
 	else
@@ -286,19 +243,15 @@
 
 	if ($_POST['mode'] == 'add')
-		$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire, ban_creator) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.', '.$pun_user['id'].')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
+		$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Impossible d\'ajouter le bannissement', __FILE__, __LINE__, $db->error());
 	else
-		$db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Impossible de modifier le bannissement', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the bans cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_bans_cache();
 
-	if ($_POST['mode'] == 'edit')
-		redirect('admin_bans.php', $lang_admin_bans['Ban edited redirect']);
-	else
-		redirect('admin_bans.php', $lang_admin_bans['Ban added redirect']);
+	redirect('admin_bans.php', 'Bannissement '.(($_POST['mode'] == 'edit') ? 'modifiÃ©' : 'ajoutÃ©').'. Redirection ...');
 }
+
 
 // Remove a ban
@@ -311,170 +264,16 @@
 		message($lang_common['Bad request']);
 
-	$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to delete ban', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de supprimer le bannissement', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the bans cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_bans_cache();
 
-	redirect('admin_bans.php', $lang_admin_bans['Ban removed redirect']);
+	redirect('admin_bans.php', 'Bannissement supprimÃ©. Redirection ...');
 }
 
-// Find bans
-else if (isset($_GET['find_ban']))
-{
-	$form = isset($_GET['form']) ? $_GET['form'] : array();
-
-	// trim() all elements in $form
-	$form = array_map('pun_trim', $form);
-	$conditions = $query_str = array();
-
-	$expire_after = isset($_GET['expire_after']) ? trim($_GET['expire_after']) : '';
-	$expire_before = isset($_GET['expire_before']) ? trim($_GET['expire_before']) : '';
-	$order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'ip', 'email', 'expire')) ? 'b.'.$_GET['order_by'] : 'b.username';
-	$direction = isset($_GET['direction']) && $_GET['direction'] == 'DESC' ? 'DESC' : 'ASC';
-
-	$query_str[] = 'order_by='.$order_by;
-	$query_str[] = 'direction='.$direction;
-
-	// Try to convert date/time to timestamps
-	if ($expire_after != '')
-	{
-		$query_str[] = 'expire_after='.$expire_after;
-
-		$expire_after = strtotime($expire_after);
-		if ($expire_after === false || $expire_after == -1)
-			message($lang_admin_bans['Invalid date message']);
-
-		$conditions[] = 'b.expire>'.$expire_after;
-	}
-	if ($expire_before != '')
-	{
-		$query_str[] = 'expire_before='.$expire_before;
-
-		$expire_before = strtotime($expire_before);
-		if ($expire_before === false || $expire_before == -1)
-			message($lang_admin_bans['Invalid date message']);
-
-		$conditions[] = 'b.expire<'.$expire_before;
-	}
-
-	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
-	foreach ($form as $key => $input)
-	{
-		if ($input != '' && in_array($key, array('username', 'ip', 'email', 'message')))
-		{
-			$conditions[] = 'b.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
-			$query_str[] = 'form%5B'.$key.'%5D='.urlencode($input);
-		}
-	}
-
-	// Fetch ban count
-	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'bans as b WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '')) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
-	$num_bans = $db->result($result);
-
-	// Determine the ban offset (based on $_GET['p'])
-	$num_pages = ceil($num_bans / 50);
-
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-	$start_from = 50 * ($p - 1);
-
-	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_bans.php?find_ban=&amp;'.implode('&amp;', $query_str));
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans'], $lang_admin_bans['Results head']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-?>
-<div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
-	</div>
-</div>
-
-
-<div id="bans1" class="blocktable">
-	<h2><span><?php echo $lang_admin_bans['Results head'] ?></span></h2>
-	<div class="box">
-		<div class="inbox">
-			<table cellspacing="0">
-			<thead>
-				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_admin_bans['Results username head'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_admin_bans['Results e-mail head'] ?></th>
-					<th class="tc3" scope="col"><?php echo $lang_admin_bans['Results IP address head'] ?></th>
-					<th class="tc4" scope="col"><?php echo $lang_admin_bans['Results expire head'] ?></th>
-					<th class="tc5" scope="col"><?php echo $lang_admin_bans['Results message head'] ?></th>
-					<th class="tc6" scope="col"><?php echo $lang_admin_bans['Results banned by head'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_admin_bans['Results actions head'] ?></th>
-				</tr>
-			</thead>
-			<tbody>
-<?php
-
-	$result = $db->query('SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, b.ban_creator, u.username AS ban_creator_username FROM '.$db->prefix.'bans AS b LEFT JOIN '.$db->prefix.'users AS u ON b.ban_creator=u.id WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result))
-	{
-		while ($ban_data = $db->fetch_assoc($result))
-		{
-
-			$actions = '<a href="admin_bans.php?edit_ban='.$ban_data['id'].'">'.$lang_admin_common['Edit'].'</a> | <a href="admin_bans.php?del_ban='.$ban_data['id'].'">'.$lang_admin_common['Remove'].'</a>';
-			$expire = format_time($ban_data['expire'], true);
-
-?>
-				<tr>
-					<td class="tcl"><?php echo ($ban_data['username'] != '') ? pun_htmlspecialchars($ban_data['username']) : '&#160;' ?></td>
-					<td class="tc2"><?php echo ($ban_data['email'] != '') ? $ban_data['email'] : '&#160;' ?></td>
-					<td class="tc3"><?php echo ($ban_data['ip'] != '') ? $ban_data['ip'] : '&#160;' ?></td>
-					<td class="tc4"><?php echo $expire ?></td>
-					<td class="tc5"><?php echo ($ban_data['message'] != '') ? pun_htmlspecialchars($ban_data['message']) : '&#160;' ?></td>
-					<td class="tc6"><?php echo ($ban_data['ban_creator_username'] != '') ? '<a href="profile.php?id='.$ban_data['ban_creator'].'">'.pun_htmlspecialchars($ban_data['ban_creator_username']).'</a>' : $lang_admin_bans['Unknown'] ?></td>
-					<td class="tcr"><?php echo $actions ?></td>
-				</tr>
-<?php
-
-		}
-	}
-	else
-		echo "\t\t\t\t".'<tr><td class="tcl" colspan="7">'.$lang_admin_bans['No match'].'</td></tr>'."\n";
-
-?>
-			</tbody>
-			</table>
-		</div>
-	</div>
-</div>
-
-<div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
-		</ul>
-		<div class="clearer"></div>
-	</div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissement';
 $focus_element = array('bans', 'new_ban_user');
-define('PUN_ACTIVE_PAGE', 'admin');
 require PUN_ROOT.'header.php';
 
@@ -483,17 +282,17 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_bans['New ban head'] ?></span></h2>
+		<h2><span>Nouveau bannissement</span></h2>
 		<div class="box">
 			<form id="bans" method="post" action="admin_bans.php?action=more">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Add ban subhead'] ?></legend>
+						<legend>Ajouter un bannissement</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?><div><input type="submit" name="add_ban" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="2" /></div></th>
+									<th scope="row">Nom d'utilisateur<div><input type="submit" name="add_ban" value=" Ajouter " tabindex="2" /></div></th>
 									<td>
 										<input type="text" name="new_ban_user" size="25" maxlength="25" tabindex="1" />
-										<span><?php echo $lang_admin_bans['Username advanced help'] ?></span>
+										<span>Le nom d'utilisateur Ã  bannir (insensible Ã  la casse). La page suivante vous permettra d'entrer une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> et/ou une adresse e-mail de votre choix. Si vous souhaitez bannir une adresse <acronym title="Internet Protocol" lang="en">IP</acronym>, une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail, laissez simplement ce champ vide.</span>
 									</td>
 								</tr>
@@ -505,60 +304,52 @@
 		</div>
 
-		<h2 class="block2"><span><?php echo $lang_admin_bans['Ban search head'] ?></span></h2>
+		<h2 class="block2"><span>Bannissements actuels</span></h2>
 		<div class="box">
-			<form id="find_band" method="get" action="admin_bans.php">
-				<p class="submittop"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="3" /></p>
+			<div class="fakeform">
+<?php
+
+$result = $db->query('SELECT id, username, ip, email, message, expire FROM '.$db->prefix.'bans ORDER BY id') or error('Impossible de retrouver la liste des bannissements', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+	while ($cur_ban = $db->fetch_assoc($result))
+	{
+		$expire = format_time($cur_ban['expire'], true);
+
+?>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Ban search subhead'] ?></legend>
+						<legend>Date d'Ã©chÃ©ance&#160;: <?php echo $expire ?></legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_bans['Ban search info'] ?></p>
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
-									<td><input type="text" name="form[username]" size="25" maxlength="25" tabindex="4" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
-									<td><input type="text" name="form[ip]" size="30" maxlength="255" tabindex="5" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
-									<td><input type="text" name="form[email]" size="30" maxlength="80" tabindex="6" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Message label'] ?></th>
-									<td><input type="text" name="form[message]" size="30" maxlength="255" tabindex="7" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire after label'] ?></th>
-									<td><input type="text" name="expire_after" size="10" maxlength="10" tabindex="8" />
-									<span><?php echo $lang_admin_bans['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire before label'] ?></th>
-									<td><input type="text" name="expire_before" size="10" maxlength="10" tabindex="9" />
-									<span><?php echo $lang_admin_bans['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Order by label'] ?></th>
-									<td>
-										<select name="order_by" tabindex="10">
-											<option value="username" selected="selected"><?php echo $lang_admin_bans['Order by username'] ?></option>
-											<option value="ip"><?php echo $lang_admin_bans['Order by ip'] ?></option>
-											<option value="email"><?php echo $lang_admin_bans['Order by e-mail'] ?></option>
-											<option value="expire"><?php echo $lang_admin_bans['Order by expire'] ?></option>
-										</select>&#160;&#160;&#160;<select name="direction" tabindex="11">
-											<option value="ASC" selected="selected"><?php echo $lang_admin_bans['Ascending'] ?></option>
-											<option value="DESC"><?php echo $lang_admin_bans['Descending'] ?></option>
-										</select>
-									</td>
-								</tr>
-							</table>
+							<table cellspacing="0">
+<?php if ($cur_ban['username'] != ''): ?>								<tr>
+									<th>Nom d'utilisateur</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['username']) ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['email'] != ''): ?>								<tr>
+									<th>E-mail</th>
+									<td><?php echo $cur_ban['email'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['ip'] != ''): ?>								<tr>
+									<th><acronym title="Internet Protocol" lang="en">IP</acronym>/plage d'<acronym title="Internet Protocol" lang="en">IP</acronym></th>
+									<td><?php echo $cur_ban['ip'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['message'] != ''): ?>								<tr>
+									<th>Motif</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['message']) ?></td>
+								</tr>
+<?php endif; ?>							</table>
+							<p class="linkactions"><a href="admin_bans.php?edit_ban=<?php echo $cur_ban['id'] ?>">Modifier</a> - <a href="admin_bans.php?del_ban=<?php echo $cur_ban['id'] ?>">Supprimer</a></p>
 						</div>
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="12" /></p>
-			</form>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t\t".'<p>Aucun bannissement Ã  lister.</p>'."\n";
+
+?>
+			</div>
 		</div>
 	</div>
Index: /trunk/web/punbb/admin_categories.php
===================================================================
--- /trunk/web/punbb/admin_categories.php	(revision 10)
+++ /trunk/web/punbb/admin_categories.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_categories.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_categories.php';
 
 // Add a new category
@@ -26,12 +41,13 @@
 	confirm_referrer('admin_categories.php');
 
-	$new_cat_name = pun_trim($_POST['new_cat_name']);
+	$new_cat_name = trim($_POST['new_cat_name']);
 	if ($new_cat_name == '')
-		message($lang_admin_categories['Must enter name message']);
-
-	$db->query('INSERT INTO '.$db->prefix.'categories (cat_name) VALUES(\''.$db->escape($new_cat_name).'\')') or error('Unable to create category', __FILE__, __LINE__, $db->error());
-
-	redirect('admin_categories.php', $lang_admin_categories['Category added redirect']);
+		message('Vous devez saisir un nom pour la nouvelle catÃ©gorie.');
+
+	$db->query('INSERT INTO '.$db->prefix.'categories (cat_name) VALUES(\''.$db->escape($new_cat_name).'\')') or error('Impossible de crÃ©er la catÃ©gorie', __FILE__, __LINE__, $db->error());
+
+	redirect('admin_categories.php', 'CatÃ©gorie ajoutÃ©e. Redirection ...');
 }
+
 
 // Delete a category
@@ -44,9 +60,9 @@
 		message($lang_common['Bad request']);
 
-	if (isset($_POST['del_cat_comply'])) // Delete a category with all forums and posts
+	if (isset($_POST['del_cat_comply']))	// Delete a category with all forums and posts
 	{
 		@set_time_limit(0);
 
-		$result = $db->query('SELECT id FROM '.$db->prefix.'forums WHERE cat_id='.$cat_to_delete) or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT id FROM '.$db->prefix.'forums WHERE cat_id='.$cat_to_delete) or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
 		$num_forums = $db->num_rows($result);
 
@@ -59,9 +75,9 @@
 
 			// Delete the forum
-			$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$cur_forum) or error('Unable to delete forum', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$cur_forum) or error('Impossible de supprimer le forum', __FILE__, __LINE__, $db->error());
 		}
 
 		// Locate any "orphaned redirect topics" and delete them
-		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Unable to fetch redirect topics', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Impossible de retrouver les sujets de redirection', __FILE__, __LINE__, $db->error());
 		$num_orphans = $db->num_rows($result);
 
@@ -71,25 +87,22 @@
 				$orphans[] = $db->result($result, $i);
 
-			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Impossible de supprimer les sujets de redirection', __FILE__, __LINE__, $db->error());
 		}
 
 		// Delete the category
-		$db->query('DELETE FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Unable to delete category', __FILE__, __LINE__, $db->error());
-
-		// Regenerate the quick jump cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
+		$db->query('DELETE FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Impossible de supprimer la catÃ©gorie', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
 		generate_quickjump_cache();
 
-		redirect('admin_categories.php', $lang_admin_categories['Category deleted redirect']);
-	}
-	else // If the user hasn't comfirmed the delete
-	{
-		$result = $db->query('SELECT cat_name FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Unable to fetch category info', __FILE__, __LINE__, $db->error());
+		redirect('admin_categories.php', 'CatÃ©gorie supprimÃ©e. Redirection ...');
+	}
+	else	// If the user hasn't comfirmed the delete
+	{
+		$result = $db->query('SELECT cat_name FROM '.$db->prefix.'categories WHERE id='.$cat_to_delete) or error('Impossible de retrouver les informations de la catÃ©gorie', __FILE__, __LINE__, $db->error());
 		$cat_name = $db->result($result);
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Categories']);
-		define('PUN_ACTIVE_PAGE', 'admin');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / CatÃ©gories';
 		require PUN_ROOT.'header.php';
 
@@ -98,5 +111,5 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_categories['Delete category head'] ?></span></h2>
+		<h2><span>Supprimer une catÃ©gorie</span></h2>
 		<div class="box">
 			<form method="post" action="admin_categories.php">
@@ -104,12 +117,12 @@
 				<input type="hidden" name="cat_to_delete" value="<?php echo $cat_to_delete ?>" />
 					<fieldset>
-						<legend><?php echo $lang_admin_categories['Confirm delete subhead'] ?></legend>
+						<legend>Confirmez la supression de la catÃ©gorie</legend>
 						<div class="infldset">
-							<p><?php printf($lang_admin_categories['Confirm delete info'], pun_htmlspecialchars($cat_name)) ?></p>
-							<p class="warntext"><?php echo $lang_admin_categories['Delete category warn'] ?></p>
+							<p>Ãtes vous sÃ»r de vouloir supprimer la catÃ©gorie "<?php echo $cat_name ?>"&#160;?</p>
+							<p>ATTENTION ! Supprimer cette catÃ©gorie supprimera en mÃªme temps tous les forums et messages (s'il y en a) prÃ©sents dans cette catÃ©gorie&#160;!</p>
 						</div>
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="del_cat_comply" value="<?php echo $lang_admin_common['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_admin_common['Go back'] ?></a></p>
+				<p><input type="submit" name="del_cat_comply" value=" Supprimer " /><a href="javascript:history.go(-1)">Retour</a></p>
 			</form>
 		</div>
@@ -123,44 +136,45 @@
 }
 
-else if (isset($_POST['update'])) // Change position and name of the categories
+
+else if (isset($_POST['update']))	// Change position and name of the categories
 {
 	confirm_referrer('admin_categories.php');
 
-	$categories = $_POST['cat'];
-	if (empty($categories))
-		message($lang_common['Bad request']);
-
-	foreach ($categories as $cat_id => $cur_cat)
-	{
-		$cur_cat['name'] = pun_trim($cur_cat['name']);
-		$cur_cat['order'] = trim($cur_cat['order']);
-
-		if ($cur_cat['name'] == '')
-			message($lang_admin_categories['Must enter name message']);
-
-		if ($cur_cat['order'] == '' || preg_match('%[^0-9]%', $cur_cat['order']))
-			message($lang_admin_categories['Must enter integer message']);
-
-		$db->query('UPDATE '.$db->prefix.'categories SET cat_name=\''.$db->escape($cur_cat['name']).'\', disp_position='.$cur_cat['order'].' WHERE id='.intval($cat_id)) or error('Unable to update category', __FILE__, __LINE__, $db->error());
-	}
-
-	// Regenerate the quick jump cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	$cat_order = $_POST['cat_order'];
+	$cat_name = $_POST['cat_name'];
+
+	$result = $db->query('SELECT id, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+	$num_cats = $db->num_rows($result);
+
+	for ($i = 0; $i < $num_cats; ++$i)
+	{
+		if ($cat_name[$i] == '')
+			message('Vous devez saisir un nom de catÃ©gorie.');
+
+		if (!preg_match('#^\d+$#', $cat_order[$i]))
+			message('La position doit Ãªtre un nombre entier.');
+
+		list($cat_id, $position) = $db->fetch_row($result);
+
+		$db->query('UPDATE '.$db->prefix.'categories SET cat_name=\''.$db->escape($cat_name[$i]).'\', disp_position='.$cat_order[$i].' WHERE id='.$cat_id) or error('Impossible de modifier les catÃ©gories', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
 	generate_quickjump_cache();
 
-	redirect('admin_categories.php', $lang_admin_categories['Categories updated redirect']);
+	redirect('admin_categories.php', 'CatÃ©gories modifiÃ©es. Redirection ...');
 }
 
+
 // Generate an array with all categories
-$result = $db->query('SELECT id, cat_name, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT id, cat_name, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
 $num_cats = $db->num_rows($result);
 
 for ($i = 0; $i < $num_cats; ++$i)
-	$cat_list[] = $db->fetch_assoc($result);
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Categories']);
-define('PUN_ACTIVE_PAGE', 'admin');
+	$cat_list[] = $db->fetch_row($result);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / CatÃ©gories';
 require PUN_ROOT.'header.php';
 
@@ -169,95 +183,73 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_categories['Add categories head'] ?></span></h2>
+		<h2><span>Ajouter/supprimer/modifier les catÃ©gories</span></h2>
 		<div class="box">
-			<form method="post" action="admin_categories.php">
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_categories['Add categories subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_categories['Add category label'] ?><div><input type="submit" name="add_cat" value="<?php echo $lang_admin_categories['Add new submit'] ?>" tabindex="2" /></div></th>
-									<td>
-										<input type="text" name="new_cat_name" size="35" maxlength="80" tabindex="1" />
-										<span><?php printf($lang_admin_categories['Add category help'], '<a href="admin_forums.php">'.$lang_admin_common['Forums'].'</a>') ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-			</form>
+		<form method="post" action="admin_categories.php?action=foo">
+			<div class="inform">
+				<fieldset>
+					<legend>Ajouter/supprimer une catÃ©gorie</legend>
+					<div class="infldset">
+						<table class="aligntop" cellspacing="0">
+							<tr>
+								<th scope="row">Ajouter une catÃ©gorie<div><input type="submit" name="add_cat" value=" Ajouter " tabindex="2" /></div></th>
+								<td>
+									<input type="text" name="new_cat_name" size="35" maxlength="80" tabindex="1" />
+									<span>Saisissez le nom de la catÃ©gorie que vous souhaitez ajouter. Vous pourrez modifier ce nom plus tard (voir ci-dessous). Pour ajouter des forums Ã  une nouvelle catÃ©gorie, allez Ã  la page de gestion des <a href="admin_forums.php">Forums</a>.</span>
+								</td>
+							</tr>
+<?php if ($num_cats): ?>							<tr>
+								<th scope="row">Supprimer une catÃ©gorie<div><input type="submit" name="del_cat" value=" Supprimer " tabindex="4" /></div></th>
+								<td>
+									<select name="cat_to_delete" tabindex="3">
+<?php
+
+	while (list(, list($cat_id, $cat_name, ,)) = @each($cat_list))
+		echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cat_id.'">'.pun_htmlspecialchars($cat_name).'</option>'."\n";
+
+?>
+									</select>
+									<span>Choisissez le nom de la catÃ©gorie que vous souhaitez supprimer. Vous serez invitÃ©s Ã  confirmer votre choix de catÃ©gorie Ã  supprimer avant qu'elle ne soit effectivement supprimÃ©e.</span>
+								</td>
+							</tr>
+<?php endif; ?>						</table>
+					</div>
+				</fieldset>
+			</div>
+<?php if ($num_cats): ?>			<div class="inform">
+				<fieldset>
+					<legend>Modifier les catÃ©gories</legend>
+					<div class="infldset">
+						<table id="categoryedit" cellspacing="0" >
+						<thead>
+							<tr>
+								<th class="tcl" scope="col">Nom</th>
+								<th scope="col">Position</th>
+								<th>&#160;</th>
+							</tr>
+						</thead>
+						<tbody>
+<?php
+
+	@reset($cat_list);
+	for ($i = 0; $i < $num_cats; ++$i)
+	{
+		list(, list($cat_id, $cat_name, $position)) = @each($cat_list);
+
+?>
+							<tr><td><input type="text" name="cat_name[<?php echo $i ?>]" value="<?php echo pun_htmlspecialchars($cat_name) ?>" size="35" maxlength="80" /></td><td><input type="text" name="cat_order[<?php echo $i ?>]" value="<?php echo $position ?>" size="3" maxlength="3" /></td><td>&#160;</td></tr>
+<?php
+
+	}
+
+?>
+						</tbody>
+						</table>
+						<div class="fsetsubmit"><input type="submit" name="update" value=" Modifier " /></div>
+					</div>
+				</fieldset>
+			</div>
+<?php endif; ?>		</form>
 		</div>
-
-<?php if ($num_cats): ?>		<h2 class="block2"><span><?php echo $lang_admin_categories['Delete categories head'] ?></span></h2>
-		<div class="box">
-			<form method="post" action="admin_categories.php">
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_categories['Delete categories subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_categories['Delete category label'] ?><div><input type="submit" name="del_cat" value="<?php echo $lang_admin_common['Delete'] ?>" tabindex="4" /></div></th>
-									<td>
-										<select name="cat_to_delete" tabindex="3">
-<?php
-
-	foreach ($cat_list as $cur_cat)
-		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n";
-
-?>
-										</select>
-										<span><?php echo $lang_admin_categories['Delete category help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-			</form>
-		</div>
-<?php endif; ?>
-
-<?php if ($num_cats): ?>		<h2 class="block2"><span><?php echo $lang_admin_categories['Edit categories head'] ?></span></h2>
-		<div class="box">
-			<form method="post" action="admin_categories.php">
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_categories['Edit categories subhead'] ?></legend>
-						<div class="infldset">
-							<table id="categoryedit" cellspacing="0" >
-							<thead>
-								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_categories['Category name label'] ?></th>
-									<th scope="col"><?php echo $lang_admin_categories['Category position label'] ?></th>
-								</tr>
-							</thead>
-							<tbody>
-<?php
-
-	foreach ($cat_list as $cur_cat)
-	{
-
-?>
-								<tr>
-									<td class="tcl"><input type="text" name="cat[<?php echo $cur_cat['id'] ?>][name]" value="<?php echo pun_htmlspecialchars($cur_cat['cat_name']) ?>" size="35" maxlength="80" /></td>
-									<td><input type="text" name="cat[<?php echo $cur_cat['id'] ?>][order]" value="<?php echo $cur_cat['disp_position'] ?>" size="3" maxlength="3" /></td>
-								</tr>
-<?php
-
-	}
-
-?>
-							</tbody>
-							</table>
-							<div class="fsetsubmit"><input type="submit" name="update" value="<?php echo $lang_admin_common['Update'] ?>" /></div>
-						</div>
-					</fieldset>
-				</div>
-			</form>
-		</div>
-<?php endif; ?>	</div>
+	</div>
 	<div class="clearer"></div>
 </div>
Index: /trunk/web/punbb/admin_censoring.php
===================================================================
--- /trunk/web/punbb/admin_censoring.php	(revision 10)
+++ /trunk/web/punbb/admin_censoring.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
 
-// Load the admin_censoring.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_censoring.php';
 
 // Add a censor word
@@ -26,20 +41,15 @@
 	confirm_referrer('admin_censoring.php');
 
-	$search_for = pun_trim($_POST['new_search_for']);
-	$replace_with = pun_trim($_POST['new_replace_with']);
+	$search_for = trim($_POST['new_search_for']);
+	$replace_with = trim($_POST['new_replace_with']);
 
-	if ($search_for == '')
-		message($lang_admin_censoring['Must enter word message']);
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
 
-	$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Unable to add censor word', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Impossible d\'ajouter un mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
+	redirect('admin_censoring.php', 'Mot Ã  censurer ajoutÃ©. Redirection ...');
+}
 
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php', $lang_admin_censoring['Word added redirect']);
-}
 
 // Update a censor word
@@ -50,20 +60,15 @@
 	$id = intval(key($_POST['update']));
 
-	$search_for = pun_trim($_POST['search_for'][$id]);
-	$replace_with = pun_trim($_POST['replace_with'][$id]);
+	$search_for = trim($_POST['search_for'][$id]);
+	$replace_with = trim($_POST['replace_with'][$id]);
 
-	if ($search_for == '')
-		message($lang_admin_censoring['Must enter word message']);
+	if ($search_for == '' || $replace_with == '')
+		message('Vous devez saisir Ã  la fois un mot Ã  censurer et un texte pour le remplacer.');
 
-	$db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Unable to update censor word', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Impossible de mettre Ã  jour le mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
+	redirect('admin_censoring.php', 'Mot Ã  censurer modifiÃ©. Redirection ...');
+}
 
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php', $lang_admin_censoring['Word updated redirect']);
-}
 
 // Remove a censor word
@@ -74,18 +79,12 @@
 	$id = intval(key($_POST['remove']));
 
-	$db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Impossible de supprimer le mot Ã  censurer', __FILE__, __LINE__, $db->error());
 
-	// Regenerate the censoring cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
-	generate_censoring_cache();
-
-	redirect('admin_censoring.php',  $lang_admin_censoring['Word removed redirect']);
+	redirect('admin_censoring.php', 'Mot Ã  censurer supprimÃ©. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Censoring']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Mots Ã  censurer';
 $focus_element = array('censoring', 'new_search_for');
-define('PUN_ACTIVE_PAGE', 'admin');
 require PUN_ROOT.'header.php';
 
@@ -94,25 +93,25 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_censoring['Censoring head'] ?></span></h2>
+		<h2><span>Mots Ã  censurer</span></h2>
 		<div class="box">
-			<form id="censoring" method="post" action="admin_censoring.php">
+			<form id="censoring" method="post" action="admin_censoring.php?action=foo">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_censoring['Add word subhead'] ?></legend>
+						<legend>Ajouter un mot Ã  censurer</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_censoring['Add word info'].' '.($pun_config['o_censoring'] == '1' ? sprintf($lang_admin_censoring['Censoring enabled'], '<a href="admin_options.php#censoring">'.$lang_admin_common['Options'].'</a>') : sprintf($lang_admin_censoring['Censoring disabled'], '<a href="admin_options.php#censoring">'.$lang_admin_common['Options'].'</a>')) ?></p>
-							<table cellspacing="0">
+							<p>Saisissez le mot que vous voulez censurer ainsi que le texte qui le remplacera. Les caractÃšres joker sont permis  (ex: *fleur* vÃ©rifiera Â«&#160;fleurette&#160;Â» et Â«&#160;gonfleur&#160;Â» ). Les mots censurÃ©s affectent Ã©galement les noms d'utilisateurs. Un nouvel utilisateur ne pourrait s'inscrire avec un nom d'utilisateur qui contiendrait un des mots censurÃ©s. La recherche est insensible Ã  la casse. <strong>Les mots censurÃ©s doivent Ãªtres activÃ©s Ã  la page <a href="admin_options.php#censoring">Options</a> pour qu'ils aient un quelconque effet.</strong></p>
+							<table  cellspacing="0">
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_censoring['Censored word label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_censoring['Replacement label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_censoring['Action label'] ?></th>
+									<th class="tcl" scope="col">Mot Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Action</th>
 								</tr>
 							</thead>
 							<tbody>
 								<tr>
-									<td class="tcl"><input type="text" name="new_search_for" size="24" maxlength="60" tabindex="1" /></td>
-									<td class="tc2"><input type="text" name="new_replace_with" size="24" maxlength="60" tabindex="2" /></td>
-									<td><input type="submit" name="add_word" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="3" /></td>
+									<td><input type="text" name="new_search_for" size="24" maxlength="60" tabindex="1" /></td>
+									<td><input type="text" name="new_replace_with" size="24" maxlength="60" tabindex="2" /></td>
+									<td><input type="submit" name="add_word" value=" Add " tabindex="3" /></td>
 								</tr>
 							</tbody>
@@ -123,9 +122,9 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_censoring['Edit remove subhead'] ?></legend>
+						<legend>Modifier/supprimer des mots Ã  censurer</legend>
 						<div class="infldset">
 <?php
 
-$result = $db->query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Unable to fetch censor word list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Impossible de retrouver la liste des mots Ã  censurer', __FILE__, __LINE__, $db->error());
 if ($db->num_rows($result))
 {
@@ -135,7 +134,7 @@
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_censoring['Censored word label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_censoring['Replacement label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_censoring['Action label'] ?></th>
+									<th class="tcl" scope="col">Mots Ã  censurer</th>
+									<th class="tc2" scope="col">Texte de remplacement</th>
+									<th class="hidehead" scope="col">Actions</th>
 								</tr>
 							</thead>
@@ -144,5 +143,5 @@
 
 	while ($cur_word = $db->fetch_assoc($result))
-		echo "\t\t\t\t\t\t\t\t".'<tr><td class="tcl"><input type="text" name="search_for['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['search_for']).'" size="24" maxlength="60" /></td><td class="tc2"><input type="text" name="replace_with['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['replace_with']).'" size="24" maxlength="60" /></td><td><input type="submit" name="update['.$cur_word['id'].']" value="'.$lang_admin_common['Update'].'" />&#160;<input type="submit" name="remove['.$cur_word['id'].']" value="'.$lang_admin_common['Remove'].'" /></td></tr>'."\n";
+		echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="search_for['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['search_for']).'" size="24" maxlength="60" /></td><td><input type="text" name="replace_with['.$cur_word['id'].']" value="'.pun_htmlspecialchars($cur_word['replace_with']).'" size="24" maxlength="60" /></td><td><input type="submit" name="update['.$cur_word['id'].']" value=" Modifier " />&#160;<input type="submit" name="remove['.$cur_word['id'].']" value=" Supprimer " /></td></tr>'."\n";
 
 ?>
@@ -153,5 +152,5 @@
 }
 else
-	echo "\t\t\t\t\t\t\t".'<p>'.$lang_admin_censoring['No words in list'].'</p>'."\n";
+	echo "\t\t\t\t\t\t\t".'<p>Aucun mot Ã  censurer dans la liste.</p>'."\n";
 
 ?>
Index: /trunk/web/punbb/admin_forums.php
===================================================================
--- /trunk/web/punbb/admin_forums.php	(revision 10)
+++ /trunk/web/punbb/admin_forums.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_forums.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_forums.php';
 
 // Add a "default" forum
@@ -30,14 +45,13 @@
 		message($lang_common['Bad request']);
 
-	$db->query('INSERT INTO '.$db->prefix.'forums (forum_name, cat_id) VALUES(\''.$db->escape($lang_admin_forums['New forum']).'\', '.$add_to_cat.')') or error('Unable to create forum', __FILE__, __LINE__, $db->error());
-
-	// Regenerate the quick jump cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	$db->query('INSERT INTO '.$db->prefix.'forums (cat_id) VALUES('.$add_to_cat.')') or error('Impossible de crÃ©er un nouveau forum', __FILE__, __LINE__, $db->error());
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
 	generate_quickjump_cache();
 
-	redirect('admin_forums.php', $lang_admin_forums['Forum added redirect']);
+	redirect('admin_forums.php', 'Forum ajoutÃ©. Redirection ...');
 }
+
 
 // Delete a forum
@@ -50,5 +64,5 @@
 		message($lang_common['Bad request']);
 
-	if (isset($_POST['del_forum_comply'])) // Delete a forum with all posts
+	if (isset($_POST['del_forum_comply']))	// Delete a forum with all posts
 	{
 		@set_time_limit(0);
@@ -58,5 +72,5 @@
 
 		// Locate any "orphaned redirect topics" and delete them
-		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Unable to fetch redirect topics', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Impossible de retrouver les sujets de redirection', __FILE__, __LINE__, $db->error());
 		$num_orphans = $db->num_rows($result);
 
@@ -66,29 +80,24 @@
 				$orphans[] = $db->result($result, $i);
 
-			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Impossible de supprimer les sujets de redirection', __FILE__, __LINE__, $db->error());
 		}
 
 		// Delete the forum and any forum specific group permissions
-		$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to delete forum', __FILE__, __LINE__, $db->error());
-		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Unable to delete group forum permissions', __FILE__, __LINE__, $db->error());
-
-		// Delete any subscriptions for this forum
-		$db->query('DELETE FROM '.$db->prefix.'forum_subscriptions WHERE forum_id='.$forum_id) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
-
-		// Regenerate the quick jump cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
+		$db->query('DELETE FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de supprimer un forum', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupe du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
 		generate_quickjump_cache();
 
-		redirect('admin_forums.php', $lang_admin_forums['Forum deleted redirect']);
-	}
-	else // If the user hasn't confirmed the delete
-	{
-		$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+		redirect('admin_forums.php', 'Forum supprimÃ©. Redirection ...');
+	}
+	else	// If the user hasn't confirmed the delete
+	{
+		$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
 		$forum_name = pun_htmlspecialchars($db->result($result));
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Forums']);
-		define('PUN_ACTIVE_PAGE', 'admin');
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
 		require PUN_ROOT.'header.php';
 
@@ -97,17 +106,17 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_forums['Confirm delete head'] ?></span></h2>
+		<h2><span>Confirmez la suppresion du forum</span></h2>
 		<div class="box">
 			<form method="post" action="admin_forums.php?del_forum=<?php echo $forum_id ?>">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_forums['Confirm delete subhead'] ?></legend>
+						<legend>Important ! Lire attentivement avant de procÃ©der Ã  la suppression.</legend>
 						<div class="infldset">
-							<p><?php printf($lang_admin_forums['Confirm delete info'], $forum_name) ?></p>
-							<p class="warntext"><?php echo $lang_admin_forums['Confirm delete warn'] ?></p>
+							<p>Ãtes vous sÃ»r de vouloir supprimer le forum "<?php echo $forum_name ?>"&#160;?</p>
+							<p>ATTENTION ! Supprimer un forum effacera tous les messages (s'il y en a) prÃ©sent dans ce forum&#160;!</p>
 						</div>
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="del_forum_comply" value="<?php echo $lang_admin_common['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_admin_common['Go back'] ?></a></p>
+				<p><input type="submit" name="del_forum_comply" value=" Supprimer " /><a href="javascript:history.go(-1)">Retour</a></p>
 			</form>
 		</div>
@@ -121,4 +130,5 @@
 }
 
+
 // Update forum positions
 else if (isset($_POST['update_positions']))
@@ -126,21 +136,19 @@
 	confirm_referrer('admin_forums.php');
 
-	foreach ($_POST['position'] as $forum_id => $disp_position)
-	{
-		$disp_position = trim($disp_position);
-		if ($disp_position == '' || preg_match('%[^0-9]%', $disp_position))
-			message($lang_admin_forums['Must be integer message']);
-
-		$db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.intval($forum_id)) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
-	}
-
-	// Regenerate the quick jump cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	while (list($forum_id, $disp_position) = @each($_POST['position']))
+	{
+		if (!preg_match('#^\d+$#', $disp_position))
+			message('La position doit Ãªtre un nombre entier.');
+
+		$db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour les forums', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
 	generate_quickjump_cache();
 
-	redirect('admin_forums.php', $lang_admin_forums['Forums updated redirect']);
+	redirect('admin_forums.php', 'Forums modifiÃ©s. Redirection ...');
 }
+
 
 else if (isset($_GET['edit_forum']))
@@ -156,6 +164,6 @@
 
 		// Start with the forum details
-		$forum_name = pun_trim($_POST['forum_name']);
-		$forum_desc = pun_linebreaks(pun_trim($_POST['forum_desc']));
+		$forum_name = trim($_POST['forum_name']);
+		$forum_desc = pun_linebreaks(trim($_POST['forum_desc']));
 		$cat_id = intval($_POST['cat_id']);
 		$sort_by = intval($_POST['sort_by']);
@@ -163,5 +171,5 @@
 
 		if ($forum_name == '')
-			message($lang_admin_forums['Must enter name message']);
+			message('Vous devez saisir un nom de forum.');
 
 		if ($cat_id < 1)
@@ -171,15 +179,15 @@
 		$redirect_url = ($redirect_url != '') ? '\''.$db->escape($redirect_url).'\'' : 'NULL';
 
-		$db->query('UPDATE '.$db->prefix.'forums SET forum_name=\''.$db->escape($forum_name).'\', forum_desc='.$forum_desc.', redirect_url='.$redirect_url.', sort_by='.$sort_by.', cat_id='.$cat_id.' WHERE id='.$forum_id) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'forums SET forum_name=\''.$db->escape($forum_name).'\', forum_desc='.$forum_desc.', redirect_url='.$redirect_url.', sort_by='.$sort_by.', cat_id='.$cat_id.' WHERE id='.$forum_id) or error('Impossible de modifier le forum', __FILE__, __LINE__, $db->error());
 
 		// Now let's deal with the permissions
 		if (isset($_POST['read_forum_old']))
 		{
-			$result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Impossible de retrouver la liste des groupes d\'utilisateurs', __FILE__, __LINE__, $db->error());
 			while ($cur_group = $db->fetch_assoc($result))
 			{
-				$read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? '1' : '0' : intval($_POST['read_forum_old'][$cur_group['g_id']]);
-				$post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? '1' : '0';
-				$post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? '1' : '0';
+				$read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']];
+				$post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0';
+				$post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0';
 
 				// Check if the new settings differ from the old
@@ -188,11 +196,11 @@
 					// If the new settings are identical to the default settings for this group, delete it's row in forum_perms
 					if ($read_forum_new == '1' && $post_replies_new == $cur_group['g_post_replies'] && $post_topics_new == $cur_group['g_post_topics'])
-						$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Unable to delete group forum permissions', __FILE__, __LINE__, $db->error());
+						$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
 					else
 					{
 						// Run an UPDATE and see if it affected a row, if not, INSERT
-						$db->query('UPDATE '.$db->prefix.'forum_perms SET read_forum='.$read_forum_new.', post_replies='.$post_replies_new.', post_topics='.$post_topics_new.' WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error());
+						$db->query('UPDATE '.$db->prefix.'forum_perms SET read_forum='.$read_forum_new.', post_replies='.$post_replies_new.', post_topics='.$post_topics_new.' WHERE group_id='.$cur_group['g_id'].' AND forum_id='.$forum_id) or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
 						if (!$db->affected_rows())
-							$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$cur_group['g_id'].', '.$forum_id.', '.$read_forum_new.', '.$post_replies_new.', '.$post_topics_new.')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error());
+							$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$cur_group['g_id'].', '.$forum_id.', '.$read_forum_new.', '.$post_replies_new.', '.$post_topics_new.')') or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
 					}
 				}
@@ -200,11 +208,9 @@
 		}
 
-		// Regenerate the quick jump cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
 		generate_quickjump_cache();
 
-		redirect('admin_forums.php', $lang_admin_forums['Forum updated redirect']);
+		redirect('admin_forums.php', 'Forum modifiÃ©. Redirection ...');
 	}
 	else if (isset($_POST['revert_perms']))
@@ -212,17 +218,16 @@
 		confirm_referrer('admin_forums.php');
 
-		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Unable to delete group forum permissions', __FILE__, __LINE__, $db->error());
-
-		// Regenerate the quick jump cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE forum_id='.$forum_id) or error('Impossible de supprimer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
 		generate_quickjump_cache();
 
-		redirect('admin_forums.php?edit_forum='.$forum_id, $lang_admin_forums['Perms reverted redirect']);
-	}
+		redirect('admin_forums.php?edit_forum='.$forum_id, 'Permissions remises Ã  leurs valeurs par dÃ©faut. Redirection ...');
+	}
+
 
 	// Fetch forum info
-	$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
 		message($lang_common['Bad request']);
@@ -230,6 +235,6 @@
 	$cur_forum = $db->fetch_assoc($result);
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Forums']);
-	define('PUN_ACTIVE_PAGE', 'admin');
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
 	require PUN_ROOT.'header.php';
 
@@ -238,28 +243,28 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_forums['Edit forum head'] ?></span></h2>
+		<h2><span>Modifier forum</span></h2>
 		<div class="box">
 			<form id="edit_forum" method="post" action="admin_forums.php?edit_forum=<?php echo $forum_id ?>">
-				<p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" tabindex="6" /></p>
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer modifications " tabindex="6" /></p>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_forums['Edit details subhead'] ?></legend>
+						<legend>Modifier les dÃ©tails du forum</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Forum name label'] ?></th>
+									<th scope="row">Nom du forum</th>
 									<td><input type="text" name="forum_name" size="35" maxlength="80" value="<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?>" tabindex="1" /></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Forum description label'] ?></th>
+									<th scope="row">Description (<acronym title="HyperText Markup Language" lang="en">HTML</acronym>)</th>
 									<td><textarea name="forum_desc" rows="3" cols="50" tabindex="2"><?php echo pun_htmlspecialchars($cur_forum['forum_desc']) ?></textarea></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Category label'] ?></th>
+									<th scope="row">CatÃ©gorie</th>
 									<td>
 										<select name="cat_id" tabindex="3">
 <?php
 
-	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
 	while ($cur_cat = $db->fetch_assoc($result))
 	{
@@ -273,16 +278,15 @@
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Sort by label'] ?></th>
+									<th scope="row">Trier les discussions par</th>
 									<td>
 										<select name="sort_by" tabindex="4">
-											<option value="0"<?php if ($cur_forum['sort_by'] == '0') echo ' selected="selected"' ?>><?php echo $lang_admin_forums['Last post'] ?></option>
-											<option value="1"<?php if ($cur_forum['sort_by'] == '1') echo ' selected="selected"' ?>><?php echo $lang_admin_forums['Topic start'] ?></option>
-											<option value="2"<?php if ($cur_forum['sort_by'] == '2') echo ' selected="selected"' ?>><?php echo $lang_admin_forums['Subject'] ?></option>
+											<option value="0"<?php if ($cur_forum['sort_by'] == '0') echo ' selected="selected"' ?>>Derniers messages</option>
+											<option value="1"<?php if ($cur_forum['sort_by'] == '1') echo ' selected="selected"' ?>>Dates des discussions</option>
 										</select>
 									</td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Redirect label'] ?></th>
-									<td><?php echo ($cur_forum['num_topics']) ? $lang_admin_forums['Redirect help'] : '<input type="text" name="redirect_url" size="45" maxlength="100" value="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" tabindex="5" />'; ?></td>
+									<th scope="row"><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de redirection</th>
+									<td><?php echo ($cur_forum['num_topics']) ? 'Disponible uniquement pour les forums vides' : '<input type="text" name="redirect_url" size="45" maxlength="100" value="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" tabindex="5" />'; ?></td>
 								</tr>
 							</table>
@@ -292,14 +296,14 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_forums['Group permissions subhead'] ?></legend>
+						<legend>Modifier les permissions de groupes de ce forum</legend>
 						<div class="infldset">
-							<p><?php printf($lang_admin_forums['Group permissions info'], '<a href="admin_groups.php">'.$lang_admin_common['User groups'].'</a>') ?></p>
+							<p>Avec ce formulaire vous pouvez rÃ©gler les permissions de ce forum spÃ©cifiques aux diffÃ©rents groupes d'utilisateurs. Si vous n'avez effectuÃ© aucune modification Ã  ces permissions de groupes, ce que vous voyez ci-dessous sont les permissions par dÃ©faut basÃ©es sur les paramÃštres des <a href="admin_groups.php">Groupes d'utilisateurs</a>. Les administrateurs ont toujours toutes les permissions et sont donc Ã©cartÃ©s. Les paramÃštres de permission qui diffÃšrent des permissions par dÃ©faut pour le groupe d'utilisateur sont signalÃ©s en rouge. La permission Â«&#160;Lire&#160;Â» pourra Ãªtre dÃ©sactivÃ©e si le groupe en question ne possÃšde pas la permission globale Â«&#160;Lire forums&#160;Â». Pour les forums de redirection seule la permission Â«&#160;Lire&#160;Â» est modifiable.</p>
 							<table id="forumperms" cellspacing="0">
 							<thead>
 								<tr>
 									<th class="atcl">&#160;</th>
-									<th><?php echo $lang_admin_forums['Read forum label'] ?></th>
-									<th><?php echo $lang_admin_forums['Post replies label'] ?></th>
-									<th><?php echo $lang_admin_forums['Post topics label'] ?></th>
+									<th>Lire le forum</th>
+									<th>Ãcrire des rÃ©ponses</th>
+									<th>Lancer des discussions</th>
 								</tr>
 							</thead>
@@ -307,7 +311,5 @@
 <?php
 
-	$result = $db->query('SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM '.$db->prefix.'groups AS g LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (g.g_id=fp.group_id AND fp.forum_id='.$forum_id.') WHERE g.g_id!='.PUN_ADMIN.' ORDER BY g.g_id') or error('Unable to fetch group forum permission list', __FILE__, __LINE__, $db->error());
-
-	$cur_index = 7;
+	$result = $db->query('SELECT g.g_id, g.g_title, g.g_read_board, g.g_post_replies, g.g_post_topics, fp.read_forum, fp.post_replies, fp.post_topics FROM '.$db->prefix.'groups AS g LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (g.g_id=fp.group_id AND fp.forum_id='.$forum_id.') WHERE g.g_id!='.PUN_ADMIN.' ORDER BY g.g_id') or error('Impossible de retrouver la liste des permissions de groupe du forum', __FILE__, __LINE__, $db->error());
 
 	while ($cur_perm = $db->fetch_assoc($result))
@@ -317,5 +319,5 @@
 		$post_topics = (($cur_perm['g_post_topics'] == '0' && $cur_perm['post_topics'] == '1') || ($cur_perm['g_post_topics'] == '1' && $cur_perm['post_topics'] != '0')) ? true : false;
 
-		// Determine if the current settings differ from the default or not
+		// Determine if the current sittings differ from the default or not
 		$read_forum_def = ($cur_perm['read_forum'] == '0') ? false : true;
 		$post_replies_def = (($post_replies && $cur_perm['g_post_replies'] == '0') || (!$post_replies && ($cur_perm['g_post_replies'] == '' || $cur_perm['g_post_replies'] == '1'))) ? false : true;
@@ -327,13 +329,13 @@
 									<td<?php if (!$read_forum_def) echo ' class="nodefault"'; ?>>
 										<input type="hidden" name="read_forum_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($read_forum) ? '1' : '0'; ?>" />
-										<input type="checkbox" name="read_forum_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($read_forum) ? ' checked="checked"' : ''; ?><?php echo ($cur_perm['g_read_board'] == '0') ? ' disabled="disabled"' : ''; ?> tabindex="<?php echo $cur_index++ ?>" />
+										<input type="checkbox" name="read_forum_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($read_forum) ? ' checked="checked"' : ''; ?><?php echo ($cur_perm['g_read_board'] == '0') ? ' disabled="disabled"' : ''; ?> />
 									</td>
 									<td<?php if (!$post_replies_def && $cur_forum['redirect_url'] == '') echo ' class="nodefault"'; ?>>
 										<input type="hidden" name="post_replies_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($post_replies) ? '1' : '0'; ?>" />
-										<input type="checkbox" name="post_replies_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_replies) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> tabindex="<?php echo $cur_index++ ?>" />
+										<input type="checkbox" name="post_replies_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_replies) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> />
 									</td>
 									<td<?php if (!$post_topics_def && $cur_forum['redirect_url'] == '') echo ' class="nodefault"'; ?>>
 										<input type="hidden" name="post_topics_old[<?php echo $cur_perm['g_id'] ?>]" value="<?php echo ($post_topics) ? '1' : '0'; ?>" />
-										<input type="checkbox" name="post_topics_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_topics) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> tabindex="<?php echo $cur_index++ ?>" />
+										<input type="checkbox" name="post_topics_new[<?php echo $cur_perm['g_id'] ?>]" value="1"<?php echo ($post_topics) ? ' checked="checked"' : ''; ?><?php echo ($cur_forum['redirect_url'] != '') ? ' disabled="disabled"' : ''; ?> />
 									</td>
 								</tr>
@@ -345,9 +347,9 @@
 							</tbody>
 							</table>
-							<div class="fsetsubmit"><input type="submit" name="revert_perms" value="<?php echo $lang_admin_forums['Revert to default'] ?>" tabindex="<?php echo $cur_index++ ?>" /></div>
+							<div class="fsetsubmit"><input type="submit" name="revert_perms" value=" RÃ©tablir les permissions par dÃ©faut " /></div>
 						</div>
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" tabindex="<?php echo $cur_index++ ?>" /></p>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer modifications " /></p>
 			</form>
 		</div>
@@ -361,6 +363,6 @@
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Forums']);
-define('PUN_ACTIVE_PAGE', 'admin');
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Forums';
 require PUN_ROOT.'header.php';
 
@@ -369,30 +371,25 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_forums['Add forum head'] ?></span></h2>
+		<h2><span>Ajouter forum</span></h2>
 		<div class="box">
 			<form method="post" action="admin_forums.php?action=adddel">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_forums['Create new subhead'] ?></legend>
+						<legend>CrÃ©er un forum</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_forums['Add forum label'] ?><div><input type="submit" name="add_forum" value="<?php echo $lang_admin_forums['Add forum'] ?>" tabindex="2" /></div></th>
+									<th scope="row">Ajouter un forum Ã  la catÃ©gorie<div><input type="submit" name="add_forum" value=" Ajouter " tabindex="2" /></div></th>
 									<td>
 										<select name="add_to_cat" tabindex="1">
 <?php
 
-	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result) > 0)
-	{
-		while ($cur_cat = $db->fetch_assoc($result))
-			echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n";
-	}
-	else
-		echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="0" disabled="disabled">'.$lang_admin_forums['No categories exist'].'</option>'."\n";
+	$result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Impossible de retrouver la liste des catÃ©gories', __FILE__, __LINE__, $db->error());
+	while ($cur_cat = $db->fetch_assoc($result))
+		echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n";
 
 ?>
 										</select>
-										<span><?php echo $lang_admin_forums['Add forum help'] ?></span>
+										<span>Choisissez la catÃ©gorie dans laquelle vous souhaitez ajouter un nouveau forum.</span>
 									</td>
 								</tr>
@@ -403,43 +400,31 @@
 			</form>
 		</div>
-<?php
-
-// Display all the categories and forums
-$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-
-if ($db->num_rows($result) > 0)
-{
-
-?>
-		<h2 class="block2"><span><?php echo $lang_admin_forums['Edit forums head'] ?></span></h2>
+
+		<h2 class="block2"><span>Modifier les forums</span></h2>
 		<div class="box">
 			<form id="edforum" method="post" action="admin_forums.php?action=edit">
-				<p class="submittop"><input type="submit" name="update_positions" value="<?php echo $lang_admin_forums['Update positions'] ?>" tabindex="3" /></p>
-<?php
-
-$cur_index = 4;
-
+				<p class="submittop"><input type="submit" name="update_positions" value=" Modifier positions " tabindex="3" /></p>
+<?php
+
+$tabindex_count = 4;
+
+// Display all the categories and forums
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+if($db->num_rows($result)) :
 $cur_category = 0;
 while ($cur_forum = $db->fetch_assoc($result))
 {
-	if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 	{
 		if ($cur_category != 0)
-			echo "\t\t\t\t\t\t\t".'</tbody>'."\n\t\t\t\t\t\t\t".'</table>'."\n\t\t\t\t\t\t".'</div>'."\n\t\t\t\t\t".'</fieldset>'."\n\t\t\t\t".'</div>'."\n";
+			echo "\t\t\t\t\t\t\t".'</table>'."\n\t\t\t\t\t\t".'</div>'."\n\t\t\t\t\t".'</fieldset>'."\n\t\t\t\t".'</div>'."\n";
 
 ?>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_forums['Category subhead'] ?> <?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></legend>
+						<legend>CatÃ©gorie&#160;: <?php echo pun_htmlspecialchars($cur_forum['cat_name']) ?></legend>
 						<div class="infldset">
 							<table cellspacing="0">
-							<thead>
-								<tr>
-									<th class="tcl"><?php echo $lang_admin_common['Action'] ?></th>
-									<th class="tc2"><?php echo $lang_admin_forums['Position label'] ?></th>
-									<th class="tcr"><?php echo $lang_admin_forums['Forum label'] ?></th>
-								</tr>
-							</thead>
-							<tbody>
 <?php
 
@@ -449,26 +434,22 @@
 ?>
 								<tr>
-									<td class="tcl"><a href="admin_forums.php?edit_forum=<?php echo $cur_forum['fid'] ?>" tabindex="<?php echo $cur_index++ ?>"><?php echo $lang_admin_forums['Edit link'] ?></a> | <a href="admin_forums.php?del_forum=<?php echo $cur_forum['fid'] ?>" tabindex="<?php echo $cur_index++ ?>"><?php echo $lang_admin_forums['Delete link'] ?></a></td>
-									<td class="tc2"><input type="text" name="position[<?php echo $cur_forum['fid'] ?>]" size="3" maxlength="3" value="<?php echo $cur_forum['disp_position'] ?>" tabindex="<?php echo $cur_index++ ?>" /></td>
-									<td class="tcr"><strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>
-								</tr>
-<?php
-
+									<th><a href="admin_forums.php?edit_forum=<?php echo $cur_forum['fid'] ?>">Modifier</a> - <a href="admin_forums.php?del_forum=<?php echo $cur_forum['fid'] ?>">Supprimer</a></th>
+									<td>Position&#160;&#160;<input type="text" name="position[<?php echo $cur_forum['fid'] ?>]" size="3" maxlength="3" value="<?php echo $cur_forum['disp_position'] ?>" tabindex="<?php echo $tabindex_count ?>" />
+									&#160;&#160;<strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>
+								</tr>
+<?php
+
+	$tabindex_count += 2;
 }
 
 ?>
-							</tbody>
 							</table>
 						</div>
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="update_positions" value="<?php echo $lang_admin_forums['Update positions'] ?>" tabindex="<?php echo $cur_index++ ?>" /></p>
+<?php endif; ?>
+				<p class="submitend"><input type="submit" name="update_positions" value=" Modifier positions " tabindex="<?php echo $tabindex_count ?>" /></p>
 			</form>
 		</div>
-<?php
-
-}
-
-?>
 	</div>
 	<div class="clearer"></div>
Index: /trunk/web/punbb/admin_groups.php
===================================================================
--- /trunk/web/punbb/admin_groups.php	(revision 10)
+++ /trunk/web/punbb/admin_groups.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_censoring.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_groups.php';
 
 // Add/edit a group (stage 1)
@@ -28,10 +43,10 @@
 		$base_group = intval($_POST['base_group']);
 
-		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$base_group) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$base_group) or error('Impossible de retrouver les informations de groupes utilisateurs', __FILE__, __LINE__, $db->error());
 		$group = $db->fetch_assoc($result);
 
 		$mode = 'add';
 	}
-	else // We are editing a group
+	else	// We are editing a group
 	{
 		$group_id = intval($_GET['edit_group']);
@@ -39,5 +54,5 @@
 			message($lang_common['Bad request']);
 
-		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Impossible de retrouver les informations de groupes utilisateurs', __FILE__, __LINE__, $db->error());
 		if (!$db->num_rows($result))
 			message($lang_common['Bad request']);
@@ -49,8 +64,7 @@
 
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['User groups']);
-	$required_fields = array('req_title' => $lang_admin_groups['Group title label']);
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+	$required_fields = array('req_title' => 'Nom groupe');
 	$focus_element = array('groups2', 'req_title');
-	define('PUN_ACTIVE_PAGE', 'admin');
 	require PUN_ROOT.'header.php';
 
@@ -59,19 +73,19 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_groups['Group settings head'] ?></span></h2>
+		<h2><span>RÃ©glages du groupe</span></h2>
 		<div class="box">
 			<form id="groups2" method="post" action="admin_groups.php" onsubmit="return process_form(this)">
-				<p class="submittop"><input type="submit" name="add_edit_group" value="<?php echo $lang_admin_common['Save'] ?>" /></p>
+				<p class="submittop"><input type="submit" name="add_edit_group" value=" Enregistrer " /></p>
 				<div class="inform">
 					<input type="hidden" name="mode" value="<?php echo $mode ?>" />
-<?php if ($mode == 'edit'): ?>					<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
-<?php endif; ?><?php if ($mode == 'add'): ?>					<input type="hidden" name="base_group" value="<?php echo $base_group ?>" />
+<?php if ($mode == 'edit'): ?>				<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
+<?php endif; ?><?php if ($mode == 'add'): ?>				<input type="hidden" name="base_group" value="<?php echo $base_group ?>" />
 <?php endif; ?>					<fieldset>
-						<legend><?php echo $lang_admin_groups['Group settings subhead'] ?></legend>
+						<legend>RÃ©glages des options et des permissions de groupe</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_groups['Group settings info'] ?></p>
+							<p>Les options et permissions ci-dessous sont les permissions par dÃ©faut pour le groupe. Ces options s'appliquent s'il n'y a pas de rÃ©glages de permissions spÃ©cifiques Ã  un forum.</p>
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Group title label'] ?></th>
+									<th scope="row">Nom groupe</th>
 									<td>
 										<input type="text" name="req_title" size="25" maxlength="50" value="<?php if ($mode == 'edit') echo pun_htmlspecialchars($group['g_title']); ?>" tabindex="1" />
@@ -79,156 +93,101 @@
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['User title label'] ?></th>
+									<th scope="row">Titre utilisateur</th>
 									<td>
 										<input type="text" name="user_title" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($group['g_user_title']) ?>" tabindex="2" />
-										<span><?php echo $lang_admin_groups['User title help'] ?></span>
-									</td>
-								</tr>
-<?php if ($group['g_id'] != PUN_ADMIN): if ($group['g_id'] != PUN_GUEST): if ($mode != 'edit' || $pun_config['o_default_user_group'] != $group['g_id']): ?>								<tr>
-									<th scope="row"> <?php echo $lang_admin_groups['Mod privileges label'] ?></th>
-									<td>
-										<input type="radio" name="moderator" value="1"<?php if ($group['g_moderator'] == '1') echo ' checked="checked"' ?> tabindex="3" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="moderator" value="0"<?php if ($group['g_moderator'] == '0') echo ' checked="checked"' ?> tabindex="4" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Mod privileges help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Edit profile label'] ?></th>
-									<td>
-										<input type="radio" name="mod_edit_users" value="1"<?php if ($group['g_mod_edit_users'] == '1') echo ' checked="checked"' ?> tabindex="5" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="mod_edit_users" value="0"<?php if ($group['g_mod_edit_users'] == '0') echo ' checked="checked"' ?> tabindex="6" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Edit profile help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Rename users label'] ?></th>
-									<td>
-										<input type="radio" name="mod_rename_users" value="1"<?php if ($group['g_mod_rename_users'] == '1') echo ' checked="checked"' ?> tabindex="7" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="mod_rename_users" value="0"<?php if ($group['g_mod_rename_users'] == '0') echo ' checked="checked"' ?> tabindex="8" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Rename users help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Change passwords label'] ?></th>
-									<td>
-										<input type="radio" name="mod_change_passwords" value="1"<?php if ($group['g_mod_change_passwords'] == '1') echo ' checked="checked"' ?> tabindex="9" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="mod_change_passwords" value="0"<?php if ($group['g_mod_change_passwords'] == '0') echo ' checked="checked"' ?> tabindex="10" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Change passwords help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Ban users label'] ?></th>
-									<td>
-										<input type="radio" name="mod_ban_users" value="1"<?php if ($group['g_mod_ban_users'] == '1') echo ' checked="checked"' ?> tabindex="11" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="mod_ban_users" value="0"<?php if ($group['g_mod_ban_users'] == '0') echo ' checked="checked"' ?> tabindex="12" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Ban users help'] ?></span>
-									</td>
-								</tr>
-<?php endif; endif; ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Read board label'] ?></th>
-									<td>
-										<input type="radio" name="read_board" value="1"<?php if ($group['g_read_board'] == '1') echo ' checked="checked"' ?> tabindex="13" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="read_board" value="0"<?php if ($group['g_read_board'] == '0') echo ' checked="checked"' ?> tabindex="14" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Read board help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['View user info label'] ?></th>
-									<td>
-										<input type="radio" name="view_users" value="1"<?php if ($group['g_view_users'] == '1') echo ' checked="checked"' ?> tabindex="15" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="view_users" value="0"<?php if ($group['g_view_users'] == '0') echo ' checked="checked"' ?> tabindex="16" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['View user info help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Post replies label'] ?></th>
-									<td>
-										<input type="radio" name="post_replies" value="1"<?php if ($group['g_post_replies'] == '1') echo ' checked="checked"' ?> tabindex="17" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="post_replies" value="0"<?php if ($group['g_post_replies'] == '0') echo ' checked="checked"' ?> tabindex="18" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Post replies help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Post topics label'] ?></th>
-									<td>
-										<input type="radio" name="post_topics" value="1"<?php if ($group['g_post_topics'] == '1') echo ' checked="checked"' ?> tabindex="19" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="post_topics" value="0"<?php if ($group['g_post_topics'] == '0') echo ' checked="checked"' ?> tabindex="20" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Post topics help'] ?></span>
+										<span>Ce titre remplacera n'importe quel nom de rang que les utilisateurs de ce groupe auront atteint. Laissez vide pour utiliser le titre par dÃ©faut ou le rang.</span>
+									</td>
+								</tr>
+<?php if ($group['g_id'] != PUN_ADMIN): ?>								<tr>
+									<th scope="row">Lire forums</th>
+									<td>
+										<input type="radio" name="read_board" value="1"<?php if ($group['g_read_board'] == '1') echo ' checked="checked"' ?> tabindex="3" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="read_board" value="0"<?php if ($group['g_read_board'] == '0') echo ' checked="checked"' ?> tabindex="4" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  voir les forums. Ce rÃ©glage s'applique Ã  tous les aspects des forums et ne peut Ãªtre outrepassÃ© par les permissions spÃ©cifiques aux forums. Avec cette option Ã  non les utilisateurs de ce groupe ne pourront que s'identifier/se dÃ©connecter.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Ãcrire des rÃ©ponses</th>
+									<td>
+										<input type="radio" name="post_replies" value="1"<?php if ($group['g_post_replies'] == '1') echo ' checked="checked"' ?> tabindex="5" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="post_replies" value="0"<?php if ($group['g_post_replies'] == '0') echo ' checked="checked"' ?> tabindex="6" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  Ã©crire des rÃ©ponses aux discussions.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Lancer des discussions</th>
+									<td>
+										<input type="radio" name="post_topics" value="1"<?php if ($group['g_post_topics'] == '1') echo ' checked="checked"' ?> tabindex="7" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="post_topics" value="0"<?php if ($group['g_post_topics'] == '0') echo ' checked="checked"' ?> tabindex="8" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  lancer des nouveaux sujets.</span>
 									</td>
 								</tr>
 <?php if ($group['g_id'] != PUN_GUEST): ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Edit posts label'] ?></th>
-									<td>
-										<input type="radio" name="edit_posts" value="1"<?php if ($group['g_edit_posts'] == '1') echo ' checked="checked"' ?> tabindex="21" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="edit_posts" value="0"<?php if ($group['g_edit_posts'] == '0') echo ' checked="checked"' ?> tabindex="22" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Edit posts help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Delete posts label'] ?></th>
-									<td>
-										<input type="radio" name="delete_posts" value="1"<?php if ($group['g_delete_posts'] == '1') echo ' checked="checked"' ?> tabindex="23" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="delete_posts" value="0"<?php if ($group['g_delete_posts'] == '0') echo ' checked="checked"' ?> tabindex="24" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Delete posts help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Delete topics label'] ?></th>
-									<td>
-										<input type="radio" name="delete_topics" value="1"<?php if ($group['g_delete_topics'] == '1') echo ' checked="checked"' ?> tabindex="25" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="delete_topics" value="0"<?php if ($group['g_delete_topics'] == '0') echo ' checked="checked"' ?> tabindex="26" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Delete topics help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Set own title label'] ?></th>
-									<td>
-										<input type="radio" name="set_title" value="1"<?php if ($group['g_set_title'] == '1') echo ' checked="checked"' ?> tabindex="27" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="set_title" value="0"<?php if ($group['g_set_title'] == '0') echo ' checked="checked"' ?> tabindex="28" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Set own title help'] ?></span>
+									<th scope="row">Modifier messages</th>
+									<td>
+										<input type="radio" name="edit_posts" value="1"<?php if ($group['g_edit_posts'] == '1') echo ' checked="checked"' ?> tabindex="11" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="edit_posts" value="0"<?php if ($group['g_edit_posts'] == '0') echo ' checked="checked"' ?> tabindex="12" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  modifier leurs propres messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Effacer les messages</th>
+									<td>
+										<input type="radio" name="delete_posts" value="1"<?php if ($group['g_delete_posts'] == '1') echo ' checked="checked"' ?> tabindex="13" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="delete_posts" value="0"<?php if ($group['g_delete_posts'] == '0') echo ' checked="checked"' ?> tabindex="14" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  effacer leurs propres messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Effacer les discussions</th>
+									<td>
+										<input type="radio" name="delete_topics" value="1"<?php if ($group['g_delete_topics'] == '1') echo ' checked="checked"' ?> tabindex="15" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="delete_topics" value="0"<?php if ($group['g_delete_topics'] == '0') echo ' checked="checked"' ?> tabindex="16" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  effacer leurs propres sujets (y compris toutes les rÃ©ponses).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Titre personnalisÃ©</th>
+									<td>
+										<input type="radio" name="set_title" value="1"<?php if ($group['g_set_title'] == '1') echo ' checked="checked"' ?> tabindex="17" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="set_title" value="0"<?php if ($group['g_set_title'] == '0') echo ' checked="checked"' ?> tabindex="18" />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  modifier leur propre titre utilisateur.</span>
 									</td>
 								</tr>
 <?php endif; ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['User search label'] ?></th>
-									<td>
-										<input type="radio" name="search" value="1"<?php if ($group['g_search'] == '1') echo ' checked="checked"' ?> tabindex="29" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="search" value="0"<?php if ($group['g_search'] == '0') echo ' checked="checked"' ?> tabindex="30" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['User search help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['User list search label'] ?></th>
-									<td>
-										<input type="radio" name="search_users" value="1"<?php if ($group['g_search_users'] == '1') echo ' checked="checked"' ?> tabindex="31" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="search_users" value="0"<?php if ($group['g_search_users'] == '0') echo ' checked="checked"' ?> tabindex="32" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['User list search help'] ?></span>
+									<th scope="row">Utiliser la recherche</th>
+									<td>
+										<input type="radio" name="search" value="1"<?php if ($group['g_search'] == '1') echo ' checked="checked"' ?> tabindex="19" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="search" value="0"<?php if ($group['g_search'] == '0') echo ' checked="checked"' ?> tabindex="20" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  utiliser la fonction de recherche sur les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Recherche d'utilisateur</th>
+									<td>
+										<input type="radio" name="search_users" value="1"<?php if ($group['g_search_users'] == '1') echo ' checked="checked"' ?> tabindex="21" />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="search_users" value="0"<?php if ($group['g_search_users'] == '0') echo ' checked="checked"' ?> tabindex="22" />&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs de ce groupe Ã  utiliser	un texte libre pour rechercher dans la liste des utilisateurs.</span>
 									</td>
 								</tr>
 <?php if ($group['g_id'] != PUN_GUEST): ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Send e-mails label'] ?></th>
-									<td>
-										<input type="radio" name="send_email" value="1"<?php if ($group['g_send_email'] == '1') echo ' checked="checked"' ?> tabindex="33" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="send_email" value="0"<?php if ($group['g_send_email'] == '0') echo ' checked="checked"' ?> tabindex="34" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_groups['Send e-mails help'] ?></span>
-									</td>
-								</tr>
-<?php endif; ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Post flood label'] ?></th>
-									<td>
-										<input type="text" name="post_flood" size="5" maxlength="4" value="<?php echo $group['g_post_flood'] ?>" tabindex="35" />
-										<span><?php echo $lang_admin_groups['Post flood help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Search flood label'] ?></th>
-									<td>
-										<input type="text" name="search_flood" size="5" maxlength="4" value="<?php echo $group['g_search_flood'] ?>" tabindex="36" />
-										<span><?php echo $lang_admin_groups['Search flood help'] ?></span>
-									</td>
-								</tr>
-<?php if ($group['g_id'] != PUN_GUEST): ?>								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['E-mail flood label'] ?></th>
-									<td>
-										<input type="text" name="email_flood" size="5" maxlength="4" value="<?php echo $group['g_email_flood'] ?>" tabindex="37" />
-										<span><?php echo $lang_admin_groups['E-mail flood help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Report flood label'] ?></th>
-									<td>
-										<input type="text" name="report_flood" size="5" maxlength="4" value="<?php echo $group['g_report_flood'] ?>" tabindex="38" />
-										<span><?php echo $lang_admin_groups['Report flood help'] ?></span>
-									</td>
-								</tr>
-<?php endif; endif; ?>							</table>
-<?php if ($group['g_moderator'] == '1' ): ?>							<p class="warntext"><?php echo $lang_admin_groups['Moderator info'] ?></p>
+									<th scope="row">Intervalle pour modifier le sujet d'une discussion</th>
+									<td>
+										<input type="text" name="edit_subjects_interval" size="5" maxlength="5" value="<?php echo $group['g_edit_subjects_interval'] ?>" tabindex="23" />
+										<span>Nombre de secondes aprÃšs que le message ait Ã©tÃ© envoyÃ© pendant lesquelles les utilisateurs de ce groupe pourront modifier le sujet d'une discussion qu'ils viennent de lancer. Mettre Ã  0 pour permettre la modification du sujet des discussions sans restriction dans le temps.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Intervalle de contrÃŽle de flood sur les messages</th>
+									<td>
+										<input type="text" name="post_flood" size="5" maxlength="4" value="<?php echo $group['g_post_flood'] ?>" tabindex="24" />
+										<span>Nombre de secondes pendant lesquelles les utilisateurs de ce groupe devront patienter entre deux messages. Mettre Ã  0 pour dÃ©sactiver le contrÃŽle de flood sur les messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Intervalle de contrÃŽle de flood sur les recherches</th>
+									<td>
+										<input type="text" name="search_flood" size="5" maxlength="4" value="<?php echo $group['g_search_flood'] ?>" tabindex="25" />
+										<span>Nombre de secondes pendant lesquelles les utilisateurs de ce groupe devront patienter entre deux recherches. Mettre Ã  0 pour dÃ©sactiver le contrÃŽle de flood sur les recherches.</span>
+									</td>
+								</tr>
+<?php endif; ?><?php endif; ?>							</table>
+<?php if ($group['g_id'] == PUN_MOD ): ?>							<p class="warntext">Pour qu'un utilisateur de ce groupe acquiÃšre les compÃ©tences de modÃ©rateur, il devra nÃ©cessairement Ãªtre dÃ©signÃ© comme modÃ©rateur d'un ou de plusieurs forums. Ceci est possible depuis la page d'administration du profil de l'utilisateur.</p>
 <?php endif; ?>						</div>
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="add_edit_group" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="39" /></p>
+				<p class="submitend"><input type="submit" name="add_edit_group" value=" Enregistrer " tabindex="26" /></p>
 			</form>
 		</div>
@@ -250,13 +209,7 @@
 	$is_admin_group = (isset($_POST['group_id']) && $_POST['group_id'] == PUN_ADMIN) ? true : false;
 
-	$title = pun_trim($_POST['req_title']);
-	$user_title = pun_trim($_POST['user_title']);
-	$moderator = isset($_POST['moderator']) && $_POST['moderator'] == '1' ? '1' : '0';
-	$mod_edit_users = $moderator == '1' && isset($_POST['mod_edit_users']) && $_POST['mod_edit_users'] == '1' ? '1' : '0';
-	$mod_rename_users = $moderator == '1' && isset($_POST['mod_rename_users']) && $_POST['mod_rename_users'] == '1' ? '1' : '0';
-	$mod_change_passwords = $moderator == '1' && isset($_POST['mod_change_passwords']) && $_POST['mod_change_passwords'] == '1' ? '1' : '0';
-	$mod_ban_users = $moderator == '1' && isset($_POST['mod_ban_users']) && $_POST['mod_ban_users'] == '1' ? '1' : '0';
+	$title = trim($_POST['req_title']);
+	$user_title = trim($_POST['user_title']);
 	$read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1';
-	$view_users = (isset($_POST['view_users']) && $_POST['view_users'] == '1') || $is_admin_group ? '1' : '0';
 	$post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1';
 	$post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1';
@@ -267,12 +220,10 @@
 	$search = isset($_POST['search']) ? intval($_POST['search']) : '1';
 	$search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1';
-	$send_email = (isset($_POST['send_email']) && $_POST['send_email'] == '1') || $is_admin_group ? '1' : '0';
+	$edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0';
 	$post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0';
 	$search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0';
-	$email_flood = isset($_POST['email_flood']) ? intval($_POST['email_flood']) : '0';
-	$report_flood = isset($_POST['report_flood']) ? intval($_POST['report_flood']) : '0';
 
 	if ($title == '')
-		message($lang_admin_groups['Must enter title message']);
+		message('Vous devez saisir un nom de groupe.');
 
 	$user_title = ($user_title != '') ? '\''.$db->escape($user_title).'\'' : 'NULL';
@@ -280,36 +231,30 @@
 	if ($_POST['mode'] == 'add')
 	{
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Impossible de vÃ©rifier si un groupe porte dÃ©jÃ  ce nom', __FILE__, __LINE__, $db->error());
 		if ($db->num_rows($result))
-			message(sprintf($lang_admin_groups['Title already exists message'], pun_htmlspecialchars($title)));
-
-		$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$moderator.', '.$mod_edit_users.', '.$mod_rename_users.', '.$mod_change_passwords.', '.$mod_ban_users.', '.$read_board.', '.$view_users.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$send_email.', '.$post_flood.', '.$search_flood.', '.$email_flood.', '.$report_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error());
+			message('Il existe dÃ©jÃ  un groupe nommÃ© \''.pun_htmlspecialchars($title).'\'.');
+
+		$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Impossible d\'ajouter le groupe', __FILE__, __LINE__, $db->error());
 		$new_group_id = $db->insert_id();
 
 		// Now lets copy the forum specific permissions from the group which this group is based on
-		$result = $db->query('SELECT forum_id, read_forum, post_replies, post_topics FROM '.$db->prefix.'forum_perms WHERE group_id='.intval($_POST['base_group'])) or error('Unable to fetch group forum permission list', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT forum_id, read_forum, post_replies, post_topics FROM '.$db->prefix.'forum_perms WHERE group_id='.intval($_POST['base_group'])) or error('Impossible de retrouver la liste des permissions de groupes du forum', __FILE__, __LINE__, $db->error());
 		while ($cur_forum_perm = $db->fetch_assoc($result))
-			$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error());
+			$db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Impossible d\'insÃ©rer les permissions de groupes du forum', __FILE__, __LINE__, $db->error());
 	}
 	else
 	{
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('impossible de vÃ©rifier une Ã©ventuelle collision des titres de groupes', __FILE__, __LINE__, $db->error());
 		if ($db->num_rows($result))
-			message(sprintf($lang_admin_groups['Title already exists message'], pun_htmlspecialchars($title)));
-
-		$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_moderator='.$moderator.', g_mod_edit_users='.$mod_edit_users.', g_mod_rename_users='.$mod_rename_users.', g_mod_change_passwords='.$mod_change_passwords.', g_mod_ban_users='.$mod_ban_users.', g_read_board='.$read_board.', g_view_users='.$view_users.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_send_email='.$send_email.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.', g_email_flood='.$email_flood.', g_report_flood='.$report_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error());
-	}
-
-	// Regenerate the quick jump cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
-	$group_id = $_POST['mode'] == 'add' ? $new_group_id : intval($_POST['group_id']);
-	generate_quickjump_cache($group_id);
-
-	if ($_POST['mode'] == 'edit')
-		redirect('admin_groups.php', $lang_admin_groups['Group edited redirect']);
-	else
-		redirect('admin_groups.php', $lang_admin_groups['Group added redirect']);
+			message('Il existe dÃ©jÃ  un groupe nommÃ© \''.pun_htmlspecialchars($title).'\'.');
+
+		$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Impossible de modifier le groupe', __FILE__, __LINE__, $db->error());
+	}
+
+	// Regenerate the quickjump cache
+	require_once PUN_ROOT.'include/cache.php';
+	generate_quickjump_cache();
+
+	redirect('admin_groups.php', 'Groupe '.(($_POST['mode'] == 'edit') ? 'modifiÃ©' : 'ajoutÃ©').'. Redirection ...');
 }
 
@@ -321,23 +266,14 @@
 
 	$group_id = intval($_POST['default_group']);
-
-	// Make sure it's not the admin or guest groups
-	if ($group_id == PUN_ADMIN || $group_id == PUN_GUEST)
+	if ($group_id < 1)
 		message($lang_common['Bad request']);
 
-	// Make sure it's not a moderator group
-	$result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_id='.$group_id.' AND g_moderator=0') or error('Unable to check group moderator status', __FILE__, __LINE__, $db->error());
-	if (!$db->num_rows($result))
-		message($lang_common['Bad request']);
-
-	$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Impossible de modifier la configuration des forums', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the config cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_config_cache();
 
-	redirect('admin_groups.php', $lang_admin_groups['Default group redirect']);
+	redirect('admin_groups.php', 'Groupe par dÃ©faut rÃ©glÃ©. Redirection ...');
 }
 
@@ -348,5 +284,5 @@
 	confirm_referrer('admin_groups.php');
 
-	$group_id = isset($_POST['group_to_delete']) ? intval($_POST['group_to_delete']) : intval($_GET['del_group']);
+	$group_id = intval($_GET['del_group']);
 	if ($group_id < 5)
 		message($lang_common['Bad request']);
@@ -354,53 +290,69 @@
 	// Make sure we don't remove the default group
 	if ($group_id == $pun_config['o_default_user_group'])
-		message($lang_admin_groups['Cannot remove default message']);
+		message('Le groupe par dÃ©faut ne peut Ãªtre supprimÃ©. Vous devez d\'abord dÃ©finir un groupe par dÃ©faut diffÃ©rent.');
+
 
 	// Check if this group has any members
-	$result = $db->query('SELECT g.g_title, COUNT(u.id) FROM '.$db->prefix.'groups AS g INNER JOIN '.$db->prefix.'users AS u ON g.g_id=u.group_id WHERE g.g_id='.$group_id.' GROUP BY g.g_id, g_title') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT g.g_title, COUNT(u.id) FROM '.$db->prefix.'groups AS g INNER JOIN '.$db->prefix.'users AS u ON g.g_id=u.group_id WHERE g.g_id='.$group_id.' GROUP BY g.g_id, g_title') or error('Impossible de retrouver les informations du groupe', __FILE__, __LINE__, $db->error());
 
 	// If the group doesn't have any members or if we've already selected a group to move the members to
 	if (!$db->num_rows($result) || isset($_POST['del_group']))
 	{
-		if (isset($_POST['del_group_comply']) || isset($_POST['del_group']))
+		if (isset($_POST['del_group']))
 		{
-			if (isset($_POST['del_group']))
-			{
-				$move_to_group = intval($_POST['move_to_group']);
-				$db->query('UPDATE '.$db->prefix.'users SET group_id='.$move_to_group.' WHERE group_id='.$group_id) or error('Unable to move users into group', __FILE__, __LINE__, $db->error());
-			}
-
-			// Delete the group and any forum specific permissions
-			$db->query('DELETE FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to delete group', __FILE__, __LINE__, $db->error());
-			$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$group_id) or error('Unable to delete group forum permissions', __FILE__, __LINE__, $db->error());
-
-			redirect('admin_groups.php', $lang_admin_groups['Group removed redirect']);
+			$move_to_group = intval($_POST['move_to_group']);
+			$db->query('UPDATE '.$db->prefix.'users SET group_id='.$move_to_group.' WHERE group_id='.$group_id) or error('Impossible de dÃ©placer les utilisateurs dans le groupe', __FILE__, __LINE__, $db->error());
 		}
+
+		// Delete the group and any forum specific permissions
+		$db->query('DELETE FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Impossible de supprimer le groupe', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'forum_perms WHERE group_id='.$group_id) or error('Impossible de supprimer les permissions de groupe du forum', __FILE__, __LINE__, $db->error());
+
+		// Regenerate the quickjump cache
+		require_once PUN_ROOT.'include/cache.php';
+		generate_quickjump_cache();
+
+		redirect('admin_groups.php', 'Groupe supprimÃ©. Redirection ...');
+	}
+
+
+	list($group_title, $group_members) = $db->fetch_row($result);
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+	require PUN_ROOT.'header.php';
+
+	generate_admin_menu('groups');
+
+?>
+	<div class="blockform">
+		<h2><span>Supprimer groupe</span></h2>
+		<div class="box">
+			<form id="groups" method="post" action="admin_groups.php?del_group=<?php echo $group_id ?>">
+				<div class="inform">
+					<fieldset>
+						<legend>DÃ©placer les utilisateur de ce groupe</legend>
+						<div class="infldset">
+							<p>Il y a actuellement <?php echo $group_members ?> membres dans le groupe "<?php echo pun_htmlspecialchars($group_title) ?>". Veuillez sÃ©lectionner un groupe dans lequel ces utilisateurs seront dÃ©placÃ©s.</p>
+							<label>DÃ©placer les utilisateurs dans
+							<select name="move_to_group">
+<?php
+
+	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' AND g_id!='.$group_id.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
+
+	while ($cur_group = $db->fetch_assoc($result))
+	{
+		if ($cur_group['g_id'] == PUN_MEMBER)	// Pre-select the pre-defined Members group
+			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
 		else
-		{
-			$result = $db->query('SELECT g_title FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group title', __FILE__, __LINE__, $db->error());
-			$group_title = $db->result($result);
-
-			$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['User groups']);
-			define('PUN_ACTIVE_PAGE', 'admin');
-			require PUN_ROOT.'header.php';
-
-			generate_admin_menu('groups');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_groups['Group delete head'] ?></span></h2>
-		<div class="box">
-			<form method="post" action="admin_groups.php?del_group=<?php echo $group_id ?>">
-				<div class="inform">
-				<input type="hidden" name="group_to_delete" value="<?php echo $group_id ?>" />
-					<fieldset>
-						<legend><?php echo $lang_admin_groups['Confirm delete subhead'] ?></legend>
-						<div class="infldset">
-							<p><?php printf($lang_admin_groups['Confirm delete info'], pun_htmlspecialchars($group_title)) ?></p>
-							<p class="warntext"><?php echo $lang_admin_groups['Confirm delete warn'] ?></p>
+			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+	}
+
+?>
+							</select>
+							</br></label>
 						</div>
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="del_group_comply" value="<?php echo $lang_admin_common['Delete'] ?>" tabindex="1" /><a href="javascript:history.go(-1)" tabindex="2"><?php echo $lang_admin_common['Go back'] ?></a></p>
+				<p><input type="submit" name="del_group" value=" Supprimer groupe " /></p>
 			</form>
 		</div>
@@ -410,81 +362,30 @@
 <?php
 
-			require PUN_ROOT.'footer.php';
-		}
-	}
-
-	list($group_title, $group_members) = $db->fetch_row($result);
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['User groups']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-	generate_admin_menu('groups');
+	require PUN_ROOT.'footer.php';
+}
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Groupes';
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('groups');
 
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_groups['Delete group head'] ?></span></h2>
+		<h2><span>Ajouter/rÃ©gler groupes</span></h2>
 		<div class="box">
-			<form id="groups" method="post" action="admin_groups.php?del_group=<?php echo $group_id ?>">
+			<form id="groups" method="post" action="admin_groups.php?action=foo">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_groups['Move users subhead'] ?></legend>
-						<div class="infldset">
-							<p><?php printf($lang_admin_groups['Move users info'], pun_htmlspecialchars($group_title), forum_number_format($group_members)) ?></p>
-							<label><?php echo $lang_admin_groups['Move users label'] ?>
-							<select name="move_to_group">
-<?php
-
-	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' AND g_id!='.$group_id.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
-
-	while ($cur_group = $db->fetch_assoc($result))
-	{
-		if ($cur_group['g_id'] == PUN_MEMBER) // Pre-select the pre-defined Members group
-			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
-		else
-			echo "\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
-	}
-
-?>
-							</select>
-							<br /></label>
-						</div>
-					</fieldset>
-				</div>
-				<p class="buttons"><input type="submit" name="del_group" value="<?php echo $lang_admin_groups['Delete group'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_admin_common['Go back'] ?></a></p>
-			</form>
-		</div>
-	</div>
-	<div class="clearer"></div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['User groups']);
-define('PUN_ACTIVE_PAGE', 'admin');
-require PUN_ROOT.'header.php';
-
-generate_admin_menu('groups');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_groups['Add groups head'] ?></span></h2>
-		<div class="box">
-			<form id="groups" method="post" action="admin_groups.php">
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_groups['Add group subhead'] ?></legend>
+						<legend>Ajouter un groupe</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['New group label'] ?><div><input type="submit" name="add_group" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="2" /></div></th>
+									<th scope="row">Nouveau groupe basÃ© sur le groupe<div><input type="submit" name="add_group" value=" Ajouter " tabindex="2" /></div></th>
 									<td>
 										<select id="base_group" name="base_group" tabindex="1">
 <?php
 
-$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN.' AND g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
 
 while ($cur_group = $db->fetch_assoc($result))
@@ -498,5 +399,5 @@
 ?>
 										</select>
-										<span><?php echo $lang_admin_groups['New group help'] ?></span>
+										<span>Choisissez un groupe d'utilisateurs duquel le nouveau groupe hÃ©ritera les propriÃ©tÃ©s. La page suivante vous permettra d'affiner ces rÃ©glages.</span>
 									</td>
 								</tr>
@@ -507,14 +408,14 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_groups['Default group subhead'] ?></legend>
+						<legend>DÃ©finir le groupe par dÃ©faut</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_groups['Default group label'] ?><div><input type="submit" name="set_default_group" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="4" /></div></th>
+									<th scope="row">Groupe par dÃ©faut<div><input type="submit" name="set_default_group" value=" Enregistrer " tabindex="4" /></div></th>
 									<td>
 										<select id="default_group" name="default_group" tabindex="3">
 <?php
 
-$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' AND g_moderator=0 ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
 
 while ($cur_group = $db->fetch_assoc($result))
@@ -528,5 +429,5 @@
 ?>
 										</select>
-										<span><?php echo $lang_admin_groups['Default group help'] ?></span>
+										<span>Choisissez le groupe que vous voulez dÃ©finir par dÃ©faut. C'est Ã  dire le groupe oÃ¹ les utilisateurs seront placÃ©s quand ils s'inscriront. Pour des raisons de sÃ©curitÃ©, par dÃ©faut les utilisateurs ne peuvent Ãªtre mis ni dans le groupe modÃ©rateur ni dans le groupe administrateur.</span>
 									</td>
 								</tr>
@@ -538,21 +439,19 @@
 		</div>
 
-		<h2 class="block2"><span><?php echo $lang_admin_groups['Existing groups head'] ?></span></h2>
+		<h2 class="block2"><span>Groupes existants</span></h2>
 		<div class="box">
 			<div class="fakeform">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_groups['Edit groups subhead'] ?></legend>
+						<legend>Modifier/supprimer les groupes</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_groups['Edit groups info'] ?></p>
+							<p>Les groupes prÃ©-dÃ©finis InvitÃ©s, Administrateurs, ModÃ©rateurs et Membres ne peuvent Ãªtre supprimÃ©s. Il peuvent par contre Ãªtre modifiÃ©s. Mais suivant le groupe certaines options ne sont pas disponibles (<abbr title="exemple">ex.</abbr> la permission <em>modifier messages</em> pour les invitÃ©s). Les Administrateurs ont toujours toutes les permisssions.</p>
 							<table cellspacing="0">
 <?php
 
-$cur_index = 5;
-
-$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups ORDER BY g_id') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
 
 while ($cur_group = $db->fetch_assoc($result))
-	echo "\t\t\t\t\t\t\t\t".'<tr><th scope="row"><a href="admin_groups.php?edit_group='.$cur_group['g_id'].'" tabindex="'.$cur_index++.'">'.$lang_admin_groups['Edit link'].'</a>'.(($cur_group['g_id'] > PUN_MEMBER) ? ' | <a href="admin_groups.php?del_group='.$cur_group['g_id'].'" tabindex="'.$cur_index++.'">'.$lang_admin_groups['Delete link'].'</a>' : '').'</th><td>'.pun_htmlspecialchars($cur_group['g_title']).'</td></tr>'."\n";
+	echo "\t\t\t\t\t\t\t\t".'<tr><th scope="row"><a href="admin_groups.php?edit_group='.$cur_group['g_id'].'">Modifier</a>'.(($cur_group['g_id'] > PUN_MEMBER) ? ' - <a href="admin_groups.php?del_group='.$cur_group['g_id'].'">Supprimer</a>' : '').'</th><td>'.pun_htmlspecialchars($cur_group['g_title']).'</td></tr>'."\n";
 
 ?>
Index: /trunk/web/punbb/admin_index.php
===================================================================
--- /trunk/web/punbb/admin_index.php	(revision 10)
+++ /trunk/web/punbb/admin_index.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if (!$pun_user['is_admmod'])
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
 
-// Load the admin_index.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_index.php';
 
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -27,14 +42,48 @@
 {
 	if (!ini_get('allow_url_fopen'))
-		message($lang_admin_index['fopen disabled message']);
-
-	$latest_version = trim(@file_get_contents('http://fluxbb.org/latest_version'));
-	if (empty($latest_version))
-		message($lang_admin_index['Upgrade check failed message']);
-
-	if (version_compare($pun_config['o_cur_version'], $latest_version, '>='))
-		message($lang_admin_index['Running latest version message']);
+		message('Impossible de vÃ©rifier les mises Ã  jour tant que \'allow_url_fopen\' est dÃ©sactivÃ© sur ce systÃšme.');
+
+	$fp = @fopen('http://www.punbb.org/latest_version', 'r');
+	$latest_version = trim(@fread($fp, 16));
+	@fclose($fp);
+
+	if ($latest_version == '')
+		message('La vÃ©rification de mise Ã  jour a Ã©chouÃ©e pour une raison inconnue.');
+
+	$cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version']));
+	$cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);
+
+	$latest_version = str_replace('.', '', strtolower($latest_version));
+	$latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);
+
+	if ($cur_version >= $latest_version)
+		message('Vous utilisez la derniÃšre version de PunBB.');
 	else
-		message(sprintf($lang_admin_index['New version available message'], '<a href="http://fluxbb.org/">FluxBB.org</a>'));
+		message('Une nouvelle version de PunBB est sortie ! Vous pouvez tÃ©lÃ©charger cette derniÃšre version sur <a href="http://www.punbb.org/">PunBB.org</a>.');
+}
+
+// Check for french upgrade
+if ($action == 'check_upgrade_fr')
+{
+	if (!ini_get('allow_url_fopen'))
+		message('Impossible de vÃ©rifier les mises Ã  jour tant que \'allow_url_fopen\' est dÃ©sactivÃ© sur ce systÃšme.');
+
+	$fp = @fopen('http://www.punbb.fr/latest_version', 'r');
+	$latest_version = trim(@fread($fp, 16));
+	@fclose($fp);
+
+	if ($latest_version == '')
+		message('La vÃ©rification de mise Ã  jour a Ã©chouÃ©e pour une raison inconnue.');
+
+	$cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version_fr']));
+	$cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);
+
+	$latest_version = str_replace('.', '', strtolower($latest_version));
+	$latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);
+
+	if ($cur_version >= $latest_version)
+		message('Vous utilisez la derniÃšre version de PunBB en franÃ§ais.');
+	else
+		message('Une nouvelle version de PunBB en franÃ§ais est sortie ! Vous pouvez tÃ©lÃ©charger cette derniÃšre version sur <a href="http://www.punbb.fr/">PunBB.fr</a>.');
 }
 
@@ -44,6 +93,6 @@
 {
 	// Is phpinfo() a disabled function?
-	if (strpos(strtolower((string) ini_get('disable_functions')), 'phpinfo') !== false)
-		message($lang_admin_index['PHPinfo disabled message']);
+	if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false)
+		message('La fonction phpinfo() de PHP est dÃ©sactivÃ©e sur ce serveur.');
 
 	phpinfo();
@@ -60,31 +109,39 @@
 	@fclose($fh);
 
-	if (($fh = @fopen('/proc/loadavg', 'r')))
-	{
-		$load_averages = fread($fh, 64);
-		fclose($fh);
-	}
-	else
-		$load_averages = '';
-
 	$load_averages = @explode(' ', $load_averages);
-	$server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : $lang_admin_index['Not available'];
-}
-else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('%averages?: ([0-9\.]+),?\s+([0-9\.]+),?\s+([0-9\.]+)%i', @exec('uptime'), $load_averages))
+	$server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Indisponible';
+}
+else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))
 	$server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3];
 else
-	$server_load = $lang_admin_index['Not available'];
+	$server_load = 'Indisponible';
 
 
 // Get number of current visitors
-$result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Impossible de retrouver le total d\'utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 $num_online = $db->result($result);
 
 
+// Get the database system version
+switch ($db_type)
+{
+	case 'sqlite':
+		$db_version = 'SQLite '.sqlite_libversion();
+		break;
+
+	default:
+		$result = $db->query('SELECT VERSION()') or error('Impossible de retrouver les informations utilisateurs', __FILE__, __LINE__, $db->error());
+		$db_version = $db->result($result);
+		break;
+}
+
+
 // Collect some additional info about MySQL
-if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-{
+if ($db_type == 'mysql' || $db_type == 'mysqli')
+{
+	$db_version = 'MySQL '.$db_version;
+
 	// Calculate total db size/row count
-	$result = $db->query('SHOW TABLE STATUS LIKE \''.$db->prefix.'%\'') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Impossible de retrouver le statut des tables', __FILE__, __LINE__, $db->error());
 
 	$total_records = $total_size = 0;
@@ -95,27 +152,23 @@
 	}
 
-	$total_size = file_size($total_size);
-}
-
-
-// Check for the existence of various PHP opcode caches/optimizers
+	$total_size = $total_size / 1024;
+
+	if ($total_size > 1024)
+		$total_size = round($total_size / 1024, 2).' MB';
+	else
+		$total_size = round($total_size, 2).' KB';
+}
+
+
+// See if MMCache or PHPA is loaded
 if (function_exists('mmcache'))
-	$php_accelerator = '<a href="http://'.$lang_admin_index['Turck MMCache link'].'">'.$lang_admin_index['Turck MMCache'].'</a>';
+	$php_accelerator = '<a href="http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
 else if (isset($_PHPA))
-	$php_accelerator = '<a href="http://'.$lang_admin_index['ionCube PHP Accelerator link'].'">'.$lang_admin_index['ionCube PHP Accelerator'].'</a>';
-else if (ini_get('apc.enabled'))
-	$php_accelerator ='<a href="http://'.$lang_admin_index['Alternative PHP Cache (APC) link'].'">'.$lang_admin_index['Alternative PHP Cache (APC)'].'</a>';
-else if (ini_get('zend_optimizer.optimization_level'))
-	$php_accelerator = '<a href="http://'.$lang_admin_index['Zend Optimizer link'].'">'.$lang_admin_index['Zend Optimizer'].'</a>';
-else if (ini_get('eaccelerator.enable'))
-	$php_accelerator = '<a href="http://'.$lang_admin_index['eAccelerator link'].'">'.$lang_admin_index['eAccelerator'].'</a>';
-else if (ini_get('xcache.cacher'))
-	$php_accelerator = '<a href="http://'.$lang_admin_index['XCache link'].'">'.$lang_admin_index['XCache'].'</a>';
+	$php_accelerator = '<a href="http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
 else
-	$php_accelerator = $lang_admin_index['NA'];
-
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Index']);
-define('PUN_ACTIVE_PAGE', 'admin');
+	$php_accelerator = 'N/A';
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin';
 require PUN_ROOT.'header.php';
 
@@ -124,47 +177,47 @@
 ?>
 	<div class="block">
-		<h2><span><?php echo $lang_admin_index['Forum admin head'] ?></span></h2>
+		<h2>Administration Forum</h2>
 		<div id="adintro" class="box">
 			<div class="inbox">
-				<p><?php echo $lang_admin_index['Welcome to admin'] ?></p>
-				<ul>
-					<li><span><?php echo $lang_admin_index['Welcome 1'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 2'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 3'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 4'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 5'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 6'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 7'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 8'] ?></span></li>
-					<li><span><?php echo $lang_admin_index['Welcome 9'] ?></span></li>
-				</ul>
+				<p>Bienvenue sur le panneau de contrÃŽles de  PunBB. Depuis cet espace vous pouvez contrÃŽler les points essentiels de votre forum. Selon que vous Ãªtes un administrateur ou un modÃ©rateur vous pouvez&#160;:<br /><br />
+					&#160;- organiser les catÃ©gories et les forums.<br />
+					&#160;- rÃ©gler les principales options et prÃ©fÃ©rences.<br />
+					&#160;- contrÃŽler les permissions pour les utilisateurs et les visiteurs.<br />
+					&#160;- voir les statistiques des IP pour les utilisateurs.<br />
+					&#160;- bannir des utilisateurs.<br />
+					&#160;- censurer des mots.<br />
+					&#160;- rÃ©gler les rangs des utilisateurs.<br />
+					&#160;- Ã©laguer les anciens messages.<br />
+					&#160;- traiter les messages signalÃ©s.
+				</p>
 			</div>
 		</div>
 
-		<h2 class="block2"><span><?php echo $lang_admin_index['Statistics head'] ?></span></h2>
+		<h2 class="block2"><span>Statistiques</span></h2>
 		<div id="adstats" class="box">
 			<div class="inbox">
 				<dl>
-					<dt><?php echo $lang_admin_index['FluxBB version label'] ?></dt>
-					<dd>
-						<?php printf($lang_admin_index['FluxBB version data']."\n", $pun_config['o_cur_version'], '<a href="admin_index.php?action=check_upgrade">'.$lang_admin_index['Check for upgrade'].'</a>') ?>
+					<dt>PunBB version</dt>
+					<dd>
+						PunBB version franÃ§aise <?php echo $pun_config['o_cur_version_fr'] ?> basÃ©e sur PunBB <?php echo $pun_config['o_cur_version'] ?><br />
+						<a href="admin_index.php?action=check_upgrade">VÃ©rifier la version officielle</a> - <a href="admin_index.php?action=check_upgrade_fr">VÃ©rifier la version franÃ§aise</a> <br />
+						&copy; Copyright 2002, 2003, 2004, 2005 Rickard Andersson
 					</dd>
-					<dt><?php echo $lang_admin_index['Server load label'] ?></dt>
-					<dd>
-						<?php printf($lang_admin_index['Server load data']."\n", $server_load, $num_online) ?>
+					<dt>ExÃ©cution serveur</dt>
+					<dd>
+						<?php echo $server_load ?> (<?php echo $num_online ?> utilisateurs en ligne)
 					</dd>
-<?php if ($pun_user['g_id'] == PUN_ADMIN): ?>					<dt><?php echo $lang_admin_index['Environment label'] ?></dt>
-					<dd>
-						<?php printf($lang_admin_index['Environment data OS'], PHP_OS) ?><br />
-						<?php printf($lang_admin_index['Environment data version'], phpversion(), '<a href="admin_index.php?action=phpinfo">'.$lang_admin_index['Show info'].'</a>') ?><br />
-						<?php printf($lang_admin_index['Environment data acc']."\n", $php_accelerator) ?>
+<?php if ($pun_user['g_id'] == PUN_ADMIN): ?>					<dt>Environnement</dt>
+					<dd>
+						SystÃšme d'exploitation&#160;: <?php echo PHP_OS ?><br />
+						PHP&#160;: <?php echo phpversion() ?> - <a href="admin_index.php?action=phpinfo">Afficher infos</a><br />
+						AccÃ©lÃ©rateur PHP&#160;: <?php echo $php_accelerator."\n" ?>
 					</dd>
-					<dt><?php echo $lang_admin_index['Database label'] ?></dt>
-					<dd>
-						<?php echo implode(' ', $db->get_version())."\n" ?>
-<?php if (isset($total_records) && isset($total_size)): ?>						<br /><?php printf($lang_admin_index['Database data rows']."\n", forum_number_format($total_records)) ?>
-						<br /><?php printf($lang_admin_index['Database data size']."\n", $total_size) ?>
-<?php endif; ?>					</dd>
-<?php endif; ?>
+					<dt>Base de donnÃ©es</dt>
+					<dd>
+						<?php echo $db_version."\n" ?>
+<?php if (isset($total_records) && isset($total_size)): ?>						<br />Lignes&#160;: <?php echo $total_records."\n" ?>
+						<br />Taille&#160;: <?php echo $total_size."\n" ?>
+<?php endif; endif; ?>					</dd>
 				</dl>
 			</div>
Index: /trunk/web/punbb/admin_loader.php
===================================================================
--- /trunk/web/punbb/admin_loader.php	(revision 10)
+++ /trunk/web/punbb/admin_loader.php	(revision 1)
@@ -1,34 +1,52 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if (!$pun_user['is_admmod'])
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
+
 
 // The plugin to load should be supplied via GET
 $plugin = isset($_GET['plugin']) ? $_GET['plugin'] : '';
-if (!preg_match('%^AM?P_(\w*?)\.php$%i', $plugin))
+if (!preg_match('/^AM?P_(\w*?)\.php$/i', $plugin))
 	message($lang_common['Bad request']);
 
 // AP_ == Admins only, AMP_ == admins and moderators
 $prefix = substr($plugin, 0, strpos($plugin, '_'));
-if ($pun_user['g_moderator'] == '1' && $prefix == 'AP')
+if ($pun_user['g_id'] == PUN_MOD && $prefix == 'AP')
 	message($lang_common['No permission']);
 
 // Make sure the file actually exists
 if (!file_exists(PUN_ROOT.'plugins/'.$plugin))
-	message(sprintf($lang_admin_common['No plugin message'], $plugin));
+	message('Il n\'y a pas de plugin nommÃ© \''.$plugin.'\' dans le rÃ©pertoire de plugin.');
 
 // Construct REQUEST_URI if it isn't set
@@ -36,14 +54,13 @@
 	$_SERVER['REQUEST_URI'] = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '').'?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Admin'], str_replace('_', ' ', substr($plugin, strpos($plugin, '_') + 1, -4)));
-define('PUN_ACTIVE_PAGE', 'admin');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin;
 require PUN_ROOT.'header.php';
 
 // Attempt to load the plugin. We don't use @ here to supress error messages,
 // because if we did and a parse error occurred in the plugin, we would only
-// get the "blank page of death"
+// get the "blank page of death".
 include PUN_ROOT.'plugins/'.$plugin;
 if (!defined('PUN_PLUGIN_LOADED'))
-	message(sprintf($lang_admin_common['Plugin failed message'], $plugin));
+	message('Le chargement du plugin \''.$plugin.'\' a Ã©chouÃ©.');
 
 // Output the clearer div
Index: /trunk/web/punbb/admin_maintenance.php
===================================================================
--- /trunk/web/punbb/admin_maintenance.php	(revision 10)
+++ /trunk/web/punbb/admin_maintenance.php	(revision 1)
@@ -1,9 +1,27 @@
 <?php
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
@@ -12,25 +30,18 @@
 define('PUN_DISABLE_BUFFERING', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
-
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_maintenance.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_maintenance.php';
+if (isset($_GET['i_per_page']) && isset($_GET['i_start_at']))
+{
 
-$action = isset($_REQUEST['action']) ? trim($_REQUEST['action']) : '';
-
-if ($action == 'rebuild')
-{
-	$per_page = isset($_GET['i_per_page']) ? intval($_GET['i_per_page']) : 0;
-	$start_at = isset($_GET['i_start_at']) ? intval($_GET['i_start_at']) : 0;
-
-	// Check per page is > 0
-	if ($per_page < 1)
-		message($lang_admin_maintenance['Posts must be integer message']);
+	$per_page = intval($_GET['i_per_page']);
+	$start_at = intval($_GET['i_start_at']);
+	if ($per_page < 1 || $start_at < 1)
+		message($lang_common['Bad request']);
 
 	@set_time_limit(0);
@@ -42,6 +53,7 @@
 		confirm_referrer('admin_maintenance.php');
 
-		$db->truncate_table('search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $db->error());
-		$db->truncate_table('search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $db->error());
+		$truncate_sql = ($db_type != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ';
+		$db->query($truncate_sql.$db->prefix.'search_matches') or error('Impossible de vider la table search index match', __FILE__, __LINE__, $db->error());
+		$db->query($truncate_sql.$db->prefix.'search_words') or error('Impossible de vider la table search index words', __FILE__, __LINE__, $db->error());
 
 		// Reset the sequence for the search words (not needed for SQLite)
@@ -50,15 +62,13 @@
 			case 'mysql':
 			case 'mysqli':
-			case 'mysql_innodb':
-			case 'mysqli_innodb':
-				$result = $db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $db->error());
+				$result = $db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Impossible de modifier l\'auto-incrÃ©mentation', __FILE__, __LINE__, $db->error());
 				break;
 
 			case 'pgsql';
-				$result = $db->query('SELECT setval(\''.$db->prefix.'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT setval(\'search_words_id_seq\', 1, false)') or error('Impossible de modifier la sÃ©quence', __FILE__, __LINE__, $db->error());
 		}
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_maintenance['Rebuilding search index']);
+	$end_at = $start_at + $per_page;
 
 ?>
@@ -67,16 +77,11 @@
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo generate_page_title($page_title) ?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Reconstruction des index de recherches ...</title>
 <style type="text/css">
 body {
-	font: 12px Verdana, Arial, Helvetica, sans-serif;
+	font: 10px Verdana, Arial, Helvetica, sans-serif;
 	color: #333333;
 	background-color: #FFFFFF
-}
-
-h1 {
-	font-size: 16px;
-	font-weight: normal;
 }
 </style>
@@ -84,168 +89,51 @@
 <body>
 
-<h1><?php echo $lang_admin_maintenance['Rebuilding index info'] ?></h1>
-<hr />
+Reconstruction des index ... C'est peut Ãªtre le bon moment pour aller prendre un cafÃ© :-)<br /><br />
 
 <?php
 
-	$query_str = '';
-
 	require PUN_ROOT.'include/search_idx.php';
 
-	// Fetch posts to process this cycle
-	$result = $db->query('SELECT p.id, p.message, t.subject, t.first_post_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id >= '.$start_at.' ORDER BY p.id ASC LIMIT '.$per_page) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
+	// Fetch posts to process
+	$result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' AND t.id<'.$end_at.' ORDER BY t.id') or error('Impossible de retrouver les informations des discussions et des messages', __FILE__, __LINE__, $db->error());
 
-	$end_at = 0;
-	while ($cur_item = $db->fetch_assoc($result))
+	$cur_topic = 0;
+	while ($cur_post = $db->fetch_row($result))
 	{
-		echo '<p><span>'.sprintf($lang_admin_maintenance['Processing post'], $cur_item['id']).'</span></p>'."\n";
+		if ($cur_post[0] <> $cur_topic)
+		{
+			// Fetch subject and ID of first post in topic
+			$result2 = $db->query('SELECT p.id, t.subject, MIN(p.posted) AS first FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id='.$cur_post[0].' GROUP BY p.id, t.subject ORDER BY first LIMIT 1') or error('Impossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
+			list($first_post, $subject) = $db->fetch_row($result2);
 
-		if ($cur_item['id'] == $cur_item['first_post_id'])
-			update_search_index('post', $cur_item['id'], $cur_item['message'], $cur_item['subject']);
+			$cur_topic = $cur_post[0];
+		}
+
+		echo 'Traitement du message <strong>'.$cur_post[1].'</strong> de la discussion <strong>'.$cur_post[0].'</strong><br />'."\n";
+
+		if ($cur_post[1] == $first_post)	// This is the "topic post" so we have to index the subject as well
+			update_search_index('post', $cur_post[1], $cur_post[2], $subject);
 		else
-			update_search_index('post', $cur_item['id'], $cur_item['message']);
-
-		$end_at = $cur_item['id'];
+			update_search_index('post', $cur_post[1], $cur_post[2]);
 	}
 
 	// Check if there is more work to do
-	if ($end_at > 0)
-	{
-		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE id > '.$end_at.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch next ID', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at) or error('Impossible de retrouver les informations de discussions', __FILE__, __LINE__, $db->error());
 
-		if ($db->num_rows($result) > 0)
-			$query_str = '?action=rebuild&i_per_page='.$per_page.'&i_start_at='.$db->result($result);
-	}
+	$query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : '';
 
 	$db->end_transaction();
 	$db->close();
 
-	exit('<script type="text/javascript">window.location="admin_maintenance.php'.$query_str.'"</script><hr /><p>'.sprintf($lang_admin_maintenance['Javascript redirect failed'], '<a href="admin_maintenance.php'.$query_str.'">'.$lang_admin_maintenance['Click here'].'</a>').'</p>');
-}
-
-if ($action == 'prune')
-{
-	$prune_from = trim($_POST['prune_from']);
-	$prune_sticky = intval($_POST['prune_sticky']);
-
-	if (isset($_POST['prune_comply']))
-	{
-		confirm_referrer('admin_maintenance.php');
-
-		$prune_days = intval($_POST['prune_days']);
-		$prune_date = ($prune_days) ? time() - ($prune_days * 86400) : -1;
-
-		@set_time_limit(0);
-
-		if ($prune_from == 'all')
-		{
-			$result = $db->query('SELECT id FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
-			$num_forums = $db->num_rows($result);
-
-			for ($i = 0; $i < $num_forums; ++$i)
-			{
-				$fid = $db->result($result, $i);
-
-				prune($fid, $prune_sticky, $prune_date);
-				update_forum($fid);
-			}
-		}
-		else
-		{
-			$prune_from = intval($prune_from);
-			prune($prune_from, $prune_sticky, $prune_date);
-			update_forum($prune_from);
-		}
-
-		// Locate any "orphaned redirect topics" and delete them
-		$result = $db->query('SELECT t1.id FROM '.$db->prefix.'topics AS t1 LEFT JOIN '.$db->prefix.'topics AS t2 ON t1.moved_to=t2.id WHERE t2.id IS NULL AND t1.moved_to IS NOT NULL') or error('Unable to fetch redirect topics', __FILE__, __LINE__, $db->error());
-		$num_orphans = $db->num_rows($result);
-
-		if ($num_orphans)
-		{
-			for ($i = 0; $i < $num_orphans; ++$i)
-				$orphans[] = $db->result($result, $i);
-
-			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $orphans).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
-		}
-
-		redirect('admin_maintenance.php', $lang_admin_maintenance['Posts pruned redirect']);
-	}
-
-	$prune_days = trim($_POST['req_prune_days']);
-	if ($prune_days == '' || preg_match('%[^0-9]%', $prune_days))
-		message($lang_admin_maintenance['Days must be integer message']);
-
-	$prune_date = time() - ($prune_days * 86400);
-
-	// Concatenate together the query for counting number of topics to prune
-	$sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL';
-
-	if ($prune_sticky == '0')
-		$sql .= ' AND sticky=0';
-
-	if ($prune_from != 'all')
-	{
-		$prune_from = intval($prune_from);
-		$sql .= ' AND forum_id='.$prune_from;
-
-		// Fetch the forum name (just for cosmetic reasons)
-		$result = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id='.$prune_from) or error('Unable to fetch forum name', __FILE__, __LINE__, $db->error());
-		$forum = '"'.pun_htmlspecialchars($db->result($result)).'"';
-	}
-	else
-		$forum = $lang_admin_maintenance['All forums'];
-
-	$result = $db->query($sql) or error('Unable to fetch topic prune count', __FILE__, __LINE__, $db->error());
-	$num_topics = $db->result($result);
-
-	if (!$num_topics)
-		message(sprintf($lang_admin_maintenance['No old topics message'], $prune_days));
-
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Prune']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-	generate_admin_menu('maintenance');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_maintenance['Prune head'] ?></span></h2>
-		<div class="box">
-			<form method="post" action="admin_maintenance.php">
-				<div class="inform">
-					<input type="hidden" name="action" value="prune" />
-					<input type="hidden" name="prune_days" value="<?php echo $prune_days ?>" />
-					<input type="hidden" name="prune_sticky" value="<?php echo $prune_sticky ?>" />
-					<input type="hidden" name="prune_from" value="<?php echo $prune_from ?>" />
-					<fieldset>
-						<legend><?php echo $lang_admin_maintenance['Confirm prune subhead'] ?></legend>
-						<div class="infldset">
-							<p><?php printf($lang_admin_maintenance['Confirm prune info'], $prune_days, $forum, forum_number_format($num_topics)) ?></p>
-							<p class="warntext"><?php echo $lang_admin_maintenance['Confirm prune warn'] ?></p>
-						</div>
-					</fieldset>
-				</div>
-				<p class="buttons"><input type="submit" name="prune_comply" value="<?php echo $lang_admin_common['Prune'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_admin_common['Go back'] ?></a></p>
-			</form>
-		</div>
-	</div>
-	<div class="clearer"></div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-	exit;
+	exit('<script type="text/javascript">window.location="admin_maintenance.php'.$query_str.'"</script><br />La redirection javaScript a Ã©chouÃ©e. <a href="admin_maintenance.php'.$query_str.'">Cliquez ici</a> pour continuer.');
 }
 
 
 // Get the first post ID from the db
-$result = $db->query('SELECT id FROM '.$db->prefix.'posts ORDER BY id ASC LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT id FROM '.$db->prefix.'topics ORDER BY id LIMIT 1') or error('Impossible de retrouver les informations de discussions', __FILE__, __LINE__, $db->error());
 if ($db->num_rows($result))
 	$first_id = $db->result($result);
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Maintenance']);
-define('PUN_ACTIVE_PAGE', 'admin');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Maintenance';
 require PUN_ROOT.'header.php';
 
@@ -254,96 +142,36 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_maintenance['Maintenance head'] ?></span></h2>
+		<h2><span>Maintenance des Forums</span></h2>
 		<div class="box">
 			<form method="get" action="admin_maintenance.php">
 				<div class="inform">
-					<input type="hidden" name="action" value="rebuild" />
 					<fieldset>
-						<legend><?php echo $lang_admin_maintenance['Rebuild index subhead'] ?></legend>
+						<legend>Reconstruction des index de recherches</legend>
 						<div class="infldset">
-							<p><?php printf($lang_admin_maintenance['Rebuild index info'], '<a href="admin_options.php#maintenance">'.$lang_admin_common['Maintenance mode'].'</a>') ?></p>
+							<p>Si vous avez ajoutÃ©, modifiÃ© ou supprimÃ© manuellement des messages dans la base de donnÃ©es ou si vous avez des problÃšmes avec la  recherche vous devriez reconstruire les index de recherche (supprime les mots inutiles). Pour de meilleures performances, pendant la reconstruction des index, vous devriez mettre vos forums en mode maintenance. <strong>La reconstruction des index de recherches peut prendre beaucoup de temps et augmenter considÃ©rablement la charge serveur au cours du processus de reconstruction&#160;!</strong></p>
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Posts per cycle label'] ?></th>
+									<th scope="row">Discussions par cycle</th>
 									<td>
-										<input type="text" name="i_per_page" size="7" maxlength="7" value="300" tabindex="1" />
-										<span><?php echo $lang_admin_maintenance['Posts per cycle help'] ?></span>
+										<input type="text" name="i_per_page" size="7" maxlength="7" value="100" tabindex="1" />
+										<span>Le nombre de discussions Ã  traiter par cycle. Si vous saisissez 100, une centaine de discussions sera traitÃ©e et ensuite la page sera actualisÃ©e. Cela permet d'Ã©viter que le script n'atteigne le temps limite d'exÃ©cution pendant le processus de recontruction.</span>
 									</td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Starting post label'] ?></th>
+									<th scope="row">ID de la discussion de dÃ©part</th>
 									<td>
 										<input type="text" name="i_start_at" size="7" maxlength="7" value="<?php echo (isset($first_id)) ? $first_id : 0 ?>" tabindex="2" />
-										<span><?php echo $lang_admin_maintenance['Starting post help'] ?></span>
+										<span>L'ID de discussion de laquelle vous souhaitez lancer la reconstruction. La valeur par dÃ©faut est le premier ID diponible dans la base de donnÃ©es. Normalement vous ne devriez pas avoir Ã  changer ceci.</span>
 									</td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Empty index label'] ?></th>
+									<th scope="row">Vider index</th>
 									<td class="inputadmin">
-										<span><input type="checkbox" name="i_empty_index" value="1" tabindex="3" checked="checked" />&#160;&#160;<?php echo $lang_admin_maintenance['Empty index help'] ?></span>
+										<span><input type="checkbox" name="i_empty_index" value="1" tabindex="3" checked="checked" />&#160;&#160;Cochez cette option si vous souhaitez que les index de recherches soient vidÃ©s avant la reconstruction (voir ci-dessous).</span>
 									</td>
 								</tr>
 							</table>
-							<p class="topspace"><?php echo $lang_admin_maintenance['Rebuild completed info'] ?></p>
-							<div class="fsetsubmit"><input type="submit" name="rebuild_index" value="<?php echo $lang_admin_maintenance['Rebuild index'] ?>" tabindex="4" /></div>
-						</div>
-					</fieldset>
-				</div>
-			</form>
-
-			<form method="post" action="admin_maintenance.php" onsubmit="return process_form(this)">
-				<div class="inform">
-					<input type="hidden" name="action" value="prune" />
-					<fieldset>
-						<legend><?php echo $lang_admin_maintenance['Prune subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Days old label'] ?></th>
-									<td>
-										<input type="text" name="req_prune_days" size="3" maxlength="3" tabindex="5" />
-										<span><?php echo $lang_admin_maintenance['Days old help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Prune sticky label'] ?></th>
-									<td>
-										<input type="radio" name="prune_sticky" value="1" tabindex="6" checked="checked" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="prune_sticky" value="0" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_maintenance['Prune sticky help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_maintenance['Prune from label'] ?></th>
-									<td>
-										<select name="prune_from" tabindex="7">
-											<option value="all"><?php echo $lang_admin_maintenance['All forums'] ?></option>
-<?php
-
-	$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-
-	$cur_category = 0;
-	while ($forum = $db->fetch_assoc($result))
-	{
-		if ($forum['cid'] != $cur_category) // Are we still in the same category?
-		{
-			if ($cur_category)
-				echo "\t\t\t\t\t\t\t\t\t\t\t".'</optgroup>'."\n";
-
-			echo "\t\t\t\t\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($forum['cat_name']).'">'."\n";
-			$cur_category = $forum['cid'];
-		}
-
-		echo "\t\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$forum['fid'].'">'.pun_htmlspecialchars($forum['forum_name']).'</option>'."\n";
-	}
-
-?>
-											</optgroup>
-										</select>
-										<span><?php echo $lang_admin_maintenance['Prune from help'] ?></span>
-									</td>
-								</tr>
-							</table>
-							<p class="topspace"><?php printf($lang_admin_maintenance['Prune info'], '<a href="admin_options.php#maintenance">'.$lang_admin_common['Maintenance mode'].'</a>') ?></p>
-							<div class="fsetsubmit"><input type="submit" name="prune" value="<?php echo $lang_admin_common['Prune'] ?>" tabindex="8" /></div>
+							<p class="topspace">Lorsque le processus sera terminÃ© vous serez redirigÃ© sur cette page. Il est fortement recommandÃ© que Javascript soit activÃ© sur votre navigateur pour effectuer la reconstruction (pour une redirection automatique lorsqu'un cycle est achevÃ©). Si vous Ãªtes obligÃ© d'abandonner le processus de reconstruction, notez l'ID du dernier sujet traitÃ© et saisissez cet ID+1 dans le champ "ID de la discussion de dÃ©part" quand/si vous reprennez le processus  ("Vider index" ne doit pas Ãªtre cochÃ©).</p>
+							<div class="fsetsubmit"><input type="submit" name="rebuild_index" value=" Reconstruire index " tabindex="4" /></div>
 						</div>
 					</fieldset>
Index: /trunk/web/punbb/admin_options.php
===================================================================
--- /trunk/web/punbb/admin_options.php	(revision 10)
+++ /trunk/web/punbb/admin_options.php	(revision 1)
@@ -1,93 +1,62 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_options.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_options.php';
 
 if (isset($_POST['form_sent']))
 {
-	confirm_referrer('admin_options.php', $lang_admin_options['Bad HTTP Referer message']);
-
-	$form = array(
-		'board_title'			=> pun_trim($_POST['form']['board_title']),
-		'board_desc'			=> pun_trim($_POST['form']['board_desc']),
-		'base_url'				=> pun_trim($_POST['form']['base_url']),
-		'default_timezone'		=> floatval($_POST['form']['default_timezone']),
-		'default_dst'			=> $_POST['form']['default_dst'] != '1' ? '0' : '1',
-		'default_lang'			=> pun_trim($_POST['form']['default_lang']),
-		'default_style'			=> pun_trim($_POST['form']['default_style']),
-		'time_format'			=> pun_trim($_POST['form']['time_format']),
-		'date_format'			=> pun_trim($_POST['form']['date_format']),
-		'timeout_visit'			=> intval($_POST['form']['timeout_visit']),
-		'timeout_online'		=> intval($_POST['form']['timeout_online']),
-		'redirect_delay'		=> intval($_POST['form']['redirect_delay']),
-		'show_version'			=> $_POST['form']['show_version'] != '1' ? '0' : '1',
-		'show_user_info'		=> $_POST['form']['show_user_info'] != '1' ? '0' : '1',
-		'show_post_count'		=> $_POST['form']['show_post_count'] != '1' ? '0' : '1',
-		'smilies'				=> $_POST['form']['smilies'] != '1' ? '0' : '1',
-		'smilies_sig'			=> $_POST['form']['smilies_sig'] != '1' ? '0' : '1',
-		'make_links'			=> $_POST['form']['make_links'] != '1' ? '0' : '1',
-		'topic_review'			=> intval($_POST['form']['topic_review']),
-		'disp_topics_default'	=> intval($_POST['form']['disp_topics_default']),
-		'disp_posts_default'	=> intval($_POST['form']['disp_posts_default']),
-		'indent_num_spaces'		=> intval($_POST['form']['indent_num_spaces']),
-		'quote_depth'			=> intval($_POST['form']['quote_depth']),
-		'quickpost'				=> $_POST['form']['quickpost'] != '1' ? '0' : '1',
-		'users_online'			=> $_POST['form']['users_online'] != '1' ? '0' : '1',
-		'censoring'				=> $_POST['form']['censoring'] != '1' ? '0' : '1',
-		'signatures'			=> $_POST['form']['signatures'] != '1' ? '0' : '1',
-		'ranks'					=> $_POST['form']['ranks'] != '1' ? '0' : '1',
-		'show_dot'				=> $_POST['form']['show_dot'] != '1' ? '0' : '1',
-		'topic_views'			=> $_POST['form']['topic_views'] != '1' ? '0' : '1',
-		'quickjump'				=> $_POST['form']['quickjump'] != '1' ? '0' : '1',
-		'gzip'					=> $_POST['form']['gzip'] != '1' ? '0' : '1',
-		'search_all_forums'		=> $_POST['form']['search_all_forums'] != '1' ? '0' : '1',
-		'additional_navlinks'	=> pun_trim($_POST['form']['additional_navlinks']),
-		'feed_type'				=> intval($_POST['form']['feed_type']),
-		'feed_ttl'				=> intval($_POST['form']['feed_ttl']),
-		'report_method'			=> intval($_POST['form']['report_method']),
-		'mailing_list'			=> pun_trim($_POST['form']['mailing_list']),
-		'avatars'				=> $_POST['form']['avatars'] != '1' ? '0' : '1',
-		'avatars_dir'			=> pun_trim($_POST['form']['avatars_dir']),
-		'avatars_width'			=> intval($_POST['form']['avatars_width']),
-		'avatars_height'		=> intval($_POST['form']['avatars_height']),
-		'avatars_size'			=> intval($_POST['form']['avatars_size']),
-		'admin_email'			=> strtolower(pun_trim($_POST['form']['admin_email'])),
-		'webmaster_email'		=> strtolower(pun_trim($_POST['form']['webmaster_email'])),
-		'forum_subscriptions'	=> $_POST['form']['forum_subscriptions'] != '1' ? '0' : '1',
-		'topic_subscriptions'	=> $_POST['form']['topic_subscriptions'] != '1' ? '0' : '1',
-		'smtp_host'				=> pun_trim($_POST['form']['smtp_host']),
-		'smtp_user'				=> pun_trim($_POST['form']['smtp_user']),
-		'smtp_ssl'				=> $_POST['form']['smtp_ssl'] != '1' ? '0' : '1',
-		'regs_allow'			=> $_POST['form']['regs_allow'] != '1' ? '0' : '1',
-		'regs_verify'			=> $_POST['form']['regs_verify'] != '1' ? '0' : '1',
-		'regs_report'			=> $_POST['form']['regs_report'] != '1' ? '0' : '1',
-		'rules'					=> $_POST['form']['rules'] != '1' ? '0' : '1',
-		'rules_message'			=> pun_trim($_POST['form']['rules_message']),
-		'default_email_setting'	=> intval($_POST['form']['default_email_setting']),
-		'announcement'			=> $_POST['form']['announcement'] != '1' ? '0' : '1',
-		'announcement_message'	=> pun_trim($_POST['form']['announcement_message']),
-		'maintenance'			=> $_POST['form']['maintenance'] != '1' ? '0' : '1',
-		'maintenance_message'	=> pun_trim($_POST['form']['maintenance_message']),
-	);
+	// Lazy referer check (in case base_url isn't correct)
+	if (!isset($_SERVER['HTTP_REFERER']) || !preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER']))
+		message($lang_common['Bad referrer']);
+
+	$form = array_map('trim', $_POST['form']);
 
 	if ($form['board_title'] == '')
-		message($lang_admin_options['Must enter title message']);
+		message('Vous devez saisir un titre pour vos forums.');
+
+	require PUN_ROOT.'include/email.php';
+
+	$form['admin_email'] = strtolower($form['admin_email']);
+	if (!is_valid_email($form['admin_email']))
+		message('L\'adresse email administrateur que vous avez saisi est incorrecte.');
+
+	$form['webmaster_email'] = strtolower($form['webmaster_email']);
+	if (!is_valid_email($form['webmaster_email']))
+		message('L\'adresse email webmaster que vous avez saisi est incorrecte.');
+
+	if ($form['mailing_list'] != '')
+		$form['mailing_list'] = strtolower(preg_replace('/[\s]/', '', $form['mailing_list']));
 
 	// Make sure base_url doesn't end with a slash
@@ -95,30 +64,4 @@
 		$form['base_url'] = substr($form['base_url'], 0, -1);
 
-	$languages = forum_list_langs();
-	if (!in_array($form['default_lang'], $languages))
-		message($lang_common['Bad request']);
-
-	$styles = forum_list_styles();
-	if (!in_array($form['default_style'], $styles))
-		message($lang_common['Bad request']);
-
-	if ($form['time_format'] == '')
-		$form['time_format'] = 'H:i:s';
-
-	if ($form['date_format'] == '')
-		$form['date_format'] = 'Y-m-d';
-
-
-	require PUN_ROOT.'include/email.php';
-
-	if (!is_valid_email($form['admin_email']))
-		message($lang_admin_options['Invalid e-mail message']);
-
-	if (!is_valid_email($form['webmaster_email']))
-		message($lang_admin_options['Invalid webmaster e-mail message']);
-
-	if ($form['mailing_list'] != '')
-		$form['mailing_list'] = strtolower(preg_replace('%\s%S', '', $form['mailing_list']));
-
 	// Make sure avatars_dir doesn't end with a slash
 	if (substr($form['avatars_dir'], -1) == '/')
@@ -126,17 +69,5 @@
 
 	if ($form['additional_navlinks'] != '')
-		$form['additional_navlinks'] = pun_trim(pun_linebreaks($form['additional_navlinks']));
-
-	// Change or enter a SMTP password
-	if (isset($_POST['form']['smtp_change_pass']))
-	{
-		$smtp_pass1 = isset($_POST['form']['smtp_pass1']) ? pun_trim($_POST['form']['smtp_pass1']) : '';
-		$smtp_pass2 = isset($_POST['form']['smtp_pass2']) ? pun_trim($_POST['form']['smtp_pass2']) : '';
-
-		if ($smtp_pass1 == $smtp_pass2)
-			$form['smtp_pass'] = $smtp_pass1;
-		else
-			message($lang_admin_options['SMTP passwords did not match']);
-	}
+		$form['additional_navlinks'] = trim(pun_linebreaks($form['additional_navlinks']));
 
 	if ($form['announcement_message'] != '')
@@ -144,6 +75,8 @@
 	else
 	{
-		$form['announcement_message'] = $lang_admin_options['Enter announcement here'];
-		$form['announcement'] = '0';
+		$form['announcement_message'] = 'Saisissez votre annonce ici.';
+
+		if ($form['announcement'] == '1')
+			$form['announcement'] = '0';
 	}
 
@@ -152,6 +85,8 @@
 	else
 	{
-		$form['rules_message'] = $lang_admin_options['Enter rules here'];
-		$form['rules'] = '0';
+		$form['rules_message'] = 'Saisissez les rÃšgles d\'utilisation ici.';
+
+		if ($form['rules'] == '1')
+			$form['rules'] = '0';
 	}
 
@@ -160,35 +95,25 @@
 	else
 	{
-		$form['maintenance_message'] = $lang_admin_options['Default maintenance message'];
-		$form['maintenance'] = '0';
+		$form['maintenance_message'] = 'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Veuillez essayer Ã  nouveau d\'ici quelques minutes.<br />\\n<br />\\n/Administrateur';
+
+		if ($form['maintenance'] == '1')
+			$form['maintenance'] = '0';
 	}
 
-	// Make sure the number of displayed topics and posts is between 3 and 75
-	if ($form['disp_topics_default'] < 3)
-		$form['disp_topics_default'] = 3;
-	else if ($form['disp_topics_default'] > 75)
-		$form['disp_topics_default'] = 75;
-
-	if ($form['disp_posts_default'] < 3)
-		$form['disp_posts_default'] = 3;
-	else if ($form['disp_posts_default'] > 75)
-		$form['disp_posts_default'] = 75;
-
-	if ($form['feed_type'] < 0 || $form['feed_type'] > 2)
-		message($lang_common['Bad request']);
-
-	if ($form['feed_ttl'] < 0)
-		message($lang_common['Bad request']);
-
-	if ($form['report_method'] < 0 || $form['report_method'] > 2)
-		message($lang_common['Bad request']);
-
-	if ($form['default_email_setting'] < 0 || $form['default_email_setting'] > 2)
-		message($lang_common['Bad request']);
+	$form['timeout_visit'] = intval($form['timeout_visit']);
+	$form['timeout_online'] = intval($form['timeout_online']);
+	$form['redirect_delay'] = intval($form['redirect_delay']);
+	$form['topic_review'] = intval($form['topic_review']);
+	$form['disp_topics_default'] = intval($form['disp_topics_default']);
+	$form['disp_posts_default'] = intval($form['disp_posts_default']);
+	$form['indent_num_spaces'] = intval($form['indent_num_spaces']);
+	$form['avatars_width'] = intval($form['avatars_width']);
+	$form['avatars_height'] = intval($form['avatars_height']);
+	$form['avatars_size'] = intval($form['avatars_size']);
 
 	if ($form['timeout_online'] >= $form['timeout_visit'])
-		message($lang_admin_options['Timeout error message']);
-
-	foreach ($form as $key => $input)
+		message('La valeur de "Temps mort en ligne" doit Ãªtre infÃ©rieur Ã  la valeur de "Temps mort de visite".');
+
+	while (list($key, $input) = @each($form))
 	{
 		// Only update values that have changed
@@ -200,20 +125,18 @@
 				$value = 'NULL';
 
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Impossible de mettre Ã  jour la configuration des forums', __FILE__, __LINE__, $db->error());
 		}
 	}
 
 	// Regenerate the config cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_config_cache();
-	clear_feed_cache();
-
-	redirect('admin_options.php', $lang_admin_options['Options updated redirect']);
+
+	redirect('admin_options.php', 'Options modifiÃ©es. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Options']);
-define('PUN_ACTIVE_PAGE', 'admin');
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Options';
+$form_name = 'update_options';
 require PUN_ROOT.'header.php';
 
@@ -222,99 +145,97 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_options['Options head'] ?></span></h2>
+		<h2><span>Options</span></h2>
 		<div class="box">
-			<form method="post" action="admin_options.php">
-				<p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
-				<div class="inform">
-					<input type="hidden" name="form_sent" value="1" />
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Essentials subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Board title label'] ?></th>
+			<form method="post" action="admin_options.php?action=foo">
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer " /></p>
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Essentiel</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Titre forums</th>
 									<td>
 										<input type="text" name="form[board_title]" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>" />
-										<span><?php echo $lang_admin_options['Board title help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Board desc label'] ?></th>
+										<span>Le titre de ces forums (affichÃ© en haut de chaques pages). Ce champ ne peut <strong>pas</strong> contenir d'<acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Description forums</th>
 									<td>
 										<input type="text" name="form[board_desc]" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_config['o_board_desc']) ?>" />
-										<span><?php echo $lang_admin_options['Board desc help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Base URL label'] ?></th>
-									<td>
-										<input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo pun_htmlspecialchars($pun_config['o_base_url']) ?>" />
-										<span><?php echo $lang_admin_options['Base URL help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Timezone label'] ?></th>
-									<td>
-										<select name="form[default_timezone]">
-											<option value="-12"<?php if ($pun_config['o_default_timezone'] == -12) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-12:00'] ?></option>
-											<option value="-11"<?php if ($pun_config['o_default_timezone'] == -11) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-11:00'] ?></option>
-											<option value="-10"<?php if ($pun_config['o_default_timezone'] == -10) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-10:00'] ?></option>
-											<option value="-9.5"<?php if ($pun_config['o_default_timezone'] == -9.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-09:30'] ?></option>
-											<option value="-9"<?php if ($pun_config['o_default_timezone'] == -9) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-09:00'] ?></option>
-											<option value="-8.5"<?php if ($pun_config['o_default_timezone'] == -8.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-08:30'] ?></option>
-											<option value="-8"<?php if ($pun_config['o_default_timezone'] == -8) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-08:00'] ?></option>
-											<option value="-7"<?php if ($pun_config['o_default_timezone'] == -7) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-07:00'] ?></option>
-											<option value="-6"<?php if ($pun_config['o_default_timezone'] == -6) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-06:00'] ?></option>
-											<option value="-5"<?php if ($pun_config['o_default_timezone'] == -5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-05:00'] ?></option>
-											<option value="-4"<?php if ($pun_config['o_default_timezone'] == -4) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-04:00'] ?></option>
-											<option value="-3.5"<?php if ($pun_config['o_default_timezone'] == -3.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-03:30'] ?></option>
-											<option value="-3"<?php if ($pun_config['o_default_timezone'] == -3) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-03:00'] ?></option>
-											<option value="-2"<?php if ($pun_config['o_default_timezone'] == -2) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-02:00'] ?></option>
-											<option value="-1"<?php if ($pun_config['o_default_timezone'] == -1) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC-01:00'] ?></option>
-											<option value="0"<?php if ($pun_config['o_default_timezone'] == 0) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC'] ?></option>
-											<option value="1"<?php if ($pun_config['o_default_timezone'] == 1) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+01:00'] ?></option>
-											<option value="2"<?php if ($pun_config['o_default_timezone'] == 2) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+02:00'] ?></option>
-											<option value="3"<?php if ($pun_config['o_default_timezone'] == 3) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+03:00'] ?></option>
-											<option value="3.5"<?php if ($pun_config['o_default_timezone'] == 3.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+03:30'] ?></option>
-											<option value="4"<?php if ($pun_config['o_default_timezone'] == 4) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+04:00'] ?></option>
-											<option value="4.5"<?php if ($pun_config['o_default_timezone'] == 4.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+04:30'] ?></option>
-											<option value="5"<?php if ($pun_config['o_default_timezone'] == 5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+05:00'] ?></option>
-											<option value="5.5"<?php if ($pun_config['o_default_timezone'] == 5.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+05:30'] ?></option>
-											<option value="5.75"<?php if ($pun_config['o_default_timezone'] == 5.75) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+05:45'] ?></option>
-											<option value="6"<?php if ($pun_config['o_default_timezone'] == 6) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+06:00'] ?></option>
-											<option value="6.5"<?php if ($pun_config['o_default_timezone'] == 6.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+06:30'] ?></option>
-											<option value="7"<?php if ($pun_config['o_default_timezone'] == 7) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+07:00'] ?></option>
-											<option value="8"<?php if ($pun_config['o_default_timezone'] == 8) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+08:00'] ?></option>
-											<option value="8.75"<?php if ($pun_config['o_default_timezone'] == 8.75) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+08:45'] ?></option>
-											<option value="9"<?php if ($pun_config['o_default_timezone'] == 9) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+09:00'] ?></option>
-											<option value="9.5"<?php if ($pun_config['o_default_timezone'] == 9.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+09:30'] ?></option>
-											<option value="10"<?php if ($pun_config['o_default_timezone'] == 10) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+10:00'] ?></option>
-											<option value="10.5"<?php if ($pun_config['o_default_timezone'] == 10.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+10:30'] ?></option>
-											<option value="11"<?php if ($pun_config['o_default_timezone'] == 11) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+11:00'] ?></option>
-											<option value="11.5"<?php if ($pun_config['o_default_timezone'] == 11.5) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+11:30'] ?></option>
-											<option value="12"<?php if ($pun_config['o_default_timezone'] == 12) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+12:00'] ?></option>
-											<option value="12.75"<?php if ($pun_config['o_default_timezone'] == 12.75) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+12:45'] ?></option>
-											<option value="13"<?php if ($pun_config['o_default_timezone'] == 13) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+13:00'] ?></option>
-											<option value="14"<?php if ($pun_config['o_default_timezone'] == 14) echo ' selected="selected"' ?>><?php echo $lang_admin_options['UTC+14:00'] ?></option>
+										<span>Une courte description de vos forums (affichÃ© en haut de chaques pages). Ce champ peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base</th>
+									<td>
+										<input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" />
+										<span>L'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de ces forums sans slash Ã  la fin (ex :  http://www.mon-domaine.com/forums). Ce champ <strong>doit</strong> Ãªtre correct pour que toutes les fonctions administrateurs et modÃ©rateurs soient opÃ©rationnelles. Si vous optenez une erreur "Bad referer", il est probablement incorrect.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Fuseau horaire serveur</th>
+									<td>
+										<select name="form[server_timezone]">
+											<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
+											<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+											<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+											<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-09.5</option>
+											<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
+											<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-08.5</option>
+											<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
+											<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
+											<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
+											<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
+											<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
+											<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-03.5</option>
+											<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
+											<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
+											<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+											<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+											<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+											<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
+											<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
+											<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5) echo ' selected="selected"' ?>>+03.5</option>
+											<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
+											<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5) echo ' selected="selected"' ?>>+04.5</option>
+											<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
+											<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5) echo ' selected="selected"' ?>>+05.5</option>
+											<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
+											<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5) echo ' selected="selected"' ?>>+06.5</option>
+											<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
+											<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
+											<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
+											<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5) echo ' selected="selected"' ?>>+09.5</option>
+											<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+											<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5) echo ' selected="selected"' ?>>+10.5</option>
+											<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+											<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5) echo ' selected="selected"' ?>>+11.5</option>
+											<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
+											<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
 										</select>
-										<span><?php echo $lang_admin_options['Timezone help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['DST label'] ?></th>
-									<td>
-										<input type="radio" name="form[default_dst]" value="1"<?php if ($pun_config['o_default_dst'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[default_dst]" value="0"<?php if ($pun_config['o_default_dst'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['DST help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Language label'] ?></th>
+										<span>Le fuseau horaire du serveur oÃ¹ est installÃ© PunBB.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Langage par dÃ©faut</th>
 									<td>
 										<select name="form[default_lang]">
 <?php
 
-		$languages = forum_list_langs();
-
-		foreach ($languages as $temp)
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			 if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
+		
+		@natsort($languages);
+
+		while (list(, $temp) = @each($languages))
 		{
 			if ($pun_config['o_default_lang'] == $temp)
@@ -326,522 +247,449 @@
 ?>
 										</select>
-										<span><?php echo $lang_admin_options['Language help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Default style label'] ?></th>
+										<span>Choisissez la langue par dÃ©faut qui sera utilisÃ©e si l'utilisateur est un invitÃ© ou pour les utilisateurs qui n'auront pas changÃ© de langage dans leur profil. Si vous supprimez un pack de langage vous devrez mettre Ã  jour ce rÃ©glage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Style par dÃ©faut</th>
 									<td>
 										<select name="form[default_style]">
 <?php
 
-		$styles = forum_list_styles();
-
-		foreach ($styles as $temp)
+		$styles = array();
+		$d = dir(PUN_ROOT.'style');
+		while (($entry = $d->read()) !== false)
+		{
+			if (substr($entry, strlen($entry)-4) == '.css')
+				$styles[] = substr($entry, 0, strlen($entry)-4);
+		}
+		$d->close();
+		
+		@natsort($styles);
+
+		while (list(, $temp) = @each($styles))
 		{
 			if ($pun_config['o_default_style'] == $temp)
-				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
+				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
 			else
-				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
+				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
 		}
 
 ?>
 										</select>
-										<span><?php echo $lang_admin_options['Default style help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-<?php
-
-	$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-	$timestamp = time() + $diff;
-
-?>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Timeouts subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Time format label'] ?></th>
+										<span>SÃ©lÃ©ctionnez le style par dÃ©faut qui sera utilisÃ© par les visiteurs ou les utilisateurs qui n'ont pas changÃ©s de style dans leur profil.</span></td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Dates, heures et limites de temps</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Format heure</th>
 									<td>
 										<input type="text" name="form[time_format]" size="25" maxlength="25" value="<?php echo pun_htmlspecialchars($pun_config['o_time_format']) ?>" />
-										<span><?php printf($lang_admin_options['Time format help'], gmdate($pun_config['o_time_format'], $timestamp), '<a href="http://www.php.net/manual/en/function.date.php">'.$lang_admin_options['PHP manual'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Date format label'] ?></th>
+										<span>[Format actuel : <?php echo date($pun_config['o_time_format']) ?>]&#160;Voir <a href="http://www.php.net/manual/fr/function.date.php">ici</a> pour les options de formatage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Date format</th>
 									<td>
 										<input type="text" name="form[date_format]" size="25" maxlength="25" value="<?php echo pun_htmlspecialchars($pun_config['o_date_format']) ?>" />
-										<span><?php printf($lang_admin_options['Date format help'], gmdate($pun_config['o_date_format'], $timestamp), '<a href="http://www.php.net/manual/en/function.date.php">'.$lang_admin_options['PHP manual'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Visit timeout label'] ?></th>
+										<span>[Format actuel : <?php echo date($pun_config['o_date_format']) ?>]&#160;Voir <a href="http://www.php.net/manual/fr/function.date.php">ici</a> pour les options de formatage.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps mort de visite</th>
 									<td>
 										<input type="text" name="form[timeout_visit]" size="5" maxlength="5" value="<?php echo $pun_config['o_timeout_visit'] ?>" />
-										<span><?php echo $lang_admin_options['Visit timeout help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Online timeout label'] ?></th>
+										<span>Nombre de secondes qu'un utilisateur devra rester inactif avant que les donnÃ©es de sa derniÃšre visite soient mises Ã  jours (affecte principalement les indicateurs de nouveaux messages).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps mort en ligne</th>
 									<td>
 										<input type="text" name="form[timeout_online]" size="5" maxlength="5" value="<?php echo $pun_config['o_timeout_online'] ?>" />
-										<span><?php echo $lang_admin_options['Online timeout help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Redirect time label'] ?></th>
+										<span>Nombre de secondes qu'un utilisateur devra rester inactif avant qu'il ne soit supprimÃ© de la liste des utilisateurs en ligne.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Temps de redirection</th>
 									<td>
 										<input type="text" name="form[redirect_delay]" size="3" maxlength="3" value="<?php echo $pun_config['o_redirect_delay'] ?>" />
-										<span><?php echo $lang_admin_options['Redirect time help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Display subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Version number label'] ?></th>
-									<td>
-										<input type="radio" name="form[show_version]" value="1"<?php if ($pun_config['o_show_version'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[show_version]" value="0"<?php if ($pun_config['o_show_version'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Version number help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Info in posts label'] ?></th>
-									<td>
-										<input type="radio" name="form[show_user_info]" value="1"<?php if ($pun_config['o_show_user_info'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[show_user_info]" value="0"<?php if ($pun_config['o_show_user_info'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Info in posts help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Post count label'] ?></th>
-									<td>
-										<input type="radio" name="form[show_post_count]" value="1"<?php if ($pun_config['o_show_post_count'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[show_post_count]" value="0"<?php if ($pun_config['o_show_post_count'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Post count help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Smilies label'] ?></th>
-									<td>
-										<input type="radio" name="form[smilies]" value="1"<?php if ($pun_config['o_smilies'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[smilies]" value="0"<?php if ($pun_config['o_smilies'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Smilies help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Smilies sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[smilies_sig]" value="1"<?php if ($pun_config['o_smilies_sig'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[smilies_sig]" value="0"<?php if ($pun_config['o_smilies_sig'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Smilies sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Clickable links label'] ?></th>
-									<td>
-										<input type="radio" name="form[make_links]" value="1"<?php if ($pun_config['o_make_links'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[make_links]" value="0"<?php if ($pun_config['o_make_links'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Clickable links help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Topic review label'] ?></th>
+										<span>Nombre de secondes Ã  patienter avant d'Ãªtre redirigÃ©. Si ce champ est rÃ©glÃ© Ã  0, aucune page de redirection ne sera affichÃ©e mais cela n'est pas recommandÃ©.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Afficher</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">NumÃ©ro de version</th>
+									<td>
+										<input type="radio" name="form[show_version]" value="1"<?php if ($pun_config['o_show_version'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_version]" value="0"<?php if ($pun_config['o_show_version'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche le numÃ©ro de version de PunBB en bas de page.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Infos utilisateurs dans les messages</th>
+									<td>
+										<input type="radio" name="form[show_user_info]" value="1"<?php if ($pun_config['o_show_user_info'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_user_info]" value="0"<?php if ($pun_config['o_show_user_info'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche des informations sur les utilisateurs sous leur nom d'utilisateur lorsque l'on affiche un sujet. Affiche le lieu, la date d'inscription, le nombre de message et les liens de contact (e-mail et site web).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages par utilisateur</th>
+									<td>
+										<input type="radio" name="form[show_post_count]" value="1"<?php if ($pun_config['o_show_post_count'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_post_count]" value="0"<?php if ($pun_config['o_show_post_count'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Affiche le nombre de messages qu'un utilisateur a Ã©crit (sur la page d'un sujet, son profil et la liste utilisateurs).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃmoticÃŽnes</th>
+									<td>
+										<input type="radio" name="form[smilies]" value="1"<?php if ($pun_config['o_smilies'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[smilies]" value="0"<?php if ($pun_config['o_smilies'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Convertir les Ã©moticÃŽnes en petites images.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃmoticÃŽnes dans les signatures</th>
+									<td>
+										<input type="radio" name="form[smilies_sig]" value="1"<?php if ($pun_config['o_smilies_sig'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[smilies_sig]" value="0"<?php if ($pun_config['o_smilies_sig'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Convertir les Ã©moticÃŽnes en petites images dans les signatures.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">CrÃ©er des liens cliquables</th>
+									<td>
+										<input type="radio" name="form[make_links]" value="1"<?php if ($pun_config['o_make_links'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[make_links]" value="0"<?php if ($pun_config['o_make_links'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette fonction est activÃ©e, PunBB dÃ©tecte automatiquement lors de l'envoi d'un nouveau message toutes les <acronym title="Uniform Resource Locator" lang="en">URL</acronym> qu'il contient et crÃ©er des liens cliquables.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃ©sumÃ©s des discussions</th>
 									<td>
 										<input type="text" name="form[topic_review]" size="3" maxlength="3" value="<?php echo $pun_config['o_topic_review'] ?>" />
-										<span><?php echo $lang_admin_options['Topic review help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Topics per page label'] ?></th>
+										<span>Nombre maximum  de messages Ã  afficher quand on Ã©crit une rÃ©ponse. 0 pour dÃ©sactiver.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Discussions par page</th>
 									<td>
 										<input type="text" name="form[disp_topics_default]" size="3" maxlength="3" value="<?php echo $pun_config['o_disp_topics_default'] ?>" />
-										<span><?php echo $lang_admin_options['Topics per page help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Posts per page label'] ?></th>
+										<span>Le nombre de discussions par dÃ©faut Ã  afficher sur la page d'un forum. Les utilisateurs inscrits peuvent personnaliser cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Messages par page</th>
 									<td>
 										<input type="text" name="form[disp_posts_default]" size="3" maxlength="3" value="<?php echo $pun_config['o_disp_posts_default'] ?>" />
-										<span><?php echo $lang_admin_options['Posts per page help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Indent label'] ?></th>
+										<span>Le nombre de messages par dÃ©faut Ã  afficher sur la page d'une discussion. Les utilisateurs inscrits peuvent personnaliser cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Taille du retrait</th>
 									<td>
 										<input type="text" name="form[indent_num_spaces]" size="3" maxlength="3" value="<?php echo $pun_config['o_indent_num_spaces'] ?>" />
-										<span><?php echo $lang_admin_options['Indent help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Quote depth label'] ?></th>
-									<td>
-										<input type="text" name="form[quote_depth]" size="3" maxlength="3" value="<?php echo $pun_config['o_quote_depth'] ?>" />
-										<span><?php echo $lang_admin_options['Quote depth help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Features subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Quick post label'] ?></th>
-									<td>
-										<input type="radio" name="form[quickpost]" value="1"<?php if ($pun_config['o_quickpost'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[quickpost]" value="0"<?php if ($pun_config['o_quickpost'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Quick post help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Users online label'] ?></th>
-									<td>
-										<input type="radio" name="form[users_online]" value="1"<?php if ($pun_config['o_users_online'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[users_online]" value="0"<?php if ($pun_config['o_users_online'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Users online help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><a name="censoring"><?php echo $lang_admin_options['Censor words label'] ?></a></th>
-									<td>
-										<input type="radio" name="form[censoring]" value="1"<?php if ($pun_config['o_censoring'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[censoring]" value="0"<?php if ($pun_config['o_censoring'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php printf($lang_admin_options['Censor words help'], '<a href="admin_censoring.php">'.$lang_admin_common['Censoring'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><a name="signatures"><?php echo $lang_admin_options['Signatures label'] ?></a></th>
-									<td>
-										<input type="radio" name="form[signatures]" value="1"<?php if ($pun_config['o_signatures'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[signatures]" value="0"<?php if ($pun_config['o_signatures'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Signatures help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><a name="ranks"><?php echo $lang_admin_options['User ranks label'] ?></a></th>
-									<td>
-										<input type="radio" name="form[ranks]" value="1"<?php if ($pun_config['o_ranks'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[ranks]" value="0"<?php if ($pun_config['o_ranks'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php printf($lang_admin_options['User ranks help'], '<a href="admin_ranks.php">'.$lang_admin_common['Ranks'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['User has posted label'] ?></th>
-									<td>
-										<input type="radio" name="form[show_dot]" value="1"<?php if ($pun_config['o_show_dot'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[show_dot]" value="0"<?php if ($pun_config['o_show_dot'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['User has posted help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Topic views label'] ?></th>
-									<td>
-										<input type="radio" name="form[topic_views]" value="1"<?php if ($pun_config['o_topic_views'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[topic_views]" value="0"<?php if ($pun_config['o_topic_views'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Topic views help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Quick jump label'] ?></th>
-									<td>
-										<input type="radio" name="form[quickjump]" value="1"<?php if ($pun_config['o_quickjump'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[quickjump]" value="0"<?php if ($pun_config['o_quickjump'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Quick jump help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['GZip label'] ?></th>
-									<td>
-										<input type="radio" name="form[gzip]" value="1"<?php if ($pun_config['o_gzip'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[gzip]" value="0"<?php if ($pun_config['o_gzip'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['GZip help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Search all label'] ?></th>
-									<td>
-										<input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Search all help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Menu items label'] ?></th>
+										<span>Si rÃ©glÃ©e Ã  8, une tabulation usuelle sera utilisÃ©e pour afficher du texte avec les balises [code][/code]. Sinon c'est le nombre d'espaces qui sera utilisÃ© pour mettre en retrait le texte.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>FonctionnalitÃ©s</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">RÃ©ponse rapide</th>
+									<td>
+										<input type="radio" name="form[quickpost]" value="1"<?php if ($pun_config['o_quickpost'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[quickpost]" value="0"<?php if ($pun_config['o_quickpost'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Lorsque cette option est activÃ©e, PunBB ajoute un formulaire de rÃ©ponse au bas des discussions. Ceci permet aux utilisateurs d'Ã©crire des rÃ©ponses directement depuis l'Ã©cran de lecture des discussions.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Utilisateurs en ligne</th>
+									<td>
+										<input type="radio" name="form[users_online]" value="1"<?php if ($pun_config['o_users_online'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[users_online]" value="0"<?php if ($pun_config['o_users_online'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Affiche sur la page d'accueil des forums des informations concernant les utilisateurs qui sont en ligne lors de l'affichage de la page.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><a name="censoring">Mots Ã  censurer</a></th>
+									<td>
+										<input type="radio" name="form[censoring]" value="1"<?php if ($pun_config['o_censoring'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[censoring]" value="0"<?php if ($pun_config['o_censoring'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour censurer des mots prÃ©dÃ©finis. Pour plus d'information, voir la page d'administration des <a href="admin_censoring.php">Mots censurÃ©s</a>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row"><a name="ranks">Rangs utilisateurs</a></th>
+									<td>
+										<input type="radio" name="form[ranks]" value="1"<?php if ($pun_config['o_ranks'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[ranks]" value="0"<?php if ($pun_config['o_ranks'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour utiliser les rangs utilisateurs. Pour plus d'information, voir la page d'administration des <a href="admin_ranks.php">Rangs utilisateurs</a>.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Utilisateur a Ã©crit recemment</th>
+									<td>
+										<input type="radio" name="form[show_dot]" value="1"<?php if ($pun_config['o_show_dot'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[show_dot]" value="0"<?php if ($pun_config['o_show_dot'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Cette fonctionnalitÃ© permet d'afficher un point devant les sujets dans le cas oÃ¹ l'utilisateur identifiÃ© aurait rÃ©cemment Ã©crit dans les sujets. DÃ©sactivez si vous constatez d'importantes charges serveur.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Saut rapide</th>
+									<td>
+										<input type="radio" name="form[quickjump]" value="1"<?php if ($pun_config['o_quickjump'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[quickjump]" value="0"<?php if ($pun_config['o_quickjump'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Active le menu dÃ©roulant de saut rapide (saut de forum en forum).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Compression GZip</th>
+									<td>
+										<input type="radio" name="form[gzip]" value="1"<?php if ($pun_config['o_gzip'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[gzip]" value="0"<?php if ($pun_config['o_gzip'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Si activÃ©e, PunBB compressera la sortie envoyÃ©e aux navigateurs. Ceci devrait rÃ©duire la consommation de bande passante mais utilisera un peu plus le <acronym title="Central Processing Unit" lang="en">CPU</acronym> (processeur systÃšme). Cette option nÃ©cessite que <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> soit configurÃ© avec zlib (--with-zlib). Note : Si vous avez dÃ©jÃ  un des modules Apache mod_gzip ou mod_deflate d'installÃ© et de configurÃ© pour compresser les scripts <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym>, vous pouvez alors dÃ©sactiver cette option.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Recherche dans tous les forums</th>
+									<td>
+										<input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette option est dÃ©sactivÃ©e, les recherches ne peuvent Ãªtres effectuÃ©es que sur un forum Ã  la fois. DÃ©sactivez si la charge serveur est Ã©levÃ©e Ã  cause d'un nombre trop important de recherches.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Items de menu additionnels</th>
 									<td>
 										<textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_additional_navlinks']) ?></textarea>
-										<span><?php echo $lang_admin_options['Menu items help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Feed subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Default feed label'] ?></th>
-									<td>
-										<input type="radio" name="form[feed_type]" value="0"<?php if ($pun_config['o_feed_type'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['None'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[feed_type]" value="1"<?php if ($pun_config['o_feed_type'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['RSS'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[feed_type]" value="2"<?php if ($pun_config['o_feed_type'] == '2') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['Atom'] ?></strong>
-										<span><?php echo $lang_admin_options['Default feed help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Feed TTL label'] ?></th>
-									<td>
-										<select name="form[feed_ttl]">
-											<option value="0"<?php if ($pun_config['o_feed_ttl'] == '0') echo ' selected="selected"'; ?>><?php echo $lang_admin_options['No cache'] ?></option>
-<?php
-
-		$times = array(5, 15, 30, 60);
-
-		foreach ($times as $time)
-			echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$time.'"'.($pun_config['o_feed_ttl'] == $time ? ' selected="selected"' : '').'>'.sprintf($lang_admin_options['Minutes'], $time).'</option>'."\n";
-
-?>
-										</select>
-										<span><?php echo $lang_admin_options['Feed TTL help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Reports subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Reporting method label'] ?></th>
-									<td>
-										<input type="radio" name="form[report_method]" value="0"<?php if ($pun_config['o_report_method'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['Internal'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="1"<?php if ($pun_config['o_report_method'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['By e-mail'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="2"<?php if ($pun_config['o_report_method'] == '2') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_options['Both'] ?></strong>
-										<span><?php echo $lang_admin_options['Reporting method help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Mailing list label'] ?></th>
+										<span>En entrant des liens hypertext <acronym title="HyperText Markup Language" lang="en">HTML</acronym> dans cette boite de saisie, autant d'items seront ajoutÃ©s au menu de navigation en haut de toutes les pages. Le format pour ajouter un nouveau lien est   X = &lt;a href="URL"&gt;LIEN&lt;/a&gt; oÃ¹ X est la position Ã  laquelle le lien devra Ãªtre insÃ©rÃ© (<abbr title="exemple">ex.</abbr> 0 pour insÃ©rer au dÃ©but et 2 pour insÃ©rer aprÃšs la Â«&#160;liste des membres&#160;Â»). SÃ©parez chaque entrÃ©e par un retour Ã  la ligne.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Signalements</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">MÃ©thode de signalement</th>
+									<td>
+										<input type="radio" name="form[report_method]" value="0"<?php if ($pun_config['o_report_method'] == '0') echo ' checked="checked"' ?> />&#160;Interne&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="1"<?php if ($pun_config['o_report_method'] == '1') echo ' checked="checked"' ?> />&#160;E-mail&#160;&#160;&#160;<input type="radio" name="form[report_method]" value="2"<?php if ($pun_config['o_report_method'] == '2') echo ' checked="checked"' ?> />&#160;Les deux
+										<span>Choisissez la mÃ©thode pour Ãªtre avertis de nouveaux signalements. Pour la mÃ©thode par e-mail la liste d'adresses ci-dessous sera utilisÃ©e.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Signalement nouvelle inscription</th>
+									<td>
+										<input type="radio" name="form[regs_report]" value="1"<?php if ($pun_config['o_regs_report'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_report]" value="0"<?php if ($pun_config['o_regs_report'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Si activÃ©e, PunBB enverra un e-mail Ã  chacune des adresses de la liste ci-dessous Ã  chaque nouvelle inscription sur les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Liste d'adresses e-mail</th>
 									<td>
 										<textarea name="form[mailing_list]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_mailing_list']) ?></textarea>
-										<span><?php echo $lang_admin_options['Mailing list help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Avatars subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Use avatars label'] ?></th>
-									<td>
-										<input type="radio" name="form[avatars]" value="1"<?php if ($pun_config['o_avatars'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[avatars]" value="0"<?php if ($pun_config['o_avatars'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Use avatars help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Upload directory label'] ?></th>
+										<span>Utilisez une virgule pour sÃ©parer les adresses. Les adresses de cette liste sont les destinataires des signalements envoyÃ©s par e-mail.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Avatars</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Utiliser les avatars</th>
+									<td>
+										<input type="radio" name="form[avatars]" value="1"<?php if ($pun_config['o_avatars'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[avatars]" value="0"<?php if ($pun_config['o_avatars'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Si cette option est activÃ©e, les utilisateurs pourront envoyer sur le serveur un avatar qui sera affichÃ© sous leur titre/rang.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃ©pertoire avatars</th>
 									<td>
 										<input type="text" name="form[avatars_dir]" size="35" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_avatars_dir']) ?>" />
-										<span><?php echo $lang_admin_options['Upload directory help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Max width label'] ?></th>
+										<span>Le dossier oÃ¹ les avatars seront envoyÃ©s (chemin relatif au dossier racine de PunBB). <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> doit avoir les droits en Ã©criture dans ce rÃ©pertoire.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Largeur maximum</th>
 									<td>
 										<input type="text" name="form[avatars_width]" size="5" maxlength="5" value="<?php echo $pun_config['o_avatars_width'] ?>" />
-										<span><?php echo $lang_admin_options['Max width help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Max height label'] ?></th>
+										<span>La largeur maximum admise (exprimÃ©e en pixels) pour les avatars (60 est recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Hauteur maximum</th>
 									<td>
 										<input type="text" name="form[avatars_height]" size="5" maxlength="5" value="<?php echo $pun_config['o_avatars_height'] ?>" />
-										<span><?php echo $lang_admin_options['Max height help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Max size label'] ?></th>
+										<span>La hauteur maximum admise (exprimÃ©e en pixels) pour les avatars (60 est recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Taile maximum</th>
 									<td>
 										<input type="text" name="form[avatars_size]" size="6" maxlength="6" value="<?php echo $pun_config['o_avatars_size'] ?>" />
-										<span><?php echo $lang_admin_options['Max size help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['E-mail subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Admin e-mail label'] ?></th>
-									<td>
-										<input type="text" name="form[admin_email]" size="50" maxlength="80" value="<?php echo $pun_config['o_admin_email'] ?>" />
-										<span><?php echo $lang_admin_options['Admin e-mail help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Webmaster e-mail label'] ?></th>
-									<td>
-										<input type="text" name="form[webmaster_email]" size="50" maxlength="80" value="<?php echo $pun_config['o_webmaster_email'] ?>" />
-										<span><?php echo $lang_admin_options['Webmaster e-mail help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Forum subscriptions label'] ?></th>
-									<td>
-										<input type="radio" name="form[forum_subscriptions]" value="1"<?php if ($pun_config['o_forum_subscriptions'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[forum_subscriptions]" value="0"<?php if ($pun_config['o_forum_subscriptions'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Forum subscriptions help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Topic subscriptions label'] ?></th>
-									<td>
-										<input type="radio" name="form[topic_subscriptions]" value="1"<?php if ($pun_config['o_topic_subscriptions'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[topic_subscriptions]" value="0"<?php if ($pun_config['o_topic_subscriptions'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Topic subscriptions help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['SMTP address label'] ?></th>
+										<span>La taille maximum admise (exprimÃ©e en bytes) pour les avatars (10240 est recommandÃ©).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>E-mail</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">E-mail administrateur</th>
+									<td>
+										<input type="text" name="form[admin_email]" size="50" maxlength="50" value="<?php echo $pun_config['o_admin_email'] ?>" />
+										<span>L'adresse e-mail de l'administrateur des forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail webmaster</th>
+									<td>
+										<input type="text" name="form[webmaster_email]" size="50" maxlength="50" value="<?php echo $pun_config['o_webmaster_email'] ?>" />
+										<span>Ceci est l'adresse qui sera utilisÃ©e par tous les messages envoyÃ©s par les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Abonnements</th>
+									<td>
+										<input type="radio" name="form[subscriptions]" value="1"<?php if ($pun_config['o_subscriptions'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[subscriptions]" value="0"<?php if ($pun_config['o_subscriptions'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activer l'abonnement des utilisateurs aux discussions  (rÃ©ception d'un e-mail lors d'une rÃ©ponse).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Adresse serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
 									<td>
 										<input type="text" name="form[smtp_host]" size="30" maxlength="100" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_host']) ?>" />
-										<span><?php echo $lang_admin_options['SMTP address help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['SMTP username label'] ?></th>
+										<span>L'adresse d'un serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> externe pour envoyer des e-mails. Vous pouvez spÃ©cifier un numÃ©ro de port si le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> n'utilise pas le port par dÃ©faut 25 (<abbr title="exemple">ex.</abbr> smtp.monhote.com:3580). Laissez vide pour utiliser le programme local d'envoi d'e-mails.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nom d'utilisateur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
 									<td>
 										<input type="text" name="form[smtp_user]" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_user']) ?>" />
-										<span><?php echo $lang_admin_options['SMTP username help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['SMTP password label'] ?></th>
-									<td>
-										<span><input type="checkbox" name="form[smtp_change_pass]" value="1" />&#160;&#160;<?php echo $lang_admin_options['SMTP change password help'] ?></span>
-<?php $smtp_pass = !empty($pun_config['o_smtp_pass']) ? random_key(pun_strlen($pun_config['o_smtp_pass']), true) : ''; ?>
-										<input type="password" name="form[smtp_pass1]" size="25" maxlength="50" value="<?php echo $smtp_pass ?>" />
-										<input type="password" name="form[smtp_pass2]" size="25" maxlength="50" value="<?php echo $smtp_pass ?>" />
-										<span><?php echo $lang_admin_options['SMTP password help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['SMTP SSL label'] ?></th>
-									<td>
-										<input type="radio" name="form[smtp_ssl]" value="1"<?php if ($pun_config['o_smtp_ssl'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[smtp_ssl]" value="0"<?php if ($pun_config['o_smtp_ssl'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['SMTP SSL help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Registration subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Allow new label'] ?></th>
-									<td>
-										<input type="radio" name="form[regs_allow]" value="1"<?php if ($pun_config['o_regs_allow'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[regs_allow]" value="0"<?php if ($pun_config['o_regs_allow'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Allow new help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Verify label'] ?></th>
-									<td>
-										<input type="radio" name="form[regs_verify]" value="1"<?php if ($pun_config['o_regs_verify'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[regs_verify]" value="0"<?php if ($pun_config['o_regs_verify'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Verify help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Report new label'] ?></th>
-									<td>
-										<input type="radio" name="form[regs_report]" value="1"<?php if ($pun_config['o_regs_report'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[regs_report]" value="0"<?php if ($pun_config['o_regs_report'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Report new help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Use rules label'] ?></th>
-									<td>
-										<input type="radio" name="form[rules]" value="1"<?php if ($pun_config['o_rules'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[rules]" value="0"<?php if ($pun_config['o_rules'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Use rules help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Rules label'] ?></th>
+										<span>Nom d'utilisateur du serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym>. Saisissez un nom d'utilisateur seulement si cela est nÃ©cessaire pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> (la plupart des serveurs <strong>ne demande pas</strong> d'authentification).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Mot de passe <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym></th>
+									<td>
+										<input type="text" name="form[smtp_pass]" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($pun_config['o_smtp_pass']) ?>" />
+										<span>Le mot de passe pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym>. Saisissez un mot de passe seulement si cela est nÃ©cessaire pour le serveur <acronym title="Simple Mail Transfer Protocol" lang="en">SMTP</acronym> (la plupart des serveurs <strong>ne demande pas</strong> d'authentification).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Inscriptions</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Autoriser les nouvelles inscriptions</th>
+									<td>
+										<input type="radio" name="form[regs_allow]" value="1"<?php if ($pun_config['o_regs_allow'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_allow]" value="0"<?php if ($pun_config['o_regs_allow'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Permet d'accepter ou non les nouvelles inscriptions aux forums. DÃ©sactivez seulement en cas de circonstances spÃ©ciales.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">VÃ©rification des inscriptions</th>
+									<td>
+										<input type="radio" name="form[regs_verify]" value="1"<?php if ($pun_config['o_regs_verify'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[regs_verify]" value="0"<?php if ($pun_config['o_regs_verify'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Si cette option est activÃ©e, lors de leur inscription les utilisateurs recevront par e-mail un mot de passe alÃ©atoire. Ils pourront alors s'identifier et, si ils le souhaitent, changer le mot de passe depuis leur profil. Cette option nÃ©cessite que les utilisateurs valident leur adresse e-mail si jamais ils veulent la changer depuis leur profil. C'est une bonne mÃ©thode pour limiter les incriptions abusives et pour Ãªtre sÃ»r que les utilisateurs ont une adresse e-mail valide dans leur profil.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Activer rÃšgles d'utilisation</th>
+									<td>
+										<input type="radio" name="form[rules]" value="1"<?php if ($pun_config['o_rules'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[rules]" value="0"<?php if ($pun_config['o_rules'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette option est activÃ©e, les utilisateurs devront accepter les rÃšgles d'utilisation lors de leur inscription (saisissez le texte ci-dessous). Les rÃšgles d'utilisation seront Ã©galement consultables depuis un lien situÃ© dans la barre principale en haut de chaque pages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">RÃšgles d'utilisation</th>
 									<td>
 										<textarea name="form[rules_message]" rows="10" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_rules_message']) ?></textarea>
-										<span><?php echo $lang_admin_options['Rules help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['E-mail default label'] ?></th>
-									<td>
-										<span><?php echo $lang_admin_options['E-mail default help'] ?></span>
-										<input type="radio" name="form[default_email_setting]" value="0"<?php if ($pun_config['o_default_email_setting'] == '0') echo ' checked="checked"' ?> />&#160;<?php echo $lang_admin_options['Display e-mail label'] ?><br />
-										<input type="radio" name="form[default_email_setting]" value="1"<?php if ($pun_config['o_default_email_setting'] == '1') echo ' checked="checked"' ?> />&#160;<?php echo $lang_admin_options['Hide allow form label'] ?><br />
-										<input type="radio" name="form[default_email_setting]" value="2"<?php if ($pun_config['o_default_email_setting'] == '2') echo ' checked="checked"' ?> />&#160;<?php echo $lang_admin_options['Hide both label'] ?><br />
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Announcement subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Display announcement label'] ?></th>
-									<td>
-										<input type="radio" name="form[announcement]" value="1"<?php if ($pun_config['o_announcement'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[announcement]" value="0"<?php if ($pun_config['o_announcement'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Display announcement help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Announcement message label'] ?></th>
+										<span>Ici vous pouvez saisir toutes les rÃšgles d'utilisation ou toutes autres informations que les utilisateurs devront lire et accepter lors de leur inscription. Si vous activez les rÃšgles d'utilisation ci-dessus vous devez saisir quelque chose ici, sinon elles seront dÃ©sactivÃ©es. Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Annonce</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Afficher annonce</th>
+									<td>
+										<input type="radio" name="form[announcement]" value="1"<?php if ($pun_config['o_announcement'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[announcement]" value="0"<?php if ($pun_config['o_announcement'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Activez cette option pour afficher sur les forums le texte ci-dessous.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message de l'annonce</th>
 									<td>
 										<textarea name="form[announcement_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_announcement_message']) ?></textarea>
-										<span><?php echo $lang_admin_options['Announcement message help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_options['Maintenance subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><a name="maintenance"><?php echo $lang_admin_options['Maintenance mode label'] ?></a></th>
-									<td>
-										<input type="radio" name="form[maintenance]" value="1"<?php if ($pun_config['o_maintenance'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[maintenance]" value="0"<?php if ($pun_config['o_maintenance'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_options['Maintenance mode help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_options['Maintenance message label'] ?></th>
+										<span>Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Maintenance</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row"><a name="maintenance">Mode maintenance</a></th>
+									<td>
+										<input type="radio" name="form[maintenance]" value="1"<?php if ($pun_config['o_maintenance'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[maintenance]" value="0"<?php if ($pun_config['o_maintenance'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Lorsque cette fonctionnalitÃ© est activÃ©e, les forums ne seront disponibles que pour les administrateurs. Ceci peut Ãªtre utilisÃ© si les forums doivent Ãªtre fermÃ©s temporairement pour maintenance. ATTENTION ! Ne vous dÃ©connectez pas lorsque les forums sont en mode maintenance. Vous ne pourrez pas vous reconnecter.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message de maintenance</th>
 									<td>
 										<textarea name="form[maintenance_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_maintenance_message']) ?></textarea>
-										<span><?php echo $lang_admin_options['Maintenance message help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
+										<span>Le message qui sera affichÃ© aux utilisateurs lorsque les forums sont en mode maintenance. Si laissÃ© vide, le message par dÃ©faut sera utilisÃ©. Ce texte n'est pas analysÃ© comme un message des forums et peut contenir du <acronym title="HyperText Markup Language" lang="en">HTML</acronym>.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
 			</form>
 		</div>
Index: /trunk/web/punbb/admin_permissions.php
===================================================================
--- /trunk/web/punbb/admin_permissions.php	(revision 10)
+++ /trunk/web/punbb/admin_permissions.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_permissions.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_permissions.php';
 
 if (isset($_POST['form_sent']))
@@ -27,145 +42,181 @@
 	$form = array_map('intval', $_POST['form']);
 
-	foreach ($form as $key => $input)
+	while (list($key, $input) = @each($form))
 	{
 		// Only update values that have changed
 		if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Impossible de mettre Ã  jour la configuration des forums', __FILE__, __LINE__, $db->error());
 	}
 
 	// Regenerate the config cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_config_cache();
 
-	redirect('admin_permissions.php', $lang_admin_permissions['Perms updated redirect']);
+	redirect('admin_permissions.php', 'Permissions modifiÃ©es. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Permissions']);
-define('PUN_ACTIVE_PAGE', 'admin');
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
 require PUN_ROOT.'header.php';
-
 generate_admin_menu('permissions');
 
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_permissions['Permissions head'] ?></span></h2>
+		<h2><span>Permissions</span></h2>
 		<div class="box">
 			<form method="post" action="admin_permissions.php">
-				<p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
-				<div class="inform">
-					<input type="hidden" name="form_sent" value="1" />
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Posting subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['BBCode label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['BBCode help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Image tag label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Image tag help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps message label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps message help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps subject label'] ?></th>
-									<td>
-										<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps subject help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Require e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Require e-mail help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Signatures subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['BBCode sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['BBCode sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Image tag sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Image tag sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Max sig length label'] ?></th>
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer " /></p>
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Ãcriture</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode</th>
+									<td>
+										<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisaton du BBCode dans les messages (recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise Image</th>
+									<td>
+										<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans les messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les messages qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Sujet tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les sujets qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail invitÃ© obligatoire</th>
+									<td>
+										<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Obliger les invitÃ©s Ã  donner une adresse e-mail pour Ã©crire un message.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Signatures</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation du BBCodes dans les signatures des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise image dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans la signature des utilisateurs (non recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Signature tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les signatures qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Longueur maximum des signatures</th>
 									<td>
 										<input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
-										<span><?php echo $lang_admin_permissions['Max sig length help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Max sig lines label'] ?></th>
+										<span>Le nombre maximum de caractÃšres qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre maximum de lignes dans les signatures</th>
 									<td>
 										<input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
-										<span><?php echo $lang_admin_permissions['Max sig lines help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Registration subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Banned e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Banned e-mail help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Duplicate e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Duplicate e-mail help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
+										<span>Le nombre maximum de lignes qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>ModÃ©rateurs</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Modifier les profils utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_edit_users]" value="1"<?php if ($pun_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_edit_users]" value="0"<?php if ($pun_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  modifier les profils des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Renommer utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_rename_users]" value="1"<?php if ($pun_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_rename_users]" value="0"<?php if ($pun_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  renommer les utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Changer les mots de passe des utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_change_passwords]" value="1"<?php if ($pun_config['p_mod_change_passwords'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_change_passwords]" value="0"<?php if ($pun_config['p_mod_change_passwords'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  changer les mots de passe des utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Bannir utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_ban_users]" value="1"<?php if ($pun_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_ban_users]" value="0"<?php if ($pun_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  bannir les utilisateurs (et modifier/supprimer les bannissements en cours).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Inscriptions</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail bannies</th>
+									<td>
+										<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire (ou changer d'adresse) avec une adresse/un domaine e-mail bannis. Si vous laissez cette option Ã  son rÃ©glage par dÃ©faut (oui) ceci sera possible mais une alerte par e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums (une maniÃšre efficace pour dÃ©tecter les inscriptions multiples).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail en double</th>
+									<td>
+										<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire avec une adresse e-mail dÃ©jÃ  utilisÃ©e par un autre nom d'utilisateur. Si autorisÃ© une alerte e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums lorsqu'un doublon sera dÃ©tectÃ©.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
 			</form>
 		</div>
Index: /trunk/web/punbb/admin_ranks.php
===================================================================
--- /trunk/web/punbb/admin_ranks.php	(revision 10)
+++ /trunk/web/punbb/admin_ranks.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_ranks.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_ranks.php';
 
 // Add a rank
@@ -26,27 +41,25 @@
 	confirm_referrer('admin_ranks.php');
 
-	$rank = pun_trim($_POST['new_rank']);
-	$min_posts = trim($_POST['new_min_posts']);
+	$rank = trim($_POST['new_rank']);
+	$min_posts = $_POST['new_min_posts'];
 
 	if ($rank == '')
-		message($lang_admin_ranks['Must enter title message']);
+		message('Vous devez saisir un titre au rang.');
 
-	if ($min_posts == '' || preg_match('%[^0-9]%', $min_posts))
-		message($lang_admin_ranks['Must be integer message']);
+	if (!preg_match('#^\d+$#', $min_posts))
+		message('Le nombre minimum de messages doit Ãªtre un entier positif.');
 
 	// Make sure there isn't already a rank with the same min_posts value
 	$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error());
 	if ($db->num_rows($result))
-		message(sprintf($lang_admin_ranks['Dupe min posts message'], $min_posts));
+		message('Il y a dÃ©jÃ  un rang avec un nombre minimum de '.$min_posts.'messages.');
 
-	$db->query('INSERT INTO '.$db->prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($rank).'\', '.$min_posts.')') or error('Unable to add rank', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($rank).'\', '.$min_posts.')') or error('Impossible d\'ajouter le rang', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the ranks cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_ranks_cache();
 
-	redirect('admin_ranks.php', $lang_admin_ranks['Rank added redirect']);
+	redirect('admin_ranks.php', 'Rang ajoutÃ©. Redirection ...');
 }
 
@@ -59,27 +72,25 @@
 	$id = intval(key($_POST['update']));
 
-	$rank = pun_trim($_POST['rank'][$id]);
+	$rank = trim($_POST['rank'][$id]);
 	$min_posts = trim($_POST['min_posts'][$id]);
 
 	if ($rank == '')
-		message($lang_admin_ranks['Must enter title message']);
+		message('You must enter a rank title.');
 
-	if ($min_posts == '' || preg_match('%[^0-9]%', $min_posts))
-		message($lang_admin_ranks['Must be integer message']);
+	if (!preg_match('#^\d+$#', $min_posts))
+		message('Le nombre minimum de messages doit Ãªtre un entier positif.');
 
 	// Make sure there isn't already a rank with the same min_posts value
-	$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' AND min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' && min_posts='.$min_posts) or error('Impossible de retrouver les informations des rangs', __FILE__, __LINE__, $db->error());
 	if ($db->num_rows($result))
-		message(sprintf($lang_admin_ranks['Dupe min posts message'], $min_posts));
+		message('Il y a dÃ©jÃ  un rang avec un nombre minimum de '.$min_posts.' messages.');
 
-	$db->query('UPDATE '.$db->prefix.'ranks SET rank=\''.$db->escape($rank).'\', min_posts='.$min_posts.' WHERE id='.$id) or error('Unable to update rank', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'ranks SET rank=\''.$db->escape($rank).'\', min_posts='.$min_posts.' WHERE id='.$id) or error('Impossible de modifier les rangs', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the ranks cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_ranks_cache();
 
-	redirect('admin_ranks.php', $lang_admin_ranks['Rank updated redirect']);
+	redirect('admin_ranks.php', 'Rangs modifiÃ©s. Redirection ...');
 }
 
@@ -92,18 +103,16 @@
 	$id = intval(key($_POST['remove']));
 
-	$db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Impossible de supprimer le rang', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the ranks cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_ranks_cache();
 
-	redirect('admin_ranks.php', $lang_admin_ranks['Rank removed redirect']);
+	redirect('admin_ranks.php', 'Rang supprimÃ©. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Ranks']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Rangs';
 $focus_element = array('ranks', 'new_rank');
-define('PUN_ACTIVE_PAGE', 'admin');
 require PUN_ROOT.'header.php';
 
@@ -112,25 +121,25 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_ranks['Ranks head'] ?></span></h2>
+		<h2><span>Rangs</span></h2>
 		<div class="box">
-			<form id="ranks" method="post" action="admin_ranks.php">
+			<form id="ranks" method="post" action="admin_ranks.php?action=foo">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_ranks['Add rank subhead'] ?></legend>
+						<legend>Ajouter un rang</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_ranks['Add rank info'].' '.($pun_config['o_ranks'] == '1' ? sprintf($lang_admin_ranks['Ranks enabled'], '<a href="admin_options.php#ranks">'.$lang_admin_common['Options'].'</a>') : sprintf($lang_admin_ranks['Ranks disabled'], '<a href="admin_options.php#ranks">'.$lang_admin_common['Options'].'</a>')) ?></p>
-							<table cellspacing="0">
+							<p>Saisissez un titre de rang et un nombre minimum de messages que l'utilisateur devra atteindre afin d'obtenir ce rang. Plusieurs rangs ne peuvent avoir le mÃªme nombre minimum de messages. Si un titre est donnÃ© Ã  un utilisateur, le titre sera affichÃ© Ã  la place du rang. <strong>Les rangs utilisateurs doivent Ãªtres activÃ©s Ã  la page <a href="admin_options.php#ranks">Options</a> pour qu'ils aient un quelconque effet.</strong></p>
+							<table  cellspacing="0">
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_ranks['Rank title label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_ranks['Minimum posts label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_ranks['Actions label'] ?></th>
+									<th class="tcl" scope="col">Titre du rang</th>
+									<th class="tc2" scope="col">Nombre minimum de messages</th>
+									<th class="hidehead" scope="col">Action</th>
 								</tr>
 							</thead>
 							<tbody>
 								<tr>
-									<td class="tcl"><input type="text" name="new_rank" size="24" maxlength="50" tabindex="1" /></td>
-									<td class="tc2"><input type="text" name="new_min_posts" size="7" maxlength="7" tabindex="2" /></td>
-									<td><input type="submit" name="add_rank" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="3" /></td>
+									<td><input type="text" name="new_rank" size="24" maxlength="50" tabindex="1" /></td>
+									<td><input type="text" name="new_min_posts" size="7" maxlength="7" tabindex="2" /></td>
+									<td><input type="submit" name="add_rank" value=" Ajouter " tabindex="3" /></td>
 								</tr>
 							</tbody>
@@ -141,19 +150,19 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_ranks['Edit remove subhead'] ?></legend>
+						<legend>Modifier/supprimer les rangs</legend>
 						<div class="infldset">
 <?php
 
-$result = $db->query('SELECT id, rank, min_posts FROM '.$db->prefix.'ranks ORDER BY min_posts') or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT id, rank, min_posts FROM '.$db->prefix.'ranks ORDER BY min_posts') or error('Impossible de retrouver la liste des rangs', __FILE__, __LINE__, $db->error());
 if ($db->num_rows($result))
 {
 
 ?>
-							<table cellspacing="0">
+							<table  cellspacing="0">
 							<thead>
 								<tr>
-									<th class="tcl" scope="col"><?php echo $lang_admin_ranks['Rank title label'] ?></th>
-									<th class="tc2" scope="col"><?php echo $lang_admin_ranks['Minimum posts label'] ?></th>
-									<th class="hidehead" scope="col"><?php echo $lang_admin_ranks['Actions label'] ?></th>
+									<th class="tcl" scope="col"><strong>Titre du rang</strong></th>
+									<th class="tc2" scope="col"><strong>Nombre minimum de messages</strong></th>
+									<th class="hidehead" scope="col">Actions</th>
 								</tr>
 							</thead>
@@ -162,5 +171,5 @@
 
 	while ($cur_rank = $db->fetch_assoc($result))
-		echo "\t\t\t\t\t\t\t\t".'<tr><td class="tcl"><input type="text" name="rank['.$cur_rank['id'].']" value="'.pun_htmlspecialchars($cur_rank['rank']).'" size="24" maxlength="50" /></td><td class="tc2"><input type="text" name="min_posts['.$cur_rank['id'].']" value="'.$cur_rank['min_posts'].'" size="7" maxlength="7" /></td><td><input type="submit" name="update['.$cur_rank['id'].']" value="'.$lang_admin_common['Update'].'" />&#160;<input type="submit" name="remove['.$cur_rank['id'].']" value="'.$lang_admin_common['Remove'].'" /></td></tr>'."\n";
+		echo "\t\t\t\t\t\t\t\t".'<tr><td><input type="text" name="rank['.$cur_rank['id'].']" value="'.pun_htmlspecialchars($cur_rank['rank']).'" size="24" maxlength="50" /></td><td><input type="text" name="min_posts['.$cur_rank['id'].']" value="'.$cur_rank['min_posts'].'" size="7" maxlength="7" /></td><td><input type="submit" name="update['.$cur_rank['id'].']" value="Modifier" />&#160;<input type="submit" name="remove['.$cur_rank['id'].']" value="Supprimer" /></td></tr>'."\n";
 
 ?>
@@ -171,5 +180,5 @@
 }
 else
-	echo "\t\t\t\t\t\t\t".'<p>'.$lang_admin_ranks['No ranks in list'].'</p>'."\n";
+	echo "\t\t\t\t\t\t\t".'<p>Aucun rang dans la liste.</p>'."\n";
 
 ?>
Index: /trunk/web/punbb/admin_reports.php
===================================================================
--- /trunk/web/punbb/admin_reports.php	(revision 10)
+++ /trunk/web/punbb/admin_reports.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if (!$pun_user['is_admmod'])
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
 
-// Load the admin_reports.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_reports.php';
 
 // Zap a report
@@ -28,24 +43,15 @@
 	$zap_id = intval(key($_POST['zap_id']));
 
-	$result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Impossible de retrouver les informations de signalements', __FILE__, __LINE__, $db->error());
 	$zapped = $db->result($result);
 
 	if ($zapped == '')
-		$db->query('UPDATE '.$db->prefix.'reports SET zapped='.time().', zapped_by='.$pun_user['id'].' WHERE id='.$zap_id) or error('Unable to zap report', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'reports SET zapped='.time().', zapped_by='.$pun_user['id'].' WHERE id='.$zap_id) or error('Impossible d\'ignorer le signalement', __FILE__, __LINE__, $db->error());
 
-	// Delete old reports (which cannot be viewed anyway)
-	$result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10,1') or error('Unable to fetch read reports to delete', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result) > 0)
-	{
-		$zapped_threshold = $db->result($result);
-		$db->query('DELETE FROM '.$db->prefix.'reports WHERE zapped <= '.$zapped_threshold) or error('Unable to delete old read reports', __FILE__, __LINE__, $db->error());
-	}
-
-	redirect('admin_reports.php', $lang_admin_reports['Report zapped redirect']);
+	redirect('admin_reports.php', 'Signalement ignorÃ©. Redirection ...');
 }
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Reports']);
-define('PUN_ACTIVE_PAGE', 'admin');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Signalements';
 require PUN_ROOT.'header.php';
 
@@ -54,10 +60,10 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_reports['New reports head'] ?></span></h2>
+		<h2><span>Nouveaux signalements</span></h2>
 		<div class="box">
 			<form method="post" action="admin_reports.php?action=zap">
 <?php
 
-$result = $db->query('SELECT r.id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, p.id AS pid, t.subject, f.forum_name, u.username AS reporter FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'posts AS p ON r.post_id=p.id LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Impossible de retrouver la liste des signalements', __FILE__, __LINE__, $db->error());
 
 if ($db->num_rows($result))
@@ -65,23 +71,22 @@
 	while ($cur_report = $db->fetch_assoc($result))
 	{
-		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : $lang_admin_reports['Deleted user'];
-		$forum = ($cur_report['forum_name'] != '') ? '<span><a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a></span>' : '<span>'.$lang_admin_reports['Deleted'].'</span>';
-		$topic = ($cur_report['subject'] != '') ? '<span>Â»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a></span>' : '<span>Â»&#160;'.$lang_admin_reports['Deleted'].'</span>';
-		$post = str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message']));
-		$post_id = ($cur_report['pid'] != '') ? '<span>Â»&#160;<a href="viewtopic.php?pid='.$cur_report['pid'].'#p'.$cur_report['pid'].'">'.sprintf($lang_admin_reports['Post ID'], $cur_report['pid']).'</a></span>' : '<span>Â»&#160;'.$lang_admin_reports['Deleted'].'</span>';
-		$report_location = array($forum, $topic, $post_id);
+		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Utilisateur supprimÃ©';
+		$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'SupprimÃ©';
+		$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'SupprimÃ©';
+		$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'SupprimÃ©';
+		$postid = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'SupprimÃ©';
 
 ?>
 				<div class="inform">
 					<fieldset>
-						<legend><?php printf($lang_admin_reports['Report subhead'], format_time($cur_report['created'])) ?></legend>
+						<legend>SignalÃ© le <?php echo format_time($cur_report['created']) ?></legend>
 						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
+							<table cellspacing="0">
 								<tr>
-									<th scope="row"><?php printf($lang_admin_reports['Reported by'], $reporter) ?></th>
-									<td class="location"><?php echo implode(' ', $report_location) ?></td>
+									<th scope="row">Forum&#160;&raquo;&#160;Discussion&#160;&raquo;&#160;Message</th>
+									<td><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $topic ?>&#160;&raquo;&#160;<?php echo $postid ?></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_reports['Reason'] ?><div><input type="submit" name="zap_id[<?php echo $cur_report['id'] ?>]" value="<?php echo $lang_admin_reports['Zap'] ?>" /></div></th>
+									<th scope="row">SignalÃ© par <?php echo $reporter ?><div><input type="submit" name="zap_id[<?php echo $cur_report['id'] ?>]" value=" Ignorer " /></div></th>
 									<td><?php echo $post ?></td>
 								</tr>
@@ -95,18 +100,5 @@
 }
 else
-{
-
-?>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_common['None'] ?></legend>
-						<div class="infldset">
-							<p><?php echo $lang_admin_reports['No new reports'] ?></p>
-						</div>
-					</fieldset>
-				</div>
-<?php
-
-}
+	echo "\t\t\t\t".'<p>Il n\'y a pas de nouveaux signalements.</p>'."\n";
 
 ?>
@@ -116,10 +108,10 @@
 
 	<div class="blockform block2">
-		<h2><span><?php echo $lang_admin_reports['Last 10 head'] ?></span></h2>
+		<h2><span>10 derniers signalements ignorÃ©s</span></h2>
 		<div class="box">
 			<div class="fakeform">
 <?php
 
-$result = $db->query('SELECT r.id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, p.id AS pid, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'posts AS p ON r.post_id=p.id LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Impossible de retrouver la liste des signalements', __FILE__, __LINE__, $db->error());
 
 if ($db->num_rows($result))
@@ -127,25 +119,23 @@
 	while ($cur_report = $db->fetch_assoc($result))
 	{
-		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : $lang_admin_reports['Deleted user'];
-		$forum = ($cur_report['forum_name'] != '') ? '<span><a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a></span>' : '<span>'.$lang_admin_reports['Deleted'].'</span>';
-		$topic = ($cur_report['subject'] != '') ? '<span>Â»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a></span>' : '<span>Â»&#160;'.$lang_admin_reports['Deleted'].'</span>';
-		$post = str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message']));
-		$post_id = ($cur_report['pid'] != '') ? '<span>Â»&#160;<a href="viewtopic.php?pid='.$cur_report['pid'].'#p'.$cur_report['pid'].'">'.sprintf($lang_admin_reports['Post ID'], $cur_report['pid']).'</a></span>' : '<span>Â»&#160;'.$lang_admin_reports['Deleted'].'</span>';
-		$zapped_by = ($cur_report['zapped_by'] != '') ? '<a href="profile.php?id='.$cur_report['zapped_by_id'].'">'.pun_htmlspecialchars($cur_report['zapped_by']).'</a>' : $lang_admin_reports['NA'];
-		$zapped_by = ($cur_report['zapped_by'] != '') ? '<strong>'.pun_htmlspecialchars($cur_report['zapped_by']).'</strong>' : $lang_admin_reports['NA'];
-		$report_location = array($forum, $topic, $post_id);
+		$reporter = ($cur_report['reporter'] != '') ? '<a href="profile.php?id='.$cur_report['reported_by'].'">'.pun_htmlspecialchars($cur_report['reporter']).'</a>' : 'Utilisateur supprimÃ©';
+		$forum = ($cur_report['forum_name'] != '') ? '<a href="viewforum.php?id='.$cur_report['forum_id'].'">'.pun_htmlspecialchars($cur_report['forum_name']).'</a>' : 'SupprimÃ©';
+		$topic = ($cur_report['subject'] != '') ? '<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a>' : 'SupprimÃ©';
+		$post = ($cur_report['post_id'] != '') ? str_replace("\n", '<br />', pun_htmlspecialchars($cur_report['message'])) : 'SupprimÃ©';
+		$post_id = ($cur_report['post_id'] != '') ? '<a href="viewtopic.php?pid='.$cur_report['post_id'].'#p'.$cur_report['post_id'].'">Post #'.$cur_report['post_id'].'</a>' : 'SupprimÃ©';
+		$zapped_by = ($cur_report['zapped_by'] != '') ? '<a href="profile.php?id='.$cur_report['zapped_by_id'].'">'.pun_htmlspecialchars($cur_report['zapped_by']).'</a>' : 'N/A';
 
 ?>
 				<div class="inform">
 					<fieldset>
-						<legend><?php printf($lang_admin_reports['Zapped subhead'], format_time($cur_report['zapped']), $zapped_by) ?></legend>
+						<legend>Zapped <?php echo format_time($cur_report['zapped']) ?></legend>
 						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
+							<table cellspacing="0">
 								<tr>
-									<th scope="row"><?php printf($lang_admin_reports['Reported by'], $reporter) ?></th>
-									<td class="location"><?php echo implode(' ', $report_location) ?></td>
+									<th scope="row">Forum&#160;&raquo;&#160;Discussion&#160;&raquo;&#160;Message</th>
+									<td><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $topic ?>&#160;&raquo;&#160;<?php echo $post_id ?></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_reports['Reason'] ?></th>
+									<th scope="row">SignalÃ© par <?php echo $reporter ?><div class="topspace">IgnorÃ© par <?php echo $zapped_by ?></div></th>
 									<td><?php echo $post ?></td>
 								</tr>
@@ -159,18 +149,5 @@
 }
 else
-{
-
-?>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_common['None'] ?></legend>
-						<div class="infldset">
-							<p><?php echo $lang_admin_reports['No zapped reports'] ?></p>
-						</div>
-					</fieldset>
-				</div>
-<?php
-
-}
+	echo "\t\t\t\t".'<p>Il n\'y a pas de signalement ignorÃ©.</p>'."\n";
 
 ?>
Index: /trunk/web/punbb/admin_users.php
===================================================================
--- /trunk/web/punbb/admin_users.php	(revision 10)
+++ /trunk/web/punbb/admin_users.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if (!$pun_user['is_admmod'])
+if ($pun_user['g_id'] > PUN_MOD)
 	message($lang_common['No permission']);
 
-// Load the admin_users.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_users.php';
 
 // Show IP statistics for a certain user ID
@@ -28,38 +43,17 @@
 		message($lang_common['Bad request']);
 
-	// Fetch ip count
-	$result = $db->query('SELECT poster_ip, MAX(posted) AS last_used FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-	$num_ips = $db->num_rows($result);
-
-	// Determine the ip offset (based on $_GET['p'])
-	$num_pages = ceil($num_ips / 50);
-
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-	$start_from = 50 * ($p - 1);
-
-	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_users.php?ip_stats='.$ip_stats );
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Results head']);
-	define('PUN_ACTIVE_PAGE', 'admin');
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
 	</div>
 </div>
 
 <div id="users1" class="blocktable">
-	<h2><span><?php echo $lang_admin_users['Results head'] ?></span></h2>
+	<h2><span>Utilisateurs</span></h2>
 	<div class="box">
 		<div class="inbox">
@@ -67,8 +61,8 @@
 			<thead>
 				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_admin_users['Results IP address head'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_admin_users['Results last used head'] ?></th>
-					<th class="tc3" scope="col"><?php echo $lang_admin_users['Results times found head'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_admin_users['Results action head'] ?></th>
+					<th class="tcl" scope="col">Adresse <acronym title="Internet Protocol" lang="en">IP</acronym></th>
+					<th class="tc2" scope="col">DerniÃšre visite</th>
+					<th class="tc3" scope="col">Occurences</th>
+					<th class="tcr" scope="col">Action</th>
 				</tr>
 			</thead>
@@ -76,5 +70,5 @@
 <?php
 
-	$result = $db->query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip ORDER BY last_used DESC LIMIT '.$start_from.', 50') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT poster_ip, MAX(posted) AS last_used, COUNT(id) AS used_times FROM '.$db->prefix.'posts WHERE poster_id='.$ip_stats.' GROUP BY poster_ip ORDER BY last_used DESC') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 	if ($db->num_rows($result))
 	{
@@ -87,5 +81,5 @@
 					<td class="tc2"><?php echo format_time($cur_ip['last_used']) ?></td>
 					<td class="tc3"><?php echo $cur_ip['used_times'] ?></td>
-					<td class="tcr"><a href="admin_users.php?show_users=<?php echo $cur_ip['poster_ip'] ?>"><?php echo $lang_admin_users['Results find more link'] ?></a></td>
+					<td class="tcr"><a href="admin_users.php?show_users=<?php echo $cur_ip['poster_ip'] ?>">Trouver plus d'utilisateur pour cette <acronym title="Internet Protocol" lang="en">IP</acronym></a></td>
 				</tr>
 <?php
@@ -94,5 +88,5 @@
 	}
 	else
-		echo "\t\t\t\t".'<tr><td class="tcl" colspan="4">'.$lang_admin_users['Results no posts found'].'</td></tr>'."\n";
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="4">Il n\'y a actuellement aucun message de cet utilisateur dans les forums.</td></tr>'."\n";
 
 ?>
@@ -104,14 +98,6 @@
 
 <div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
 	</div>
 </div>
@@ -124,43 +110,22 @@
 if (isset($_GET['show_users']))
 {
-	$ip = trim($_GET['show_users']);
-
-	if (!@preg_match('%^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$%', $ip) && !@preg_match('%^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$%', $ip))
-		message($lang_admin_users['Bad IP message']);
-
-	// Fetch user count
-	$result = $db->query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\'') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-	$num_users = $db->num_rows($result);
-
-	// Determine the user offset (based on $_GET['p'])
-	$num_pages = ceil($num_users / 50);
-
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-	$start_from = 50 * ($p - 1);
-
-	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_users.php?show_users='.$ip);
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Results head']);
-	define('PUN_ACTIVE_PAGE', 'admin');
+	$ip = $_GET['show_users'];
+
+	if (!preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip))
+		message('L\'adresse IP soumise n\'est pas correctement formÃ©e.');
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
 	</div>
 </div>
 
 <div id="users2" class="blocktable">
-	<h2><span><?php echo $lang_admin_users['Results head'] ?></span></h2>
+	<h2><span>Utilisateurs</span></h2>
 	<div class="box">
 		<div class="inbox">
@@ -168,10 +133,10 @@
 			<thead>
 				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_admin_users['Results username head'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_admin_users['Results e-mail head'] ?></th>
-					<th class="tc3" scope="col"><?php echo $lang_admin_users['Results title head'] ?></th>
-					<th class="tc4" scope="col"><?php echo $lang_admin_users['Results posts head'] ?></th>
-					<th class="tc5" scope="col"><?php echo $lang_admin_users['Results admin note head'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_admin_users['Results actions head'] ?></th>
+					<th class="tcl" scope="col">Nom d'utilisateur</th>
+					<th class="tc2" scope="col">E-mail</th>
+					<th class="tc3" scope="col">Titre/Statut</th>
+					<th class="tc4" scope="col">Messages</th>
+					<th class="tc5" scope="col">Note admin</th>
+					<th class="tcr" scope="col">Actions</th>
 				</tr>
 			</thead>
@@ -179,5 +144,5 @@
 <?php
 
-	$result = $db->query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\' ORDER BY poster DESC') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT DISTINCT poster_id, poster FROM '.$db->prefix.'posts WHERE poster_ip=\''.$db->escape($ip).'\' ORDER BY poster DESC') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 	$num_posts = $db->num_rows($result);
 
@@ -189,5 +154,5 @@
 			list($poster_id, $poster) = $db->fetch_row($result);
 
-			$result2 = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND u.id='.$poster_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+			$result2 = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND u.id='.$poster_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 
 			if (($user_data = $db->fetch_assoc($result2)))
@@ -195,5 +160,5 @@
 				$user_title = get_title($user_data);
 
-				$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">'.$lang_admin_users['Results view IP link'].'</a> | <a href="search.php?action=show_user_posts&amp;user_id='.$user_data['id'].'">'.$lang_admin_users['Results show posts link'].'</a>';
+				$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">Voir stats IP</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Afficher messages</a>';
 
 ?>
@@ -202,6 +167,6 @@
 					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
 					<td class="tc3"><?php echo $user_title ?></td>
-					<td class="tc4"><?php echo forum_number_format($user_data['num_posts']) ?></td>
-					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? pun_htmlspecialchars($user_data['admin_note']) : '&#160;' ?></td>
+					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
+					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&#160;' ?></td>
 					<td class="tcr"><?php echo $actions ?></td>
 				</tr>
@@ -216,5 +181,5 @@
 					<td class="tcl"><?php echo pun_htmlspecialchars($poster) ?></td>
 					<td class="tc2">&#160;</td>
-					<td class="tc3"><?php echo $lang_admin_users['Results guest'] ?></td>
+					<td class="tc3">InvitÃ©</td>
 					<td class="tc4">&#160;</td>
 					<td class="tc5">&#160;</td>
@@ -227,5 +192,5 @@
 	}
 	else
-		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">'.$lang_admin_users['Results no IP found'].'</td></tr>'."\n";
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">L\'adresse IP soumise est introuvable dans la base de donnÃ©es.</td></tr>'."\n";
 
 ?>
@@ -237,14 +202,6 @@
 
 <div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
 	</div>
 </div>
@@ -254,578 +211,79 @@
 
 
-// Move multiple users to other user groups
-else if (isset($_POST['move_users']) || isset($_POST['move_users_comply']))
+else if (isset($_POST['find_user']))
 {
-	if ($pun_user['g_id'] > PUN_ADMIN)
-		message($lang_common['No permission']);
-
-	confirm_referrer('admin_users.php');
-
-	if (isset($_POST['users']))
-	{
-		$user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
-		$user_ids = array_map('intval', $user_ids);
-
-		// Delete invalid IDs
-		$user_ids = array_diff($user_ids, array(0, 1));
-	}
-	else
-		$user_ids = array();
-
-	if (empty($user_ids))
-		message($lang_admin_users['No users selected']);
-
-	// Are we trying to batch move any admins?
-	$result = $db->query('SELECT COUNT(*) FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).') AND group_id='.PUN_ADMIN) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-	if ($db->result($result) > 0)
-		message($lang_admin_users['No move admins message']);
-
-	// Fetch all user groups
-	$all_groups = array();
-	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id NOT IN ('.PUN_GUEST.','.PUN_ADMIN.') ORDER BY g_title ASC') or error('Unable to fetch groups', __FILE__, __LINE__, $db->error());
-	while ($row = $db->fetch_row($result))
-		$all_groups[$row[0]] = $row[1];
-
-	if (isset($_POST['move_users_comply']))
-	{
-		$new_group = isset($_POST['new_group']) && isset($all_groups[$_POST['new_group']]) ? $_POST['new_group'] : message($lang_admin_users['Invalid group message']);
-
-		// Is the new group a moderator group?
-		$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$new_group) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-		$new_group_mod = $db->result($result);
-
-		// Fetch user groups
-		$user_groups = array();
-		$result = $db->query('SELECT id, group_id FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).')') or error('Unable to fetch user groups', __FILE__, __LINE__, $db->error());
-		while ($cur_user = $db->fetch_assoc($result))
-		{
-			if (!isset($user_groups[$cur_user['group_id']]))
-				$user_groups[$cur_user['group_id']] = array();
-
-			$user_groups[$cur_user['group_id']][] = $cur_user['id'];
-		}
-
-		// Are any users moderators?
-		$group_ids = array_keys($user_groups);
-		$result = $db->query('SELECT g_id, g_moderator FROM '.$db->prefix.'groups WHERE g_id IN ('.implode(',', $group_ids).')') or error('Unable to fetch group moderators', __FILE__, __LINE__, $db->error());
-		while ($cur_group = $db->fetch_assoc($result))
-		{
-			if ($cur_group['g_moderator'] == '0')
-				unset($user_groups[$cur_group['g_id']]);
-		}
-
-		if (!empty($user_groups) && $new_group != PUN_ADMIN && $new_group_mod != '1')
-		{
-			// Fetch forum list and clean up their moderator list
-			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
-			while ($cur_forum = $db->fetch_assoc($result))
-			{
-				$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
-
-				foreach ($user_groups as $group_users)
-					$cur_moderators = array_diff($cur_moderators, $group_users);
-
-				$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
-				$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
-			}
-		}
-
-		// Change user group
-		$db->query('UPDATE '.$db->prefix.'users SET group_id='.$new_group.' WHERE id IN ('.implode(',', $user_ids).')') or error('Unable to change user group', __FILE__, __LINE__, $db->error());
-
-		redirect('admin_users.php', $lang_admin_users['Users move redirect']);
-	}
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Move users']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-	generate_admin_menu('users');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_users['Move users'] ?></span></h2>
-		<div class="box">
-			<form name="confirm_move_users" method="post" action="admin_users.php">
-				<input type="hidden" name="users" value="<?php echo implode(',', $user_ids) ?>" />
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_users['Move users subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['New group label'] ?></th>
-									<td>
-										<select name="new_group" tabindex="1">
-<?php foreach ($all_groups as $gid => $group) : ?>											<option value="<?php echo $gid ?>"><?php echo pun_htmlspecialchars($group) ?></option>
-<?php endforeach; ?>
-										</select>
-										<span><?php echo $lang_admin_users['New group help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<p class="submitend"><input type="submit" name="move_users_comply" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="2" /></p>
-			</form>
-		</div>
-	</div>
-	<div class="clearer"></div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-
-// Delete multiple users
-else if (isset($_POST['delete_users']) || isset($_POST['delete_users_comply']))
-{
-	if ($pun_user['g_id'] > PUN_ADMIN)
-		message($lang_common['No permission']);
-
-	confirm_referrer('admin_users.php');
-
-	if (isset($_POST['users']))
-	{
-		$user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
-		$user_ids = array_map('intval', $user_ids);
-
-		// Delete invalid IDs
-		$user_ids = array_diff($user_ids, array(0, 1));
-	}
-	else
-		$user_ids = array();
-
-	if (empty($user_ids))
-		message($lang_admin_users['No users selected']);
-
-	// Are we trying to delete any admins?
-	$result = $db->query('SELECT COUNT(*) FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).') AND group_id='.PUN_ADMIN) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-	if ($db->result($result) > 0)
-		message($lang_admin_users['No delete admins message']);
-
-	if (isset($_POST['delete_users_comply']))
-	{
-		// Fetch user groups
-		$user_groups = array();
-		$result = $db->query('SELECT id, group_id FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).')') or error('Unable to fetch user groups', __FILE__, __LINE__, $db->error());
-		while ($cur_user = $db->fetch_assoc($result))
-		{
-			if (!isset($user_groups[$cur_user['group_id']]))
-				$user_groups[$cur_user['group_id']] = array();
-
-			$user_groups[$cur_user['group_id']][] = $cur_user['id'];
-		}
-
-		// Are any users moderators?
-		$group_ids = array_keys($user_groups);
-		$result = $db->query('SELECT g_id, g_moderator FROM '.$db->prefix.'groups WHERE g_id IN ('.implode(',', $group_ids).')') or error('Unable to fetch group moderators', __FILE__, __LINE__, $db->error());
-		while ($cur_group = $db->fetch_assoc($result))
-		{
-			if ($cur_group['g_moderator'] == '0')
-				unset($user_groups[$cur_group['g_id']]);
-		}
-
-		// Fetch forum list and clean up their moderator list
-		$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
-		while ($cur_forum = $db->fetch_assoc($result))
-		{
-			$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
-
-			foreach ($user_groups as $group_users)
-				$cur_moderators = array_diff($cur_moderators, $group_users);
-
-			$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
-			$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
-		}
-
-		// Delete any subscriptions
-		$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE user_id IN ('.implode(',', $user_ids).')') or error('Unable to delete topic subscriptions', __FILE__, __LINE__, $db->error());
-		$db->query('DELETE FROM '.$db->prefix.'forum_subscriptions WHERE user_id IN ('.implode(',', $user_ids).')') or error('Unable to delete forum subscriptions', __FILE__, __LINE__, $db->error());
-
-		// Remove them from the online list (if they happen to be logged in)
-		$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id IN ('.implode(',', $user_ids).')') or error('Unable to remove users from online list', __FILE__, __LINE__, $db->error());
-
-		// Should we delete all posts made by these users?
-		if (isset($_POST['delete_posts']))
-		{
-			require PUN_ROOT.'include/search_idx.php';
-			@set_time_limit(0);
-
-			// Find all posts made by this user
-			$result = $db->query('SELECT p.id, p.topic_id, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE p.poster_id IN ('.implode(',', $user_ids).')') or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
-			if ($db->num_rows($result))
-			{
-				while ($cur_post = $db->fetch_assoc($result))
-				{
-					// Determine whether this post is the "topic post" or not
-					$result2 = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['topic_id'].' ORDER BY posted LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-
-					if ($db->result($result2) == $cur_post['id'])
-						delete_topic($cur_post['topic_id']);
-					else
-						delete_post($cur_post['id'], $cur_post['topic_id']);
-
-					update_forum($cur_post['forum_id']);
-				}
-			}
-		}
-		else
-			// Set all their posts to guest
-			$db->query('UPDATE '.$db->prefix.'posts SET poster_id=1 WHERE poster_id IN ('.implode(',', $user_ids).')') or error('Unable to update posts', __FILE__, __LINE__, $db->error());
-
-		// Delete the users
-		$db->query('DELETE FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).')') or error('Unable to delete users', __FILE__, __LINE__, $db->error());
-
-		// Delete user avatars
-		foreach ($user_ids as $user_id)
-			delete_avatar($user_id);
-
-		// Regenerate the users info cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
-
-		redirect('admin_users.php', $lang_admin_users['Users delete redirect']);
-	}
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Delete users']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-	generate_admin_menu('users');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_users['Delete users'] ?></span></h2>
-		<div class="box">
-			<form name="confirm_del_users" method="post" action="admin_users.php">
-				<input type="hidden" name="users" value="<?php echo implode(',', $user_ids) ?>" />
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_users['Confirm delete legend'] ?></legend>
-						<div class="infldset">
-							<p><?php echo $lang_admin_users['Confirm delete info'] ?></p>
-							<div class="rbox">
-								<label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_admin_users['Delete posts'] ?><br /></label>
-							</div>
-							<p class="warntext"><strong><?php echo $lang_admin_users['Delete warning'] ?></strong></p>
-						</div>
-					</fieldset>
-				</div>
-				<p class="buttons"><input type="submit" name="delete_users_comply" value="<?php echo $lang_admin_users['Delete'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_admin_common['Go back'] ?></a></p>
-			</form>
-		</div>
-	</div>
-	<div class="clearer"></div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-
-// Ban multiple users
-else if (isset($_POST['ban_users']) || isset($_POST['ban_users_comply']))
-{
-	if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] != '1' || $pun_user['g_mod_ban_users'] == '0'))
-		message($lang_common['No permission']);
-
-	confirm_referrer('admin_users.php');
-
-	if (isset($_POST['users']))
-	{
-		$user_ids = is_array($_POST['users']) ? array_keys($_POST['users']) : explode(',', $_POST['users']);
-		$user_ids = array_map('intval', $user_ids);
-
-		// Delete invalid IDs
-		$user_ids = array_diff($user_ids, array(0, 1));
-	}
-	else
-		$user_ids = array();
-
-	if (empty($user_ids))
-		message($lang_admin_users['No users selected']);
-
-	// Are we trying to ban any admins?
-	$result = $db->query('SELECT COUNT(*) FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).') AND group_id='.PUN_ADMIN) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-	if ($db->result($result) > 0)
-		message($lang_admin_users['No ban admins message']);
-
-	// Also, we cannot ban moderators
-	$result = $db->query('SELECT COUNT(*) FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id WHERE g.g_moderator=1 AND u.id IN ('.implode(',', $user_ids).')') or error('Unable to fetch moderator group info', __FILE__, __LINE__, $db->error());
-	if ($db->result($result) > 0)
-		message($lang_admin_users['No ban mods message']);
-
-	if (isset($_POST['ban_users_comply']))
-	{
-		$ban_message = pun_trim($_POST['ban_message']);
-		$ban_expire = pun_trim($_POST['ban_expire']);
-		$ban_the_ip = isset($_POST['ban_the_ip']) ? intval($_POST['ban_the_ip']) : 0;
-
-		if ($ban_expire != '' && $ban_expire != 'Never')
-		{
-			$ban_expire = strtotime($ban_expire.' GMT');
-
-			if ($ban_expire == -1 || !$ban_expire)
-				message($lang_admin_users['Invalid date message'].' '.$lang_admin_users['Invalid date reasons']);
-
-			$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-			$ban_expire -= $diff;
-
-			if ($ban_expire <= time())
-				message($lang_admin_users['Invalid date message'].' '.$lang_admin_users['Invalid date reasons']);
-		}
-		else
-			$ban_expire = 'NULL';
-
-		$ban_message = ($ban_message != '') ? '\''.$db->escape($ban_message).'\'' : 'NULL';
-
-		// Fetch user information
-		$user_info = array();
-		$result = $db->query('SELECT id, username, email, registration_ip FROM '.$db->prefix.'users WHERE id IN ('.implode(',', $user_ids).')') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-		while ($cur_user = $db->fetch_assoc($result))
-			$user_info[$cur_user['id']] = array('username' => $cur_user['username'], 'email' => $cur_user['email'], 'ip' => $cur_user['registration_ip']);
-
-		// Overwrite the registration IP with one from the last post (if it exists)
-		if ($ban_the_ip != 0)
-		{
-			$result = $db->query('SELECT p.poster_id, p.poster_ip FROM '.$db->prefix.'posts AS p INNER JOIN (SELECT MAX(id) AS id FROM '.$db->prefix.'posts WHERE poster_id IN ('.implode(',', $user_ids).') GROUP BY poster_id) AS i ON p.id=i.id') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-			while ($cur_address = $db->fetch_assoc($result))
-				$user_info[$cur_address['poster_id']]['ip'] = $cur_address['poster_ip'];
-		}
-
-		// And insert the bans!
-		foreach ($user_ids as $user_id)
-		{
-			$ban_username = '\''.$db->escape($user_info[$user_id]['username']).'\'';
-			$ban_email = '\''.$db->escape($user_info[$user_id]['email']).'\'';
-			$ban_ip = ($ban_the_ip != 0) ? '\''.$db->escape($user_info[$user_id]['ip']).'\'' : 'NULL';
-
-			$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire, ban_creator) VALUES('.$ban_username.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.', '.$pun_user['id'].')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
-		}
-
-		// Regenerate the bans cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_bans_cache();
-
-		redirect('admin_users.php', $lang_admin_users['Users banned redirect']);
-	}
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
-	$focus_element = array('bans2', 'ban_message');
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-	generate_admin_menu('users');
-
-?>
-	<div class="blockform">
-		<h2><span><?php echo $lang_admin_users['Ban users'] ?></span></h2>
-		<div class="box">
-			<form id="bans2" name="confirm_ban_users" method="post" action="admin_users.php">
-				<input type="hidden" name="users" value="<?php echo implode(',', $user_ids) ?>" />
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_users['Message expiry subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Ban message label'] ?></th>
-									<td>
-										<input type="text" name="ban_message" size="50" maxlength="255" tabindex="1" />
-										<span><?php echo $lang_admin_users['Ban message help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Expire date label'] ?></th>
-									<td>
-										<input type="text" name="ban_expire" size="17" maxlength="10" tabindex="2" />
-										<span><?php echo $lang_admin_users['Expire date help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Ban IP label'] ?></th>
-									<td>
-										<input type="radio" name="ban_the_ip" tabindex="3" value="1" checked="checked" />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="ban_the_ip" tabindex="4" value="0" checked="checked" />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_users['Ban IP help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<p class="submitend"><input type="submit" name="ban_users_comply" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="3" /></p>
-			</form>
-		</div>
-	</div>
-	<div class="clearer"></div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-
-else if (isset($_GET['find_user']))
-{
-	$form = isset($_GET['form']) ? $_GET['form'] : array();
+	$form = $_POST['form'];
+	$form['username'] = $_POST['username'];
 
 	// trim() all elements in $form
-	$form = array_map('pun_trim', $form);
-	$conditions = $query_str = array();
-
-	$posts_greater = isset($_GET['posts_greater']) ? trim($_GET['posts_greater']) : '';
-	$posts_less = isset($_GET['posts_less']) ? trim($_GET['posts_less']) : '';
-	$last_post_after = isset($_GET['last_post_after']) ? trim($_GET['last_post_after']) : '';
-	$last_post_before = isset($_GET['last_post_before']) ? trim($_GET['last_post_before']) : '';
-	$last_visit_after = isset($_GET['last_visit_after']) ? trim($_GET['last_visit_after']) : '';
-	$last_visit_before = isset($_GET['last_visit_before']) ? trim($_GET['last_visit_before']) : '';
-	$registered_after = isset($_GET['registered_after']) ? trim($_GET['registered_after']) : '';
-	$registered_before = isset($_GET['registered_before']) ? trim($_GET['registered_before']) : '';
-	$order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'email', 'num_posts', 'last_post', 'last_visit', 'registered')) ? $_GET['order_by'] : 'username';
-	$direction = isset($_GET['direction']) && $_GET['direction'] == 'DESC' ? 'DESC' : 'ASC';
-	$user_group = isset($_GET['user_group']) ? intval($_GET['user_group']) : -1;
-
-	$query_str[] = 'order_by='.$order_by;
-	$query_str[] = 'direction='.$direction;
-	$query_str[] = 'user_group='.$user_group;
-
-	if (preg_match('%[^0-9]%', $posts_greater.$posts_less))
-		message($lang_admin_users['Non numeric message']);
+	$form = array_map('trim', $form);
+	$conditions = array();
+	
+	$posts_greater = trim($_POST['posts_greater']);
+	$posts_less = trim($_POST['posts_less']);
+	$last_post_after = trim($_POST['last_post_after']);
+	$last_post_before = trim($_POST['last_post_before']);
+	$registered_after = trim($_POST['registered_after']);
+	$registered_before = trim($_POST['registered_before']);
+	$order_by = $_POST['order_by'];
+	$direction = $_POST['direction'];
+	$user_group = $_POST['user_group'];
+
+	if (preg_match('/[^0-9]/', $posts_greater.$posts_less))
+		message('Vous avez saisi une donnÃ©e non-numÃ©rique dans un champ qui en requiÃšre une.');
 
 	// Try to convert date/time to timestamps
 	if ($last_post_after != '')
+		$last_post_after = strtotime($last_post_after);
+	if ($last_post_before != '')
+		$last_post_before = strtotime($last_post_before);
+	if ($registered_after != '')
+		$registered_after = strtotime($registered_after);
+	if ($registered_before != '')
+		$registered_before = strtotime($registered_before);
+
+	if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1)
+		message('Vous avez saisi une date/heure invalide.');
+
+	if ($last_post_after != '')
+		$conditions[] = 'u.last_post>'.$last_post_after;
+	if ($last_post_before != '')
+		$conditions[] = 'u.last_post<'.$last_post_before;
+	if ($registered_after != '')
+		$conditions[] = 'u.registered>'.$registered_after;
+	if ($registered_before != '')
+		$conditions[] = 'u.registered<'.$registered_before;
+
+	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
+	while (list($key, $input) = @each($form))
 	{
-		$query_str[] = 'last_post_after='.$last_post_after;
-
-		$last_post_after = strtotime($last_post_after);
-		if ($last_post_after === false || $last_post_after == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.last_post>'.$last_post_after;
+		if ($input != '')
+			$conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
 	}
-	if ($last_post_before != '')
-	{
-		$query_str[] = 'last_post_before='.$last_post_before;
-
-		$last_post_before = strtotime($last_post_before);
-		if ($last_post_before === false || $last_post_before == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.last_post<'.$last_post_before;
-	}
-	if ($last_visit_after != '')
-	{
-		$query_str[] = 'last_visit_after='.$last_visit_after;
-
-		$last_visit_after = strtotime($last_visit_after);
-		if ($last_visit_after === false || $last_visit_after == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.last_visit>'.$last_visit_after;
-	}
-	if ($last_visit_before != '')
-	{
-		$query_str[] = 'last_visit_before='.$last_visit_before;
-
-		$last_visit_before = strtotime($last_visit_before);
-		if ($last_visit_before === false || $last_visit_before == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.last_visit<'.$last_visit_before;
-	}
-	if ($registered_after != '')
-	{
-		$query_str[] = 'registered_after='.$registered_after;
-
-		$registered_after = strtotime($registered_after);
-		if ($registered_after === false || $registered_after == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.registered>'.$registered_after;
-	}
-	if ($registered_before != '')
-	{
-		$query_str[] = 'registered_before='.$registered_before;
-
-		$registered_before = strtotime($registered_before);
-		if ($registered_before === false || $registered_before == -1)
-			message($lang_admin_users['Invalid date time message']);
-
-		$conditions[] = 'u.registered<'.$registered_before;
-	}
-
-	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
-	foreach ($form as $key => $input)
-	{
-		if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note')))
-		{
-			$conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
-			$query_str[] = 'form%5B'.$key.'%5D='.urlencode($input);
-		}
-	}
 
 	if ($posts_greater != '')
-	{
-		$query_str[] = 'posts_greater='.$posts_greater;
 		$conditions[] = 'u.num_posts>'.$posts_greater;
-	}
 	if ($posts_less != '')
-	{
-		$query_str[] = 'posts_less='.$posts_less;
 		$conditions[] = 'u.num_posts<'.$posts_less;
-	}
-
-	if ($user_group > -1)
-		$conditions[] = 'u.group_id='.$user_group;
-
-	// Fetch user count
-	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '')) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-	$num_users = $db->result($result);
-
-	// Determine the user offset (based on $_GET['p'])
-	$num_pages = ceil($num_users / 50);
-
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-	$start_from = 50 * ($p - 1);
-
-	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_users.php?find_user=&amp;'.implode('&amp;', $query_str));
-
-	// Some helper variables for permissions
-	$can_delete = $can_move = $pun_user['g_id'] == PUN_ADMIN;
-	$can_ban = $pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && $pun_user['g_mod_ban_users'] == '1');
-	$can_action = ($can_delete || $can_ban || $can_move) && $num_users > 0;
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users'], $lang_admin_users['Results head']);
-	$page_head = array('js' => '<script type="text/javascript" src="common.js"></script>');
-	define('PUN_ACTIVE_PAGE', 'admin');
+
+	if ($user_group != 'all')
+		$conditions[] = 'u.group_id='.$db->escape($user_group);
+
+	if (empty($conditions))
+		message('Vous n\'avez saisi aucun critÃšres de recherche.');
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
-	</div>
-</div>
-
-
-<form id="search-users-form" action="admin_users.php" method="post">
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
+
 <div id="users2" class="blocktable">
-	<h2><span><?php echo $lang_admin_users['Results head'] ?></span></h2>
+	<h2><span>Utilisateurs</span></h2>
 	<div class="box">
 		<div class="inbox">
@@ -833,12 +291,10 @@
 			<thead>
 				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_admin_users['Results username head'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_admin_users['Results e-mail head'] ?></th>
-					<th class="tc3" scope="col"><?php echo $lang_admin_users['Results title head'] ?></th>
-					<th class="tc4" scope="col"><?php echo $lang_admin_users['Results posts head'] ?></th>
-					<th class="tc5" scope="col"><?php echo $lang_admin_users['Results admin note head'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_admin_users['Results actions head'] ?></th>
-<?php if ($can_action): ?>					<th class="tcmod" scope="col"><?php echo $lang_admin_users['Select'] ?></th>
-<?php endif; ?>
+					<th class="tcl" scope="col">Nom d'utilisateur</th>
+					<th class="tc2" scope="col">E-mail</th>
+					<th class="tc3" scope="col">Titre/Status</th>
+					<th class="tc4" scope="col">Messages</th>
+					<th class="tc5" scope="col">Note admin</th>
+					<th class="tcr" scope="col">Actions</th>
 				</tr>
 			</thead>
@@ -846,5 +302,5 @@
 <?php
 
-	$result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Impossible de retrouver les informations utilisateurs', __FILE__, __LINE__, $db->error());
 	if ($db->num_rows($result))
 	{
@@ -855,7 +311,7 @@
 			// This script is a special case in that we want to display "Not verified" for non-verified users
 			if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
-				$user_title = '<span class="warntext">'.$lang_admin_users['Not verified'].'</span>';
-
-			$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">'.$lang_admin_users['Results view IP link'].'</a> | <a href="search.php?action=show_user_posts&amp;user_id='.$user_data['id'].'">'.$lang_admin_users['Results show posts link'].'</a>';
+				$user_title = '<span class="warntext">Not verified</span>';
+
+			$actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">Voir stats IP</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Afficher messages</a>';
 
 ?>
@@ -864,9 +320,7 @@
 					<td class="tc2"><a href="mailto:<?php echo $user_data['email'] ?>"><?php echo $user_data['email'] ?></a></td>
 					<td class="tc3"><?php echo $user_title ?></td>
-					<td class="tc4"><?php echo forum_number_format($user_data['num_posts']) ?></td>
-					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? pun_htmlspecialchars($user_data['admin_note']) : '&#160;' ?></td>
+					<td class="tc4"><?php echo $user_data['num_posts'] ?></td>
+					<td class="tc5"><?php echo ($user_data['admin_note'] != '') ? $user_data['admin_note'] : '&#160;' ?></td>
 					<td class="tcr"><?php echo $actions ?></td>
-<?php if ($can_action): ?>					<td class="tcmod"><input type="checkbox" name="users[<?php echo $user_data['id'] ?>]" value="1" /></td>
-<?php endif; ?>
 				</tr>
 <?php
@@ -875,5 +329,5 @@
 	}
 	else
-		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">'.$lang_admin_users['No match'].'</td></tr>'."\n";
+		echo "\t\t\t\t".'<tr><td class="tcl" colspan="6">Aucun rÃ©sultat.</td></tr>'."\n";
 
 ?>
@@ -885,19 +339,8 @@
 
 <div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-<?php if ($can_action): ?>			<p class="conr modbuttons"><a href="#" onclick="return select_checkboxes('search-users-form', this, '<?php echo $lang_admin_users['Unselect all'] ?>')"><?php echo $lang_admin_users['Select all'] ?></a> <?php if ($can_ban) : ?><input type="submit" name="ban_users" value="<?php echo $lang_admin_users['Ban'] ?>" /><?php endif; if ($can_delete) : ?><input type="submit" name="delete_users" value="<?php echo $lang_admin_users['Delete'] ?>" /><?php endif; if ($can_move) : ?><input type="submit" name="move_users" value="<?php echo $lang_admin_users['Change group'] ?>" /><?php endif; ?></p>
-<?php endif; ?>
-		</div>
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_users['Results head'] ?></strong></li>
-		</ul>
-		<div class="clearer"></div>
-	</div>
-</div>
-</form>
+	<div class="inbox">
+		<div><a href="javascript:history.go(-1)">Retour</a></div>
+	</div>
+</div>
 <?php
 
@@ -908,7 +351,6 @@
 else
 {
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Users']);
-	$focus_element = array('find_user', 'form[username]');
-	define('PUN_ACTIVE_PAGE', 'admin');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Utilisateurs';
+	$focus_element = array('find_user', 'username');
 	require PUN_ROOT.'header.php';
 
@@ -917,129 +359,113 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_users['User search head'] ?></span></h2>
+		<h2><span>Recherche d'utilisateur</span></h2>
 		<div class="box">
-			<form id="find_user" method="get" action="admin_users.php">
-				<p class="submittop"><input type="submit" name="find_user" value="<?php echo $lang_admin_users['Submit search'] ?>" tabindex="1" /></p>
+			<form id="find_user" method="post" action="admin_users.php?action=find_user">
+				<p class="submittop"><input type="submit" name="find_user" value=" Rechercher " tabindex="1" /></p>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_users['User search subhead'] ?></legend>
+						<legend>Saisissez vos critÃšres de recherche</legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_users['User search info'] ?></p>
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Username label'] ?></th>
-									<td><input type="text" name="form[username]" size="25" maxlength="25" tabindex="2" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['E-mail address label'] ?></th>
-									<td><input type="text" name="form[email]" size="30" maxlength="80" tabindex="3" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Title label'] ?></th>
+							<p>Recherche d'utilisateur dans la base de donnÃ©es. Vous pouvez saisir un ou plusieurs termes Ã  rechercher. Utilisez le caractÃšre astÃ©risque (*) comme joker.</p>
+							<table  class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Nom d'utilisateur</th>
+									<td><input type="text" name="username" size="25" maxlength="25" tabindex="2" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Adresse e-mail</th>
+									<td><input type="text" name="form[email]" size="30" maxlength="50" tabindex="3" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Titre</th>
 									<td><input type="text" name="form[title]" size="30" maxlength="50" tabindex="4" /></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Real name label'] ?></th>
+									<th scope="row">Nom rÃ©el</th>
 									<td><input type="text" name="form[realname]" size="30" maxlength="40" tabindex="5" /></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Website label'] ?></th>
+									<th scope="row">Site web</th>
 									<td><input type="text" name="form[url]" size="35" maxlength="100" tabindex="6" /></td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Jabber label'] ?></th>
-									<td><input type="text" name="form[jabber]" size="30" maxlength="75" tabindex="7" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['ICQ label'] ?></th>
-									<td><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="8" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['MSN label'] ?></th>
-									<td><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="9" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['AOL label'] ?></th>
-									<td><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="10" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Yahoo label'] ?></th>
-									<td><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="11" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Location label'] ?></th>
-									<td><input type="text" name="form[location]" size="30" maxlength="30" tabindex="12" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Signature label'] ?></th>
-									<td><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="13" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Admin note label'] ?></th>
-									<td><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="14" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Posts more than label'] ?></th>
-									<td><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="15" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Posts less than label'] ?></th>
-									<td><input type="text" name="posts_less" size="5" maxlength="8" tabindex="16" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Last post after label'] ?></th>
-									<td><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="17" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Last post before label'] ?></th>
-									<td><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="18" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Last visit after label'] ?></th>
-									<td><input type="text" name="last_visit_after" size="24" maxlength="19" tabindex="17" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Last visit before label'] ?></th>
-									<td><input type="text" name="last_visit_before" size="24" maxlength="19" tabindex="18" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Registered after label'] ?></th>
-									<td><input type="text" name="registered_after" size="24" maxlength="19" tabindex="19" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Registered before label'] ?></th>
-									<td><input type="text" name="registered_before" size="24" maxlength="19" tabindex="20" />
-									<span><?php echo $lang_admin_users['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_users['Order by label'] ?></th>
+									<th scope="row">ICQ</th>
+									<td><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="7" /></td>
+								</tr>
+								<tr>
+									<th scope="row">MSN Messenger</th>
+									<td><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="8" /></td>
+								</tr>
+								<tr>
+									<th scope="row">AOL IM</th>
+									<td><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="9" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Yahoo! Messenger</th>
+									<td><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="10" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Lieu</th>
+									<td><input type="text" name="form[location]" size="30" maxlength="30" tabindex="11" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Signature</th>
+									<td><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="12" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Note admin</th>
+									<td><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="13" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages supÃ©rieur Ã </th>
+									<td><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="14" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre de messages infÃ©rieur Ã </th>
+									<td><input type="text" name="posts_less" size="5" maxlength="8" tabindex="15" /></td>
+								</tr>
+								<tr>
+									<th scope="row">Le dernier message est aprÃšs le</th>
+									<td><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="16" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Le dernier message est avant le</th>
+									<td><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="17" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Inscrit aprÃšs le</th>
+									<td><input type="text" name="registered_after" size="24" maxlength="19" tabindex="18" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Inscrit avant le</th>
+									<td><input type="text" name="registered_before" size="24" maxlength="19" tabindex="19" />
+									<span>(yyyy-mm-dd hh:mm:ss)</span></td>
+								</tr>
+								<tr>
+									<th scope="row">Trier par</th>
 									<td>
-										<select name="order_by" tabindex="21">
-											<option value="username" selected="selected"><?php echo $lang_admin_users['Order by username'] ?></option>
-											<option value="email"><?php echo $lang_admin_users['Order by e-mail'] ?></option>
-											<option value="num_posts"><?php echo $lang_admin_users['Order by posts'] ?></option>
-											<option value="last_post"><?php echo $lang_admin_users['Order by last post'] ?></option>
-											<option value="last_visit"><?php echo $lang_admin_users['Order by last visit'] ?></option>
-											<option value="registered"><?php echo $lang_admin_users['Order by registered'] ?></option>
-										</select>&#160;&#160;&#160;<select name="direction" tabindex="22">
-											<option value="ASC" selected="selected"><?php echo $lang_admin_users['Ascending'] ?></option>
-											<option value="DESC"><?php echo $lang_admin_users['Descending'] ?></option>
+										<select name="order_by" tabindex="20">
+											<option value="username" selected="selected">Nom d'utilisateur</option>
+											<option value="email">e-mail</option>
+											<option value="num_posts">messages</option>
+											<option value="last_post">dernier message</option>
+											<option value="registered">inscriptions</option>
+										</select>&#160;&#160;&#160;<select name="direction" tabindex="21">
+											<option value="ASC" selected="selected">croissant</option>
+											<option value="DESC">dÃ©croissant</option>
 										</select>
 									</td>
 								</tr>
 								<tr>
-									<th scope="row"><?php echo $lang_admin_users['User group label'] ?></th>
+									<th scope="row">Groupe utilisateurs</th>
 									<td>
-										<select name="user_group" tabindex="23">
-											<option value="-1" selected="selected"><?php echo $lang_admin_users['All groups'] ?></option>
-											<option value="0"><?php echo $lang_admin_users['Unverified users'] ?></option>
-<?php
-
-	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+										<select name="user_group" tabindex="22">
+												<option value="all" selected="selected">Tous les groupes</option>
+<?php
+
+	$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes', __FILE__, __LINE__, $db->error());
 
 	while ($cur_group = $db->fetch_assoc($result))
@@ -1054,20 +480,20 @@
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="find_user" value="<?php echo $lang_admin_users['Submit search'] ?>" tabindex="25" /></p>
+				<p class="submitend"><input type="submit" name="find_user" value=" Rechercher " tabindex="23" /></p>
 			</form>
 		</div>
 
-		<h2 class="block2"><span><?php echo $lang_admin_users['IP search head'] ?></span></h2>
+		<h2 class="block2"><span>Recherche <acronym title="Internet Protocol" lang="en">IP</acronym></span></h2>
 		<div class="box">
 			<form method="get" action="admin_users.php">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_users['IP search subhead'] ?></legend>
+						<legend>Saisissez une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> Ã  rechercher</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_users['IP address label'] ?><div><input type="submit" value="<?php echo $lang_admin_users['Find IP address'] ?>" tabindex="26" /></div></th>
+									<th scope="row">Adresse <acronym title="Internet Protocol" lang="en">IP</acronym><div><input type="submit" value=" Trouver " tabindex="25" /></div></th>
 									<td><input type="text" name="show_users" size="18" maxlength="15" tabindex="24" />
-									<span><?php echo $lang_admin_users['IP address help'] ?></span></td>
+									<span>L'adresse <acronym title="Internet Protocol" lang="en">IP</acronym> Ã  rechercher dans la base de donnÃ©es.</span></td>
 								</tr>
 							</table>
Index: /trunk/web/punbb/cache/.htaccess
===================================================================
--- /trunk/web/punbb/cache/.htaccess	(revision 10)
+++ /trunk/web/punbb/cache/.htaccess	(revision 1)
Index: /trunk/web/punbb/cache/cache_smilies.php
===================================================================
--- /trunk/web/punbb/cache/cache_smilies.php	(revision 1)
+++ /trunk/web/punbb/cache/cache_smilies.php	(revision 1)
@@ -0,0 +1,39 @@
+<?php
+
+$smiley_text = array(
+':top:',
+'whaou',
+':d',
+':terminator:',
+':roll:',
+':|',
+':mad2:',
+':/',
+':cool:',
+':D',
+':(',
+':)',
+':p',
+';)',
+);
+
+$smiley_img = array(
+'canon.gif',
+'whaouh6na.gif',
+'yikes.png',
+'terminator.png',
+'roll.png',
+'neutral.png',
+'mad.png',
+'hmm.png',
+'cool.png',
+'big_smile.png',
+'sad.png',
+'smile.png',
+'tongue.png',
+'wink.png',
+);
+
+define('PUN_CACHE_SMILEY', 1);
+
+?>
Index: /trunk/web/punbb/cache/index.html
===================================================================
--- /trunk/web/punbb/cache/index.html	(revision 10)
+++ /trunk/web/punbb/cache/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: unk/web/punbb/common.js
===================================================================
--- /trunk/web/punbb/common.js	(revision 10)
+++ 	(revision )
@@ -1,32 +1,0 @@
-
-function select_checkboxes(curFormId, link, new_string)
-{
-	var curForm = document.getElementById(curFormId);
-	var inputlist = curForm.getElementsByTagName("input");
-	for (i = 0; i < inputlist.length; i++)
-	{
-		if (inputlist[i].getAttribute("type") == 'checkbox' && inputlist[i].disabled == false)
-			inputlist[i].checked = true;
-	}
-	
-	link.setAttribute('onclick', 'return unselect_checkboxes(\'' + curFormId + '\', this, \'' + link.innerHTML + '\')');
-	link.innerHTML = new_string;
-
-	return false;
-}
-
-function unselect_checkboxes(curFormId, link, new_string)
-{
-	var curForm = document.getElementById(curFormId);
-	var inputlist = curForm.getElementsByTagName("input");
-	for (i = 0; i < inputlist.length; i++)
-	{
-		if (inputlist[i].getAttribute("type") == 'checkbox' && inputlist[i].disabled == false)
-			inputlist[i].checked = false;
-	}
-	
-	link.setAttribute('onclick', 'return select_checkboxes(\'' + curFormId + '\', this, \'' + link.innerHTML + '\')');
-	link.innerHTML = new_string;
-
-	return false;
-}
Index: /trunk/web/punbb/config.php
===================================================================
--- /trunk/web/punbb/config.php	(revision 10)
+++ /trunk/web/punbb/config.php	(revision 1)
@@ -4,5 +4,5 @@
   { $site_path = "../";
     require $site_path."pathes.php";
-    require_once $site_path.RSR_APP_PATH."env.php";
+    require $site_path.RSR_APP_PATH."env.php";
     $env = new env($site_path.RSR_CONFIG_FILE, $site_path);
   }
Index: unk/web/punbb/db_update.php
===================================================================
--- /trunk/web/punbb/db_update.php	(revision 10)
+++ 	(revision )
@@ -1,1908 +1,0 @@
-<?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-// The FluxBB version this script updates to
-define('UPDATE_TO', '1.4.7');
-
-define('UPDATE_TO_DB_REVISION', 15);
-define('UPDATE_TO_SI_REVISION', 2);
-define('UPDATE_TO_PARSER_REVISION', 2);
-
-define('MIN_PHP_VERSION', '4.4.0');
-define('MIN_MYSQL_VERSION', '4.1.2');
-define('MIN_PGSQL_VERSION', '7.0.0');
-define('PUN_SEARCH_MIN_WORD', 3);
-define('PUN_SEARCH_MAX_WORD', 20);
-
-// The MySQL connection character set that was used for FluxBB 1.2 - in 99% of cases this should be detected automatically,
-// but can be overridden using the below constant if required.
-//define('FORUM_DEFAULT_CHARSET', 'latin1');
-
-
-// The number of items to process per page view (lower this if the update script times out during UTF-8 conversion)
-define('PER_PAGE', 300);
-
-// Don't set to UTF-8 until after we've found out what the default character set is
-define('FORUM_NO_SET_NAMES', 1);
-
-// Make sure we are running at least MIN_PHP_VERSION
-if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
-	exit('You are running PHP version '.PHP_VERSION.'. FluxBB '.UPDATE_TO.' requires at least PHP '.MIN_PHP_VERSION.' to run properly. You must upgrade your PHP installation before you can continue.');
-
-define('PUN_ROOT', dirname(__FILE__).'/');
-
-// Attempt to load the configuration file config.php
-if (file_exists(PUN_ROOT.'config.php'))
-	include PUN_ROOT.'config.php';
-
-// If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
-if (defined('FORUM'))
-	define('PUN', FORUM);
-
-// If PUN isn't defined, config.php is missing or corrupt
-if (!defined('PUN'))
-{
-	header('Location: install.php');
-	exit;
-}
-
-// Enable debug mode
-if (!defined('PUN_DEBUG'))
-	define('PUN_DEBUG', 1);
-
-// Load the functions script
-require PUN_ROOT.'include/functions.php';
-
-// Load UTF-8 functions
-require PUN_ROOT.'include/utf8/utf8.php';
-
-// Strip out "bad" UTF-8 characters
-forum_remove_bad_characters();
-
-// Reverse the effect of register_globals
-forum_unregister_globals();
-
-// Turn on full PHP error reporting
-error_reporting(E_ALL);
-
-// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
-setlocale(LC_CTYPE, 'C');
-
-// Turn off magic_quotes_runtime
-if (get_magic_quotes_runtime())
-	set_magic_quotes_runtime(0);
-
-// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
-if (get_magic_quotes_gpc())
-{
-	function stripslashes_array($array)
-	{
-		return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
-	}
-
-	$_GET = stripslashes_array($_GET);
-	$_POST = stripslashes_array($_POST);
-	$_COOKIE = stripslashes_array($_COOKIE);
-	$_REQUEST = stripslashes_array($_REQUEST);
-}
-
-// If a cookie name is not specified in config.php, we use the default (forum_cookie)
-if (empty($cookie_name))
-	$cookie_name = 'pun_cookie';
-
-// If the cache directory is not specified, we use the default setting
-if (!defined('FORUM_CACHE_DIR'))
-	define('FORUM_CACHE_DIR', PUN_ROOT.'cache/');
-
-// Turn off PHP time limit
-@set_time_limit(0);
-
-// Define a few commonly used constants
-define('PUN_UNVERIFIED', 0);
-define('PUN_ADMIN', 1);
-define('PUN_MOD', 2);
-define('PUN_GUEST', 3);
-define('PUN_MEMBER', 4);
-
-// Load DB abstraction layer and try to connect
-require PUN_ROOT.'include/dblayer/common_db.php';
-
-// Check what the default character set is - since 1.2 didn't specify any we will use whatever the default was (usually latin1)
-$old_connection_charset = defined('FORUM_DEFAULT_CHARSET') ? FORUM_DEFAULT_CHARSET : $db->get_names();
-
-// Set the connection to UTF-8 now
-$db->set_names('utf8');
-
-// Get the forum config
-$result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch config.', __FILE__, __LINE__, $db->error());
-while ($cur_config_item = $db->fetch_row($result))
-	$pun_config[$cur_config_item[0]] = $cur_config_item[1];
-
-// Load language file
-$default_lang = $pun_config['o_default_lang'];
-
-if (!file_exists(PUN_ROOT.'lang/'.$default_lang.'/update.php'))
-	$default_lang = 'English';
-
-require PUN_ROOT.'lang/'.$default_lang.'/common.php';
-require PUN_ROOT.'lang/'.$default_lang.'/update.php';
-
-// Check current version
-$cur_version = $pun_config['o_cur_version'];
-
-if (version_compare($cur_version, '1.2', '<'))
-	error(sprintf($lang_update['Version mismatch error'], $db_name));
-
-// Do some DB type specific checks
-$mysql = false;
-switch ($db_type)
-{
-	case 'mysql':
-	case 'mysqli':
-	case 'mysql_innodb':
-	case 'mysqli_innodb':
-		$mysql_info = $db->get_version();
-		if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<'))
-			error(sprintf($lang_update['You are running error'], 'MySQL', $mysql_info['version'], UPDATE_TO, MIN_MYSQL_VERSION));
-
-		$mysql = true;
-		break;
-
-	case 'pgsql':
-		$pgsql_info = $db->get_version();
-		if (version_compare($pgsql_info['version'], MIN_PGSQL_VERSION, '<'))
-			error(sprintf($lang_update['You are running error'], 'PostgreSQL', $pgsql_info['version'], UPDATE_TO, MIN_PGSQL_VERSION));
-
-		break;
-}
-
-// Check the database, search index and parser revision and the current version
-if (isset($pun_config['o_database_revision']) && $pun_config['o_database_revision'] >= UPDATE_TO_DB_REVISION &&
-		isset($pun_config['o_searchindex_revision']) && $pun_config['o_searchindex_revision'] >= UPDATE_TO_SI_REVISION &&
-		isset($pun_config['o_parser_revision']) && $pun_config['o_parser_revision'] >= UPDATE_TO_PARSER_REVISION &&
-		version_compare($pun_config['o_cur_version'], UPDATE_TO, '>='))
-	error($lang_update['No update error']);
-
-$default_style = $pun_config['o_default_style'];
-if (!file_exists(PUN_ROOT.'style/'.$default_style.'.css'))
-	$default_style = 'Air';
-
-// Start a session, used to queue up errors if duplicate users occur when converting from FluxBB v1.2.
-session_start();
-
-//
-// Determines whether $str is UTF-8 encoded or not
-//
-function seems_utf8($str)
-{
-	$str_len = strlen($str);
-	for ($i = 0; $i < $str_len; ++$i)
-	{
-		if (ord($str[$i]) < 0x80) continue; # 0bbbbbbb
-		else if ((ord($str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb
-		else if ((ord($str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb
-		else if ((ord($str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb
-		else if ((ord($str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb
-		else if ((ord($str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b
-		else return false; # Does not match any model
-
-		for ($j = 0; $j < $n; ++$j) # n bytes matching 10bbbbbb follow ?
-		{
-			if ((++$i == strlen($str)) || ((ord($str[$i]) & 0xC0) != 0x80))
-				return false;
-		}
-	}
-
-	return true;
-}
-
-
-//
-// Translates the number from a HTML numeric entity into an UTF-8 character
-//
-function dcr2utf8($src)
-{
-	$dest = '';
-	if ($src < 0)
-		return false;
-	else if ($src <= 0x007f)
-		$dest .= chr($src);
-	else if ($src <= 0x07ff)
-	{
-		$dest .= chr(0xc0 | ($src >> 6));
-		$dest .= chr(0x80 | ($src & 0x003f));
-	}
-	else if ($src == 0xFEFF)
-	{
-		// nop -- zap the BOM
-	}
-	else if ($src >= 0xD800 && $src <= 0xDFFF)
-	{
-		// found a surrogate
-		return false;
-	}
-	else if ($src <= 0xffff)
-	{
-		$dest .= chr(0xe0 | ($src >> 12));
-		$dest .= chr(0x80 | (($src >> 6) & 0x003f));
-		$dest .= chr(0x80 | ($src & 0x003f));
-	}
-	else if ($src <= 0x10ffff)
-	{
-		$dest .= chr(0xf0 | ($src >> 18));
-		$dest .= chr(0x80 | (($src >> 12) & 0x3f));
-		$dest .= chr(0x80 | (($src >> 6) & 0x3f));
-		$dest .= chr(0x80 | ($src & 0x3f));
-	}
-	else
-	{
-		// out of range
-		return false;
-	}
-
-	return $dest;
-}
-
-
-//
-// Attempts to convert $str from $old_charset to UTF-8. Also converts HTML entities (including numeric entities) to UTF-8 characters
-//
-function convert_to_utf8(&$str, $old_charset)
-{
-	if ($str === null || $str == '')
-		return false;
-
-	$save = $str;
-
-	// Replace literal entities (for non-UTF-8 compliant html_entity_encode)
-	if (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')
-		$str = html_entity_decode($str, ENT_QUOTES, $old_charset);
-
-	if ($old_charset != 'UTF-8' && !seems_utf8($str))
-	{
-		if (function_exists('iconv'))
-			$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1', 'UTF-8', $str);
-		else if (function_exists('mb_convert_encoding'))
-			$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');
-		else if ($old_charset == 'ISO-8859-1')
-			$str = utf8_encode($str);
-	}
-
-	// Replace literal entities (for UTF-8 compliant html_entity_encode)
-	if (version_compare(PHP_VERSION, '5.0.0', '>='))
-		$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
-
-	// Replace numeric entities
-	$str = preg_replace_callback('%&#([0-9]+);%', 'utf8_callback_1', $str);
-	$str = preg_replace_callback('%&#x([a-f0-9]+);%i', 'utf8_callback_2', $str);
-
-	// Remove "bad" characters
-	$str = remove_bad_characters($str);
-
-	return ($save != $str);
-}
-
-
-function utf8_callback_1($matches)
-{
-	return dcr2utf8($matches[1]);
-}
-
-
-function utf8_callback_2($matches)
-{
-	return dcr2utf8(hexdec($matches[1]));
-}
-
-
-//
-// Alter a table to be utf8. MySQL only
-// Function based on update_convert_table_utf8() from the Drupal project (http://drupal.org/)
-//
-function alter_table_utf8($table)
-{
-	global $mysql, $db;
-	static $types;
-
-	if (!$mysql)
-		return;
-
-	if (!isset($types))
-	{
-		$types = array(
-			'char'			=> 'binary',
-			'varchar'		=> 'varbinary',
-			'tinytext'		=> 'tinyblob',
-			'mediumtext'	=> 'mediumblob',
-			'text'			=> 'blob',
-			'longtext'		=> 'longblob'
-		);
-	}
-
-	// Set table default charset to utf8
-	$db->query('ALTER TABLE '.$table.' CHARACTER SET utf8') or error('Unable to set table character set', __FILE__, __LINE__, $db->error());
-
-	// Find out which columns need converting and build SQL statements
-	$result = $db->query('SHOW FULL COLUMNS FROM '.$table) or error('Unable to fetch column information', __FILE__, __LINE__, $db->error());
-	while ($cur_column = $db->fetch_assoc($result))
-	{
-		if ($cur_column['Collation'] === null)
-			continue;
-
-		list($type) = explode('(', $cur_column['Type']);
-		if (isset($types[$type]) && strpos($cur_column['Collation'], 'utf8') === false)
-		{
-			$allow_null = ($cur_column['Null'] == 'YES');
-			$collate = (substr($cur_column['Collation'], -3) == 'bin') ? 'utf8_bin' : 'utf8_general_ci';
-
-			$db->alter_field($table, $cur_column['Field'], preg_replace('%'.$type.'%i', $types[$type], $cur_column['Type']), $allow_null, $cur_column['Default'], null, true) or error('Unable to alter field to binary', __FILE__, __LINE__, $db->error());
-			$db->alter_field($table, $cur_column['Field'], $cur_column['Type'].' CHARACTER SET utf8 COLLATE '.$collate, $allow_null, $cur_column['Default'], null, true) or error('Unable to alter field to utf8', __FILE__, __LINE__, $db->error());
-		}
-	}
-}
-
-//
-// Safely converts text type columns into utf8
-// If finished returns true, otherwise returns $end_at
-//
-function convert_table_utf8($table, $callback, $old_charset, $key = null, $start_at = null, $error_callback = null)
-{
-	global $mysql, $db, $old_connection_charset;
-
-	$finished = true;
-	$end_at = 0;
-	if ($mysql)
-	{
-		// Only set up the tables if we are doing this in 1 go, or its the first go
-		if ($start_at === null || $start_at == 0)
-		{
-			// Drop any temp table that exists, in-case it's left over from a failed update
-			$db->drop_table($table.'_utf8', true) or error('Unable to drop left over temp table', __FILE__, __LINE__, $db->error());
-
-			// Copy the table
-			$db->query('CREATE TABLE '.$table.'_utf8 LIKE '.$table) or error('Unable to create new table', __FILE__, __LINE__, $db->error());
-
-			// Set table default charset to utf8
-			alter_table_utf8($table.'_utf8');
-		}
-
-		// Change to the old character set so MySQL doesn't attempt to perform conversion on the data from the old table
-		$db->set_names($old_connection_charset);
-
-		// Move & Convert everything
-		$result = $db->query('SELECT * FROM '.$table.($start_at === null ? '' : ' WHERE '.$key.'>'.$start_at).' ORDER BY '.$key.' ASC'.($start_at === null ? '' : ' LIMIT '.PER_PAGE), false) or error('Unable to select from old table', __FILE__, __LINE__, $db->error());
-
-		// Change back to utf8 mode so we can insert it into the new table
-		$db->set_names('utf8');
-
-		while ($cur_item = $db->fetch_assoc($result))
-		{
-			$cur_item = call_user_func($callback, $cur_item, $old_charset);
-
-			$temp = array();
-			foreach ($cur_item as $idx => $value)
-				$temp[$idx] = $value === null ? 'NULL' : '\''.$db->escape($value).'\'';
-
-			$db->query('INSERT INTO '.$table.'_utf8('.implode(',', array_keys($temp)).') VALUES ('.implode(',', array_values($temp)).')') or ($error_callback === null ? error('Unable to insert data to new table', __FILE__, __LINE__, $db->error()) : call_user_func($error_callback, $cur_item));
-
-			$end_at = $cur_item[$key];
-		}
-
-		// If we aren't doing this all in 1 go and $end_at has a value (i.e. we have processed at least 1 row), figure out if we have more to do or not
-		if ($start_at !== null && $end_at > 0)
-		{
-			$result = $db->query('SELECT 1 FROM '.$table.' WHERE '.$key.'>'.$end_at.' ORDER BY '.$key.' ASC LIMIT 1') or error('Unable to check for next row', __FILE__, __LINE__, $db->error());
-			$finished = $db->num_rows($result) == 0;
-		}
-
-		// Only swap the tables if we are doing this in 1 go, or its the last go
-		if ($finished)
-		{
-			// Delete old table
-			$db->drop_table($table, true) or error('Unable to drop old table', __FILE__, __LINE__, $db->error());
-
-			// Rename table
-			$db->query('ALTER TABLE '.$table.'_utf8 RENAME '.$table) or error('Unable to rename new table', __FILE__, __LINE__, $db->error());
-
-			return true;
-		}
-
-		return $end_at;
-	}
-	else
-	{
-		// Convert everything
-		$result = $db->query('SELECT * FROM '.$table.($start_at === null ? '' : ' WHERE '.$key.'>'.$start_at).' ORDER BY '.$key.' ASC'.($start_at === null ? '' : ' LIMIT '.PER_PAGE)) or error('Unable to select from table', __FILE__, __LINE__, $db->error());
-		while ($cur_item = $db->fetch_assoc($result))
-		{
-			$cur_item = call_user_func($callback, $cur_item, $old_charset);
-
-			$temp = array();
-			foreach ($cur_item as $idx => $value)
-				$temp[] = $idx.'='.($value === null ? 'NULL' : '\''.$db->escape($value).'\'');
-
-			if (!empty($temp))
-				$db->query('UPDATE '.$table.' SET '.implode(', ', $temp).' WHERE '.$key.'=\''.$db->escape($cur_item[$key]).'\'') or error('Unable to update data', __FILE__, __LINE__, $db->error());
-
-			$end_at = $cur_item[$key];
-		}
-
-		if ($start_at !== null && $end_at > 0)
-		{
-			$result = $db->query('SELECT 1 FROM '.$table.' WHERE '.$key.'>'.$end_at.' ORDER BY '.$key.' ASC LIMIT 1') or error('Unable to check for next row', __FILE__, __LINE__, $db->error());
-			if ($db->num_rows($result) == 0)
-				return true;
-
-			return $end_at;
-		}
-
-		return true;
-	}
-}
-
-
-header('Content-type: text/html; charset=utf-8');
-
-// Empty all output buffers and stop buffering
-while (@ob_end_clean());
-
-
-$stage = isset($_REQUEST['stage']) ? $_REQUEST['stage'] : '';
-$old_charset = isset($_REQUEST['req_old_charset']) ? str_replace('ISO8859', 'ISO-8859', strtoupper($_REQUEST['req_old_charset'])) : 'ISO-8859-1';
-$start_at = isset($_REQUEST['start_at']) ? intval($_REQUEST['start_at']) : 0;
-$query_str = '';
-
-// Show form
-if (empty($stage))
-{
-	if (file_exists(FORUM_CACHE_DIR.'db_update.lock'))
-	{
-		// Deal with newlines, tabs and multiple spaces
-		$pattern = array("\t", '  ', '  ');
-		$replace = array('&#160; &#160; ', '&#160; ', ' &#160;');
-		$message = str_replace($pattern, $replace, $pun_config['o_maintenance_message']);
-
-?>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang_common['lang_identifier'] ?>" lang="<?php echo $lang_common['lang_identifier'] ?>" dir="<?php echo $lang_common['lang_direction'] ?>">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_update['Maintenance'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
-</head>
-<body>
-
-<div id="punmaint" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div id="brdmain">
-<div class="block">
-	<h2><?php echo $lang_update['Maintenance'] ?></h2>
-	<div class="box">
-		<div class="inbox">
-			<p><?php echo $message ?></p>
-		</div>
-	</div>
-</div>
-</div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
-</div>
-
-</body>
-</html>
-<?php
-
-	}
-	else
-	{
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang_common['lang_identifier'] ?>" lang="<?php echo $lang_common['lang_identifier'] ?>" dir="<?php echo $lang_common['lang_direction'] ?>">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_update['Update'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
-</head>
-<body onload="document.getElementById('install').req_db_pass.focus();document.getElementById('install').start.disabled=false;">
-
-<div id="pundb_update" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div id="brdheader" class="block">
-	<div class="box">
-		<div id="brdtitle" class="inbox">
-			<h1><span><?php echo $lang_update['Update'] ?></span></h1>
-			<div id="brddesc"><p><?php echo $lang_update['Update message'] ?></p><p><strong><?php echo $lang_update['Note']; ?></strong> <?php echo $lang_update['Members message']; ?></p></div>
-		</div>
-	</div>
-</div>
-
-<div id="brdmain">
-<div class="blockform">
-	<h2><span><?php echo $lang_update['Update'] ?></span></h2>
-	<div class="box">
-		<form id="install" method="post" action="db_update.php">
-			<input type="hidden" name="stage" value="start" />
-			<div class="inform">
-				<fieldset>
-				<legend><?php echo $lang_update['Administrator only'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_update['Database password info'] ?></p>
-						<p><strong><?php echo $lang_update['Note']; ?></strong> <?php echo $lang_update['Database password note'] ?></p>
-						<label class="required"><strong><?php echo $lang_update['Database password'] ?> <span><?php echo $lang_update['Required'] ?></span></strong><br /><input type="password" id="req_db_pass" name="req_db_pass" /><br /></label>
-						<p><?php echo $lang_update['Maintenance message info'] ?></p>
-						<div class="txtarea">
-							<label class="required"><strong><?php echo $lang_update['Maintenance message'] ?> <span><?php echo $lang_update['Required'] ?></span></strong><br />
-							<textarea name="req_maintenance_message" rows="4" cols="65"><?php echo pun_htmlspecialchars($pun_config['o_maintenance_message']) ?></textarea><br /></label>
-						</div>
-					</div>
-				</fieldset>
-			</div>
-			<div class="inform">
-				<div class="forminfo">
-					<p><?php echo $lang_update['Intro 1'] ?></p>
-					<p><?php echo $lang_update['Intro 2'] ?></p>
-<?php
-
-	if (strpos($cur_version, '1.2') === 0)
-	{
-		if (!function_exists('iconv') && !function_exists('mb_convert_encoding'))
-		{
-
-?>
-					<p><?php echo $lang_update['No charset conversion'] ?></p>
-<?php
-
-		}
-
-?>
-				</div>
-			</div>
-			<div class="inform">
-				<div class="forminfo">
-					<p><?php echo $lang_update['Enable conversion'] ?></p>
-					<p><?php echo $lang_update['Current character set'] ?></p>
-				</div>
-				<fieldset>
-					<legend><?php echo $lang_update['Charset conversion'] ?></legend>
-					<div class="infldset">
-						<div class="rbox">
-							<label><input type="checkbox" name="convert_charset" value="1" checked="checked" /><?php echo $lang_update['Enable conversion label'] ?><br /></label>
-						</div>
-						<label>
-							<strong><?php echo $lang_update['Current character set label'] ?></strong><br /><?php echo $lang_update['Current character set info'] ?><br />
-							<input type="text" name="req_old_charset" size="12" maxlength="20" value="<?php echo $old_charset ?>" /><br />
-						</label>
-					</div>
-				</fieldset>
-<?php
-
-	}
-	else
-		echo "\t\t\t\t".'</div>'."\n";
-
-?>
-			</div>
-			<p class="buttons"><input type="submit" name="start" value="<?php echo $lang_update['Start update'] ?>" /></p>
-		</form>
-	</div>
-</div>
-</div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
-</div>
-
-</body>
-</html>
-<?php
-
-	}
-	$db->end_transaction();
-	$db->close();
-	exit;
-
-}
-
-// Read the lock file
-$lock = file_exists(FORUM_CACHE_DIR.'db_update.lock') ? trim(file_get_contents(FORUM_CACHE_DIR.'db_update.lock')) : false;
-$lock_error = false;
-
-// Generate or fetch the UID - this confirms we have a valid admin
-if (isset($_POST['req_db_pass']))
-{
-	$req_db_pass = strtolower(trim($_POST['req_db_pass']));
-
-	switch ($db_type)
-	{
-		// For SQLite we compare against the database file name, since the password is left blank
-		case 'sqlite':
-			if ($req_db_pass != strtolower($db_name))
-				error(sprintf($lang_update['Invalid file error'], 'config.php'));
-
-			break;
-		// For everything else, check the password matches
-		default:
-			if ($req_db_pass != strtolower($db_password))
-				error(sprintf($lang_update['Invalid password error'], 'config.php'));
-
-			break;
-	}
-
-	// Generate a unique id to identify this session, only if this is a valid session
-	$uid = pun_hash($req_db_pass.'|'.uniqid(rand(), true));
-	if ($lock) // We already have a lock file
-		$lock_error = true;
-	else // Create the lock file
-	{
-		$fh = @fopen(FORUM_CACHE_DIR.'db_update.lock', 'wb');
-		if (!$fh)
-			error(sprintf($lang_update['Unable to lock error'], 'cache'));
-
-		fwrite($fh, $uid);
-		fclose($fh);
-
-		// Update maintenance message
-		if ($_POST['req_maintenance_message'] != '')
-			$maintenance_message = pun_trim(pun_linebreaks($_POST['req_maintenance_message']));
-		else
-		{
-			// Load the admin_options.php language file
-			require PUN_ROOT.'lang/'.$default_lang.'/admin_options.php';
-
-			$maintenance_message = $lang_admin_options['Default maintenance message'];
-		}
-
-		$db->query('UPDATE '.$db->prefix.'config SET conf_value=\''.$db->escape($maintenance_message).'\' WHERE conf_name=\'o_maintenance_message\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
-
-		// Regenerate the config cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_config_cache();
-	}
-}
-else if (isset($_GET['uid']))
-{
-	$uid = trim($_GET['uid']);
-	if (!$lock || $lock != $uid) // The lock doesn't exist or doesn't match the given UID
-		$lock_error = true;
-}
-else
-	error($lang_update['No password error']);
-
-// If there is an error with the lock file
-if ($lock_error)
-	error(sprintf($lang_update['Script runs error'], FORUM_CACHE_DIR.'db_update.lock'));
-
-switch ($stage)
-{
-	// Start by updating the database structure
-	case 'start':
-		$query_str = '?stage=preparse_posts';
-
-		// If we don't need to update the database, skip this stage
-		if (isset($pun_config['o_database_revision']) && $pun_config['o_database_revision'] >= UPDATE_TO_DB_REVISION)
-			break;
-
-		// Make all email fields VARCHAR(80)
-		$db->alter_field('bans', 'email', 'VARCHAR(80)', true) or error('Unable to alter email field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('posts', 'poster_email', 'VARCHAR(80)', true) or error('Unable to alter poster_email field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('users', 'email', 'VARCHAR(80)', false, '') or error('Unable to alter email field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('users', 'jabber', 'VARCHAR(80)', true) or error('Unable to alter jabber field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('users', 'msn', 'VARCHAR(80)', true) or error('Unable to alter msn field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('users', 'activate_string', 'VARCHAR(80)', true) or error('Unable to alter activate_string field', __FILE__, __LINE__, $db->error());
-
-		// Make all IP fields VARCHAR(39) to support IPv6
-		$db->alter_field('posts', 'poster_ip', 'VARCHAR(39)', true) or error('Unable to alter poster_ip field', __FILE__, __LINE__, $db->error());
-		$db->alter_field('users', 'registration_ip', 'VARCHAR(39)', false, '0.0.0.0') or error('Unable to alter registration_ip field', __FILE__, __LINE__, $db->error());
-
-		// Make the message field MEDIUMTEXT to allow proper conversion of 65535 character posts to UTF-8
-		$db->alter_field('posts', 'message', 'MEDIUMTEXT', true) or error('Unable to alter message field', __FILE__, __LINE__, $db->error());
-
-		// Add the DST option to the users table
-		$db->add_field('users', 'dst', 'TINYINT(1)', false, 0, 'timezone') or error('Unable to add dst field', __FILE__, __LINE__, $db->error());
-
-		// Add the last_post field to the online table
-		$db->add_field('online', 'last_post', 'INT(10) UNSIGNED', true, null, null) or error('Unable to add last_post field', __FILE__, __LINE__, $db->error());
-
-		// Add the last_search field to the online table
-		$db->add_field('online', 'last_search', 'INT(10) UNSIGNED', true, null, null) or error('Unable to add last_search field', __FILE__, __LINE__, $db->error());
-
-		// Add the last_search column to the users table
-		$db->add_field('users', 'last_search', 'INT(10) UNSIGNED', true, null, 'last_post') or error('Unable to add last_search field', __FILE__, __LINE__, $db->error());
-
-		// Drop use_avatar column from users table
-		$db->drop_field('users', 'use_avatar') or error('Unable to drop use_avatar field', __FILE__, __LINE__, $db->error());
-
-		// Drop save_pass column from users table
-		$db->drop_field('users', 'save_pass') or error('Unable to drop save_pass field', __FILE__, __LINE__, $db->error());
-
-		// Drop g_edit_subjects_interval column from groups table
-		$db->drop_field('groups', 'g_edit_subjects_interval');
-
-		// Add database revision number
-		if (!array_key_exists('o_database_revision', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_database_revision\', \'0\')') or error('Unable to insert config value \'o_database_revision\'', __FILE__, __LINE__, $db->error());
-
-		// Add search index revision number
-		if (!array_key_exists('o_searchindex_revision', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_searchindex_revision\', \'0\')') or error('Unable to insert config value \'o_searchindex_revision\'', __FILE__, __LINE__, $db->error());
-
-		// Add parser revision number
-		if (!array_key_exists('o_parser_revision', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_parser_revision\', \'0\')') or error('Unable to insert config value \'o_parser_revision\'', __FILE__, __LINE__, $db->error());
-
-		// Add default email setting option
-		if (!array_key_exists('o_default_email_setting', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_default_email_setting\', \'1\')') or error('Unable to insert config value \'o_default_email_setting\'', __FILE__, __LINE__, $db->error());
-
-		// Make sure we have o_additional_navlinks (was added in 1.2.1)
-		if (!array_key_exists('o_additional_navlinks', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_additional_navlinks\', \'\')') or error('Unable to insert config value \'o_additional_navlinks\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_topic_views
-		if (!array_key_exists('o_topic_views', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_topic_views\', \'1\')') or error('Unable to insert config value \'o_topic_views\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_signatures
-		if (!array_key_exists('o_signatures', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_signatures\', \'1\')') or error('Unable to insert config value \'o_signatures\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_smtp_ssl
-		if (!array_key_exists('o_smtp_ssl', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_smtp_ssl\', \'0\')') or error('Unable to insert config value \'o_smtp_ssl\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_default_dst
-		if (!array_key_exists('o_default_dst', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_default_dst\', \'0\')') or error('Unable to insert config value \'o_default_dst\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_quote_depth
-		if (!array_key_exists('o_quote_depth', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_quote_depth\', \'3\')') or error('Unable to insert config value \'o_quote_depth\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_feed_type
-		if (!array_key_exists('o_feed_type', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_feed_type\', \'2\')') or error('Unable to insert config value \'o_feed_type\'', __FILE__, __LINE__, $db->error());
-
-		// Insert new config option o_feed_ttl
-		if (!array_key_exists('o_feed_ttl', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_feed_ttl\', \'0\')') or error('Unable to insert config value \'o_feed_ttl\'', __FILE__, __LINE__, $db->error());
-
-		// Insert config option o_base_url which was removed in 1.3
-		if (!array_key_exists('o_base_url', $pun_config))
-		{
-			// If it isn't in $pun_config['o_base_url'] it should be in $base_url, but just in-case it isn't we can make a guess at it
-			if (!isset($base_url))
-			{
-				// Make an educated guess regarding base_url
-				$base_url  = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';	// protocol
-				$base_url .= preg_replace('%:(80|443)$%', '', $_SERVER['HTTP_HOST']);							// host[:port]
-				$base_url .= str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));							// path
-			}
-
-			if (substr($base_url, -1) == '/')
-				$base_url = substr($base_url, 0, -1);
-
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_base_url\', \''.$db->escape($base_url).'\')') or error('Unable to insert config value \'o_quote_depth\'', __FILE__, __LINE__, $db->error());
-		}
-
-		if (strpos($cur_version, '1.2') === 0)
-		{
-			// Groups are almost the same as 1.2:
-			// unverified:	32000 -> 0
-
-			$db->query('UPDATE '.$db->prefix.'users SET group_id = 0 WHERE group_id = 32000') or error('Unable to update unverified users', __FILE__, __LINE__, $db->error());
-		}
-		else if (strpos($cur_version, '1.3') === 0)
-		{
-			// Groups have changed quite a lot from 1.3:
-			// unverified:	0 -> 0
-			// admin:		1 -> 1
-			// mod:			? -> 2
-			// guest:		2 -> 3
-			// member:		? -> 4
-
-			$result = $db->query('SELECT MAX(g_id) + 1 FROM '.$db->prefix.'groups') or error('Unable to select temp group ID', __FILE__, __LINE__, $db->error());
-			$temp_id = $db->result($result);
-
-			$result = $db->query('SELECT g_id FROM '.$db->prefix.'groups WHERE g_moderator = 1 AND g_id > 1 LIMIT 1') or error('Unable to select moderator group', __FILE__, __LINE__, $db->error());
-			if ($db->num_rows($result))
-				$mod_gid = $db->result($result);
-			else
-			{
-				$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES('."'Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
-				$mod_gid = $db->insert_id();
-			}
-
-			$member_gid = $pun_config['o_default_user_group'];
-
-			// move the mod group to a temp place
-			$db->query('UPDATE '.$db->prefix.'groups SET g_id = '.$temp_id.' WHERE g_id = '.$mod_gid) or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'users SET group_id = '.$temp_id.' WHERE group_id = '.$mod_gid) or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = '.$temp_id.' WHERE group_id = '.$mod_gid) or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-			if ($member_gid == $mod_gid) $member_gid = $temp_id;
-
-			// move whoever is in 3 to a spare slot
-			$db->query('UPDATE '.$db->prefix.'groups SET g_id = '.$mod_gid.' WHERE g_id = 3') or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'users SET group_id = '.$mod_gid.' WHERE group_id = 3') or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = '.$mod_gid.' WHERE group_id = 3') or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-			if ($member_gid == 3) $member_gid = $mod_gid;
-
-			// move guest to 3
-			$db->query('UPDATE '.$db->prefix.'groups SET g_id = 3 WHERE g_id = 2') or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'users SET group_id = 3 WHERE group_id = 2') or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = 3 WHERE group_id = 2') or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-			if ($member_gid == 2) $member_gid = 3;
-
-			// move mod group in temp place to 2
-			$db->query('UPDATE '.$db->prefix.'groups SET g_id = 2 WHERE g_id = '.$temp_id) or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'users SET group_id = 2 WHERE group_id = '.$temp_id) or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-			$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = 2 WHERE group_id = '.$temp_id) or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-			if ($member_gid == $temp_id) $member_gid = 2;
-
-			// Only move stuff around if it isn't already in the right place
-			if ($member_gid != $mod_gid || $member_gid != 4)
-			{
-				// move members to temp place
-				$db->query('UPDATE '.$db->prefix.'groups SET g_id = '.$temp_id.' WHERE g_id = '.$member_gid) or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'users SET group_id = '.$temp_id.' WHERE group_id = '.$member_gid) or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = '.$temp_id.' WHERE group_id = '.$member_gid) or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-
-				// move whoever is in 4 to members place
-				$db->query('UPDATE '.$db->prefix.'groups SET g_id = '.$member_gid.' WHERE g_id = 4') or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'users SET group_id = '.$member_gid.' WHERE group_id = 4') or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = '.$member_gid.' WHERE group_id = 4') or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-
-				// move members in temp place to 4
-				$db->query('UPDATE '.$db->prefix.'groups SET g_id = 4 WHERE g_id = '.$temp_id) or error('Unable to update group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'users SET group_id = 4 WHERE group_id = '.$temp_id) or error('Unable to update users group ID', __FILE__, __LINE__, $db->error());
-				$db->query('UPDATE '.$db->prefix.'forum_perms SET group_id = 4 WHERE group_id = '.$temp_id) or error('Unable to forum_perms group ID', __FILE__, __LINE__, $db->error());
-			}
-
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value=\''.$member_gid.'\' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update default user group ID', __FILE__, __LINE__, $db->error());
-		}
-
-		// Server time zone is now simply the default time zone
-		if (!array_key_exists('o_default_timezone', $pun_config))
-			$db->query('UPDATE '.$db->prefix.'config SET conf_name = \'o_default_timezone\' WHERE conf_name = \'o_server_timezone\'') or error('Unable to update time zone config', __FILE__, __LINE__, $db->error());
-
-		// Increase visit timeout to 30 minutes (only if it hasn't been changed from the default)
-		if (!array_key_exists('o_database_revision', $pun_config) && $pun_config['o_timeout_visit'] == '600')
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value = \'1800\' WHERE conf_name = \'o_timeout_visit\'') or error('Unable to update visit timeout config', __FILE__, __LINE__, $db->error());
-
-		// Remove obsolete g_post_polls permission from groups table
-		$db->drop_field('groups', 'g_post_polls');
-
-		// Make room for multiple moderator groups
-		if (!$db->field_exists('groups', 'g_moderator'))
-		{
-			// Add g_moderator column to groups table
-			$db->add_field('groups', 'g_moderator', 'TINYINT(1)', false, 0, 'g_user_title') or error('Unable to add g_moderator field', __FILE__, __LINE__, $db->error());
-
-			// Give the moderator group moderator privileges
-			$db->query('UPDATE '.$db->prefix.'groups SET g_moderator = 1 WHERE g_id = 2') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-		}
-
-		// Replace obsolete p_mod_edit_users config setting with new per-group permission
-		if (array_key_exists('p_mod_edit_users', $pun_config))
-		{
-			$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'p_mod_edit_users\'') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-
-			$db->add_field('groups', 'g_mod_edit_users', 'TINYINT(1)', false, 0, 'g_moderator') or error('Unable to add g_mod_edit_users field', __FILE__, __LINE__, $db->error());
-
-			$db->query('UPDATE '.$db->prefix.'groups SET g_mod_edit_users = '.$pun_config['p_mod_edit_users'].' WHERE g_moderator = 1') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-		}
-
-		// Replace obsolete p_mod_rename_users config setting with new per-group permission
-		if (array_key_exists('p_mod_rename_users', $pun_config))
-		{
-			$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'p_mod_rename_users\'') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-
-			$db->add_field('groups', 'g_mod_rename_users', 'TINYINT(1)', false, 0, 'g_mod_edit_users') or error('Unable to add g_mod_rename_users field', __FILE__, __LINE__, $db->error());
-
-			$db->query('UPDATE '.$db->prefix.'groups SET g_mod_rename_users = '.$pun_config['p_mod_rename_users'].' WHERE g_moderator = 1') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-		}
-
-		// Replace obsolete p_mod_change_passwords config setting with new per-group permission
-		if (array_key_exists('p_mod_change_passwords', $pun_config))
-		{
-			$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'p_mod_change_passwords\'') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-
-			$db->add_field('groups', 'g_mod_change_passwords', 'TINYINT(1)', false, 0, 'g_mod_rename_users') or error('Unable to add g_mod_change_passwords field', __FILE__, __LINE__, $db->error());
-
-			$db->query('UPDATE '.$db->prefix.'groups SET g_mod_change_passwords = '.$pun_config['p_mod_change_passwords'].' WHERE g_moderator = 1') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-		}
-
-		// Replace obsolete p_mod_ban_users config setting with new per-group permission
-		if (array_key_exists('p_mod_ban_users', $pun_config))
-		{
-			$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'p_mod_ban_users\'') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-
-			$db->add_field('groups', 'g_mod_ban_users', 'TINYINT(1)', false, 0, 'g_mod_change_passwords') or error('Unable to add g_mod_ban_users field', __FILE__, __LINE__, $db->error());
-
-			$db->query('UPDATE '.$db->prefix.'groups SET g_mod_ban_users = '.$pun_config['p_mod_ban_users'].' WHERE g_moderator = 1') or error('Unable to update moderator powers', __FILE__, __LINE__, $db->error());
-		}
-
-		// We need to add a unique index to avoid users having multiple rows in the online table
-		if (!$db->index_exists('online', 'user_id_ident_idx'))
-		{
-			$db->truncate_table('online') or error('Unable to clear online table', __FILE__, __LINE__, $db->error());
-
-			if ($mysql)
-				$db->add_index('online', 'user_id_ident_idx', array('user_id', 'ident(25)'), true) or error('Unable to add user_id_ident_idx index', __FILE__, __LINE__, $db->error());
-			else
-				$db->add_index('online', 'user_id_ident_idx', array('user_id', 'ident'), true) or error('Unable to add user_id_ident_idx index', __FILE__, __LINE__, $db->error());
-		}
-
-		// Remove the redundant user_id_idx on the online table
-		$db->drop_index('online', 'user_id_idx') or error('Unable to drop user_id_idx index', __FILE__, __LINE__, $db->error());
-
-		// Add an index to ident on the online table
-		if ($mysql)
-			$db->add_index('online', 'ident_idx', array('ident(25)')) or error('Unable to add ident_idx index', __FILE__, __LINE__, $db->error());
-		else
-			$db->add_index('online', 'ident_idx', array('ident')) or error('Unable to add ident_idx index', __FILE__, __LINE__, $db->error());
-
-		// Add an index to logged in the online table
-		$db->add_index('online', 'logged_idx', array('logged')) or error('Unable to add logged_idx index', __FILE__, __LINE__, $db->error());
-
-		// Add an index to last_post in the topics table
-		$db->add_index('topics', 'last_post_idx', array('last_post')) or error('Unable to add last_post_idx index', __FILE__, __LINE__, $db->error());
-
-		// Add an index to username on the bans table
-		if ($mysql)
-			$db->add_index('bans', 'username_idx', array('username(25)')) or error('Unable to add username_idx index', __FILE__, __LINE__, $db->error());
-		else
-			$db->add_index('bans', 'username_idx', array('username')) or error('Unable to add username_idx index', __FILE__, __LINE__, $db->error());
-
-		// Change the username_idx on users to a unique index of max size 25
-		$db->drop_index('users', 'username_idx') or error('Unable to drop old username_idx index', __FILE__, __LINE__, $db->error());
-		$field = $mysql ? 'username(25)' : 'username';
-
-		// Attempt to add a unique index. If the user doesn't use a transactional database this can fail due to multiple matching usernames in the
-		// users table. This is bad, but just giving up if it happens is even worse! If it fails just add a regular non-unique index.
-		if (!$db->add_index('users', 'username_idx', array($field), true))
-			$db->add_index('users', 'username_idx', array($field)) or error('Unable to add username_idx field', __FILE__, __LINE__, $db->error());
-
-		// Add g_view_users field to groups table
-		$db->add_field('groups', 'g_view_users', 'TINYINT(1)', false, 1, 'g_read_board') or error('Unable to add g_view_users field', __FILE__, __LINE__, $db->error());
-
-		// Add the last_email_sent column to the users table and the g_send_email and
-		// g_email_flood columns to the groups table
-		$db->add_field('users', 'last_email_sent', 'INT(10) UNSIGNED', true, null, 'last_search') or error('Unable to add last_email_sent field', __FILE__, __LINE__, $db->error());
-		$db->add_field('groups', 'g_send_email', 'TINYINT(1)', false, 1, 'g_search_users') or error('Unable to add g_send_email field', __FILE__, __LINE__, $db->error());
-		$db->add_field('groups', 'g_email_flood', 'SMALLINT(6)', false, 60, 'g_search_flood') or error('Unable to add g_email_flood field', __FILE__, __LINE__, $db->error());
-
-		// Add the last_report_sent column to the users table and the g_report_flood
-		// column to the groups table
-		$db->add_field('users', 'last_report_sent', 'INT(10) UNSIGNED', true, null, 'last_email_sent') or error('Unable to add last_report_sent field', __FILE__, __LINE__, $db->error());
-		$db->add_field('groups', 'g_report_flood', 'SMALLINT(6)', false, 60, 'g_email_flood') or error('Unable to add g_report_flood field', __FILE__, __LINE__, $db->error());
-
-		// Set non-default g_send_email, g_flood_email and g_flood_report values properly
-		$db->query('UPDATE '.$db->prefix.'groups SET g_send_email = 0 WHERE g_id = 3') or error('Unable to update group email permissions', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'groups SET g_email_flood = 0, g_report_flood = 0 WHERE g_id IN (1,2,3)') or error('Unable to update group email permissions', __FILE__, __LINE__, $db->error());
-
-		// Add the auto notify/subscription option to the users table
-		$db->add_field('users', 'auto_notify', 'TINYINT(1)', false, 0, 'notify_with_post') or error('Unable to add auto_notify field', __FILE__, __LINE__, $db->error());
-
-		// Add the first_post_id column to the topics table
-		if (!$db->field_exists('topics', 'first_post_id'))
-		{
-			$db->add_field('topics', 'first_post_id', 'INT(10) UNSIGNED', false, 0, 'posted') or error('Unable to add first_post_id field', __FILE__, __LINE__, $db->error());
-			$db->add_index('topics', 'first_post_id_idx', array('first_post_id')) or error('Unable to add first_post_id_idx index', __FILE__, __LINE__, $db->error());
-
-			// Now that we've added the column and indexed it, we need to give it correct data
-			$result = $db->query('SELECT MIN(id) AS first_post, topic_id FROM '.$db->prefix.'posts GROUP BY topic_id') or error('Unable to fetch first_post_id', __FILE__, __LINE__, $db->error());
-
-			while ($cur_post = $db->fetch_assoc($result))
-				$db->query('UPDATE '.$db->prefix.'topics SET first_post_id = '.$cur_post['first_post'].' WHERE id = '.$cur_post['topic_id']) or error('Unable to update first_post_id', __FILE__, __LINE__, $db->error());
-		}
-
-		// Move any users with the old unverified status to their new group
-		$db->query('UPDATE '.$db->prefix.'users SET group_id=0 WHERE group_id=32000') or error('Unable to move unverified users', __FILE__, __LINE__, $db->error());
-
-		// Add the ban_creator column to the bans table
-		$db->add_field('bans', 'ban_creator', 'INT(10) UNSIGNED', false, 0) or error('Unable to add ban_creator field', __FILE__, __LINE__, $db->error());
-
-		// Add the time/date format settings to the user table
-		$db->add_field('users', 'time_format', 'TINYINT(1)', false, 0, 'dst') or error('Unable to add time_format field', __FILE__, __LINE__, $db->error());
-		$db->add_field('users', 'date_format', 'TINYINT(1)', false, 0, 'dst') or error('Unable to add date_format field', __FILE__, __LINE__, $db->error());
-
-		// Change the search_data field to mediumtext
-		$db->alter_field('search_cache', 'search_data', 'MEDIUMTEXT', true) or error('Unable to alter search_data field', __FILE__, __LINE__, $db->error());
-
-		// Incase we had the fulltext search extension installed (1.3-legacy), remove it
-		$db->drop_index('topics', 'subject_idx') or error('Unable to drop subject_idx index', __FILE__, __LINE__, $db->error());
-		$db->drop_index('posts', 'message_idx') or error('Unable to drop message_idx index', __FILE__, __LINE__, $db->error());
-		// Incase we had the fulltext search mod installed (1.2), remove it
-		$db->drop_index('topics', 'subject_fulltext_search') or error('Unable to drop subject_fulltext_search index', __FILE__, __LINE__, $db->error());
-		$db->drop_index('posts', 'message_fulltext_search') or error('Unable to drop message_fulltext_search index', __FILE__, __LINE__, $db->error());
-
-		// If the search_cache table has been dropped by the fulltext search extension, recreate it
-		if (!$db->table_exists('search_cache'))
-		{
-			$schema = array(
-				'FIELDS'		=> array(
-					'id'			=> array(
-						'datatype'		=> 'INT(10) UNSIGNED',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					),
-					'ident'			=> array(
-						'datatype'		=> 'VARCHAR(200)',
-						'allow_null'	=> false,
-						'default'		=> '\'\''
-					),
-					'search_data'	=> array(
-						'datatype'		=> 'MEDIUMTEXT',
-						'allow_null'	=> true
-					)
-				),
-				'PRIMARY KEY'	=> array('id'),
-				'INDEXES'		=> array(
-					'ident_idx'	=> array('ident')
-				)
-			);
-
-			if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-				$schema['INDEXES']['ident_idx'] = array('ident(8)');
-
-			$db->create_table('search_cache', $schema);
-		}
-
-		// If the search_matches table has been dropped by the fulltext search extension, recreate it
-		if (!$db->table_exists('search_matches'))
-		{
-			$schema = array(
-				'FIELDS'		=> array(
-					'post_id'		=> array(
-						'datatype'		=> 'INT(10) UNSIGNED',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					),
-					'word_id'		=> array(
-						'datatype'		=> 'INT(10) UNSIGNED',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					),
-					'subject_match'	=> array(
-						'datatype'		=> 'TINYINT(1)',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					)
-				),
-				'INDEXES'		=> array(
-					'word_id_idx'	=> array('word_id'),
-					'post_id_idx'	=> array('post_id')
-				)
-			);
-
-			$db->create_table('search_matches', $schema);
-		}
-
-		// If the search_words table has been dropped by the fulltext search extension, recreate it
-		if (!$db->table_exists('search_words'))
-		{
-			$schema = array(
-				'FIELDS'		=> array(
-					'id'			=> array(
-						'datatype'		=> 'SERIAL',
-						'allow_null'	=> false
-					),
-					'word'			=> array(
-						'datatype'		=> 'VARCHAR(20)',
-						'allow_null'	=> false,
-						'default'		=> '\'\'',
-						'collation'		=> 'bin'
-					)
-				),
-				'PRIMARY KEY'	=> array('word'),
-				'INDEXES'		=> array(
-					'id_idx'	=> array('id')
-				)
-			);
-
-			if ($db_type == 'sqlite')
-			{
-				$schema['PRIMARY KEY'] = array('id');
-				$schema['UNIQUE KEYS'] = array('word_idx'	=> array('word'));
-			}
-
-			$db->create_table('search_words', $schema);
-		}
-
-		// Rename the subscription table
-		$db->rename_table('subscriptions', 'topic_subscriptions');
-
-		// if we don't have the forum_subscriptions table, create it
-		if (!$db->table_exists('forum_subscriptions'))
-		{
-			$schema = array(
-				'FIELDS'		=> array(
-					'user_id'		=> array(
-						'datatype'		=> 'INT(10) UNSIGNED',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					),
-					'forum_id'		=> array(
-						'datatype'		=> 'INT(10) UNSIGNED',
-						'allow_null'	=> false,
-						'default'		=> '0'
-					)
-				),
-				'PRIMARY KEY'	=> array('user_id', 'forum_id')
-			);
-
-			$db->create_table('forum_subscriptions', $schema) or error('Unable to create forum subscriptions table', __FILE__, __LINE__, $db->error());
-		}
-
-		// Insert new config option o_forum_subscriptions
-		if (!array_key_exists('o_forum_subscriptions', $pun_config))
-			$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_forum_subscriptions\', \'1\')') or error('Unable to insert config value \'o_forum_subscriptions\'', __FILE__, __LINE__, $db->error());
-
-		// Rename config option o_subscriptions to o_topic_subscriptions
-		if (!array_key_exists('o_topic_subscriptions', $pun_config))
-			$db->query('UPDATE '.$db->prefix.'config SET conf_name=\'o_topic_subscriptions\' WHERE conf_name=\'o_subscriptions\'') or error('Unable to rename config value \'o_subscriptions\'', __FILE__, __LINE__, $db->error());
-
-		// Change the default style if the old doesn't exist anymore
-		if ($pun_config['o_default_style'] != $default_style)
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value = \''.$db->escape($default_style).'\' WHERE conf_name = \'o_default_style\'') or error('Unable to update default style config', __FILE__, __LINE__, $db->error());
-
-		// For MySQL(i) without InnoDB, change the engine of the online table (for performance reasons)
-		if ($db_type == 'mysql' || $db_type == 'mysqli')
-			$db->query('ALTER TABLE '.$db->prefix.'online ENGINE = MyISAM') or error('Unable to change engine type of online table to MyISAM', __FILE__, __LINE__, $db->error());
-
-		// Should we do charset conversion or not?
-		if (strpos($cur_version, '1.2') === 0 && isset($_POST['convert_charset']))
-			$query_str = '?stage=conv_bans&req_old_charset='.$old_charset;
-
-		break;
-
-
-	// Convert bans
-	case 'conv_bans':
-		$query_str = '?stage=conv_categories&req_old_charset='.$old_charset;
-
-		function _conv_bans($cur_item, $old_charset)
-		{
-			global $lang_update;
-
-			echo sprintf($lang_update['Converting item'], $lang_update['ban'], $cur_item['id']).'<br />'."\n";
-
-			convert_to_utf8($cur_item['username'], $old_charset);
-			convert_to_utf8($cur_item['message'], $old_charset);
-
-			return $cur_item;
-		}
-
-		$end_at = convert_table_utf8($db->prefix.'bans', '_conv_bans', $old_charset, 'id', $start_at);
-
-		if ($end_at !== true)
-			$query_str = '?stage=conv_bans&req_old_charset='.$old_charset.'&start_at='.$end_at;
-
-		break;
-
-
-	// Convert categories
-	case 'conv_categories':
-		$query_str = '?stage=conv_censors&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['categories']).'<br />'."\n";
-
-		function _conv_categories($cur_item, $old_charset)
-		{
-			convert_to_utf8($cur_item['cat_name'], $old_charset);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'categories', '_conv_categories', $old_charset, 'id');
-
-		break;
-
-
-	// Convert censor words
-	case 'conv_censors':
-		$query_str = '?stage=conv_config&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['censor words']).'<br />'."\n";
-
-		function _conv_censoring($cur_item, $old_charset)
-		{
-			convert_to_utf8($cur_item['search_for'], $old_charset);
-			convert_to_utf8($cur_item['replace_with'], $old_charset);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'censoring', '_conv_censoring', $old_charset, 'id');
-
-		break;
-
-
-	// Convert config
-	case 'conv_config':
-		$query_str = '?stage=conv_forums&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['configuration']).'<br />'."\n";
-
-		function _conv_config($cur_item, $old_charset)
-		{
-			convert_to_utf8($cur_item['conf_value'], $old_charset);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'config', '_conv_config', $old_charset, 'conf_name');
-
-		break;
-
-
-	// Convert forums
-	case 'conv_forums':
-		$query_str = '?stage=conv_perms&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['forums']).'<br />'."\n";
-
-		function _conv_forums($cur_item, $old_charset)
-		{
-			$moderators = ($cur_item['moderators'] != '') ? unserialize($cur_item['moderators']) : array();
-			$moderators_utf8 = array();
-			foreach ($moderators as $mod_username => $mod_user_id)
-			{
-				convert_to_utf8($mod_username, $old_charset);
-				$moderators_utf8[$mod_username] = $mod_user_id;
-			}
-
-			convert_to_utf8($cur_item['forum_name'], $old_charset);
-			convert_to_utf8($cur_item['forum_desc'], $old_charset);
-
-			if (!empty($moderators_utf8))
-				$cur_item['moderators'] = serialize($moderators_utf8);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'forums', '_conv_forums', $old_charset, 'id');
-
-		break;
-
-
-	// Convert forum permissions
-	case 'conv_perms':
-		$query_str = '?stage=conv_groups&req_old_charset='.$old_charset;
-
-		alter_table_utf8($db->prefix.'forum_perms');
-
-		break;
-
-
-	// Convert groups
-	case 'conv_groups':
-		$query_str = '?stage=conv_online&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['groups']).'<br />'."\n";
-
-		function _conv_groups($cur_item, $old_charset)
-		{
-			convert_to_utf8($cur_item['g_title'], $old_charset);
-			convert_to_utf8($cur_item['g_user_title'], $old_charset);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'groups', '_conv_groups', $old_charset, 'g_id');
-
-		break;
-
-
-	// Convert online
-	case 'conv_online':
-		$query_str = '?stage=conv_posts&req_old_charset='.$old_charset;
-
-		// Truncate the table
-		$db->truncate_table('online') or error('Unable to empty online table', __FILE__, __LINE__, $db->error());
-
-		alter_table_utf8($db->prefix.'online');
-
-		break;
-
-
-	// Convert posts
-	case 'conv_posts':
-		$query_str = '?stage=conv_ranks&req_old_charset='.$old_charset;
-
-		function _conv_posts($cur_item, $old_charset)
-		{
-			global $lang_update;
-
-			echo sprintf($lang_update['Converting item'], $lang_update['post'], $cur_item['id']).'<br />'."\n";
-
-			convert_to_utf8($cur_item['poster'], $old_charset);
-			convert_to_utf8($cur_item['message'], $old_charset);
-			convert_to_utf8($cur_item['edited_by'], $old_charset);
-
-			return $cur_item;
-		}
-
-		$end_at = convert_table_utf8($db->prefix.'posts', '_conv_posts', $old_charset, 'id', $start_at);
-
-		if ($end_at !== true)
-			$query_str = '?stage=conv_posts&req_old_charset='.$old_charset.'&start_at='.$end_at;
-
-		break;
-
-
-	// Convert ranks
-	case 'conv_ranks':
-		$query_str = '?stage=conv_reports&req_old_charset='.$old_charset;
-
-		echo sprintf($lang_update['Converting'], $lang_update['ranks']).'<br />'."\n";
-
-		function _conv_ranks($cur_item, $old_charset)
-		{
-			convert_to_utf8($cur_item['rank'], $old_charset);
-
-			return $cur_item;
-		}
-
-		convert_table_utf8($db->prefix.'ranks', '_conv_ranks', $old_charset, 'id');
-
-		break;
-
-
-	// Convert reports
-	case 'conv_reports':
-		$query_str = '?stage=conv_search_cache&req_old_charset='.$old_charset;
-
-		function _conv_reports($cur_item, $old_charset)
-		{
-			global $lang_update;
-
-			echo sprintf($lang_update['Converting item'], $lang_update['report'], $cur_item['id']).'<br />'."\n";
-
-			convert_to_utf8($cur_item['message'], $old_charset);
-
-			return $cur_item;
-		}
-
-		$end_at = convert_table_utf8($db->prefix.'reports', '_conv_reports', $old_charset, 'id', $start_at);
-
-		if ($end_at !== true)
-			$query_str = '?stage=conv_reports&req_old_charset='.$old_charset.'&start_at='.$end_at;
-
-		break;
-
-
-	// Convert search cache
-	case 'conv_search_cache':
-		$query_str = '?stage=conv_search_matches&req_old_charset='.$old_charset;
-
-		// Truncate the table
-		$db->truncate_table('search_cache') or error('Unable to empty search cache table', __FILE__, __LINE__, $db->error());
-
-		alter_table_utf8($db->prefix.'search_cache');
-
-		break;
-
-
-	// Convert search matches
-	case 'conv_search_matches':
-		$query_str = '?stage=conv_search_words&req_old_charset='.$old_charset;
-
-		// Truncate the table
-		$db->truncate_table('search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $db->error());
-
-		alter_table_utf8($db->prefix.'search_matches');
-
-		break;
-
-
-	// Convert search words
-	case 'conv_search_words':
-		$query_str = '?stage=conv_subscriptions&req_old_charset='.$old_charset;
-
-		// Truncate the table
-		$db->truncate_table('search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $db->error());
-
-		// Reset the sequence for the search words (not needed for SQLite)
-		switch ($db_type)
-		{
-			case 'mysql':
-			case 'mysqli':
-			case 'mysql_innodb':
-			case 'mysqli_innodb':
-				$db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $db->error());
-				break;
-
-			case 'pgsql';
-				$db->query('SELECT setval(\''.$db->prefix.'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $db->error());
-				break;
-		}
-
-		alter_table_utf8($db->prefix.'search_words');
-
-		break;
-
-
-	// Convert subscriptions
-	case 'conv_subscriptions':
-		$query_str = '?stage=conv_topics&req_old_charset='.$old_charset;
-
-		// By this stage we should have already renamed the subscription table
-		alter_table_utf8($db->prefix.'topic_subscriptions');
-		alter_table_utf8($db->prefix.'forum_subscriptions'); // This should actually already be utf8, but for consistency...
-
-		break;
-
-
-	// Convert topics
-	case 'conv_topics':
-		$query_str = '?stage=conv_users&req_old_charset='.$old_charset;
-
-		function _conv_topics($cur_item, $old_charset)
-		{
-			global $lang_update;
-
-			echo sprintf($lang_update['Converting item'], $lang_update['topic'], $cur_item['id']).'<br />'."\n";
-
-			convert_to_utf8($cur_item['poster'], $old_charset);
-			convert_to_utf8($cur_item['subject'], $old_charset);
-			convert_to_utf8($cur_item['last_poster'], $old_charset);
-
-			return $cur_item;
-		}
-
-		$end_at = convert_table_utf8($db->prefix.'topics', '_conv_topics', $old_charset, 'id', $start_at);
-
-		if ($end_at !== true)
-			$query_str = '?stage=conv_topics&req_old_charset='.$old_charset.'&start_at='.$end_at;
-
-		break;
-
-
-	// Convert users
-	case 'conv_users':
-		$query_str = '?stage=preparse_posts';
-
-		if ($start_at == 0)
-			$_SESSION['dupe_users'] = array();
-
-		function _conv_users($cur_item, $old_charset)
-		{
-			global $lang_update;
-
-			echo sprintf($lang_update['Converting item'], $lang_update['user'], $cur_item['id']).'<br />'."\n";
-
-			convert_to_utf8($cur_item['username'], $old_charset);
-			convert_to_utf8($cur_item['title'], $old_charset);
-			convert_to_utf8($cur_item['realname'], $old_charset);
-			convert_to_utf8($cur_item['location'], $old_charset);
-			convert_to_utf8($cur_item['signature'], $old_charset);
-			convert_to_utf8($cur_item['admin_note'], $old_charset);
-
-			return $cur_item;
-		}
-
-		function _error_users($cur_user)
-		{
-			$_SESSION['dupe_users'][$cur_user['id']] = $cur_user;
-		}
-
-		$end_at = convert_table_utf8($db->prefix.'users', '_conv_users', $old_charset, 'id', $start_at, '_error_users');
-
-		if ($end_at !== true)
-			$query_str = '?stage=conv_users&req_old_charset='.$old_charset.'&start_at='.$end_at;
-		else if (!empty($_SESSION['dupe_users']))
-			$query_str = '?stage=conv_users_dupe';
-
-		break;
-
-
-	// Handle any duplicate users which occured due to conversion
-	case 'conv_users_dupe':
-		$query_str = '?stage=preparse_posts';
-
-		if (!$mysql || empty($_SESSION['dupe_users']))
-			break;
-
-		if (isset($_POST['form_sent']))
-		{
-			$errors = array();
-
-			require PUN_ROOT.'include/email.php';
-
-			foreach ($_SESSION['dupe_users'] as $id => $cur_user)
-			{
-				$errors[$id] = array();
-
-				$username = pun_trim($_POST['dupe_users'][$id]);
-
-				if (pun_strlen($username) < 2)
-					$errors[$id][] = $lang_update['Username too short error'];
-				else if (pun_strlen($username) > 25) // This usually doesn't happen since the form element only accepts 25 characters
-					$errors[$id][] = $lang_update['Username too long error'];
-				else if (!strcasecmp($username, 'Guest'))
-					$errors[$id][] = $lang_update['Username Guest reserved error'];
-				else if (preg_match('%[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}%', $username) || preg_match('%((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))%', $username))
-					$errors[$id][] = $lang_update['Username IP format error'];
-				else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
-					$errors[$id][] = $lang_update['Username bad characters error'];
-				else if (preg_match('%(?:\[/?(?:b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|\*)\]|\[(?:img|url|quote|list)=)%i', $username))
-					$errors[$id][] = $lang_update['Username BBCode error'];
-
-				$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE (UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(ucp_preg_replace('%[^\p{L}\p{N}]%u', '', $username)).'\')) AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-
-				if ($db->num_rows($result))
-				{
-					$busy = $db->result($result);
-					$errors[$id][] = sprintf($lang_update['Username duplicate error'], pun_htmlspecialchars($busy));
-				}
-
-				if (empty($errors[$id]))
-				{
-					$old_username = $cur_user['username'];
-					$_SESSION['dupe_users'][$id]['username'] = $cur_user['username'] = $username;
-
-					$temp = array();
-					foreach ($cur_user as $idx => $value)
-						$temp[$idx] = $value === null ? 'NULL' : '\''.$db->escape($value).'\'';
-
-					// Insert the renamed user
-					$db->query('INSERT INTO '.$db->prefix.'users('.implode(',', array_keys($temp)).') VALUES ('.implode(',', array_values($temp)).')') or error('Unable to insert data to new table', __FILE__, __LINE__, $db->error());
-
-					// Renaming a user also affects a bunch of other stuff, lets fix that too...
-					$db->query('UPDATE '.$db->prefix.'posts SET poster=\''.$db->escape($username).'\' WHERE poster_id='.$id) or error('Unable to update posts', __FILE__, __LINE__, $db->error());
-
-					// TODO: The following must compare using collation utf8_bin otherwise we will accidently update posts/topics/etc belonging to both of the duplicate users, not just the one we renamed!
-					$db->query('UPDATE '.$db->prefix.'posts SET edited_by=\''.$db->escape($username).'\' WHERE edited_by=\''.$db->escape($old_username).'\' COLLATE utf8_bin') or error('Unable to update posts', __FILE__, __LINE__, $db->error());
-					$db->query('UPDATE '.$db->prefix.'topics SET poster=\''.$db->escape($username).'\' WHERE poster=\''.$db->escape($old_username).'\' COLLATE utf8_bin') or error('Unable to update topics', __FILE__, __LINE__, $db->error());
-					$db->query('UPDATE '.$db->prefix.'topics SET last_poster=\''.$db->escape($username).'\' WHERE last_poster=\''.$db->escape($old_username).'\' COLLATE utf8_bin') or error('Unable to update topics', __FILE__, __LINE__, $db->error());
-					$db->query('UPDATE '.$db->prefix.'forums SET last_poster=\''.$db->escape($username).'\' WHERE last_poster=\''.$db->escape($old_username).'\' COLLATE utf8_bin') or error('Unable to update forums', __FILE__, __LINE__, $db->error());
-					$db->query('UPDATE '.$db->prefix.'online SET ident=\''.$db->escape($username).'\' WHERE ident=\''.$db->escape($old_username).'\' COLLATE utf8_bin') or error('Unable to update online list', __FILE__, __LINE__, $db->error());
-
-					// If the user is a moderator or an administrator we have to update the moderator lists
-					$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$cur_user['group_id']) or error('Unable to fetch group', __FILE__, __LINE__, $db->error());
-					$group_mod = $db->result($result);
-
-					if ($cur_user['group_id'] == PUN_ADMIN || $group_mod == '1')
-					{
-						$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
-
-						while ($cur_forum = $db->fetch_assoc($result))
-						{
-							$cur_moderators = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
-
-							if (in_array($id, $cur_moderators))
-							{
-								unset($cur_moderators[$old_username]);
-								$cur_moderators[$username] = $id;
-								uksort($cur_moderators, 'utf8_strcasecmp');
-
-								$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
-							}
-						}
-					}
-
-					// Email the user alerting them of the change
-					if (file_exists(PUN_ROOT.'lang/'.$cur_user['language'].'/mail_templates/rename.tpl'))
-						$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_user['language'].'/mail_templates/rename.tpl'));
-					else if (file_exists(PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/mail_templates/rename.tpl'))
-						$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/mail_templates/rename.tpl'));
-					else
-						$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/English/mail_templates/rename.tpl'));
-
-					// The first row contains the subject
-					$first_crlf = strpos($mail_tpl, "\n");
-					$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-					$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-					$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
-					$mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
-					$mail_message = str_replace('<old_username>', $old_username, $mail_message);
-					$mail_message = str_replace('<new_username>', $username, $mail_message);
-					$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-					pun_mail($cur_user['email'], $mail_subject, $mail_message);
-
-					unset($_SESSION['dupe_users'][$id]);
-				}
-			}
-		}
-
-		if (!empty($_SESSION['dupe_users']))
-		{
-			$query_str = '';
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang_common['lang_identifier'] ?>" lang="<?php echo $lang_common['lang_identifier'] ?>" dir="<?php echo $lang_common['lang_direction'] ?>">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_update['Update'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
-</head>
-<body>
-
-<div id="pundb_update" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div class="blockform">
-	<h2><span><?php echo $lang_update['Error converting users'] ?></span></h2>
-	<div class="box">
-		<form method="post" action="db_update.php?stage=conv_users_dupe&amp;uid=<?php echo $uid ?>">
-			<input type="hidden" name="form_sent" value="1" />
-			<div class="inform">
-				<div class="forminfo">
-						<p style="font-size: 1.1em"><?php echo $lang_update['Error info 1'] ?></p>
-						<p style="font-size: 1.1em"><?php echo $lang_update['Error info 2'] ?></p>
-				</div>
-			</div>
-<?php
-
-			foreach ($_SESSION['dupe_users'] as $id => $cur_user)
-			{
-
-?>
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo pun_htmlspecialchars($cur_user['username']); ?></legend>
-					<div class="infldset">
-						<label class="required"><strong><?php echo $lang_update['New username'] ?> <span><?php echo $lang_update['Required'] ?></span></strong><br /><input type="text" name="<?php echo 'dupe_users['.$id.']'; ?>" value="<?php if (isset($_POST['dupe_users'][$id])) echo pun_htmlspecialchars($_POST['dupe_users'][$id]); ?>" size="25" maxlength="25" /><br /></label>
-					</div>
-				</fieldset>
-<?php if (!empty($errors[$id])): ?>				<div class="forminfo error-info">
-					<h3><?php echo $lang_update['Correct errors'] ?></h3>
-					<ul class="error-list">
-<?php
-
-foreach ($errors[$id] as $cur_error)
-	echo "\t\t\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
-?>
-					</ul>
-				</div>
-<?php endif; ?>			</div>
-<?php
-
-			}
-
-?>
-			<p class="buttons"><input type="submit" name="rename" value="<?php echo $lang_update['Rename users'] ?>" /></p>
-		</form>
-	</div>
-</div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
-</div>
-
-</body>
-</html>
-<?php
-
-		}
-
-		break;
-
-
-	// Preparse posts
-	case 'preparse_posts':
-		$query_str = '?stage=preparse_sigs';
-
-		// If we don't need to parse the posts, skip this stage
-		if (isset($pun_config['o_parser_revision']) && $pun_config['o_parser_revision'] >= UPDATE_TO_PARSER_REVISION)
-			break;
-
-		require PUN_ROOT.'include/parser.php';
-
-		// Fetch posts to process this cycle
-		$result = $db->query('SELECT id, message FROM '.$db->prefix.'posts WHERE id > '.$start_at.' ORDER BY id ASC LIMIT '.PER_PAGE) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
-
-		$temp = array();
-		$end_at = 0;
-		while ($cur_item = $db->fetch_assoc($result))
-		{
-			echo sprintf($lang_update['Preparsing item'], $lang_update['post'], $cur_item['id']).'<br />'."\n";
-			$db->query('UPDATE '.$db->prefix.'posts SET message = \''.$db->escape(preparse_bbcode($cur_item['message'], $temp)).'\' WHERE id = '.$cur_item['id']) or error('Unable to update post', __FILE__, __LINE__, $db->error());
-
-			$end_at = $cur_item['id'];
-		}
-
-		// Check if there is more work to do
-		if ($end_at > 0)
-		{
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'posts WHERE id > '.$end_at.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch next ID', __FILE__, __LINE__, $db->error());
-
-			if ($db->num_rows($result) > 0)
-				$query_str = '?stage=preparse_posts&start_at='.$end_at;
-		}
-
-		break;
-
-
-	// Preparse signatures
-	case 'preparse_sigs':
-		$query_str = '?stage=rebuild_idx';
-
-		// If we don't need to parse the sigs, skip this stage
-		if (isset($pun_config['o_parser_revision']) && $pun_config['o_parser_revision'] >= UPDATE_TO_PARSER_REVISION)
-			break;
-
-		require PUN_ROOT.'include/parser.php';
-
-		// Fetch users to process this cycle
-		$result = $db->query('SELECT id, signature FROM '.$db->prefix.'users WHERE id > '.$start_at.' ORDER BY id ASC LIMIT '.PER_PAGE) or error('Unable to fetch users', __FILE__, __LINE__, $db->error());
-
-		$temp = array();
-		$end_at = 0;
-		while ($cur_item = $db->fetch_assoc($result))
-		{
-			echo sprintf($lang_update['Preparsing item'], $lang_update['signature'], $cur_item['id']).'<br />'."\n";
-			$db->query('UPDATE '.$db->prefix.'users SET signature = \''.$db->escape(preparse_bbcode($cur_item['signature'], $temp, true)).'\' WHERE id = '.$cur_item['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-
-			$end_at = $cur_item['id'];
-		}
-
-		// Check if there is more work to do
-		if ($end_at > 0)
-		{
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE id > '.$end_at.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch next ID', __FILE__, __LINE__, $db->error());
-			if ($db->num_rows($result) > 0)
-				$query_str = '?stage=preparse_sigs&start_at='.$end_at;
-		}
-
-		break;
-
-
-	// Rebuild the search index
-	case 'rebuild_idx':
-		$query_str = '?stage=finish';
-
-		// If we don't need to update the search index, skip this stage
-		if (isset($pun_config['o_searchindex_revision']) && $pun_config['o_searchindex_revision'] >= UPDATE_TO_SI_REVISION)
-			break;
-
-		if ($start_at == 0)
-		{
-			// Truncate the tables just in-case we didn't already (if we are coming directly here without converting the tables)
-			$db->truncate_table('search_cache') or error('Unable to empty search cache table', __FILE__, __LINE__, $db->error());
-			$db->truncate_table('search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $db->error());
-			$db->truncate_table('search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $db->error());
-
-			// Reset the sequence for the search words (not needed for SQLite)
-			switch ($db_type)
-			{
-				case 'mysql':
-				case 'mysqli':
-				case 'mysql_innodb':
-				case 'mysqli_innodb':
-					$db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $db->error());
-					break;
-
-				case 'pgsql';
-					$db->query('SELECT setval(\''.$db->prefix.'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $db->error());
-					break;
-			}
-		}
-
-		require PUN_ROOT.'include/search_idx.php';
-
-		// Fetch posts to process this cycle
-		$result = $db->query('SELECT p.id, p.message, t.subject, t.first_post_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id > '.$start_at.' ORDER BY p.id ASC LIMIT '.PER_PAGE) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
-
-		$end_at = 0;
-		while ($cur_item = $db->fetch_assoc($result))
-		{
-			echo sprintf($lang_update['Rebuilding index item'], $lang_update['post'], $cur_item['id']).'<br />'."\n";
-
-			if ($cur_item['id'] == $cur_item['first_post_id'])
-				update_search_index('post', $cur_item['id'], $cur_item['message'], $cur_item['subject']);
-			else
-				update_search_index('post', $cur_item['id'], $cur_item['message']);
-
-			$end_at = $cur_item['id'];
-		}
-
-		// Check if there is more work to do
-		if ($end_at > 0)
-		{
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'posts WHERE id > '.$end_at.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch next ID', __FILE__, __LINE__, $db->error());
-
-			if ($db->num_rows($result) > 0)
-				$query_str = '?stage=rebuild_idx&start_at='.$end_at;
-		}
-
-		break;
-
-
-	// Show results page
-	case 'finish':
-		// We update the version number
-		$db->query('UPDATE '.$db->prefix.'config SET conf_value = \''.UPDATE_TO.'\' WHERE conf_name = \'o_cur_version\'') or error('Unable to update version', __FILE__, __LINE__, $db->error());
-
-		// And the database revision number
-		$db->query('UPDATE '.$db->prefix.'config SET conf_value = \''.UPDATE_TO_DB_REVISION.'\' WHERE conf_name = \'o_database_revision\'') or error('Unable to update database revision number', __FILE__, __LINE__, $db->error());
-
-		// And the search index revision number
-		$db->query('UPDATE '.$db->prefix.'config SET conf_value = \''.UPDATE_TO_SI_REVISION.'\' WHERE conf_name = \'o_searchindex_revision\'') or error('Unable to update search index revision number', __FILE__, __LINE__, $db->error());
-
-		// And the parser revision number
-		$db->query('UPDATE '.$db->prefix.'config SET conf_value = \''.UPDATE_TO_PARSER_REVISION.'\' WHERE conf_name = \'o_parser_revision\'') or error('Unable to update parser revision number', __FILE__, __LINE__, $db->error());
-
-		// Check the default language still exists!
-		if (!file_exists(PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php'))
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value = \'English\' WHERE conf_name = \'o_default_lang\'') or error('Unable to update default language', __FILE__, __LINE__, $db->error());
-
-		// Check the default style still exists!
-		if (!file_exists(PUN_ROOT.'style/'.$pun_config['o_default_style'].'.css'))
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value = \'Air\' WHERE conf_name = \'o_default_style\'') or error('Unable to update default style', __FILE__, __LINE__, $db->error());
-
-		// This feels like a good time to synchronize the forums
-		$result = $db->query('SELECT id FROM '.$db->prefix.'forums') or error('Unable to fetch forum IDs', __FILE__, __LINE__, $db->error());
-
-		while ($row = $db->fetch_row($result))
-			update_forum($row[0]);
-
-		// Empty the PHP cache
-		forum_clear_cache();
-
-		// Delete the update lock file
-		@unlink(FORUM_CACHE_DIR.'db_update.lock');
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang_common['lang_identifier'] ?>" lang="<?php echo $lang_common['lang_identifier'] ?>" dir="<?php echo $lang_common['lang_direction'] ?>">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_update['Update'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
-</head>
-<body>
-
-<div id="pundb_update" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div class="blockform">
-	<h2><span><?php echo $lang_update['Update'] ?></span></h2>
-	<div class="box">
-		<div class="fakeform">
-			<div class="inform">
-				<div class="forminfo">
-					<p style="font-size: 1.1em"><?php printf($lang_update['Successfully updated'], sprintf('<a href="index.php">%s</a>', $lang_update['go to index'])) ?></p>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
-</div>
-
-</body>
-</html>
-<?php
-
-		break;
-}
-
-$db->end_transaction();
-$db->close();
-
-if ($query_str != '')
-	exit('<script type="text/javascript">window.location="db_update.php'.$query_str.'&uid='.$uid.'"</script><noscript><meta http-equiv="refresh" content="0;url=db_update.php'.$query_str.'&uid='.$uid.'" /></noscript>');
Index: /trunk/web/punbb/delete.php
===================================================================
--- /trunk/web/punbb/delete.php	(revision 10)
+++ /trunk/web/punbb/delete.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -20,5 +37,5 @@
 
 // Fetch some info about the post, the topic and the forum
-$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.first_post_id, t.closed, p.posted, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 if (!$db->num_rows($result))
 	message($lang_common['Bad request']);
@@ -26,12 +43,13 @@
 $cur_post = $db->fetch_assoc($result);
 
-if ($pun_config['o_censoring'] == '1')
-	$cur_post['subject'] = censor_words($cur_post['subject']);
-
 // Sort out who the moderators are and if we are currently a moderator (or an admin)
 $mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
-$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
 
-$is_topic_post = ($id == $cur_post['first_post_id']) ? true : false;
+// Determine whether this post is the "topic post" or not
+$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+$topic_post_id = $db->result($result);
+
+$is_topic_post = ($id == $topic_post_id) ? true : false;
 
 // Do we have permission to edit this post?
@@ -68,15 +86,10 @@
 		update_forum($cur_post['fid']);
 
-		// Redirect towards the previous post
-		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' AND id < '.$id.' ORDER BY id DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-		$post_id = $db->result($result);
-
-		redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_delete['Post del redirect']);
+		redirect('viewtopic.php?id='.$cur_post['tid'], $lang_delete['Post del redirect']);
 	}
 }
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_delete['Delete post']);
-define ('PUN_ACTIVE_PAGE', 'index');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_delete['Delete post'];
 require PUN_ROOT.'header.php';
 
@@ -87,10 +100,5 @@
 <div class="linkst">
 	<div class="inbox">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?pid=<?php echo $id ?>#p<?php echo $id ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_delete['Delete post'] ?></strong></li>
-		</ul>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
 	</div>
 </div>
@@ -101,34 +109,16 @@
 		<form method="post" action="delete.php?id=<?php echo $id ?>">
 			<div class="inform">
-				<div class="forminfo">
-					<h3><span><?php printf($is_topic_post ? $lang_delete['Topic by'] : $lang_delete['Reply by'], '<strong>'.pun_htmlspecialchars($cur_post['poster']).'</strong>', format_time($cur_post['posted'])) ?></span></h3>
-					<p><?php echo ($is_topic_post) ? '<strong>'.$lang_delete['Topic warning'].'</strong>' : '<strong>'.$lang_delete['Warning'].'</strong>' ?><br /><?php echo $lang_delete['Delete info'] ?></p>
-				</div>
-			</div>
-			<p class="buttons"><input type="submit" name="delete" value="<?php echo $lang_delete['Delete'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
-		</form>
-	</div>
-</div>
-
-<div id="postreview">
-	<div class="blockpost">
-		<div class="box">
-			<div class="inbox">
-				<div class="postbody">
-					<div class="postleft">
-						<dl>
-							<dt><strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></dt>
-							<dd><span><?php echo format_time($cur_post['posted']) ?></span></dd>
-						</dl>
-					</div>
-					<div class="postright">
+				<fieldset>
+					<legend class="warntext"><?php echo $lang_delete['Warning'] ?></legend>
+					<div class="infldset">
 						<div class="postmsg">
-							<?php echo $cur_post['message']."\n" ?>
+							<p><?php echo $lang_common['Author'] ?>: <strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></p>
+							<?php echo $cur_post['message'] ?>
 						</div>
 					</div>
-				</div>
-				<div class="clearer"></div>
+				</fieldset>
 			</div>
-		</div>
+			<p><input type="submit" name="delete" value="<?php echo $lang_delete['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		</form>
 	</div>
 </div>
Index: /trunk/web/punbb/edit.php
===================================================================
--- /trunk/web/punbb/edit.php	(revision 10)
+++ /trunk/web/punbb/edit.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -20,5 +37,5 @@
 
 // Fetch some info about the post, the topic and the forum
-$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.first_post_id, t.sticky, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 if (!$db->num_rows($result))
 	message($lang_common['Bad request']);
@@ -28,13 +45,11 @@
 // Sort out who the moderators are and if we are currently a moderator (or an admin)
 $mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
-$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
-
-$can_edit_subject = $id == $cur_post['first_post_id'];
-
-if ($pun_config['o_censoring'] == '1')
-{
-	$cur_post['subject'] = censor_words($cur_post['subject']);
-	$cur_post['message'] = censor_words($cur_post['message']);
-}
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+
+// Determine whether this post is the "topic post" or not
+$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['tid'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
+$topic_post_id = $db->result($result);
+
+$can_edit_subject = ($id == $topic_post_id && (($pun_user['g_edit_subjects_interval'] == '0' || (time() - $cur_post['posted']) < $pun_user['g_edit_subjects_interval']) || $is_admmod)) ? true : false;
 
 // Do we have permission to edit this post?
@@ -57,20 +72,15 @@
 		confirm_referrer('edit.php');
 
-	// If it's a topic it must contain a subject
+	// If it is a topic it must contain a subject
 	if ($can_edit_subject)
 	{
 		$subject = pun_trim($_POST['req_subject']);
 
-		if ($pun_config['o_censoring'] == '1')
-			$censored_subject = pun_trim(censor_words($subject));
-
 		if ($subject == '')
 			$errors[] = $lang_post['No subject'];
-		else if ($pun_config['o_censoring'] == '1' && $censored_subject == '')
-			$errors[] = $lang_post['No subject after censoring'];
 		else if (pun_strlen($subject) > 70)
 			$errors[] = $lang_post['Too long subject'];
-		else if ($pun_config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$pun_user['is_admmod'])
-			$errors[] = $lang_post['All caps subject'];
+		else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
+			$subject = ucwords(strtolower($subject));
 	}
 
@@ -78,12 +88,13 @@
 	$message = pun_linebreaks(pun_trim($_POST['req_message']));
 
-	// Here we use strlen() not pun_strlen() as we want to limit the post to PUN_MAX_POSTSIZE bytes, not characters
-	if (strlen($message) > PUN_MAX_POSTSIZE)
-		$errors[] = sprintf($lang_post['Too long message'], forum_number_format(PUN_MAX_POSTSIZE));
-	else if ($pun_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$pun_user['is_admmod'])
-		$errors[] = $lang_post['All caps message'];
+	if ($message == '')
+		$errors[] = $lang_post['No message'];
+	else if (strlen($message) > 65535)
+		$errors[] = $lang_post['Too long message'];
+	else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
+		$message = ucwords(strtolower($message));
 
 	// Validate BBCode syntax
-	if ($pun_config['p_message_bbcode'] == '1')
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
 	{
 		require PUN_ROOT.'include/parser.php';
@@ -91,27 +102,12 @@
 	}
 
-	if (empty($errors))
-	{
-		if ($message == '')
-			$errors[] = $lang_post['No message'];
-		else if ($pun_config['o_censoring'] == '1')
-		{
-			// Censor message to see if that causes problems
-			$censored_message = pun_trim(censor_words($message));
-
-			if ($censored_message == '')
-				$errors[] = $lang_post['No message after censoring'];
-		}
-	}
-
-	$hide_smilies = isset($_POST['hide_smilies']) ? '1' : '0';
-	$stick_topic = isset($_POST['stick_topic']) ? '1' : '0';
-	if (!$is_admmod)
-		$stick_topic = $cur_post['sticky'];
+
+	$hide_smilies = isset($_POST['hide_smilies']) ? intval($_POST['hide_smilies']) : 0;
+	if ($hide_smilies != '1') $hide_smilies = '0';
 
 	// Did everything go according to plan?
 	if (empty($errors) && !isset($_POST['preview']))
 	{
-		$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';
+		$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';
 
 		require PUN_ROOT.'include/search_idx.php';
@@ -120,5 +116,5 @@
 		{
 			// Update the topic and any redirect topics
-			$db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\', sticky='.$stick_topic.' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
 
 			// We changed the subject, so we need to take that into account when we update the search words
@@ -129,5 +125,5 @@
 
 		// Update the post
-		$db->query('UPDATE '.$db->prefix.'posts SET message=\''.$db->escape($message).'\', hide_smilies='.$hide_smilies.$edited_sql.' WHERE id='.$id) or error('Unable to update post', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'posts SET message=\''.$db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\''.$edited_sql.' WHERE id='.$id) or error('Impossible de modifier le message', __FILE__, __LINE__, $db->error());
 
 		redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']);
@@ -137,8 +133,7 @@
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_post['Edit post']);
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_post['Edit post'];
 $required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
 $focus_element = array('edit', 'req_message');
-define('PUN_ACTIVE_PAGE', 'index');
 require PUN_ROOT.'header.php';
 
@@ -148,10 +143,5 @@
 <div class="linkst">
 	<div class="inbox">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $cur_post['tid'] ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_post['Edit post'] ?></strong></li>
-		</ul>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul>
 	</div>
 </div>
@@ -167,10 +157,10 @@
 	<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
 	<div class="box">
-		<div class="inbox error-info">
+		<div class="inbox"
 			<p><?php echo $lang_post['Post errors info'] ?></p>
-			<ul class="error-list">
-<?php
-
-	foreach ($errors as $cur_error)
+			<ul>
+<?php
+
+	while (list(, $cur_error) = each($errors))
 		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
 ?>
@@ -193,9 +183,7 @@
 	<div class="box">
 		<div class="inbox">
-			<div class="postbody">
-				<div class="postright">
-					<div class="postmsg">
-						<?php echo $preview_message."\n" ?>
-					</div>
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $preview_message."\n" ?>
 				</div>
 			</div>
@@ -209,6 +197,6 @@
 
 ?>
-<div id="editform" class="blockform">
-	<h2><span><?php echo $lang_post['Edit post'] ?></span></h2>
+<div class="blockform">
+	<h2><?php echo $lang_post['Edit post'] ?></h2>
 	<div class="box">
 		<form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&amp;action=edit" onsubmit="return process_form(this)">
@@ -218,12 +206,13 @@
 					<input type="hidden" name="form_sent" value="1" />
 					<div class="infldset txtarea">
-<?php if ($can_edit_subject): ?>						<label class="required"><strong><?php echo $lang_common['Subject'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
+<?php if ($can_edit_subject): ?>						<label><?php echo $lang_common['Subject'] ?><br />
 						<input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label>
-<?php endif; ?>						<label class="required"><strong><?php echo $lang_common['Message'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
+<?php endif; $bbcode_form = 'edit'; $bbcode_field = 'req_message'; require PUN_ROOT.'mod_easy_bbcode.php'; ?>						<label><?php echo $lang_common['Message'] ?><br />
+
 						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label>
 						<ul class="bblinks">
-							<li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
 						</ul>
 					</div>
@@ -232,26 +221,18 @@
 
 $checkboxes = array();
-if ($can_edit_subject && $is_admmod)
-{
-	if (isset($_POST['stick_topic']) || $cur_post['sticky'] == '1')
-		$checkboxes[] = '<label><input type="checkbox" name="stick_topic" value="1" checked="checked" tabindex="'.($cur_index++).'" />'.$lang_common['Stick topic'].'<br /></label>';
+if ($pun_config['o_smilies'] == '1')
+{
+	if (isset($_POST['hide_smilies']) || $cur_post['hide_smilies'] == '1')
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Hide smilies'];
 	else
-		$checkboxes[] = '<label><input type="checkbox" name="stick_topic" value="1" tabindex="'.($cur_index++).'" />'.$lang_common['Stick topic'].'<br /></label>';
-}
-
-if ($pun_config['o_smilies'] == '1')
-{
-	if (isset($_POST['hide_smilies']) || $cur_post['hide_smilies'] == '1')
-		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />'.$lang_post['Hide smilies'].'<br /></label>';
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Hide smilies'];
+}
+
+if ($is_admmod)
+{
+	if ((isset($_POST['form_sent']) && isset($_POST['silent'])) || !isset($_POST['form_sent']))
+		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" checked="checked" />&#160;'.$lang_post['Silent edit'];
 	else
-		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'" />'.$lang_post['Hide smilies'].'<br /></label>';
-}
-
-if ($is_admmod)
-{
-	if ((isset($_POST['form_sent']) && isset($_POST['silent'])) || !isset($_POST['form_sent']))
-		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" checked="checked" />'.$lang_post['Silent edit'].'<br /></label>';
-	else
-		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" />'.$lang_post['Silent edit'].'<br /></label>';
+		$checkboxes[] = '<label><input type="checkbox" name="silent" value="1" tabindex="'.($cur_index++).'" />&#160;'.$lang_post['Silent edit'];
 }
 
@@ -266,5 +247,5 @@
 					<div class="infldset">
 						<div class="rbox">
-							<?php echo implode("\n\t\t\t\t\t\t\t", $checkboxes)."\n" ?>
+							<?php echo implode('</label>'."\n\t\t\t\t\t\t\t", $checkboxes).'</label>'."\n" ?>
 						</div>
 					</div>
@@ -276,5 +257,5 @@
 ?>
 			</div>
-			<p class="buttons"><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /> <input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
Index: /trunk/web/punbb/extern.php
===================================================================
--- /trunk/web/punbb/extern.php	(revision 10)
+++ /trunk/web/punbb/extern.php	(revision 1)
@@ -1,488 +1,282 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-/*-----------------------------------------------------------------------------
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************
+
 
   INSTRUCTIONS
 
-  This script is used to include information about your board from
-  pages outside the forums and to syndicate news about recent
-  discussions via RSS/Atom/XML. The script can display a list of
-  recent discussions, a list of active users or a collection of
-  general board statistics. The script can be called directly via
-  an URL, from a PHP include command or through the use of Server
-  Side Includes (SSI).
-
-  The scripts behaviour is controlled via variables supplied in the
-  URL to the script. The different variables are: action (what to
-  do), show (how many items to display), fid (the ID or IDs of
-  the forum(s) to poll for topics), nfid (the ID or IDs of forums
-  that should be excluded), tid (the ID of the topic from which to
-  display posts) and type (output as HTML or RSS). The only
-  mandatory variable is action. Possible/default values are:
-
-	action: feed - show most recent topics/posts (HTML or RSS)
-			online - show users online (HTML)
-			online_full - as above, but includes a full list (HTML)
-			stats - show board statistics (HTML)
-
-	type:   rss - output as RSS 2.0
-			atom - output as Atom 1.0
-			xml - output as XML
-			html - output as HTML (<li>'s)
-
-	fid:    One or more forum IDs (comma-separated). If ignored,
-			topics from all readable forums will be pulled.
-
-	nfid:   One or more forum IDs (comma-separated) that are to be
-			excluded. E.g. the ID of a a test forum.
-
-	tid:    A topic ID from which to show posts. If a tid is supplied,
-			fid and nfid are ignored.
-
-	show:   Any integer value between 1 and 50. The default is 15.
-
-	order:  last_post - show topics ordered by when they were last
-						posted in, giving information about the reply.
-			posted - show topics ordered by when they were first
-					 posted, giving information about the original post.
-
------------------------------------------------------------------------------*/
-
-define('PUN_QUIET_VISIT', 1);
-
-if (!defined('PUN_ROOT'))
-	define('PUN_ROOT', dirname(__FILE__).'/');
-require PUN_ROOT.'include/common.php';
-
-// The length at which topic subjects will be truncated (for HTML output)
-if (!defined('FORUM_EXTERN_MAX_SUBJECT_LENGTH'))
-	define('FORUM_EXTERN_MAX_SUBJECT_LENGTH', 30);
-
-// If we're a guest and we've sent a username/pass, we can try to authenticate using those details
-if ($pun_user['is_guest'] && isset($_SERVER['PHP_AUTH_USER']))
-	authenticate_user($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
-
-if ($pun_user['g_read_board'] == '0')
-{
-	http_authenticate_user();
-	exit($lang_common['No view']);
-}
-
-$action = isset($_GET['action']) ? strtolower($_GET['action']) : 'feed';
-
-// Handle a couple old formats, from FluxBB 1.2
-switch ($action)
-{
-	case 'active':
-		$action = 'feed';
-		$_GET['order'] = 'last_post';
-		break;
-
-	case 'new':
-		$action = 'feed';
-		$_GET['order'] = 'posted';
-		break;
-}
-
-//
-// Sends the proper headers for Basic HTTP Authentication
-//
-function http_authenticate_user()
-{
-	global $pun_config, $pun_user;
-
-	if (!$pun_user['is_guest'])
-		return;
-
-	header('WWW-Authenticate: Basic realm="'.$pun_config['o_board_title'].' External Syndication"');
-	header('HTTP/1.0 401 Unauthorized');
-}
-
-
-//
-// Output $feed as RSS 2.0
-//
-function output_rss($feed)
-{
-	global $lang_common, $pun_config;
-
-	// Send XML/no cache headers
-	header('Content-Type: application/xml; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
-	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">'."\n";
-	echo "\t".'<channel>'."\n";
-	echo "\t\t".'<atom:link href="'.pun_htmlspecialchars(get_current_url()).'" rel="self" type="application/rss+xml" />'."\n";
-	echo "\t\t".'<title><![CDATA['.escape_cdata($feed['title']).']]></title>'."\n";
-	echo "\t\t".'<link>'.pun_htmlspecialchars($feed['link']).'</link>'."\n";
-	echo "\t\t".'<description><![CDATA['.escape_cdata($feed['description']).']]></description>'."\n";
-	echo "\t\t".'<lastBuildDate>'.gmdate('r', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()).'</lastBuildDate>'."\n";
-
-	if ($pun_config['o_show_version'] == '1')
-		echo "\t\t".'<generator>FluxBB '.$pun_config['o_cur_version'].'</generator>'."\n";
+  Le script extern.php est utiliser pour inclure des informations Ã  
+  propos de vos forums sur des pages externes aux forums et pour 
+  syndiquer les discussions rÃ©centes via RSS. Le script peut afficher 
+  une liste de discussions rÃ©centes (triÃ©e par messages, dates ou 
+  derniers messages), une liste dÂutilisateurs actifs ou une 
+  collection de statistiques gÃ©nÃ©rales. Le script peut Ãªtre appeler 
+  directement par lÂintermÃ©diaire dÂune URL (pour RSS), de la 
+  commande inclue de PHP ou par lÂutilisation du Server Side 
+  Includes (SSI).
+
+  Le comportement du script est commandÃ© par lÂintermÃ©diaire de 
+  variables fournies au script dans lÂURL. Les diffÃ©rentes variables 
+  sont : action (que faut-il afficher), show (combien de discussions 
+  afficher), forum (lÂID du forum Ã  sonder pour rÃ©cupÃšrer les 
+  discussions) et type (sortie comme HTML ou RSS). La seule variable 
+  obligatoire est action. Les valeurs de possibles (par defaut) sont :
+
+    action: 
+	  active (affiche les discussions rÃ©cemment actives) (HTML ou RSS)
+      new (afficher les plus rÃ©centes discussions) (HTML ou RSS)
+      online (afficher les utilisateurs en ligne) (HTML)
+      online_full (idem, mais inclut une liste complÃšte) (HTML)
+      stats (afficher les statistiques des forums) (HTML)
+
+    show:   NÂimporte quÂelle valeur, nombre entier entre 1 et 50. 
+	        Cette variable est ignorÃ©es pour la sortie RSS. 15 par 
+			dÃ©faut.
+
+    fid:    Un ou plusieurs ID de forum (sÃ©parÃ©s par des virgules). 
+	        Si ignorÃ©e, des discussions de tous les forums lisibles 
+			par les invitÃ©s seront rÃ©cupÃ©rÃ©es.
+
+    nfid:   Un ou plusieurs ID de forum (sÃ©parÃ©s par des virgules) 
+	        qui seront ignorÃ©s. Ex. l'ID d'un forum de test.
+
+    type:   RSS. Toute autre chose signifie une sortie en HTML.
+
+
+  Voici quelques exemples en utilisant la fonction include() de PHP :
+
+    Afficher les 15 discussions les plus rÃ©cemment actives depuis tous les forums :
+    include('http://host.com/forums/extern.php?action=active');
+
+    Afficher les 10 discussions les plus rÃ©centes depuis les forums dÂID 5, 6 et 7 :
+    include('http://host.com/forums/extern.php?action=new&show=10&fid=5,6,7');
+
+    Afficher les utilisateurs en ligne :
+    include('http://host.com/forums/extern.php?action=online');
+
+    Afficher les utilisateurs en ligne avec une liste complÃšte :
+    include('http://host.com/forums/extern.php?action=online_full');
+
+    Afficher les statistiques des forums :
+    include('http://host.com/forums/extern.php?action=stats');
+
+
+  Voici quelques exemples en utilisant SSI :
+
+    Afficher les 5 discussions les plus rÃ©centes depuis les forums dÂID 11 et 22:
+    <!--#include virtual="forums/extern.php?action=new&show=5&fid=11,22" -->
+
+    Afficher les statistiques des forums :
+    <!--#include virtual="forums/extern.php?action=stats" -->
+
+
+  Et finalement quelques exemples en utilisant extern.php pour produire un fil RSS 0.91 :
+
+    Afficher les 15 discussions les plus rÃ©cemment actives :
+    http://host.com/extern.php?action=active&type=RSS
+
+    Afficher les 15 discussions les plus rÃ©cemment actives depuis le forum dÂID 2:
+    http://host.com/extern.php?action=active&type=RSS&fid=2
+
+  Ci-dessous vous trouverez des variables que vous pouvez modifier pour que le 
+  script se comporte selon vos besoins.
+
+/***********************************************************************/
+
+// Le nombre maximum de discussions qui seront affichÃ©es
+$show_max_topics = 60;
+
+// La longueur Ã  laquelle les sujets des discussions seront tronquÃ©es (pour HTML)
+$max_subject_length = 30;
+
+/***********************************************************************/
+
+// NE MODIFIEZ RIEN AU-DESSOUS DE CETTE LIGNE ! (Ã  moins que vous sachiez ce que vous faites)
+
+
+define('PUN_ROOT', './');
+@include PUN_ROOT.'config.php';
+
+// If PUN isn't defined, config.php is missing or corrupt
+if (!defined('PUN'))
+	exit('Le fichier "config.php" n\'existe pas ou est endommagÃ©. Veuillez lancer install.php pour installer PunBB.');
+
+
+// Make sure PHP reports all errors except E_NOTICE
+error_reporting(E_ALL ^ E_NOTICE);
+
+// Turn off magic_quotes_runtime
+set_magic_quotes_runtime(0);
+
+
+// Load the functions script
+require PUN_ROOT.'include/functions.php';
+
+// Load DB abstraction layer and try to connect
+require PUN_ROOT.'include/dblayer/common_db.php';
+
+// Load cached config
+@include PUN_ROOT.'cache/cache_config.php';
+if (!defined('PUN_CONFIG_LOADED'))
+{
+	require PUN_ROOT.'include/cache.php';
+	generate_config_cache();
+	require PUN_ROOT.'cache/cache_config.php';
+}
+
+// Make sure we (guests) have permission to read the forums
+$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
+if ($db->result($result) == '0')
+	exit('Vous n\'avez pas les permissions');
+
+
+// Attempt to load the common language file
+@include PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/common.php';
+if (!isset($lang_common))
+	exit('Il n\'y a pas de pack de langue \''.$pun_config['o_default_lang'].'\' d\'installÃ©. Veuillez rÃ©-installer une langue de ce nom.');
+
+if (!isset($_GET['action']))
+	exit('Aucun paramÃštre de fourni. Veuillez voir extern.php pour les instructions.');
+
+
+//
+// Converts the CDATA end sequence ]]> into ]]&gt;
+//
+function escape_cdata($str)
+{
+	return str_replace(']]>', ']]&gt;', $str);
+}
+
+
+//
+// Show recent discussions
+//
+if ($_GET['action'] == 'active' || $_GET['action'] == 'new')
+{
+	$order_by = ($_GET['action'] == 'active') ? 't.last_post' : 't.posted';
+	$forum_sql = '';
+
+	// Was any specific forum ID's supplied?
+	if (isset($_GET['fid']) && $_GET['fid'] != '')
+	{
+		$fids = explode(',', trim($_GET['fid']));
+		$fids = array_map('intval', $fids);
+
+		if (!empty($fids))
+			$forum_sql = ' AND f.id IN('.implode(',', $fids).')';
+	}
+
+	// Any forum ID's to exclude?
+	if (isset($_GET['nfid']) && $_GET['nfid'] != '')
+	{
+		$nfids = explode(',', trim($_GET['nfid']));
+		$nfids = array_map('intval', $nfids);
+
+		if (!empty($nfids))
+			$forum_sql = ' AND f.id NOT IN('.implode(',', $nfids).')';
+	}
+
+	// Should we output this as RSS?
+	if (isset($_GET['type']) && strtoupper($_GET['type']) == 'RSS')
+	{
+		$rss_description = ($_GET['action'] == 'active') ? $lang_common['RSS Desc Active'] : $lang_common['RSS Desc New'];
+		$url_action = ($_GET['action'] == 'active') ? '&amp;action=new' : '';
+
+		// Send XML/no cache headers
+		header('Content-Type: text/xml');
+		header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
+		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+		header('Pragma: public');
+
+		// It's time for some syndication!
+		echo '<?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?>'."\r\n";
+		echo '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\r\n";
+		echo '<rss version="0.91">'."\r\n";
+		echo '<channel>'."\r\n";
+		echo "\t".'<title>'.pun_htmlspecialchars($pun_config['o_board_title']).'</title>'."\r\n";
+		echo "\t".'<link>'.$pun_config['o_base_url'].'/</link>'."\r\n";
+		echo "\t".'<description>'.pun_htmlspecialchars($rss_description.' '.$pun_config['o_board_title']).'</description>'."\r\n";
+		echo "\t".'<language>en-us</language>'."\r\n";
+
+		// Fetch 15 topics
+		$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT 15') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+		while ($cur_topic = $db->fetch_assoc($result))
+		{
+			if ($pun_config['o_censoring'] == '1')
+				$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+			echo "\t".'<item>'."\r\n";
+			echo "\t\t".'<title>'.pun_htmlspecialchars($cur_topic['subject']).'</title>'."\r\n";
+			echo "\t\t".'<link>'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].$url_action.'</link>'."\r\n";
+			echo "\t\t".'<description><![CDATA['.escape_cdata($lang_common['Forum'].': <a href="'.$pun_config['o_base_url'].'/viewforum.php?id='.$cur_topic['fid'].'">'.$cur_topic['forum_name'].'</a><br />'."\r\n".$lang_common['Author'].': '.$cur_topic['poster'].'<br />'."\r\n".$lang_common['Posted'].': '.date('r', $cur_topic['posted']).'<br />'."\r\n".$lang_common['Last post'].': '.date('r', $cur_topic['last_post'])).']]></description>'."\r\n";
+			echo "\t".'</item>'."\r\n";
+		}
+
+		echo '</channel>'."\r\n";
+		echo '</rss>';
+	}
+
+
+	// Output regular HTML
 	else
-		echo "\t\t".'<generator>FluxBB</generator>'."\n";
-
-	foreach ($feed['items'] as $item)
-	{
-		echo "\t\t".'<item>'."\n";
-		echo "\t\t\t".'<title><![CDATA['.escape_cdata($item['title']).']]></title>'."\n";
-		echo "\t\t\t".'<link>'.pun_htmlspecialchars($item['link']).'</link>'."\n";
-		echo "\t\t\t".'<description><![CDATA['.escape_cdata($item['description']).']]></description>'."\n";
-		echo "\t\t\t".'<author><![CDATA['.(isset($item['author']['email']) ? escape_cdata($item['author']['email']) : 'dummy@example.com').' ('.escape_cdata($item['author']['name']).')]]></author>'."\n";
-		echo "\t\t\t".'<pubDate>'.gmdate('r', $item['pubdate']).'</pubDate>'."\n";
-		echo "\t\t\t".'<guid>'.pun_htmlspecialchars($item['link']).'</guid>'."\n";
-
-		echo "\t\t".'</item>'."\n";
-	}
-
-	echo "\t".'</channel>'."\n";
-	echo '</rss>'."\n";
-}
-
-
-//
-// Output $feed as Atom 1.0
-//
-function output_atom($feed)
-{
-	global $lang_common, $pun_config;
-
-	// Send XML/no cache headers
-	header('Content-Type: application/atom+xml; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
-	echo '<feed xmlns="http://www.w3.org/2005/Atom">'."\n";
-
-	echo "\t".'<title type="html"><![CDATA['.escape_cdata($feed['title']).']]></title>'."\n";
-	echo "\t".'<link rel="self" href="'.pun_htmlspecialchars(get_current_url()).'"/>'."\n";
-	echo "\t".'<link href="'.pun_htmlspecialchars($feed['link']).'"/>'."\n";
-	echo "\t".'<updated>'.gmdate('Y-m-d\TH:i:s\Z', count($feed['items']) ? $feed['items'][0]['pubdate'] : time()).'</updated>'."\n";
-
-	if ($pun_config['o_show_version'] == '1')
-		echo "\t".'<generator version="'.$pun_config['o_cur_version'].'">FluxBB</generator>'."\n";
-	else
-		echo "\t".'<generator>FluxBB</generator>'."\n";
-
-	echo "\t".'<id>'.pun_htmlspecialchars($feed['link']).'</id>'."\n";
-
-	$content_tag = ($feed['type'] == 'posts') ? 'content' : 'summary';
-
-	foreach ($feed['items'] as $item)
-	{
-		echo "\t".'<entry>'."\n";
-		echo "\t\t".'<title type="html"><![CDATA['.escape_cdata($item['title']).']]></title>'."\n";
-		echo "\t\t".'<link rel="alternate" href="'.pun_htmlspecialchars($item['link']).'"/>'."\n";
-		echo "\t\t".'<'.$content_tag.' type="html"><![CDATA['.escape_cdata($item['description']).']]></'.$content_tag.'>'."\n";
-		echo "\t\t".'<author>'."\n";
-		echo "\t\t\t".'<name><![CDATA['.escape_cdata($item['author']['name']).']]></name>'."\n";
-
-		if (isset($item['author']['email']))
-			echo "\t\t\t".'<email><![CDATA['.escape_cdata($item['author']['email']).']]></email>'."\n";
-
-		if (isset($item['author']['uri']))
-			echo "\t\t\t".'<uri>'.pun_htmlspecialchars($item['author']['uri']).'</uri>'."\n";
-
-		echo "\t\t".'</author>'."\n";
-		echo "\t\t".'<updated>'.gmdate('Y-m-d\TH:i:s\Z', $item['pubdate']).'</updated>'."\n";
-
-		echo "\t\t".'<id>'.pun_htmlspecialchars($item['link']).'</id>'."\n";
-		echo "\t".'</entry>'."\n";
-	}
-
-	echo '</feed>'."\n";
-}
-
-
-//
-// Output $feed as XML
-//
-function output_xml($feed)
-{
-	global $lang_common, $pun_config;
-
-	// Send XML/no cache headers
-	header('Content-Type: application/xml; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	echo '<?xml version="1.0" encoding="utf-8"?>'."\n";
-	echo '<source>'."\n";
-	echo "\t".'<url>'.pun_htmlspecialchars($feed['link']).'</url>'."\n";
-
-	$forum_tag = ($feed['type'] == 'posts') ? 'post' : 'topic';
-
-	foreach ($feed['items'] as $item)
-	{
-		echo "\t".'<'.$forum_tag.' id="'.$item['id'].'">'."\n";
-
-		echo "\t\t".'<title><![CDATA['.escape_cdata($item['title']).']]></title>'."\n";
-		echo "\t\t".'<link>'.pun_htmlspecialchars($item['link']).'</link>'."\n";
-		echo "\t\t".'<content><![CDATA['.escape_cdata($item['description']).']]></content>'."\n";
-		echo "\t\t".'<author>'."\n";
-		echo "\t\t\t".'<name><![CDATA['.escape_cdata($item['author']['name']).']]></name>'."\n";
-
-		if (isset($item['author']['email']))
-			echo "\t\t\t".'<email><![CDATA['.escape_cdata($item['author']['email']).']]></email>'."\n";
-
-		if (isset($item['author']['uri']))
-			echo "\t\t\t".'<uri>'.pun_htmlspecialchars($item['author']['uri']).'</uri>'."\n";
-
-		echo "\t\t".'</author>'."\n";
-		echo "\t\t".'<posted>'.gmdate('r', $item['pubdate']).'</posted>'."\n";
-
-		echo "\t".'</'.$forum_tag.'>'."\n";
-	}
-
-	echo '</source>'."\n";
-}
-
-
-//
-// Output $feed as HTML (using <li> tags)
-//
-function output_html($feed)
-{
-
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	foreach ($feed['items'] as $item)
-	{
-		if (utf8_strlen($item['title']) > FORUM_EXTERN_MAX_SUBJECT_LENGTH)
-			$subject_truncated = pun_htmlspecialchars(pun_trim(utf8_substr($item['title'], 0, (FORUM_EXTERN_MAX_SUBJECT_LENGTH - 5)))).' âŠ';
-		else
-			$subject_truncated = pun_htmlspecialchars($item['title']);
-
-		echo '<li><a href="'.pun_htmlspecialchars($item['link']).'" title="'.pun_htmlspecialchars($item['title']).'">'.$subject_truncated.'</a></li>'."\n";
-	}
-}
-
-// Show recent discussions
-if ($action == 'feed')
-{
-	require PUN_ROOT.'include/parser.php';
-
-	// Determine what type of feed to output
-	$type = isset($_GET['type']) ? strtolower($_GET['type']) : 'html';
-	if (!in_array($type, array('html', 'rss', 'atom', 'xml')))
-		$type = 'html';
-
-	$show = isset($_GET['show']) ? intval($_GET['show']) : 15;
-	if ($show < 1 || $show > 50)
-		$show = 15;
-
-	// Was a topic ID supplied?
-	if (isset($_GET['tid']))
-	{
-		$tid = intval($_GET['tid']);
-
-		// Fetch topic subject
-		$result = $db->query('SELECT t.subject, t.first_post_id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL AND t.id='.$tid) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
+	{
+		$show = isset($_GET['show']) ? intval($_GET['show']) : 15;
+		if ($show < 1 || $show > 50)
+			$show = 15;
+
+		// Fetch $show topics
+		$result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+		while ($cur_topic = $db->fetch_assoc($result))
 		{
-			http_authenticate_user();
-			exit($lang_common['Bad request']);
+			if ($pun_config['o_censoring'] == '1')
+				$cur_topic['subject'] = censor_words($cur_topic['subject']);
+
+			if (pun_strlen($cur_topic['subject']) > $max_subject_length)
+				$subject_truncated = pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, ($max_subject_length-5)))).' ...';
+			else
+				$subject_truncated = pun_htmlspecialchars($cur_topic['subject']);
+
+			echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
 		}
-
-		$cur_topic = $db->fetch_assoc($result);
-
-		if ($pun_config['o_censoring'] == '1')
-			$cur_topic['subject'] = censor_words($cur_topic['subject']);
-
-		// Setup the feed
-		$feed = array(
-			'title' 		=>	$pun_config['o_board_title'].$lang_common['Title separator'].$cur_topic['subject'],
-			'link'			=>	get_base_url(true).'/viewtopic.php?id='.$tid,
-			'description'		=>	sprintf($lang_common['RSS description topic'], $cur_topic['subject']),
-			'items'			=>	array(),
-			'type'			=>	'posts'
-		);
-
-		// Fetch $show posts
-		$result = $db->query('SELECT p.id, p.poster, p.message, p.hide_smilies, p.posted, p.poster_id, u.email_setting, u.email, p.poster_email FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id WHERE p.topic_id='.$tid.' ORDER BY p.posted DESC LIMIT '.$show) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-		while ($cur_post = $db->fetch_assoc($result))
-		{
-			$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
-
-			$item = array(
-				'id'			=>	$cur_post['id'],
-				'title'			=>	$cur_topic['first_post_id'] == $cur_post['id'] ? $cur_topic['subject'] : $lang_common['RSS reply'].$cur_topic['subject'],
-				'link'			=>	get_base_url(true).'/viewtopic.php?pid='.$cur_post['id'].'#p'.$cur_post['id'],
-				'description'		=>	$cur_post['message'],
-				'author'		=>	array(
-					'name'	=> $cur_post['poster'],
-				),
-				'pubdate'		=>	$cur_post['posted']
-			);
-
-			if ($cur_post['poster_id'] > 1)
-			{
-				if ($cur_post['email_setting'] == '0' && !$pun_user['is_guest'])
-					$item['author']['email'] = $cur_post['email'];
-
-				$item['author']['uri'] = get_base_url(true).'/profile.php?id='.$cur_post['poster_id'];
-			}
-			else if ($cur_post['poster_email'] != '' && !$pun_user['is_guest'])
-				$item['author']['email'] = $cur_post['poster_email'];
-
-			$feed['items'][] = $item;
-		}
-
-		$output_func = 'output_'.$type;
-		$output_func($feed);
-	}
-	else
-	{
-		$order_posted = isset($_GET['order']) && strtolower($_GET['order']) == 'posted';
-		$forum_name = '';
-		$forum_sql = '';
-
-		// Were any forum IDs supplied?
-		if (isset($_GET['fid']) && is_scalar($_GET['fid']) && $_GET['fid'] != '')
-		{
-			$fids = explode(',', pun_trim($_GET['fid']));
-			$fids = array_map('intval', $fids);
-
-			if (!empty($fids))
-				$forum_sql .= ' AND t.forum_id IN('.implode(',', $fids).')';
-
-			if (count($fids) == 1)
-			{
-				// Fetch forum name
-				$result = $db->query('SELECT f.forum_name FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fids[0]) or error('Unable to fetch forum name', __FILE__, __LINE__, $db->error());
-				if ($db->num_rows($result))
-					$forum_name = $lang_common['Title separator'].$db->result($result);
-			}
-		}
-
-		// Any forum IDs to exclude?
-		if (isset($_GET['nfid']) && is_scalar($_GET['nfid']) && $_GET['nfid'] != '')
-		{
-			$nfids = explode(',', pun_trim($_GET['nfid']));
-			$nfids = array_map('intval', $nfids);
-
-			if (!empty($nfids))
-				$forum_sql .= ' AND t.forum_id NOT IN('.implode(',', $nfids).')';
-		}
-
-		// Only attempt to cache if caching is enabled and we have all or a single forum
-		if ($pun_config['o_feed_ttl'] > 0 && ($forum_sql == '' || ($forum_name != '' && !isset($_GET['nfid']))))
-			$cache_id = 'feed'.sha1($pun_user['g_id'].'|'.$lang_common['lang_identifier'].'|'.($order_posted ? '1' : '0').($forum_name == '' ? '' : '|'.$fids[0]));
-
-		// Load cached feed
-		if (isset($cache_id) && file_exists(FORUM_CACHE_DIR.'cache_'.$cache_id.'.php'))
-			include FORUM_CACHE_DIR.'cache_'.$cache_id.'.php';
-
-		$now = time();
-		if (!isset($feed) || $cache_expire < $now)
-		{
-			// Setup the feed
-			$feed = array(
-				'title' 		=>	$pun_config['o_board_title'].$forum_name,
-				'link'			=>	'/index.php',
-				'description'	=>	sprintf($lang_common['RSS description'], $pun_config['o_board_title']),
-				'items'			=>	array(),
-				'type'			=>	'topics'
-			);
-
-			// Fetch $show topics
-			$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_poster, p.message, p.hide_smilies, u.email_setting, u.email, p.poster_id, p.poster_email FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.id='.($order_posted ? 't.first_post_id' : 't.last_post_id').' INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.($order_posted ? 't.posted' : 't.last_post').' DESC LIMIT '.(isset($cache_id) ? 50 : $show)) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
-			while ($cur_topic = $db->fetch_assoc($result))
-			{
-				if ($pun_config['o_censoring'] == '1')
-					$cur_topic['subject'] = censor_words($cur_topic['subject']);
-
-				$cur_topic['message'] = parse_message($cur_topic['message'], $cur_topic['hide_smilies']);
-
-				$item = array(
-					'id'			=>	$cur_topic['id'],
-					'title'			=>	$cur_topic['subject'],
-					'link'			=>	'/viewtopic.php?id='.$cur_topic['id'].($order_posted ? '' : '&action=new'),
-					'description'	=>	$cur_topic['message'],
-					'author'		=>	array(
-						'name'	=> $order_posted ? $cur_topic['poster'] : $cur_topic['last_poster']
-					),
-					'pubdate'		=>	$order_posted ? $cur_topic['posted'] : $cur_topic['last_post']
-				);
-
-				if ($cur_topic['poster_id'] > 1)
-				{
-					if ($cur_topic['email_setting'] == '0' && !$pun_user['is_guest'])
-						$item['author']['email'] = $cur_topic['email'];
-
-					$item['author']['uri'] = '/profile.php?id='.$cur_topic['poster_id'];
-				}
-				else if ($cur_topic['poster_email'] != '' && !$pun_user['is_guest'])
-					$item['author']['email'] = $cur_topic['poster_email'];
-
-				$feed['items'][] = $item;
-			}
-
-			// Output feed as PHP code
-			if (isset($cache_id))
-			{
-				$fh = @fopen(FORUM_CACHE_DIR.'cache_'.$cache_id.'.php', 'wb');
-				if (!$fh)
-					error('Unable to write feed cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
-
-				fwrite($fh, '<?php'."\n\n".'$feed = '.var_export($feed, true).';'."\n\n".'$cache_expire = '.($now + ($pun_config['o_feed_ttl'] * 60)).';'."\n\n".'?>');
-
-				fclose($fh);
-
-				if (function_exists('apc_delete_file'))
-					@apc_delete_file(FORUM_CACHE_DIR.'cache_'.$cache_id.'.php');
-			}
-		}
-
-		// If we only want to show a few items but due to caching we have too many
-		if (count($feed['items']) > $show)
-			$feed['items'] = array_slice($feed['items'], 0, $show);
-
-		// Prepend the current base URL onto some links. Done after caching to handle http/https correctly
-		$feed['link'] = get_base_url(true).$feed['link'];
-
-		foreach ($feed['items'] as $key => $item)
-		{
-			$feed['items'][$key]['link'] = get_base_url(true).$item['link'];
-
-			if (isset($item['author']['uri']))
-				$feed['items'][$key]['author']['uri'] = get_base_url(true).$item['author']['uri'];
-		}
-
-		$output_func = 'output_'.$type;
-		$output_func($feed);
-	}
-
-	exit;
-}
-
+	}
+
+	return;
+}
+
+
+//
 // Show users online
-else if ($action == 'online' || $action == 'online_full')
+//
+else if ($_GET['action'] == 'online' || $_GET['action'] == 'online_full')
 {
 	// Load the index.php language file
 	require PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/index.php';
-
+	
 	// Fetch users online info and generate strings for output
 	$num_guests = $num_users = 0;
 	$users = array();
-
-	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 	while ($pun_user_online = $db->fetch_assoc($result))
@@ -490,5 +284,5 @@
 		if ($pun_user_online['user_id'] > 1)
 		{
-			$users[] = ($pun_user['g_view_users'] == '1') ? '<a href="'.pun_htmlspecialchars(get_base_url(true)).'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>' : pun_htmlspecialchars($pun_user_online['ident']);
+			$users[] = '<a href="'.$pun_config['o_base_url'].'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
 			++$num_users;
 		}
@@ -497,22 +291,19 @@
 	}
 
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	echo sprintf($lang_index['Guests online'], forum_number_format($num_guests)).'<br />'."\n";
-
-	if ($action == 'online_full' && !empty($users))
-		echo sprintf($lang_index['Users online'], implode(', ', $users)).'<br />'."\n";
+	echo $lang_index['Guests online'].': '.$num_guests.'<br />';
+
+	if ($_GET['action'] == 'online_full')
+		echo $lang_index['Users online'].': '.implode(', ', $users).'<br />';
 	else
-		echo sprintf($lang_index['Users online'], forum_number_format($num_users)).'<br />'."\n";
-
-	exit;
-}
-
+		echo $lang_index['Users online'].': '.$num_users.'<br />';
+
+	return;
+}
+
+
+//
 // Show board statistics
-else if ($action == 'stats')
+//
+else if ($_GET['action'] == 'stats')
 {
 	// Load the index.php language file
@@ -520,33 +311,22 @@
 
 	// Collect some statistics from the database
-	if (file_exists(FORUM_CACHE_DIR.'cache_users_info.php'))
-		include FORUM_CACHE_DIR.'cache_users_info.php';
-
-	if (!defined('PUN_USERS_INFO_LOADED'))
-	{
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
-		require FORUM_CACHE_DIR.'cache_users_info.php';
-	}
-
-	$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\'utilisateurs', __FILE__, __LINE__, $db->error());
+	$stats['total_users'] = $db->result($result);
+
+	$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier utilisateur inscrit', __FILE__, __LINE__, $db->error());
+	$stats['last_user'] = $db->fetch_assoc($result);
+
+	$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le total de discussions et de messages', __FILE__, __LINE__, $db->error());
 	list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
 
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
-	header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-	header('Pragma: public');
-
-	echo sprintf($lang_index['No of users'], forum_number_format($stats['total_users'])).'<br />'."\n";
-	echo sprintf($lang_index['Newest user'], (($pun_user['g_view_users'] == '1') ? '<a href="'.pun_htmlspecialchars(get_base_url(true)).'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a>' : pun_htmlspecialchars($stats['last_user']['username']))).'<br />'."\n";
-	echo sprintf($lang_index['No of topics'], forum_number_format($stats['total_topics'])).'<br />'."\n";
-	echo sprintf($lang_index['No of posts'], forum_number_format($stats['total_posts'])).'<br />'."\n";
-
-	exit;
-}
-
-// If we end up here, the script was called with some wacky parameters
-exit($lang_common['Bad request']);
+	echo $lang_index['No of users'].': '.$stats['total_users'].'<br />';
+	echo $lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a><br />';
+	echo $lang_index['No of topics'].': '.$stats['total_topics'].'<br />';
+	echo $lang_index['No of posts'].': '.$stats['total_posts'];
+
+	return;
+}
+
+
+else
+	exit('Bad request');
Index: /trunk/web/punbb/footer.php
===================================================================
--- /trunk/web/punbb/footer.php	(revision 10)
+++ /trunk/web/punbb/footer.php	(revision 1)
@@ -1,9 +1,38 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+/* dÃ©commenter pour activer les stats phpmyvisites */
+
+// include ("../phpmv2.php");
+
+
+
+
+/* dÃ©commenter pour activer les stats google analytics */
+
+// include ("../google_analytics.php");
+
+
 
 // Make sure no one attempts to run this script "directly"
@@ -24,67 +53,5 @@
 	<h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
 	<div class="box">
-<?php
-
-if (isset($footer_style) && ($footer_style == 'viewforum' || $footer_style == 'viewtopic') && $is_admmod)
-{
-	echo "\t\t".'<div id="modcontrols" class="inbox">'."\n";
-
-	if ($footer_style == 'viewforum')
-	{
-		echo "\t\t\t".'<dl>'."\n";
-		echo "\t\t\t\t".'<dt><strong>'.$lang_forum['Mod controls'].'</strong></dt>'."\n";
-		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></span></dd>'."\n";
-		echo "\t\t\t".'</dl>'."\n";
-	}
-	else if ($footer_style == 'viewtopic')
-	{
-		echo "\t\t\t".'<dl>'."\n";
-		echo "\t\t\t\t".'<dt><strong>'.$lang_topic['Mod controls'].'</strong></dt>'."\n";
-		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Moderate topic'].'</a></span></dd>'."\n";
-		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></span></dd>'."\n";
-
-		if ($cur_topic['closed'] == '1')
-			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></span></dd>'."\n";
-		else
-			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></span></dd>'."\n";
-
-		if ($cur_topic['sticky'] == '1')
-			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></span></dd>'."\n";
-		else
-			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></span></dd>'."\n";
-
-		echo "\t\t\t".'</dl>'."\n";
-	}
-
-	echo "\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'."\n";
-}
-
-?>
-		<div id="brdfooternav" class="inbox">
-<?php
-
-echo "\t\t\t".'<div class="conl">'."\n";
-
-// Display the "Jump to" drop list
-if ($pun_config['o_quickjump'] == '1')
-{
-	// Load cached quick jump
-	if (file_exists(FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php'))
-		include FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
-
-	if (!defined('PUN_QJ_LOADED'))
-	{
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_quickjump_cache($pun_user['g_id']);
-		require FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
-	}
-}
-
-echo "\t\t\t".'</div>'."\n";
-
-?>
-			<div class="conr">
+		<div class="inbox">
 <?php
 
@@ -92,29 +59,77 @@
 $footer_style = isset($footer_style) ? $footer_style : NULL;
 
-if ($footer_style == 'index')
+if ($footer_style == 'index' || $footer_style == 'search')
 {
-	if ($pun_config['o_feed_type'] == '1')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;type=rss">'.$lang_common['RSS active topics feed'].'</a></span></p>'."\n";
-	else if ($pun_config['o_feed_type'] == '2')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;type=atom">'.$lang_common['Atom active topics feed'].'</a></span></p>'."\n";
+	if (!$pun_user['is_guest'])
+	{
+		echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
+		echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";
+
+		if ($pun_config['o_subscriptions'] == '1')
+			echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";
+
+		echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&amp;user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
+	}
+	else
+	{
+		if ($pun_user['g_search'] == '1')
+		{
+			echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
+			echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
+		}
+	}
 }
-else if ($footer_style == 'viewforum')
+else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
 {
-	if ($pun_config['o_feed_type'] == '1')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;fid='.$forum_id.'&amp;type=rss">'.$lang_common['RSS forum feed'].'</a></span></p>'."\n";
-	else if ($pun_config['o_feed_type'] == '2')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;fid='.$forum_id.'&amp;type=atom">'.$lang_common['Atom forum feed'].'</a></span></p>'."\n";
-}
-else if ($footer_style == 'viewtopic')
-{
-	if ($pun_config['o_feed_type'] == '1')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;tid='.$id.'&amp;type=rss">'.$lang_common['RSS topic feed'].'</a></span></p>'."\n";
-	else if ($pun_config['o_feed_type'] == '2')
-		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;tid='.$id.'&amp;type=atom">'.$lang_common['Atom topic feed'].'</a></span></p>'."\n";
+	echo "\n\t\t\t".'<div class="conl">'."\n";
+
+	// Display the "Jump to" drop list
+	if ($pun_config['o_quickjump'] == '1')
+	{
+		// Load cached quickjump
+		@include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
+		if (!defined('PUN_QJ_LOADED'))
+		{
+			require_once PUN_ROOT.'include/cache.php';
+			generate_quickjump_cache($pun_user['g_id']);
+			require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
+		}
+	}
+
+	if ($footer_style == 'viewforum' && $is_admmod)
+		echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
+	else if ($footer_style == 'viewtopic' && $is_admmod)
+	{
+		echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";
+		echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";
+
+		if ($cur_topic['closed'] == '1')
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
+		else
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";
+
+		if ($cur_topic['sticky'] == '1')
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
+		else
+			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
+	}
+
+	echo "\t\t\t".'</div>'."\n";
 }
 
 ?>
-				<p id="poweredby"><?php printf($lang_common['Powered by'], '<a href="http://fluxbb.org/">FluxBB</a>'.(($pun_config['o_show_version'] == '1') ? ' '.$pun_config['o_cur_version'] : '')) ?></p>
-			</div>
+		  <p class="conr">PropulsÃ© par <a href="http://www.punbb.org/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson<br /> Traduction par <a href="http://www.punbb.fr/">punbb.fr</a></p>
+<?php
+
+// Display debug info (if enabled/defined)
+if (defined('PUN_DEBUG'))
+{
+	// Calculate script generation time
+	list($usec, $sec) = explode(' ', microtime());
+	$time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
+	echo "\t\t\t".'<p class="conr">[ GÃ©nÃ©rÃ©e en '.$time_diff.' sec., '.$db->get_num_queries().' requÃªtes exÃ©cutÃ©es ]</p>'."\n";
+}
+
+?>
 			<div class="clearer"></div>
 		</div>
@@ -122,24 +137,4 @@
 </div>
 <?php
-
-// Display debug info (if enabled/defined)
-if (defined('PUN_DEBUG'))
-{
-	echo '<p id="debugtime">[ ';
-
-	// Calculate script generation time
-	$time_diff = sprintf('%.3f', get_microtime() - $pun_start);
-	echo sprintf($lang_common['Querytime'], $time_diff, $db->get_num_queries());
-
-	if (function_exists('memory_get_usage'))
-	{
-		echo ' - '.sprintf($lang_common['Memory usage'], file_size(memory_get_usage()));
-
-		if (function_exists('memory_get_peak_usage'))
-			echo ' '.sprintf($lang_common['Peak usage'], file_size(memory_get_peak_usage()));
-	}
-
-	echo ' ]</p>'."\n";
-}
 
 
@@ -157,6 +152,21 @@
 
 
+// START SUBST - <pun_include "*">
+while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
+{
+	if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
+	    error('Impossible de procÃ©der Ã  l\'inclusion utilisateur &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; depuis le template main.tpl. Il n\'y a pas de fichier dans le rÃ©pertoire /include/user/');
+	
+	ob_start();
+	include PUN_ROOT.'include/user/'.$cur_include[1];
+	$tpl_temp = ob_get_contents();
+	$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
+    ob_end_clean();
+}
+// END SUBST - <pun_include "*">
+
+
 // Close the db connection (and free up any result data)
-//$db->close();
+// $db->close();
 
 // Spit out the page
Index: /trunk/web/punbb/header.php
===================================================================
--- /trunk/web/punbb/header.php	(revision 10)
+++ /trunk/web/punbb/header.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure no one attempts to run this script "directly"
@@ -12,58 +29,17 @@
 
 // Send no-cache headers
-header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
+header('Expires: Thu, 21 Jul 1977 07:30:00 GMT');	// When yours truly first set eyes on this world! :)
 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
 header('Cache-Control: post-check=0, pre-check=0', false);
-header('Pragma: no-cache'); // For HTTP/1.0 compatibility
-
-// Send the Content-type header in case the web server is setup to send something else
-header('Content-type: text/html; charset=utf-8');
+header('Pragma: no-cache');		// For HTTP/1.0 compability
+
 
 // Load the template
 if (defined('PUN_ADMIN_CONSOLE'))
-	$tpl_file = 'admin.tpl';
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
 else if (defined('PUN_HELP'))
-	$tpl_file = 'help.tpl';
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
 else
-	$tpl_file = 'main.tpl';
-
-if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/'.$tpl_file))
-{
-	$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/'.$tpl_file;
-	$tpl_inc_dir = PUN_ROOT.'style/'.$pun_user['style'].'/';
-}
-else
-{
-	$tpl_file = PUN_ROOT.'include/template/'.$tpl_file;
-	$tpl_inc_dir = PUN_ROOT.'include/user/';
-}
-
-$tpl_main = file_get_contents($tpl_file);
-
-// START SUBST - <pun_include "*">
-preg_match_all('%<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">%i', $tpl_main, $pun_includes, PREG_SET_ORDER);
-
-foreach ($pun_includes as $cur_include)
-{
-	ob_start();
-
-	// Allow for overriding user includes, too.
-	if (file_exists($tpl_inc_dir.$cur_include[1].'.'.$cur_include[2]))
-		require $tpl_inc_dir.$cur_include[1].'.'.$cur_include[2];
-	else if (file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]))
-		require PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2];
-	else
-		error(sprintf($lang_common['Pun include error'], htmlspecialchars($cur_include[0]), basename($tpl_file)));
-
-	$tpl_temp = ob_get_contents();
-	$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
-	ob_end_clean();
-}
-// END SUBST - <pun_include "*">
-
-
-// START SUBST - <pun_language>
-$tpl_main = str_replace('<pun_language>', $lang_common['lang_identifier'], $tpl_main);
-// END SUBST - <pun_language>
+	$tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');
 
 
@@ -73,9 +49,11 @@
 
 
+// START SUBST - <pun_char_encoding>
+$tpl_main = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_main);
+// END SUBST - <pun_char_encoding>
+
+
 // START SUBST - <pun_head>
 ob_start();
-
-// Define $p if its not set to avoid a PHP notice
-$p = isset($p) ? $p : null;
 
 // Is this a page that we want search index spiders to index?
@@ -84,15 +62,10 @@
 
 ?>
-<title><?php echo generate_page_title($page_title, $p) ?></title>
+<title><?php echo $page_title ?></title>
 <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
 <?php
 
 if (defined('PUN_ADMIN_CONSOLE'))
-{
-	if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/base_admin.css'))
-		echo '<link rel="stylesheet" type="text/css" href="style/'.$pun_user['style'].'/base_admin.css" />'."\n";
-	else
-		echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n";
-}
+	echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n";
 
 if (isset($required_fields))
@@ -102,37 +75,36 @@
 ?>
 <script type="text/javascript">
-/* <![CDATA[ */
+<!--
 function process_form(the_form)
 {
-	var element_names = {
-<?php
-	// Output a JavaScript object with localised field names
-	$tpl_temp = count($required_fields);
-	foreach ($required_fields as $elem_orig => $elem_trans)
-	{
-		echo "\t\t\"".$elem_orig.'": "'.addslashes(str_replace('&#160;', ' ', $elem_trans));
-		if (--$tpl_temp) echo "\",\n";
-		else echo "\"\n\t};\n";
-	}
-?>
+	var element_names = new Object()
+<?php
+
+	// Output a JavaScript array with localised field names
+	while (list($elem_orig, $elem_trans) = @each($required_fields))
+		echo "\t".'element_names["'.$elem_orig.'"] = "'.addslashes(str_replace('&#160;', ' ', $elem_trans)).'"'."\n";
+
+?>
+
 	if (document.all || document.getElementById)
 	{
-		for (var i = 0; i < the_form.length; ++i)
+		for (i = 0; i < the_form.length; ++i)
 		{
-			var elem = the_form.elements[i];
-			if (elem.name && (/^req_/.test(elem.name)))
+			var elem = the_form.elements[i]
+			if (elem.name && elem.name.substring(0, 4) == "req_")
 			{
-				if (!elem.value && elem.type && (/^(?:text(?:area)?|password|file)$/i.test(elem.type)))
+				if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
 				{
-					alert('"' + element_names[elem.name] + '" <?php echo $lang_common['required field'] ?>');
-					elem.focus();
-					return false;
+					alert("\"" + element_names[elem.name] + "\" <?php echo $lang_common['required field'] ?>")
+					elem.focus()
+					return false
 				}
 			}
 		}
 	}
-	return true;
-}
-/* ]]> */
+
+	return true
+}
+// -->
 </script>
 <?php
@@ -140,9 +112,7 @@
 }
 
-// JavaScript tricks for IE6 and older
-echo '<!--[if lte IE 6]><script type="text/javascript" src="style/imports/minmax.js"></script><![endif]-->'."\n";
-
-if (isset($page_head))
-	echo implode("\n", $page_head)."\n";
+$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
+if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false)
+	echo '<script type="text/javascript" src="style/imports/minmax.js"></script>';
 
 $tpl_temp = trim(ob_get_contents());
@@ -155,6 +125,6 @@
 if (isset($focus_element))
 {
-	$tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').elements[\''.$focus_element[1].'\'].focus();', $tpl_main);
-	$tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').elements[\''.$focus_element[1].'\'].focus()">', $tpl_main);
+	$tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
+	$tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
 }
 // END SUBST - <body>
@@ -162,126 +132,46 @@
 
 // START SUBST - <pun_page>
-$tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main);
-// END SUBST - <pun_page>
+$tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main);
+// END SUBST - <pun_title>
 
 
 // START SUBST - <pun_title>
-$tpl_main = str_replace('<pun_title>', '<h1><a href="index.php">'.pun_htmlspecialchars($pun_config['o_board_title']).'</a></h1>', $tpl_main);
+$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>', $tpl_main);
 // END SUBST - <pun_title>
 
 
 // START SUBST - <pun_desc>
-$tpl_main = str_replace('<pun_desc>', '<div id="brddesc">'.$pun_config['o_board_desc'].'</div>', $tpl_main);
+$tpl_main = str_replace('<pun_desc>', '<p><span>'.$pun_config['o_board_desc'].'</span></p>', $tpl_main);
 // END SUBST - <pun_desc>
 
 
 // START SUBST - <pun_navlinks>
-$links = array();
-
-// Index should always be displayed
-$links[] = '<li id="navindex"'.((PUN_ACTIVE_PAGE == 'index') ? ' class="isactive"' : '').'><a href="index.php">'.$lang_common['Index'].'</a></li>';
-
-if ($pun_user['g_read_board'] == '1' && $pun_user['g_view_users'] == '1')
-	$links[] = '<li id="navuserlist"'.((PUN_ACTIVE_PAGE == 'userlist') ? ' class="isactive"' : '').'><a href="userlist.php">'.$lang_common['User list'].'</a></li>';
-
-if ($pun_config['o_rules'] == '1' && (!$pun_user['is_guest'] || $pun_user['g_read_board'] == '1' || $pun_config['o_regs_allow'] == '1'))
-	$links[] = '<li id="navrules"'.((PUN_ACTIVE_PAGE == 'rules') ? ' class="isactive"' : '').'><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a></li>';
-
-if ($pun_user['g_read_board'] == '1' && $pun_user['g_search'] == '1')
-	$links[] = '<li id="navsearch"'.((PUN_ACTIVE_PAGE == 'search') ? ' class="isactive"' : '').'><a href="search.php">'.$lang_common['Search'].'</a></li>';
-
+$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);
+// END SUBST - <pun_navlinks>
+
+
+// START SUBST - <pun_status>
 if ($pun_user['is_guest'])
-{
-	$links[] = '<li id="navregister"'.((PUN_ACTIVE_PAGE == 'register') ? ' class="isactive"' : '').'><a href="register.php">'.$lang_common['Register'].'</a></li>';
-	$links[] = '<li id="navlogin"'.((PUN_ACTIVE_PAGE == 'login') ? ' class="isactive"' : '').'><a href="login.php">'.$lang_common['Login'].'</a></li>';
-}
+	$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
 else
 {
-	$links[] = '<li id="navprofile"'.((PUN_ACTIVE_PAGE == 'profile') ? ' class="isactive"' : '').'><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a></li>';
-
-	if ($pun_user['is_admmod'])
-		$links[] = '<li id="navadmin"'.((PUN_ACTIVE_PAGE == 'admin') ? ' class="isactive"' : '').'><a href="admin_index.php">'.$lang_common['Admin'].'</a></li>';
-
-	$links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'&amp;csrf_token='.pun_hash($pun_user['id'].pun_hash(get_remote_address())).'">'.$lang_common['Logout'].'</a></li>';
-}
-
-// Are there any additional navlinks we should insert into the array before imploding it?
-if ($pun_user['g_read_board'] == '1' && $pun_config['o_additional_navlinks'] != '')
-{
-	if (preg_match_all('%([0-9]+)\s*=\s*(.*?)\n%s', $pun_config['o_additional_navlinks']."\n", $extra_links))
+	$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
+
+	if ($pun_user['g_id'] < PUN_GUEST)
 	{
-		// Insert any additional links into the $links array (at the correct index)
-		$num_links = count($extra_links[1]);
-		for ($i = 0; $i < $num_links; ++$i)
-			array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i].'</li>'));
+		$result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
+
+		if ($db->result($result_header))
+			$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">Il y a de nouveaux signalements</a></strong></li>';
+
+		if ($pun_config['o_maintenance'] == '1')
+			$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Le mode maintenance est activÃ©&#160;!</a></strong></li>';
 	}
-}
-
-$tpl_temp = '<div id="brdmenu" class="inbox">'."\n\t\t\t".'<ul>'."\n\t\t\t\t".implode("\n\t\t\t\t", $links)."\n\t\t\t".'</ul>'."\n\t\t".'</div>';
-$tpl_main = str_replace('<pun_navlinks>', $tpl_temp, $tpl_main);
-// END SUBST - <pun_navlinks>
-
-
-// START SUBST - <pun_status>
-$page_statusinfo = $page_topicsearches = array();
-
-if ($pun_user['is_guest'])
-	$page_statusinfo = '<p class="conl">'.$lang_common['Not logged in'].'</p>';
-else
-{
-	$page_statusinfo[] = '<li><span>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></span></li>';
-	$page_statusinfo[] = '<li><span>'.sprintf($lang_common['Last visit'], format_time($pun_user['last_visit'])).'</span></li>';
-
-	if ($pun_user['is_admmod'])
-	{
-		if ($pun_config['o_report_method'] == '0' || $pun_config['o_report_method'] == '2')
-		{
-			$result_header = $db->query('SELECT 1 FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
-
-			if ($db->result($result_header))
-				$page_statusinfo[] = '<li class="reportlink"><span><strong><a href="admin_reports.php">'.$lang_common['New reports'].'</a></strong></span></li>';
-		}
-
-		if ($pun_config['o_maintenance'] == '1')
-			$page_statusinfo[] = '<li class="maintenancelink"><span><strong><a href="admin_options.php#maintenance">'.$lang_common['Maintenance mode enabled'].'</a></strong></span></li>';
-	}
-
-	if ($pun_user['g_read_board'] == '1' && $pun_user['g_search'] == '1')
-	{
-		$page_topicsearches[] = '<a href="search.php?action=show_replies" title="'.$lang_common['Show posted topics'].'">'.$lang_common['Posted topics'].'</a>';
-		$page_topicsearches[] = '<a href="search.php?action=show_new" title="'.$lang_common['Show new posts'].'">'.$lang_common['New posts header'].'</a>';
-	}
-}
-
-// Quick searches
-if ($pun_user['g_read_board'] == '1' && $pun_user['g_search'] == '1')
-{
-	$page_topicsearches[] = '<a href="search.php?action=show_recent" title="'.$lang_common['Show active topics'].'">'.$lang_common['Active topics'].'</a>';
-	$page_topicsearches[] = '<a href="search.php?action=show_unanswered" title="'.$lang_common['Show unanswered topics'].'">'.$lang_common['Unanswered topics'].'</a>';
-}
-
-
-// Generate all that jazz
-$tpl_temp = '<div id="brdwelcome" class="inbox">';
-
-// The status information
-if (is_array($page_statusinfo))
-{
-	$tpl_temp .= "\n\t\t\t".'<ul class="conl">';
-	$tpl_temp .= "\n\t\t\t\t".implode("\n\t\t\t\t", $page_statusinfo);
-	$tpl_temp .= "\n\t\t\t".'</ul>';
-}
-else
-	$tpl_temp .= "\n\t\t\t".$page_statusinfo;
-
-// Generate quicklinks
-if (!empty($page_topicsearches))
-{
-	$tpl_temp .= "\n\t\t\t".'<ul class="conr">';
-	$tpl_temp .= "\n\t\t\t\t".'<li><span>'.$lang_common['Topic searches'].' '.implode(' | ', $page_topicsearches).'</span></li>';
-	$tpl_temp .= "\n\t\t\t".'</ul>';
-}
-
-$tpl_temp .= "\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
+
+	if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
+		$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
+	else
+		$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
+}
 
 $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
@@ -290,5 +180,5 @@
 
 // START SUBST - <pun_announcement>
-if ($pun_user['g_read_board'] == '1' && $pun_config['o_announcement'] == '1')
+if ($pun_config['o_announcement'] == '1')
 {
 	ob_start();
@@ -296,8 +186,8 @@
 ?>
 <div id="announce" class="block">
-	<div class="hd"><h2><span><?php echo $lang_common['Announcement'] ?></span></h2></div>
+	<h2><span><?php echo $lang_common['Announcement'] ?></span></h2>
 	<div class="box">
-		<div id="announce-block" class="inbox">
-			<div class="usercontent"><?php echo $pun_config['o_announcement_message'] ?></div>
+		<div class="inbox">
+			<div><?php echo $pun_config['o_announcement_message'] ?></div>
 		</div>
 	</div>
Index: /trunk/web/punbb/help.php
===================================================================
--- /trunk/web/punbb/help.php	(revision 10)
+++ /trunk/web/punbb/help.php	(revision 1)
@@ -1,14 +1,31 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the help template
 define('PUN_HELP', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -22,130 +39,122 @@
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_help['Help']);
-define('PUN_ACTIVE_PAGE', 'help');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help'];
 require PUN_ROOT.'header.php';
 
 ?>
-<h2><span><?php echo $lang_help['BBCode'] ?></span></h2>
+<h2><?php echo $lang_common['BBCode'] ?></h2>
 <div class="box">
 	<div class="inbox">
-		<p><a name="bbcode"></a><?php echo $lang_help['BBCode info 1'] ?></p>
+		<p><a name="bbcode"></a><?php echo $lang_help['BBCode info 1'] ?></p><br />
 		<p><?php echo $lang_help['BBCode info 2'] ?></p>
 	</div>
 </div>
-<h2><span><?php echo $lang_help['Text style'] ?></span></h2>
+<h2><?php echo $lang_help['Text style'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><?php echo $lang_help['Text style info'] ?></p>
-		<p><code>[b]<?php echo $lang_help['Bold text'] ?>[/b]</code> <?php echo $lang_help['produces'] ?> <samp><strong><?php echo $lang_help['Bold text'] ?></strong></samp></p>
-		<p><code>[u]<?php echo $lang_help['Underlined text'] ?>[/u]</code> <?php echo $lang_help['produces'] ?> <samp><span class="bbu"><?php echo $lang_help['Underlined text'] ?></span></samp></p>
-		<p><code>[i]<?php echo $lang_help['Italic text'] ?>[/i]</code> <?php echo $lang_help['produces'] ?> <samp><em><?php echo $lang_help['Italic text'] ?></em></samp></p>
-		<p><code>[s]<?php echo $lang_help['Strike-through text'] ?>[/s]</code> <?php echo $lang_help['produces'] ?> <samp><span class="bbs"><?php echo $lang_help['Strike-through text'] ?></span></samp></p>
-		<p><code>[del]<?php echo $lang_help['Deleted text'] ?>[/del]</code> <?php echo $lang_help['produces'] ?> <samp><del><?php echo $lang_help['Deleted text'] ?></del></samp></p>
-		<p><code>[ins]<?php echo $lang_help['Inserted text'] ?>[/ins]</code> <?php echo $lang_help['produces'] ?> <samp><ins><?php echo $lang_help['Inserted text'] ?></ins></samp></p>
-		<p><code>[em]<?php echo $lang_help['Emphasised text'] ?>[/em]</code> <?php echo $lang_help['produces'] ?> <samp><em><?php echo $lang_help['Emphasised text'] ?></em></samp></p>
-		<p><code>[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color]</code> <?php echo $lang_help['produces'] ?> <samp><span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span></samp></p>
-		<p><code>[color=blue]<?php echo $lang_help['Blue text'] ?>[/color]</code> <?php echo $lang_help['produces'] ?> <samp><span style="color: blue"><?php echo $lang_help['Blue text'] ?></span></samp></p>
-		<p><code>[h]<?php echo $lang_help['Heading text'] ?>[/h]</code> <?php echo $lang_help['produces'] ?></p> <div class="postmsg"><h5><?php echo $lang_help['Heading text'] ?></h5></div>
+	<p><?php echo $lang_help['Text style info'] ?></p><br />
+	<div style="padding-left: 4px">
+		[b]<?php echo $lang_help['Bold text'] ?>[/b] <?php echo $lang_help['produces'] ?> <b><?php echo $lang_help['Bold text'] ?></b><br />
+		[u]<?php echo $lang_help['Underlined text'] ?>[/u] <?php echo $lang_help['produces'] ?> <span class="bbu"><?php echo $lang_help['Underlined text'] ?></span><br />
+		[i]<?php echo $lang_help['Italic text'] ?>[/i] <?php echo $lang_help['produces'] ?> <i><?php echo $lang_help['Italic text'] ?></i><br />
+		[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span><br />
+		[color=blue]<?php echo $lang_help['Blue text'] ?>[/color] <?php echo $lang_help['produces'] ?> <span style="color: blue"><?php echo $lang_help['Blue text'] ?></span>
 	</div>
 </div>
-<h2><span><?php echo $lang_help['Links and images'] ?></span></h2>
+<h2><?php echo $lang_help['Links and images'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><?php echo $lang_help['Links info'] ?></p>
-		<p><code>[url=<?php echo pun_htmlspecialchars(get_base_url(true).'/') ?>]<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>[/url]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/') ?>"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a></samp></p>
-		<p><code>[url]<?php echo pun_htmlspecialchars(get_base_url(true).'/') ?>[/url]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/') ?>"><?php echo pun_htmlspecialchars(get_base_url(true).'/') ?></a></samp></p>
-		<p><code>[url=/help.php]<?php echo $lang_help['This help page'] ?>[/url]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo get_base_url(true).'/help.php' ?>"><?php echo $lang_help['This help page'] ?></a></samp></p>
-		<p><code>[email]myname@mydomain.com[/email]</code> <?php echo $lang_help['produces'] ?> <samp><a href="mailto:myname@mydomain.com">myname@mydomain.com</a></samp></p>
-		<p><code>[email=myname@mydomain.com]<?php echo $lang_help['My email address'] ?>[/email]</code> <?php echo $lang_help['produces'] ?> <samp><a href="mailto:myname@mydomain.com"><?php echo $lang_help['My email address'] ?></a></samp></p>
-		<p><code>[topic=1]<?php echo $lang_help['Test topic'] ?>[/topic]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?id=1') ?>"><?php echo $lang_help['Test topic'] ?></a></samp></p>
-		<p><code>[topic]1[/topic]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?id=1') ?>"><?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?id=1') ?></a></samp></p>
-		<p><code>[post=1]<?php echo $lang_help['Test post'] ?>[/post]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?pid=1#p1') ?>"><?php echo $lang_help['Test post'] ?></a></samp></p>
-		<p><code>[post]1[/post]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?pid=1#p1') ?>"><?php echo pun_htmlspecialchars(get_base_url(true).'/viewtopic.php?pid=1#p1') ?></a></samp></p>
-		<p><code>[forum=1]<?php echo $lang_help['Test forum'] ?>[/forum]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewforum.php?id=1') ?>"><?php echo $lang_help['Test forum'] ?></a></samp></p>
-		<p><code>[forum]1[/forum]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/viewforum.php?id=1') ?>"><?php echo pun_htmlspecialchars(get_base_url(true).'/viewforum.php?id=1') ?></a></samp></p>
-		<p><code>[user=2]<?php echo $lang_help['Test user'] ?>[/user]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/profile.php?id=2') ?>"><?php echo $lang_help['Test user'] ?></a></samp></p>
-		<p><code>[user]2[/user]</code> <?php echo $lang_help['produces'] ?> <samp><a href="<?php echo pun_htmlspecialchars(get_base_url(true).'/profile.php?id=2') ?>"><?php echo pun_htmlspecialchars(get_base_url(true).'/profile.php?id=2') ?></a></samp></p>
+	<p><?php echo $lang_help['Links info'] ?></p><br />
+	<div style="padding-left: 4px">
+		[url=<?php echo $pun_config['o_base_url'].'/' ?>]<?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'].'/' ?>"><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?></a><br />
+		[url]<?php echo $pun_config['o_base_url'].'/' ?>[/url] <?php echo $lang_help['produces'] ?> <a href="<?php echo $pun_config['o_base_url'] ?>"><?php echo $pun_config['o_base_url'].'/' ?></a><br />
+		[email]myname@mydomain.com[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com">myname@mydomain.com</a><br />
+		[email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br />
 	</div>
-	<div class="inbox">
-		<p><a name="img"></a><?php echo $lang_help['Images info'] ?></p>
-		<p><code>[img=<?php echo $lang_help['FluxBB bbcode test'] ?>]<?php echo pun_htmlspecialchars(get_base_url(true)) ?>/img/test.png[/img]</code> <?php echo $lang_help['produces'] ?> <samp><img style="height: 21px" src="<?php echo pun_htmlspecialchars(get_base_url(true)) ?>/img/test.png" alt="<?php echo $lang_help['FluxBB bbcode test'] ?>" /></samp></p>
-	</div>
+	<p><a name="img"></a><?php echo $lang_help['Images info'] ?></p>
+	<div>[img]http://www.punbb.org/img/small_logo.png[/img] <?php echo $lang_help['produces'] ?> <img src="http://www.punbb.org/img/small_logo.png" alt="http://www.punbb.org/img/small_logo.png" /></div>
 </div>
-<h2><span><?php echo $lang_help['Quotes'] ?></span></h2>
+<h2><?php echo $lang_help['Quotes'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><?php echo $lang_help['Quotes info'] ?></p>
-		<p><code>[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]</code></p>
-		<p><?php echo $lang_help['produces quote box'] ?></p>
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Quotes info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
+		<?php echo $lang_help['produces quote box'] ?><br /><br />
 		<div class="postmsg">
-			<div class="quotebox"><cite>James <?php echo $lang_common['wrote'] ?></cite><blockquote><div><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote></div>
+			<blockquote><div class="incqbox"><h4>James <?php echo $lang_common['wrote'] ?>:</h4><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
 		</div>
-		<p><?php echo $lang_help['Quotes info 2'] ?></p>
-		<p><code>[quote]<?php echo $lang_help['Quote text'] ?>[/quote]</code></p>
-		<p><?php echo $lang_help['produces quote box'] ?></p>
+		<br />
+		<?php echo $lang_help['Quotes info 2'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
+		<?php echo $lang_help['produces quote box'] ?><br /><br />
 		<div class="postmsg">
-			<div class="quotebox"><blockquote><div><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote></div>
-		</div>
-		<p><?php echo $lang_help['quote note'] ?></p>
-	</div>
-</div>
-<h2><span><?php echo $lang_help['Code'] ?></span></h2>
-<div class="box">
-	<div class="inbox">
-		<p><?php echo $lang_help['Code info'] ?></p>
-		<p><code>[code]<?php echo $lang_help['Code text'] ?>[/code]</code></p>
-		<p><?php echo $lang_help['produces code box'] ?></p>
-		<div class="postmsg">
-			<div class="codebox"><pre><code><?php echo $lang_help['Code text'] ?></code></pre></div>
+			<blockquote><div class="incqbox"><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
 		</div>
 	</div>
 </div>
-<h2><span><?php echo $lang_help['Lists'] ?></span></h2>
+<h2><?php echo $lang_help['Code'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><a name="lists"></a><?php echo $lang_help['List info'] ?></p>
-		<p><code>[list][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code>
-		<br /><span><?php echo $lang_help['produces list'] ?></span></p>
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Code info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[code]<?php echo $lang_help['Code text'] ?>[/code]<br /><br />
+		<?php echo $lang_help['produces code box'] ?><br /><br />
 		<div class="postmsg">
-			<ul><li><p><?php echo $lang_help['List text 1'] ?></p></li><li><p><?php echo $lang_help['List text 2'] ?></p></li><li><p><?php echo $lang_help['List text 3'] ?></p></li></ul>
-		</div>
-		<p><code>[list=1][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code>
-		<br /><span><?php echo $lang_help['produces decimal list'] ?></span></p>
-		<div class="postmsg">
-			<ol class="decimal"><li><p><?php echo $lang_help['List text 1'] ?></p></li><li><p><?php echo $lang_help['List text 2'] ?></p></li><li><p><?php echo $lang_help['List text 3'] ?></p></li></ol>
-		</div>
-		<p><code>[list=a][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code>
-		<br /><span><?php echo $lang_help['produces alpha list'] ?></span></p>
-		<div class="postmsg">
-			<ol class="alpha"><li><p><?php echo $lang_help['List text 1'] ?></p></li><li><p><?php echo $lang_help['List text 2'] ?></p></li><li><p><?php echo $lang_help['List text 3'] ?></p></li></ol>
+			<div class="codebox"><div class="incqbox"><h4><?php echo $lang_common['Code'] ?>:</h4><div class="scrollbox" style="height: 4.5em"><pre><?php echo $lang_help['Code text'] ?></pre></div></div></div>
 		</div>
 	</div>
 </div>
-<h2><span><?php echo $lang_help['Nested tags'] ?></span></h2>
+<h2><?php echo $lang_help['Nested tags'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><?php echo $lang_help['Nested tags info'] ?></p>
-		<p><code>[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b]</code> <?php echo $lang_help['produces'] ?> <samp><strong><span class="bbu"><?php echo $lang_help['Bold, underlined text'] ?></span></strong></samp></p>
+	<div style="padding-left: 4px">
+		<?php echo $lang_help['Nested tags info'] ?><br /><br />
+		&#160;&#160;&#160;&#160;[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b] <?php echo $lang_help['produces'] ?> <span class="bbu"><b><?php echo $lang_help['Bold, underlined text'] ?></b></span><br /><br />
 	</div>
 </div>
-<h2><span><?php echo $lang_help['Smilies'] ?></span></h2>
+<h2><?php echo $lang_common['Smilies'] ?></h2>
 <div class="box">
-	<div class="inbox">
-		<p><a name="smilies"></a><?php echo $lang_help['Smilies info'] ?></p>
+	<div style="padding-left: 4px">
+		<a name="smilies"></a><?php echo $lang_help['Smilies info'] ?><br /><br />
 <?php
 
 // Display the smiley set
-require PUN_ROOT.'include/parser.php';
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
 
-$smiley_groups = array();
+$num_smilies = count($smiley_text);
+for ($i = 0; $i < $num_smilies; ++$i)
+{
+	// Is there a smiley at the current index?
+	if (!isset($smiley_text[$i]))
+		continue;
 
-foreach ($smilies as $smiley_text => $smiley_img)
-	$smiley_groups[$smiley_img][] = $smiley_text;
+	echo "\t\t".'&#160;&#160;&#160;&#160;'.$smiley_text[$i];
 
-foreach ($smiley_groups as $smiley_img => $smiley_texts)
-	echo "\t\t".'<p><code>'.implode('</code> '.$lang_common['and'].' <code>', $smiley_texts).'</code> <span>'.$lang_help['produces'].'</span> <samp><img src="'.pun_htmlspecialchars(get_base_url(true)).'/img/smilies/'.$smiley_img.'" width="15" height="15" alt="'.$smiley_texts[0].'" /></samp></p>'."\n";
+	// Save the current text and image
+	$cur_img = $smiley_img[$i];
+	$cur_text = $smiley_text[$i];
+
+	// Loop through the rest of the array and see if there are any duplicate images
+	// (more than one text representation for one image)
+	for ($next = $i + 1; $next < $num_smilies; ++$next)
+	{
+		// Did we find a dupe?
+		if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next])
+		{
+			echo ' '.$lang_common['and'].' '.$smiley_text[$next];
+
+			// Remove the dupe so we won't display it twice
+			unset($smiley_text[$next]);
+			unset($smiley_img[$next]);
+		}
+	}
+
+	echo ' '.$lang_help['produces'].' <img src="img/smilies/'.$cur_img.'" alt="'.$cur_text.'" /><br />'."\n";
+}
 
 ?>
+		<br />
 	</div>
 </div>
Index: unk/web/punbb/img/avatars/index.html
===================================================================
--- /trunk/web/punbb/img/avatars/index.html	(revision 10)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<html><head><title>.</title></head><body>.</body></html>
Index: /trunk/web/punbb/img/index.html
===================================================================
--- /trunk/web/punbb/img/index.html	(revision 10)
+++ /trunk/web/punbb/img/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/img/smilies/index.html
===================================================================
--- /trunk/web/punbb/img/smilies/index.html	(revision 10)
+++ /trunk/web/punbb/img/smilies/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/include/cache.php
===================================================================
--- /trunk/web/punbb/include/cache.php	(revision 10)
+++ /trunk/web/punbb/include/cache.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure no one attempts to run this script "directly"
@@ -13,4 +30,49 @@
 
 //
+// If we are running pre PHP 4.2.0, we add our own implementation of var_export
+//
+if (!function_exists('var_export'))
+{
+	function var_export()
+	{
+		$args = func_get_args();
+		$indent = (isset($args[2])) ? $args[2] : '';
+
+		if (is_array($args[0]))
+		{
+			$output = 'array ('."\n";
+
+			foreach ($args[0] as $k => $v)
+			{
+				if (is_numeric($k))
+					$output .= $indent.'  '.$k.' => ';
+				else
+					$output .= $indent.'  \''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $k)).'\' => ';
+
+				if (is_array($v))
+					$output .= var_export($v, true, $indent.'  ');
+				else
+				{
+					if (gettype($v) != 'string' && !empty($v))
+						$output .= $v.','."\n";
+					else
+						$output .= '\''.str_replace('\'', '\\\'', str_replace('\\', '\\\\', $v)).'\','."\n";
+				}
+			}
+
+			$output .= ($indent != '') ? $indent.'),'."\n" : ')';
+		}
+		else
+			$output = $args[0];
+
+		if ($args[1] == true)
+			return $output;
+		else
+			echo $output;
+	}
+}
+
+
+//
 // Generate the config cache PHP script
 //
@@ -20,19 +82,16 @@
 
 	// Get the forum config from the DB
-	$result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Impossible de retrouver la configuration des forums', __FILE__, __LINE__, $db->error());
 	while ($cur_config_item = $db->fetch_row($result))
 		$output[$cur_config_item[0]] = $cur_config_item[1];
 
 	// Output config as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_config.php', 'wb');
+	$fh = @fopen(PUN_ROOT.'cache/cache_config.php', 'wb');
 	if (!$fh)
-		error('Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
+		error('Impossible d\'Ã©crire le fichier cache de configuration dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
 
 	fwrite($fh, '<?php'."\n\n".'define(\'PUN_CONFIG_LOADED\', 1);'."\n\n".'$pun_config = '.var_export($output, true).';'."\n\n".'?>');
 
 	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_config.php');
 }
 
@@ -46,5 +105,5 @@
 
 	// Get the ban list from the DB
-	$result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Impossible de retrouver la liste de bannissements', __FILE__, __LINE__, $db->error());
 
 	$output = array();
@@ -53,14 +112,11 @@
 
 	// Output ban list as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_bans.php', 'wb');
+	$fh = @fopen(PUN_ROOT.'cache/cache_bans.php', 'wb');
 	if (!$fh)
-		error('Unable to write bans cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
+		error('Impossible d\'Ã©crire le fichier cache de bannissements dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
 
 	fwrite($fh, '<?php'."\n\n".'define(\'PUN_BANS_LOADED\', 1);'."\n\n".'$pun_bans = '.var_export($output, true).';'."\n\n".'?>');
 
 	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_bans.php');
 }
 
@@ -74,5 +130,5 @@
 
 	// Get the rank list from the DB
-	$result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Impossible de retrouver la liste des rangs utilisateurs', __FILE__, __LINE__, $db->error());
 
 	$output = array();
@@ -81,19 +137,16 @@
 
 	// Output ranks list as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_ranks.php', 'wb');
+	$fh = @fopen(PUN_ROOT.'cache/cache_ranks.php', 'wb');
 	if (!$fh)
-		error('Unable to write ranks cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
+		error('Impossible d\'Ã©crire le fichier de cache de rangs utilisateurs dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
 
 	fwrite($fh, '<?php'."\n\n".'define(\'PUN_RANKS_LOADED\', 1);'."\n\n".'$pun_ranks = '.var_export($output, true).';'."\n\n".'?>');
 
 	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_ranks.php');
-}
-
-
-//
-// Generate quick jump cache PHP scripts
+}
+
+
+//
+// Generate quickjump cache PHP scripts
 //
 function generate_quickjump_cache($group_id = false)
@@ -101,183 +154,52 @@
 	global $db, $lang_common, $pun_user;
 
-	$groups = array();
-
-	// If a group_id was supplied, we generate the quick jump cache for that group only
+	// If a group_id was supplied, we generate the quickjump cache for that group only
 	if ($group_id !== false)
-	{
-		// Is this group even allowed to read forums?
-		$result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group read permission', __FILE__, __LINE__, $db->error());
-		$read_board = $db->result($result);
-
-		$groups[$group_id] = $read_board;
-	}
+		$groups[0] = $group_id;
 	else
 	{
-		// A group_id was not supplied, so we generate the quick jump cache for all groups
-		$result = $db->query('SELECT g_id, g_read_board FROM '.$db->prefix.'groups') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+		// A group_id was now supplied, so we generate the quickjump cache for all groups
+		$result = $db->query('SELECT g_id FROM '.$db->prefix.'groups') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
 		$num_groups = $db->num_rows($result);
 
-		while ($row = $db->fetch_row($result))
-			$groups[$row[0]] = $row[1];
+		for ($i = 0; $i < $num_groups; ++$i)
+			$groups[] = $db->result($result, $i);
 	}
 
 	// Loop through the groups in $groups and output the cache for each of them
-	foreach ($groups as $group_id => $read_board)
+	while (list(, $group_id) = @each($groups))
 	{
-		// Output quick jump as PHP code
-		$fh = @fopen(FORUM_CACHE_DIR.'cache_quickjump_'.$group_id.'.php', 'wb');
+		// Output quickjump as PHP code
+		$fh = @fopen(PUN_ROOT.'cache/cache_quickjump_'.$group_id.'.php', 'wb');
 		if (!$fh)
-			error('Unable to write quick jump cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
-
-		$output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n".'$forum_id = isset($forum_id) ? $forum_id : 0;'."\n\n".'?>';
-
-		if ($read_board == '1')
+			error('Impossible d\'Ã©crire le fichier cache de saut rapide de forums dans le rÃ©pertoire cache. Veuillez vous assurer que PHP a l\'accÃšs en Ã©crire au rÃ©pertoire \'cache\'', __FILE__, __LINE__);
+
+		$output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';
+		$output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
+
+
+		$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+		$cur_category = 0;
+		while ($cur_forum = $db->fetch_assoc($result))
 		{
-			$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-
-			if ($db->num_rows($result))
+			if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 			{
-				$output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><span><?php echo $lang_common[\'Jump to\'] ?>'.'<br /></span>'."\n\t\t\t\t\t".'<select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
-
-				$cur_category = 0;
-				while ($cur_forum = $db->fetch_assoc($result))
-				{
-					if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
-					{
-						if ($cur_category)
-							$output .= "\t\t\t\t\t\t".'</optgroup>'."\n";
-
-						$output .= "\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
-						$cur_category = $cur_forum['cid'];
-					}
-
-					$redirect_tag = ($cur_forum['redirect_url'] != '') ? ' &gt;&gt;&gt;' : '';
-					$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";
-				}
-
-				$output .= "\t\t\t\t\t\t".'</optgroup>'."\n\t\t\t\t\t".'</select>'."\n\t\t\t\t\t".'<input type="submit" value="<?php echo $lang_common[\'Go\'] ?>" accesskey="g" />'."\n\t\t\t\t\t".'</label></div>'."\n\t\t\t\t".'</form>'."\n";
+				if ($cur_category)
+					$output .= "\t\t\t\t\t\t".'</optgroup>'."\n";
+
+				$output .= "\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
+				$cur_category = $cur_forum['cid'];
 			}
+
+			$redirect_tag = ($cur_forum['redirect_url'] != '') ? ' &gt;&gt;&gt;' : '';
+			$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";
 		}
 
+		$output .= "\t\t\t\t\t".'</optgroup>'."\n\t\t\t\t\t".'</select>'."\n\t\t\t\t\t".'<input type="submit" value="<?php echo $lang_common[\'Go\'] ?>" accesskey="g" />'."\n\t\t\t\t\t".'</label></div>'."\n\t\t\t\t".'</form>'."\n";
+
 		fwrite($fh, $output);
 
 		fclose($fh);
-
-		if (function_exists('apc_delete_file'))
-			@apc_delete_file(FORUM_CACHE_DIR.'cache_quickjump_'.$group_id.'.php');
 	}
 }
-
-
-//
-// Generate the censoring cache PHP script
-//
-function generate_censoring_cache()
-{
-	global $db;
-
-	$result = $db->query('SELECT search_for, replace_with FROM '.$db->prefix.'censoring') or error('Unable to fetch censoring list', __FILE__, __LINE__, $db->error());
-	$num_words = $db->num_rows($result);
-
-	$search_for = $replace_with = array();
-	for ($i = 0; $i < $num_words; $i++)
-	{
-		list($search_for[$i], $replace_with[$i]) = $db->fetch_row($result);
-		$search_for[$i] = '%(?<=[^\p{L}\p{N}])('.str_replace('\*', '[\p{L}\p{N}]*?', preg_quote($search_for[$i], '%')).')(?=[^\p{L}\p{N}])%iu';
-	}
-
-	// Output censored words as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_censoring.php', 'wb');
-	if (!$fh)
-		error('Unable to write censoring cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
-
-	fwrite($fh, '<?php'."\n\n".'define(\'PUN_CENSOR_LOADED\', 1);'."\n\n".'$search_for = '.var_export($search_for, true).';'."\n\n".'$replace_with = '.var_export($replace_with, true).';'."\n\n".'?>');
-
-	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_censoring.php');
-}
-
-
-//
-// Generate the stopwords cache PHP script
-//
-function generate_stopwords_cache()
-{
-	$stopwords = array();
-
-	$d = dir(PUN_ROOT.'lang');
-	while (($entry = $d->read()) !== false)
-	{
-		if ($entry{0} == '.')
-			continue;
-
-		if (is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/stopwords.txt'))
-			$stopwords = array_merge($stopwords, file(PUN_ROOT.'lang/'.$entry.'/stopwords.txt'));
-	}
-	$d->close();
-
-	// Tidy up and filter the stopwords
-	$stopwords = array_map('pun_trim', $stopwords);
-	$stopwords = array_filter($stopwords);
-
-	// Output stopwords as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_stopwords.php', 'wb');
-	if (!$fh)
-		error('Unable to write stopwords cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
-
-	fwrite($fh, '<?php'."\n\n".'$cache_id = \''.generate_stopwords_cache_id().'\';'."\n".'if ($cache_id != generate_stopwords_cache_id()) return;'."\n\n".'define(\'PUN_STOPWORDS_LOADED\', 1);'."\n\n".'$stopwords = '.var_export($stopwords, true).';'."\n\n".'?>');
-
-	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_stopwords.php');
-}
-
-
-//
-// Load some information about the latest registered users
-//
-function generate_users_info_cache()
-{
-	global $db;
-
-	$stats = array();
-
-	$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users WHERE group_id!='.PUN_UNVERIFIED) or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());
-	$stats['total_users'] = $db->result($result);
-
-	$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE group_id!='.PUN_UNVERIFIED.' ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());
-	$stats['last_user'] = $db->fetch_assoc($result);
-
-	// Output users info as PHP code
-	$fh = @fopen(FORUM_CACHE_DIR.'cache_users_info.php', 'wb');
-	if (!$fh)
-		error('Unable to write users info cache file to cache directory. Please make sure PHP has write access to the directory \''.pun_htmlspecialchars(FORUM_CACHE_DIR).'\'', __FILE__, __LINE__);
-
-	fwrite($fh, '<?php'."\n\n".'define(\'PUN_USERS_INFO_LOADED\', 1);'."\n\n".'$stats = '.var_export($stats, true).';'."\n\n".'?>');
-
-	fclose($fh);
-
-	if (function_exists('apc_delete_file'))
-		@apc_delete_file(FORUM_CACHE_DIR.'cache_users_info.php');
-}
-
-
-//
-// Delete all feed caches
-//
-function clear_feed_cache()
-{
-	$d = dir(FORUM_CACHE_DIR);
-	while (($entry = $d->read()) !== false)
-	{
-		if (substr($entry, 0, 10) == 'cache_feed' && substr($entry, -4) == '.php')
-			@unlink(FORUM_CACHE_DIR.$entry);
-	}
-	$d->close();
-}
-
-
-define('FORUM_CACHE_FUNCTIONS_LOADED', true);
Index: /trunk/web/punbb/include/common.php
===================================================================
--- /trunk/web/punbb/include/common.php	(revision 10)
+++ /trunk/web/punbb/include/common.php	(revision 1)
@@ -1,75 +1,63 @@
 <?php
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+// Activez le mode DEBUG en enlevant // du dÃ©but de la ligne ci-dessous
+//define('PUN_DEBUG', 1);
+
+// Ceci permettra d'afficher en bas de page toutes les requÃªtes exÃ©cutÃ©es
+// N'ACTIVEZ PAS cela sur un environnement de production !
+//define('PUN_SHOW_QUERIES', 1);
 
 if (!defined('PUN_ROOT'))
-	exit('The constant PUN_ROOT must be defined and point to a valid FluxBB installation root directory.');
+	exit('La constante PUN_ROOT doit Ãªtre dÃ©finie est doit pointer le repertoire racine d\'une installation fonctionnelle de PunBB.');
 
-// Define the version and database revision that this code was written for
-define('FORUM_VERSION', '1.4.7');
-
-define('FORUM_DB_REVISION', 15);
-define('FORUM_SI_REVISION', 2);
-define('FORUM_PARSER_REVISION', 2);
-
-// Block prefetch requests
-if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
-{
-	header('HTTP/1.1 403 Prefetching Forbidden');
-
-	// Send no-cache headers
-	header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
-	header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: post-check=0, pre-check=0', false);
-	header('Pragma: no-cache'); // For HTTP/1.0 compatibility
-
-	exit;
-}
-
-// Attempt to load the configuration file config.php
-if (file_exists(PUN_ROOT.'config.php'))
-	require PUN_ROOT.'config.php';
-
-// If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
-if (defined('FORUM'))
-	define('PUN', FORUM);
 
 // Load the functions script
 require PUN_ROOT.'include/functions.php';
 
-// Load UTF-8 functions
-require PUN_ROOT.'include/utf8/utf8.php';
+// Reverse the effect of register_globals
+if (@ini_get('register_globals'))
+	unregister_globals();
 
-// Strip out "bad" UTF-8 characters
-forum_remove_bad_characters();
-
-// Reverse the effect of register_globals
-forum_unregister_globals();
+include PUN_ROOT.'config.php';
 
 // If PUN isn't defined, config.php is missing or corrupt
 if (!defined('PUN'))
-{
-	header('Location: install.php');
-	exit;
-}
+	exit('Le fichier "config.php" n\'existe pas ou est endommagÃ©. Veuillez lancer <a href="install.php">install.php</a> pour installer PunBB.');
+
 
 // Record the start time (will be used to calculate the generation time for the page)
-$pun_start = get_microtime();
+list($usec, $sec) = explode(' ', microtime());
+$pun_start = ((float)$usec + (float)$sec);
 
-// Make sure PHP reports all errors except E_NOTICE. FluxBB supports E_ALL, but a lot of scripts it may interact with, do not
+// Enable full error, warning and notice reporting
 error_reporting(E_ALL ^ E_NOTICE);
 
-// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
-setlocale(LC_CTYPE, 'C');
+// Turn off magic_quotes_runtime
+set_magic_quotes_runtime(0);
 
-// Turn off magic_quotes_runtime
-if (get_magic_quotes_runtime())
-	set_magic_quotes_runtime(0);
-
-// Strip slashes from GET/POST/COOKIE/REQUEST/FILES (if magic_quotes_gpc is enabled)
+// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
 if (get_magic_quotes_gpc())
 {
@@ -82,22 +70,20 @@
 	$_POST = stripslashes_array($_POST);
 	$_COOKIE = stripslashes_array($_COOKIE);
-	$_REQUEST = stripslashes_array($_REQUEST);
-	$_FILES = stripslashes_array($_FILES);
 }
 
-// If a cookie name is not specified in config.php, we use the default (pun_cookie)
+// Seed the random number generator
+mt_srand((double)microtime()*1000000);
+
+// If a cookie name is not specified in config.php, we use the default (punbb_cookie)
 if (empty($cookie_name))
-	$cookie_name = 'pun_cookie';
-
-// If the cache directory is not specified, we use the default setting
-if (!defined('FORUM_CACHE_DIR'))
-	define('FORUM_CACHE_DIR', PUN_ROOT.'cache/');
+	$cookie_name = 'punbb_cookie';
 
 // Define a few commonly used constants
-define('PUN_UNVERIFIED', 0);
+define('PUN_UNVERIFIED', 32000);
 define('PUN_ADMIN', 1);
 define('PUN_MOD', 2);
 define('PUN_GUEST', 3);
 define('PUN_MEMBER', 4);
+
 
 // Load DB abstraction layer and connect
@@ -108,31 +94,21 @@
 
 // Load cached config
-if (file_exists(FORUM_CACHE_DIR.'cache_config.php'))
-	include FORUM_CACHE_DIR.'cache_config.php';
-
+@include PUN_ROOT.'cache/cache_config.php';
 if (!defined('PUN_CONFIG_LOADED'))
 {
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require PUN_ROOT.'include/cache.php';
 	generate_config_cache();
-	require FORUM_CACHE_DIR.'cache_config.php';
+	require PUN_ROOT.'cache/cache_config.php';
 }
 
-// Verify that we are running the proper database schema revision
-if (!isset($pun_config['o_database_revision']) || $pun_config['o_database_revision'] < FORUM_DB_REVISION ||
-	!isset($pun_config['o_searchindex_revision']) || $pun_config['o_searchindex_revision'] < FORUM_SI_REVISION ||
-	!isset($pun_config['o_parser_revision']) || $pun_config['o_parser_revision'] < FORUM_PARSER_REVISION ||
-	version_compare($pun_config['o_cur_version'], FORUM_VERSION, '<'))
-{
-	header('Location: db_update.php');
-	exit;
-}
 
 // Enable output buffering
 if (!defined('PUN_DISABLE_BUFFERING'))
 {
+	// For some very odd reason, "Norton Internet Security" unsets this
+	$_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';
+
 	// Should we use gzip output compression?
-	if ($pun_config['o_gzip'] && extension_loaded('zlib'))
+	if ($pun_config['o_gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
 		ob_start('ob_gzhandler');
 	else
@@ -140,7 +116,4 @@
 }
 
-// Define standard date/time formats
-$forum_time_formats = array($pun_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a');
-$forum_date_formats = array($pun_config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y');
 
 // Check/update/set cookie and fetch user info
@@ -149,8 +122,7 @@
 
 // Attempt to load the common language file
-if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'))
-	include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
-else
-	error('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name');
+@include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
+if (!isset($lang_common))
+	exit('Il n\'y a pas de pack de langue \''.pun_htmlspecialchars($pun_user['language']).'\' d\'installÃ©. Veuillez rÃ©-installer une langue de ce nom.');
 
 // Check if we are to display a maintenance message
@@ -158,15 +130,12 @@
 	maintenance_message();
 
+
 // Load cached bans
-if (file_exists(FORUM_CACHE_DIR.'cache_bans.php'))
-	include FORUM_CACHE_DIR.'cache_bans.php';
-
+@include PUN_ROOT.'cache/cache_bans.php';
 if (!defined('PUN_BANS_LOADED'))
 {
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_bans_cache();
-	require FORUM_CACHE_DIR.'cache_bans.php';
+	require PUN_ROOT.'cache/cache_bans.php';
 }
 
@@ -177,17 +146,3 @@
 update_users_online();
 
-// Check to see if we logged in without a cookie being set
-if ($pun_user['is_guest'] && isset($_GET['login']))
-	message($lang_common['No cookie']);
-
-// The maximum size of a post, in bytes, since the field is now MEDIUMTEXT this allows ~16MB but lets cap at 1MB...
-if (!defined('PUN_MAX_POSTSIZE'))
-	define('PUN_MAX_POSTSIZE', 1048576);
-
-if (!defined('PUN_SEARCH_MIN_WORD'))
-	define('PUN_SEARCH_MIN_WORD', 3);
-if (!defined('PUN_SEARCH_MAX_WORD'))
-	define('PUN_SEARCH_MAX_WORD', 20);
-
-if (!defined('FORUM_MAX_COOKIE_SIZE'))
-	define('FORUM_MAX_COOKIE_SIZE', 4048);
+?>
Index: /trunk/web/punbb/include/common_admin.php
===================================================================
--- /trunk/web/punbb/include/common_admin.php	(revision 10)
+++ /trunk/web/punbb/include/common_admin.php	(revision 1)
@@ -1,9 +1,25 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
 
 // Make sure no one attempts to run this script "directly"
@@ -11,14 +27,4 @@
 	exit;
 
-// Make sure we have a usable language pack for admin.
-if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/admin_common.php'))
-	$admin_language = $pun_user['language'];
-else if (file_exists(PUN_ROOT.'lang/'.$pun_config['o_default_lang'].'/admin_common.php'))
-	$admin_language = $pun_config['o_default_lang'];
-else
-	$admin_language = 'English';
-
-// Attempt to load the admin_common language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_common.php';
 
 //
@@ -27,5 +33,5 @@
 function generate_admin_menu($page = '')
 {
-	global $pun_config, $pun_user, $lang_admin_common;
+	global $pun_config, $pun_user;
 
 	$is_admin = $pun_user['g_id'] == PUN_ADMIN ? true : false;
@@ -34,33 +40,21 @@
 <div id="adminconsole" class="block2col">
 	<div id="adminmenu" class="blockmenu">
-		<h2><span><?php echo $lang_admin_common['Moderator menu'] ?></span></h2>
+		<h2><span>Menu <?php echo ($is_admin) ? 'Admin' : 'ModÃ©rateur' ?></span></h2>
 		<div class="box">
 			<div class="inbox">
 				<ul>
-					<li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="admin_index.php"><?php echo $lang_admin_common['Index'] ?></a></li>
-					<li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="admin_users.php"><?php echo $lang_admin_common['Users'] ?></a></li>
-<?php if ($is_admin || $pun_user['g_mod_ban_users'] == '1'): ?>					<li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
-<?php endif; if ($is_admin || $pun_config['o_report_method'] == '0' || $pun_config['o_report_method'] == '2'): ?>					<li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="admin_reports.php"><?php echo $lang_admin_common['Reports'] ?></a></li>
-<?php endif; ?>				</ul>
-			</div>
-		</div>
-<?php
-
-	if ($is_admin)
-	{
-
-?>
-		<h2 class="block2"><span><?php echo $lang_admin_common['Admin menu'] ?></span></h2>
-		<div class="box">
-			<div class="inbox">
-				<ul>
-					<li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="admin_options.php"><?php echo $lang_admin_common['Options'] ?></a></li>
-					<li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="admin_permissions.php"><?php echo $lang_admin_common['Permissions'] ?></a></li>
-					<li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="admin_categories.php"><?php echo $lang_admin_common['Categories'] ?></a></li>
-					<li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="admin_forums.php"><?php echo $lang_admin_common['Forums'] ?></a></li>
-					<li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="admin_groups.php"><?php echo $lang_admin_common['User groups'] ?></a></li>
-					<li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="admin_censoring.php"><?php echo $lang_admin_common['Censoring'] ?></a></li>
-					<li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="admin_ranks.php"><?php echo $lang_admin_common['Ranks'] ?></a></li>
-					<li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="admin_maintenance.php"><?php echo $lang_admin_common['Maintenance'] ?></a></li>
+					<li<?php if ($page == 'index') echo ' class="isactive"'; ?>><a href="admin_index.php">Index</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'categories') echo ' class="isactive"'; ?>><a href="admin_categories.php">CatÃ©gories</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'forums') echo ' class="isactive"'; ?>><a href="admin_forums.php">Forums</a></li>
+<?php endif; ?>					<li<?php if ($page == 'users') echo ' class="isactive"'; ?>><a href="admin_users.php">Utilisateurs</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'groups') echo ' class="isactive"'; ?>><a href="admin_groups.php">Groupes</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'options') echo ' class="isactive"'; ?>><a href="admin_options.php">Options</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'permissions') echo ' class="isactive"'; ?>><a href="admin_permissions.php">Permissions</a></li>
+<?php endif; ?>					<li<?php if ($page == 'censoring') echo ' class="isactive"'; ?>><a href="admin_censoring.php">Mots censurÃ©s</a></li>
+<?php if ($is_admin): ?>					<li<?php if ($page == 'ranks') echo ' class="isactive"'; ?>><a href="admin_ranks.php">Rangs utilisateurs</a></li>
+<?php endif; ?><?php if ($is_admin || $pun_config['p_mod_ban_users'] == '1'): ?>					<li<?php if ($page == 'bans') echo ' class="isactive"'; ?>><a href="admin_bans.php">Bannissements</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'prune') echo ' class="isactive"'; ?>><a href="admin_prune.php">Ãlaguage</a></li>
+<?php endif; ?><?php if ($is_admin): ?>					<li<?php if ($page == 'maintenance') echo ' class="isactive"'; ?>><a href="admin_maintenance.php">Maintenance</a></li>
+<?php endif; ?>					<li<?php if ($page == 'reports') echo ' class="isactive"'; ?>><a href="admin_reports.php">Signalements</a></li>
 				</ul>
 			</div>
@@ -68,8 +62,16 @@
 <?php
 
+	// See if there are any plugins
+	$plugins = array();
+	$d = dir(PUN_ROOT.'plugins');
+	while (($entry = $d->read()) !== false)
+	{
+		$prefix = substr($entry, 0, strpos($entry, '_'));
+		$suffix = substr($entry, strlen($entry) - 4);
+
+		if ($suffix == '.php' && ((!$is_admin && $prefix == 'AMP') || ($is_admin && ($prefix == 'AP' || $prefix == 'AMP'))))
+			$plugins[] = array(substr(substr($entry, strpos($entry, '_') + 1), 0, -4), $entry);
 	}
-
-	// See if there are any plugins
-	$plugins = forum_list_plugins($is_admin);
+	$d->close();
 
 	// Did we find any plugins?
@@ -78,5 +80,5 @@
 
 ?>
-		<h2 class="block2"><span><?php echo $lang_admin_common['Plugins menu'] ?></span></h2>
+		<h2 class="block2"><span>Plugins</span></h2>
 		<div class="box">
 			<div class="inbox">
@@ -84,6 +86,6 @@
 <?php
 
-		foreach ($plugins as $plugin_name => $plugin)
-			echo "\t\t\t\t\t".'<li'.(($page == $plugin_name) ? ' class="isactive"' : '').'><a href="admin_loader.php?plugin='.$plugin_name.'">'.str_replace('_', ' ', $plugin).'</a></li>'."\n";
+		while (list(, $cur_plugin) = @each($plugins))
+			echo "\t\t\t\t\t".'<li'.(($page == $cur_plugin[1]) ? ' class="isactive"' : '').'><a href="admin_loader.php?plugin='.$cur_plugin[1].'">'.str_replace('_', ' ', $cur_plugin[0]).'</a></li>'."\n";
 
 ?>
@@ -116,5 +118,5 @@
 
 	// Fetch topics to prune
-	$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra_sql, true) or error('Unable to fetch topics', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.$extra_sql, true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 
 	$topic_ids = '';
@@ -125,5 +127,5 @@
 	{
 		// Fetch posts to prune
-		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topic_ids.')', true) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topic_ids.')', true) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
 
 		$post_ids = '';
@@ -134,9 +136,9 @@
 		{
 			// Delete topics
-			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topic_ids.')') or error('Unable to prune topics', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topic_ids.')') or error('Impossible d\'Ã©laguer les discussions', __FILE__, __LINE__, $db->error());
 			// Delete subscriptions
-			$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id IN('.$topic_ids.')') or error('Unable to prune subscriptions', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id IN('.$topic_ids.')') or error('Impossible d\'Ã©laguer les abonnements', __FILE__, __LINE__, $db->error());
 			// Delete posts
-			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$post_ids.')') or error('Unable to prune posts', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$post_ids.')') or error('Impossible d\'Ã©laguer les messages', __FILE__, __LINE__, $db->error());
 
 			// We removed a bunch of posts, so now we have to update the search index
Index: /trunk/web/punbb/include/dblayer/common_db.php
===================================================================
--- /trunk/web/punbb/include/dblayer/common_db.php	(revision 10)
+++ /trunk/web/punbb/include/dblayer/common_db.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure no one attempts to run this script "directly"
@@ -12,33 +29,38 @@
 
 
+//
+// Return current timestamp (with microseconds) as a float (used in dblayer)
+//
+if (defined('PUN_SHOW_QUERIES'))
+{
+	function get_microtime()
+	{
+		list($usec, $sec) = explode(' ', microtime());
+		return ((float)$usec + (float)$sec);
+	}
+}
+
+
 // Load the appropriate DB layer class
 switch ($db_type)
 {
 	case 'mysql':
-		require_once PUN_ROOT.'include/dblayer/mysql.php';
-		break;
-
-	case 'mysql_innodb':
-		require_once PUN_ROOT.'include/dblayer/mysql_innodb.php';
+		require PUN_ROOT.'include/dblayer/mysql.php';
 		break;
 
 	case 'mysqli':
-		require_once PUN_ROOT.'include/dblayer/mysqli.php';
-		break;
-
-	case 'mysqli_innodb':
-		require_once PUN_ROOT.'include/dblayer/mysqli_innodb.php';
+		require PUN_ROOT.'include/dblayer/mysqli.php';
 		break;
 
 	case 'pgsql':
-		require_once PUN_ROOT.'include/dblayer/pgsql.php';
+		require PUN_ROOT.'include/dblayer/pgsql.php';
 		break;
 
 	case 'sqlite':
-		require_once PUN_ROOT.'include/dblayer/sqlite.php';
+		require PUN_ROOT.'include/dblayer/sqlite.php';
 		break;
 
 	default:
-		error('\''.$db_type.'\' is not a valid database type. Please check settings in config.php.', __FILE__, __LINE__);
+		error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es valable. Veuillez vÃ©rifier vos paramÃštres de configuration dans config.php', __FILE__, __LINE__);
 		break;
 }
Index: /trunk/web/punbb/include/dblayer/index.html
===================================================================
--- /trunk/web/punbb/include/dblayer/index.html	(revision 10)
+++ /trunk/web/punbb/include/dblayer/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/include/dblayer/mysql.php
===================================================================
--- /trunk/web/punbb/include/dblayer/mysql.php	(revision 10)
+++ /trunk/web/punbb/include/dblayer/mysql.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure we have built in support for MySQL
@@ -21,11 +38,4 @@
 	var $num_queries = 0;
 
-	var $error_no = false;
-	var $error_msg = 'Unknown';
-
-	var $datatype_transformations = array(
-		'%^SERIAL$%'	=>	'INT(10) UNSIGNED AUTO_INCREMENT'
-	);
-
 
 	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
@@ -40,15 +50,13 @@
 		if ($this->link_id)
 		{
-			if (!@mysql_select_db($db_name, $this->link_id))
+			if (@mysql_select_db($db_name, $this->link_id))
+			{ mysql_query("SET NAMES utf8");
+				return $this->link_id;
+		   }
+			else
 				error('Unable to select database. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
 		}
 		else
 			error('Unable to connect to MySQL server. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
-
-		// Setup the client-server character set (UTF-8)
-		if (!defined('FORUM_NO_SET_NAMES'))
-			$this->set_names('utf8');
-
-		return $this->link_id;
 	}
 
@@ -90,7 +98,4 @@
 				$this->saved_queries[] = array($sql, 0);
 
-			$this->error_no = @mysql_errno($this->link_id);
-			$this->error_msg = @mysql_error($this->link_id);
-
 			return false;
 		}
@@ -98,7 +103,7 @@
 
 
-	function result($query_id = 0, $row = 0, $col = 0)
+	function result($query_id = 0, $row = 0)
 	{
-		return ($query_id) ? @mysql_result($query_id, $row, $col) : false;
+		return ($query_id) ? @mysql_result($query_id, $row) : false;
 	}
 
@@ -154,7 +159,5 @@
 	function escape($str)
 	{
-		if (is_array($str))
-			return '';
-		else if (function_exists('mysql_real_escape_string'))
+		if (function_exists('mysql_real_escape_string'))
 			return mysql_real_escape_string($str, $this->link_id);
 		else
@@ -166,6 +169,6 @@
 	{
 		$result['error_sql'] = @current(@end($this->saved_queries));
-		$result['error_no'] = $this->error_no;
-		$result['error_msg'] = $this->error_msg;
+		$result['error_no'] = @mysql_errno($this->link_id);
+		$result['error_msg'] = @mysql_error($this->link_id);
 
 		return $result;
@@ -185,188 +188,3 @@
 			return false;
 	}
-
-	function get_names()
-	{
-		$result = $this->query('SHOW VARIABLES LIKE \'character_set_connection\'');
-		return $this->result($result, 0, 1);
-	}
-
-
-	function set_names($names)
-	{
-		return $this->query('SET NAMES \''.$this->escape($names).'\'');
-	}
-
-
-	function get_version()
-	{
-		$result = $this->query('SELECT VERSION()');
-
-		return array(
-			'name'		=> 'MySQL Standard',
-			'version'	=> preg_replace('%^([^-]+).*$%', '\\1', $this->result($result))
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$exists = false;
-
-		$result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name);
-		while ($cur_index = $this->fetch_assoc($result))
-		{
-			if (strtolower($cur_index['Key_name']) == strtolower(($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name))
-			{
-				$exists = true;
-				break;
-			}
-		}
-
-		return $exists;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			if (isset($field_data['collation']))
-				$query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation'];
-
-			if (!$field_data['allow_null'])
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'MyISAM').' CHARACTER SET utf8';
-
-		return $this->query($query) ? true : false;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_table, $new_table, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$old_table.' RENAME TO '.($no_prefix ? '' : $this->prefix).$new_table) ? true : false;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) ? true : false;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('TRUNCATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
 }
Index: unk/web/punbb/include/dblayer/mysql_innodb.php
===================================================================
--- /trunk/web/punbb/include/dblayer/mysql_innodb.php	(revision 10)
+++ 	(revision )
@@ -1,386 +1,0 @@
-<?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-// Make sure we have built in support for MySQL
-if (!function_exists('mysql_connect'))
-	exit('This PHP environment doesn\'t have MySQL support built in. MySQL support is required if you want to use a MySQL database to run this forum. Consult the PHP documentation for further assistance.');
-
-
-class DBLayer
-{
-	var $prefix;
-	var $link_id;
-	var $query_result;
-	var $in_transaction = 0;
-
-	var $saved_queries = array();
-	var $num_queries = 0;
-
-	var $error_no = false;
-	var $error_msg = 'Unknown';
-
-	var $datatype_transformations = array(
-		'%^SERIAL$%'	=>	'INT(10) UNSIGNED AUTO_INCREMENT'
-	);
-
-
-	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
-	{
-		$this->prefix = $db_prefix;
-
-		if ($p_connect)
-			$this->link_id = @mysql_pconnect($db_host, $db_username, $db_password);
-		else
-			$this->link_id = @mysql_connect($db_host, $db_username, $db_password);
-
-		if ($this->link_id)
-		{
-			if (!@mysql_select_db($db_name, $this->link_id))
-				error('Unable to select database. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
-		}
-		else
-			error('Unable to connect to MySQL server. MySQL reported: '.mysql_error(), __FILE__, __LINE__);
-
-		// Setup the client-server character set (UTF-8)
-		if (!defined('FORUM_NO_SET_NAMES'))
-			$this->set_names('utf8');
-
-		return $this->link_id;
-	}
-
-
-	function start_transaction()
-	{
-		++$this->in_transaction;
-
-		mysql_query('START TRANSACTION', $this->link_id);
-		return;
-	}
-
-
-	function end_transaction()
-	{
-		--$this->in_transaction;
-
-		mysql_query('COMMIT', $this->link_id);
-		return;
-	}
-
-
-	function query($sql, $unbuffered = false)
-	{
-		if (defined('PUN_SHOW_QUERIES'))
-			$q_start = get_microtime();
-
-		if ($unbuffered)
-			$this->query_result = @mysql_unbuffered_query($sql, $this->link_id);
-		else
-			$this->query_result = @mysql_query($sql, $this->link_id);
-
-		if ($this->query_result)
-		{
-			if (defined('PUN_SHOW_QUERIES'))
-				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
-
-			++$this->num_queries;
-
-			return $this->query_result;
-		}
-		else
-		{
-			if (defined('PUN_SHOW_QUERIES'))
-				$this->saved_queries[] = array($sql, 0);
-
-			$this->error_no = @mysql_errno($this->link_id);
-			$this->error_msg = @mysql_error($this->link_id);
-
-			// Rollback transaction
-			if ($this->in_transaction)
-				mysql_query('ROLLBACK', $this->link_id);
-
-			--$this->in_transaction;
-
-			return false;
-		}
-	}
-
-
-	function result($query_id = 0, $row = 0, $col = 0)
-	{
-		return ($query_id) ? @mysql_result($query_id, $row, $col) : false;
-	}
-
-
-	function fetch_assoc($query_id = 0)
-	{
-		return ($query_id) ? @mysql_fetch_assoc($query_id) : false;
-	}
-
-
-	function fetch_row($query_id = 0)
-	{
-		return ($query_id) ? @mysql_fetch_row($query_id) : false;
-	}
-
-
-	function num_rows($query_id = 0)
-	{
-		return ($query_id) ? @mysql_num_rows($query_id) : false;
-	}
-
-
-	function affected_rows()
-	{
-		return ($this->link_id) ? @mysql_affected_rows($this->link_id) : false;
-	}
-
-
-	function insert_id()
-	{
-		return ($this->link_id) ? @mysql_insert_id($this->link_id) : false;
-	}
-
-
-	function get_num_queries()
-	{
-		return $this->num_queries;
-	}
-
-
-	function get_saved_queries()
-	{
-		return $this->saved_queries;
-	}
-
-
-	function free_result($query_id = false)
-	{
-		return ($query_id) ? @mysql_free_result($query_id) : false;
-	}
-
-
-	function escape($str)
-	{
-		if (is_array($str))
-			return '';
-		else if (function_exists('mysql_real_escape_string'))
-			return mysql_real_escape_string($str, $this->link_id);
-		else
-			return mysql_escape_string($str);
-	}
-
-
-	function error()
-	{
-		$result['error_sql'] = @current(@end($this->saved_queries));
-		$result['error_no'] = $this->error_no;
-		$result['error_msg'] = $this->error_msg;
-
-		return $result;
-	}
-
-
-	function close()
-	{
-		if ($this->link_id)
-		{
-			if ($this->query_result)
-				@mysql_free_result($this->query_result);
-
-			return @mysql_close($this->link_id);
-		}
-		else
-			return false;
-	}
-
-
-	function get_names()
-	{
-		$result = $this->query('SHOW VARIABLES LIKE \'character_set_connection\'');
-		return $this->result($result, 0, 1);
-	}
-
-
-	function set_names($names)
-	{
-		return $this->query('SET NAMES \''.$this->escape($names).'\'');
-	}
-
-
-	function get_version()
-	{
-		$result = $this->query('SELECT VERSION()');
-
-		return array(
-			'name'		=> 'MySQL Standard (InnoDB)',
-			'version'	=> preg_replace('%^([^-]+).*$%', '\\1', $this->result($result))
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$exists = false;
-
-		$result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name);
-		while ($cur_index = $this->fetch_assoc($result))
-		{
-			if (strtolower($cur_index['Key_name']) == strtolower(($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name))
-			{
-				$exists = true;
-				break;
-			}
-		}
-
-		return $exists;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			if (isset($field_data['collation']))
-				$query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation'];
-
-			if (!$field_data['allow_null'])
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'InnoDB').' CHARACTER SET utf8';
-
-		return $this->query($query) ? true : false;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_table, $new_table, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$old_table.' RENAME TO '.($no_prefix ? '' : $this->prefix).$new_table) ? true : false;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) ? true : false;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('TRUNCATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-}
Index: /trunk/web/punbb/include/dblayer/mysqli.php
===================================================================
--- /trunk/web/punbb/include/dblayer/mysqli.php	(revision 10)
+++ /trunk/web/punbb/include/dblayer/mysqli.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure we have built in support for MySQL
@@ -21,13 +38,6 @@
 	var $num_queries = 0;
 
-	var $error_no = false;
-	var $error_msg = 'Unknown';
 
-	var $datatype_transformations = array(
-		'%^SERIAL$%'	=>	'INT(10) UNSIGNED AUTO_INCREMENT'
-	);
-
-
-	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
+	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $foo)
 	{
 		$this->prefix = $db_prefix;
@@ -37,20 +47,11 @@
 			list($db_host, $db_port) = explode(':', $db_host);
 
-		// Persistent connection in MySQLi are only available in PHP 5.3 and later releases
-		$p_connect = $p_connect && version_compare(PHP_VERSION, '5.3.0', '>=') ? 'p:' : '';
-
 		if (isset($db_port))
-			$this->link_id = @mysqli_connect($p_connect.$db_host, $db_username, $db_password, $db_name, $db_port);
+			$this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name, $db_port);
 		else
-			$this->link_id = @mysqli_connect($p_connect.$db_host, $db_username, $db_password, $db_name);
+			$this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name);
 
 		if (!$this->link_id)
 			error('Unable to connect to MySQL and select database. MySQL reported: '.mysqli_connect_error(), __FILE__, __LINE__);
-
-		// Setup the client-server character set (UTF-8)
-		if (!defined('FORUM_NO_SET_NAMES'))
-			$this->set_names('utf8');
-
-		return $this->link_id;
 	}
 
@@ -89,7 +90,4 @@
 				$this->saved_queries[] = array($sql, 0);
 
-			$this->error_no = @mysqli_errno($this->link_id);
-			$this->error_msg = @mysqli_error($this->link_id);
-
 			return false;
 		}
@@ -97,16 +95,13 @@
 
 
-	function result($query_id = 0, $row = 0, $col = 0)
+	function result($query_id = 0, $row = 0)
 	{
 		if ($query_id)
 		{
-			if ($row !== 0 && @mysqli_data_seek($query_id, $row) === false)
-				return false;
+			if ($row)
+				@mysqli_data_seek($query_id, $row);
 
 			$cur_row = @mysqli_fetch_row($query_id);
-			if ($cur_row === false)
-				return false;
-
-			return $cur_row[$col];
+			return $cur_row[0];
 		}
 		else
@@ -165,5 +160,5 @@
 	function escape($str)
 	{
-		return is_array($str) ? '' : mysqli_real_escape_string($this->link_id, $str);
+		return mysqli_real_escape_string($this->link_id, $str);
 	}
 
@@ -172,6 +167,6 @@
 	{
 		$result['error_sql'] = @current(@end($this->saved_queries));
-		$result['error_no'] = $this->error_no;
-		$result['error_msg'] = $this->error_msg;
+		$result['error_no'] = @mysqli_errno($this->link_id);
+		$result['error_msg'] = @mysqli_error($this->link_id);
 
 		return $result;
@@ -191,189 +186,3 @@
 			return false;
 	}
-
-
-	function get_names()
-	{
-		$result = $this->query('SHOW VARIABLES LIKE \'character_set_connection\'');
-		return $this->result($result, 0, 1);
-	}
-
-
-	function set_names($names)
-	{
-		return $this->query('SET NAMES \''.$this->escape($names).'\'');
-	}
-
-
-	function get_version()
-	{
-		$result = $this->query('SELECT VERSION()');
-
-		return array(
-			'name'		=> 'MySQL Improved',
-			'version'	=> preg_replace('%^([^-]+).*$%', '\\1', $this->result($result))
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$exists = false;
-
-		$result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name);
-		while ($cur_index = $this->fetch_assoc($result))
-		{
-			if (strtolower($cur_index['Key_name']) == strtolower(($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name))
-			{
-				$exists = true;
-				break;
-			}
-		}
-
-		return $exists;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			if (isset($field_data['collation']))
-				$query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation'];
-
-			if (!$field_data['allow_null'])
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'MyISAM').' CHARACTER SET utf8';
-
-		return $this->query($query) ? true : false;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_table, $new_table, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$old_table.' RENAME TO '.($no_prefix ? '' : $this->prefix).$new_table) ? true : false;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) ? true : false;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('TRUNCATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
 }
Index: unk/web/punbb/include/dblayer/mysqli_innodb.php
===================================================================
--- /trunk/web/punbb/include/dblayer/mysqli_innodb.php	(revision 10)
+++ 	(revision )
@@ -1,392 +1,0 @@
-<?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-// Make sure we have built in support for MySQL
-if (!function_exists('mysqli_connect'))
-	exit('This PHP environment doesn\'t have Improved MySQL (mysqli) support built in. Improved MySQL support is required if you want to use a MySQL 4.1 (or later) database to run this forum. Consult the PHP documentation for further assistance.');
-
-
-class DBLayer
-{
-	var $prefix;
-	var $link_id;
-	var $query_result;
-
-	var $saved_queries = array();
-	var $num_queries = 0;
-	var $in_transaction = 0;
-
-	var $error_no = false;
-	var $error_msg = 'Unknown';
-
-	var $datatype_transformations = array(
-		'%^SERIAL$%'	=>	'INT(10) UNSIGNED AUTO_INCREMENT'
-	);
-
-
-	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
-	{
-		$this->prefix = $db_prefix;
-
-		// Was a custom port supplied with $db_host?
-		if (strpos($db_host, ':') !== false)
-			list($db_host, $db_port) = explode(':', $db_host);
-
-		// Persistent connection in MySQLi are only available in PHP 5.3 and later releases
-		$p_connect = $p_connect && version_compare(PHP_VERSION, '5.3.0', '>=') ? 'p:' : '';
-
-		if (isset($db_port))
-			$this->link_id = @mysqli_connect($p_connect.$db_host, $db_username, $db_password, $db_name, $db_port);
-		else
-			$this->link_id = @mysqli_connect($p_connect.$db_host, $db_username, $db_password, $db_name);
-
-		if (!$this->link_id)
-			error('Unable to connect to MySQL and select database. MySQL reported: '.mysqli_connect_error(), __FILE__, __LINE__);
-
-		// Setup the client-server character set (UTF-8)
-		if (!defined('FORUM_NO_SET_NAMES'))
-			$this->set_names('utf8');
-
-		return $this->link_id;
-	}
-
-
-	function start_transaction()
-	{
-		++$this->in_transaction;
-
-		mysqli_query($this->link_id, 'START TRANSACTION');
-		return;
-	}
-
-
-	function end_transaction()
-	{
-		--$this->in_transaction;
-
-		mysqli_query($this->link_id, 'COMMIT');
-		return;
-	}
-
-
-	function query($sql, $unbuffered = false)
-	{
-		if (defined('PUN_SHOW_QUERIES'))
-			$q_start = get_microtime();
-
-		$this->query_result = @mysqli_query($this->link_id, $sql);
-
-		if ($this->query_result)
-		{
-			if (defined('PUN_SHOW_QUERIES'))
-				$this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start));
-
-			++$this->num_queries;
-
-			return $this->query_result;
-		}
-		else
-		{
-			if (defined('PUN_SHOW_QUERIES'))
-				$this->saved_queries[] = array($sql, 0);
-
-			$this->error_no = @mysqli_errno($this->link_id);
-			$this->error_msg = @mysqli_error($this->link_id);
-
-			// Rollback transaction
-			if ($this->in_transaction)
-				mysqli_query($this->link_id, 'ROLLBACK');
-
-			--$this->in_transaction;
-
-			return false;
-		}
-	}
-
-
-	function result($query_id = 0, $row = 0, $col = 0)
-	{
-		if ($query_id)
-		{
-			if ($row !== 0 && @mysqli_data_seek($query_id, $row) === false)
-				return false;
-
-			$cur_row = @mysqli_fetch_row($query_id);
-			if ($cur_row === false)
-				return false;
-
-			return $cur_row[$col];
-		}
-		else
-			return false;
-	}
-
-
-	function fetch_assoc($query_id = 0)
-	{
-		return ($query_id) ? @mysqli_fetch_assoc($query_id) : false;
-	}
-
-
-	function fetch_row($query_id = 0)
-	{
-		return ($query_id) ? @mysqli_fetch_row($query_id) : false;
-	}
-
-
-	function num_rows($query_id = 0)
-	{
-		return ($query_id) ? @mysqli_num_rows($query_id) : false;
-	}
-
-
-	function affected_rows()
-	{
-		return ($this->link_id) ? @mysqli_affected_rows($this->link_id) : false;
-	}
-
-
-	function insert_id()
-	{
-		return ($this->link_id) ? @mysqli_insert_id($this->link_id) : false;
-	}
-
-
-	function get_num_queries()
-	{
-		return $this->num_queries;
-	}
-
-
-	function get_saved_queries()
-	{
-		return $this->saved_queries;
-	}
-
-
-	function free_result($query_id = false)
-	{
-		return ($query_id) ? @mysqli_free_result($query_id) : false;
-	}
-
-
-	function escape($str)
-	{
-		return is_array($str) ? '' : mysqli_real_escape_string($this->link_id, $str);
-	}
-
-
-	function error()
-	{
-		$result['error_sql'] = @current(@end($this->saved_queries));
-		$result['error_no'] = $this->error_no;
-		$result['error_msg'] = $this->error_msg;
-
-		return $result;
-	}
-
-
-	function close()
-	{
-		if ($this->link_id)
-		{
-			if ($this->query_result)
-				@mysqli_free_result($this->query_result);
-
-			return @mysqli_close($this->link_id);
-		}
-		else
-			return false;
-	}
-
-
-	function get_names()
-	{
-		$result = $this->query('SHOW VARIABLES LIKE \'character_set_connection\'');
-		return $this->result($result, 0, 1);
-	}
-
-
-	function set_names($names)
-	{
-		return $this->query('SET NAMES \''.$this->escape($names).'\'');
-	}
-
-
-	function get_version()
-	{
-		$result = $this->query('SELECT VERSION()');
-
-		return array(
-			'name'		=> 'MySQL Improved (InnoDB)',
-			'version'	=> preg_replace('%^([^-]+).*$%', '\\1', $this->result($result))
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$exists = false;
-
-		$result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name);
-		while ($cur_index = $this->fetch_assoc($result))
-		{
-			if (strtolower($cur_index['Key_name']) == strtolower(($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name))
-			{
-				$exists = true;
-				break;
-			}
-		}
-
-		return $exists;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			if (isset($field_data['collation']))
-				$query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation'];
-
-			if (!$field_data['allow_null'])
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'InnoDB').' CHARACTER SET utf8';
-
-		return $this->query($query) ? true : false;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_table, $new_table, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$old_table.' RENAME TO '.($no_prefix ? '' : $this->prefix).$new_table) ? true : false;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		if ($default_value !== null && !is_int($default_value) && !is_float($default_value))
-			$default_value = '\''.$this->escape($default_value).'\'';
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) ? true : false;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) ? true : false;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('TRUNCATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-}
Index: /trunk/web/punbb/include/dblayer/pgsql.php
===================================================================
--- /trunk/web/punbb/include/dblayer/pgsql.php	(revision 10)
+++ /trunk/web/punbb/include/dblayer/pgsql.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure we have built in support for PostgreSQL
@@ -26,13 +43,4 @@
 	var $error_msg = 'Unknown';
 
-	var $datatype_transformations = array(
-		'%^(TINY|SMALL)INT( )?(\\([0-9]+\\))?( )?(UNSIGNED)?$%i'			=>	'SMALLINT',
-		'%^(MEDIUM)?INT( )?(\\([0-9]+\\))?( )?(UNSIGNED)?$%i'				=>	'INTEGER',
-		'%^BIGINT( )?(\\([0-9]+\\))?( )?(UNSIGNED)?$%i'						=>	'BIGINT',
-		'%^(TINY|MEDIUM|LONG)?TEXT$%i'										=>	'TEXT',
-		'%^DOUBLE( )?(\\([0-9,]+\\))?( )?(UNSIGNED)?$%i'					=>	'DOUBLE PRECISION',
-		'%^FLOAT( )?(\\([0-9]+\\))?( )?(UNSIGNED)?$%i'						=>	'REAL'
-	);
-
 
 	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
@@ -40,5 +48,5 @@
 		$this->prefix = $db_prefix;
 
-		if ($db_host)
+		if ($db_host != '')
 		{
 			if (strpos($db_host, ':') !== false)
@@ -48,5 +56,8 @@
 			}
 			else
-				$connect_str[] = 'host='.$db_host;
+			{
+				if ($db_host != 'localhost')
+					$connect_str[] = 'host='.$db_host;
+			}
 		}
 
@@ -54,8 +65,8 @@
 			$connect_str[] = 'dbname='.$db_name;
 
-		if ($db_username)
+		if ($db_username != '')
 			$connect_str[] = 'user='.$db_username;
 
-		if ($db_password)
+		if ($db_password != '')
 			$connect_str[] = 'password='.$db_password;
 
@@ -67,10 +78,6 @@
 		if (!$this->link_id)
 			error('Unable to connect to PostgreSQL server', __FILE__, __LINE__);
-
-		// Setup the client-server character set (UTF-8)
-		if (!defined('FORUM_NO_SET_NAMES'))
-			$this->set_names('utf8');
-
-		return $this->link_id;
+		else
+			return $this->link_id;
 	}
 
@@ -98,8 +105,8 @@
 
 
-	function query($sql, $unbuffered = false) // $unbuffered is ignored since there is no pgsql_unbuffered_query()
+	function query($sql, $unbuffered = false)	// $unbuffered is ignored since there is no pgsql_unbuffered_query()
 	{
 		if (strrpos($sql, 'LIMIT') !== false)
-			$sql = preg_replace('%LIMIT ([0-9]+),([ 0-9]+)%', 'LIMIT \\2 OFFSET \\1', $sql);
+			$sql = preg_replace('#LIMIT ([0-9]+),([ 0-9]+)#', 'LIMIT \\2 OFFSET \\1', $sql);
 
 		if (defined('PUN_SHOW_QUERIES'))
@@ -125,5 +132,4 @@
 				$this->saved_queries[] = array($sql, 0);
 
-			$this->error_no = false;
 			$this->error_msg = @pg_result_error($this->query_result);
 
@@ -138,7 +144,7 @@
 
 
-	function result($query_id = 0, $row = 0, $col = 0)
-	{
-		return ($query_id) ? @pg_fetch_result($query_id, $row, $col) : false;
+	function result($query_id = 0, $row = 0)
+	{
+		return ($query_id) ? @pg_fetch_result($query_id, $row, 0) : false;
 	}
 
@@ -174,5 +180,5 @@
 		if ($query_id && $this->last_query_text[$query_id] != '')
 		{
-			if (preg_match('%^INSERT INTO ([a-z0-9\_\-]+)%is', $this->last_query_text[$query_id], $table_name))
+			if (preg_match('/^INSERT INTO ([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $table_name))
 			{
 				// Hack (don't ask)
@@ -212,5 +218,5 @@
 	function escape($str)
 	{
-		return is_array($str) ? '' : pg_escape_string($str);
+		return pg_escape_string($str);
 	}
 
@@ -219,5 +225,15 @@
 	{
 		$result['error_sql'] = @current(@end($this->saved_queries));
-		$result['error_no'] = $this->error_no;
+		$result['error_no'] = false;
+/*
+		if (!empty($this->query_result))
+		{
+			$result['error_msg'] = trim(@pg_result_error($this->query_result));
+			if ($result['error_msg'] != '')
+				return $result;
+		}
+
+		$result['error_msg'] = (!empty($this->link_id)) ? trim(@pg_last_error($this->link_id)) : trim(@pg_last_error());
+*/
 		$result['error_msg'] = $this->error_msg;
 
@@ -246,191 +262,3 @@
 			return false;
 	}
-
-
-	function get_names()
-	{
-		$result = $this->query('SHOW client_encoding');
-		return strtolower($this->result($result)); // MySQL returns lowercase so lets be consistent
-	}
-
-
-	function set_names($names)
-	{
-		return $this->query('SET NAMES \''.$this->escape($names).'\'');
-	}
-
-
-	function get_version()
-	{
-		$result = $this->query('SELECT VERSION()');
-
-		return array(
-			'name'		=> 'PostgreSQL',
-			'version'	=> preg_replace('%^[^0-9]+([^\s,-]+).*$%', '\\1', $this->result($result))
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT 1 FROM pg_class WHERE relname = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT 1 FROM pg_class c INNER JOIN pg_attribute a ON a.attrelid = c.oid WHERE c.relname = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' AND a.attname = \''.$this->escape($field_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT 1 FROM pg_index i INNER JOIN pg_class c1 ON c1.oid = i.indrelid INNER JOIN pg_class c2 ON c2.oid = i.indexrelid WHERE c1.relname = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' AND c2.relname = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_'.$this->escape($index_name).'\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			// The SERIAL datatype is a special case where we don't need to say not null
-			if (!$field_data['allow_null'] && $field_data['datatype'] != 'SERIAL')
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE ('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".')';
-
-		$result = $this->query($query) ? true : false;
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$result &= $this->add_index($table_name, $index_name, $index_fields, false, $no_prefix);
-		}
-
-		return $result;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_table, $new_table, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$old_table.' RENAME TO '.($no_prefix ? '' : $this->prefix).$new_table) ? true : false;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		$result = $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type) ? true : false;
-
-		if ($default_value !== null)
-		{
-			if (!is_int($default_value) && !is_float($default_value))
-				$default_value = '\''.$this->escape($default_value).'\'';
-
-			$result &= $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ALTER '.$field_name.' SET DEFAULT '.$default_value) ? true : false;
-			$result &= $this->query('UPDATE '.($no_prefix ? '' : $this->prefix).$table_name.' SET '.$field_name.'='.$default_value) ? true : false;
-		}
-
-		if (!$allow_null)
-			$result &= $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ALTER '.$field_name.' SET NOT NULL') ? true : false;
-
-		return $result;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-
-		$result = $this->add_field($table_name, 'tmp_'.$field_name, $field_type, $allow_null, $default_value, $after_field, $no_prefix);
-		$result &= $this->query('UPDATE '.($no_prefix ? '' : $this->prefix).$table_name.' SET tmp_'.$field_name.' = '.$field_name) ? true : false;
-		$result &= $this->drop_field($table_name, $field_name, $no_prefix);
-		$result &= $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' RENAME COLUMN tmp_'.$field_name.' TO '.$field_name) ? true : false;
-
-		return $result;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		return $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) ? true : false;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('CREATE '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ON '.($no_prefix ? '' : $this->prefix).$table_name.'('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('DELETE FROM '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
 }
Index: /trunk/web/punbb/include/dblayer/sqlite.php
===================================================================
--- /trunk/web/punbb/include/dblayer/sqlite.php	(revision 10)
+++ /trunk/web/punbb/include/dblayer/sqlite.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure we have built in support for SQLite
@@ -25,10 +42,4 @@
 	var $error_msg = 'Unknown';
 
-	var $datatype_transformations = array(
-		'%^SERIAL$%'															=>	'INTEGER',
-		'%^(TINY|SMALL|MEDIUM|BIG)?INT( )?(\\([0-9]+\\))?( )?(UNSIGNED)?$%i'	=>	'INTEGER',
-		'%^(TINY|MEDIUM|LONG)?TEXT$%i'											=>	'TEXT'
-	);
-
 
 	function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
@@ -124,16 +135,12 @@
 
 
-	function result($query_id = 0, $row = 0, $col = 0)
+	function result($query_id = 0, $row = 0)
 	{
 		if ($query_id)
 		{
-			if ($row !== 0 && @sqlite_seek($query_id, $row) === false)
-				return false;
-
-			$cur_row = @sqlite_current($query_id);
-			if ($cur_row === false)
-				return false;
-
-			return $cur_row[$col];
+			if ($row != 0)
+				@sqlite_seek($query_id, $row);
+
+			return @current(@sqlite_current($query_id));
 		}
 		else
@@ -150,13 +157,13 @@
 			{
 				// Horrible hack to get rid of table names and table aliases from the array keys
-				foreach ($cur_row as $key => $value)
+				while (list($key, $value) = @each($cur_row))
 				{
-					$dot_spot = strpos($key, '.');
-					if ($dot_spot !== false)
-					{
-						unset($cur_row[$key]);
-						$key = substr($key, $dot_spot+1);
-						$cur_row[$key] = $value;
-					}
+				    $dot_spot = strpos($key, '.');
+				    if ($dot_spot !== false)
+				    {
+				        unset($cur_row[$key]);
+				        $key = substr($key, $dot_spot+1);
+				        $cur_row[$key] = $value;
+				    }
 				}
 			}
@@ -183,5 +190,5 @@
 	function affected_rows()
 	{
-		return ($this->link_id) ? @sqlite_changes($this->link_id) : false;
+		return ($this->query_result) ? @sqlite_changes($this->query_result) : false;
 	}
 
@@ -213,5 +220,5 @@
 	function escape($str)
 	{
-		return is_array($str) ? '' : sqlite_escape_string($str);
+		return sqlite_escape_string($str);
 	}
 
@@ -244,324 +251,3 @@
 			return false;
 	}
-
-
-	function get_names()
-	{
-		return '';
-	}
-
-
-	function set_names($names)
-	{
-		return true;
-	}
-
-
-	function get_version()
-	{
-		return array(
-			'name'		=> 'SQLite',
-			'version'	=> sqlite_libversion()
-		);
-	}
-
-
-	function table_exists($table_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT 1 FROM sqlite_master WHERE name = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' AND type=\'table\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function field_exists($table_name, $field_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT sql FROM sqlite_master WHERE name = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' AND type=\'table\'');
-		if (!$this->num_rows($result))
-			return false;
-
-		return preg_match('%[\r\n]'.preg_quote($field_name, '%').' %', $this->result($result));
-	}
-
-
-	function index_exists($table_name, $index_name, $no_prefix = false)
-	{
-		$result = $this->query('SELECT 1 FROM sqlite_master WHERE tbl_name = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' AND name = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_'.$this->escape($index_name).'\' AND type=\'index\'');
-		return $this->num_rows($result) > 0;
-	}
-
-
-	function create_table($table_name, $schema, $no_prefix = false)
-	{
-		if ($this->table_exists($table_name, $no_prefix))
-			return true;
-
-		$query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n";
-
-		// Go through every schema element and add it to the query
-		foreach ($schema['FIELDS'] as $field_name => $field_data)
-		{
-			$field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']);
-
-			$query .= $field_name.' '.$field_data['datatype'];
-
-			if (!$field_data['allow_null'])
-				$query .= ' NOT NULL';
-
-			if (isset($field_data['default']))
-				$query .= ' DEFAULT '.$field_data['default'];
-
-			$query .= ",\n";
-		}
-
-		// If we have a primary key, add it
-		if (isset($schema['PRIMARY KEY']))
-			$query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n";
-
-		// Add unique keys
-		if (isset($schema['UNIQUE KEYS']))
-		{
-			foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields)
-				$query .= 'UNIQUE ('.implode(',', $key_fields).'),'."\n";
-		}
-
-		// We remove the last two characters (a newline and a comma) and add on the ending
-		$query = substr($query, 0, strlen($query) - 2)."\n".')';
-
-		$result = $this->query($query) ? true : false;
-
-		// Add indexes
-		if (isset($schema['INDEXES']))
-		{
-			foreach ($schema['INDEXES'] as $index_name => $index_fields)
-				$result &= $this->add_index($table_name, $index_name, $index_fields, false, $no_prefix);
-		}
-
-		return $result;
-	}
-
-
-	function drop_table($table_name, $no_prefix = false)
-	{
-		if (!$this->table_exists($table_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
-
-
-	function rename_table($old_name, $new_name, $no_prefix = false)
-	{
-		// If there new table exists and the old one doesn't, then we're happy
-		if ($this->table_exists($new_table, $no_prefix) && !$this->table_exists($old_table, $no_prefix))
-			return true;
-
-		$table = $this->get_table_info($old_name, $no_prefix);
-
-		// Create new table
-		$newtable = str_replace('CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($old_name).' (', 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($new_name).' (', $table['sql']);
-		$result = $this->query($newtable) ? true : false;
-
-		// Recreate indexes
-		if (!empty($table['indices']))
-		{
-			foreach ($table['indices'] as $cur_index)
-				$result &= $this->query($cur_index) ? true : false;
-		}
-
-		// Copy content across
-		$result &= $this->query('INSERT INTO '.($no_prefix ? '' : $this->prefix).$this->escape($new_name).' SELECT * FROM '.($no_prefix ? '' : $this->prefix).$this->escape($old_name)) ? true : false;
-
-		// Drop old table
-		$result &= $this->drop_table(($no_prefix ? '' : $this->prefix).$this->escape($table_name));
-
-		return $result;
-	}
-
-
-	function get_table_info($table_name, $no_prefix = false)
-	{
-		// Grab table info
-		$result = $this->query('SELECT sql FROM sqlite_master WHERE tbl_name = \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\' ORDER BY type DESC') or error('Unable to fetch table information', __FILE__, __LINE__, $this->error());
-		$num_rows = $this->num_rows($result);
-
-		if ($num_rows == 0)
-			return;
-
-		$table = array();
-		$table['indices'] = array();
-		while ($cur_index = $this->fetch_assoc($result))
-		{
-			if (empty($cur_index['sql']))
-				continue;
-
-			if (!isset($table['sql']))
-				$table['sql'] = $cur_index['sql'];
-			else
-				$table['indices'][] = $cur_index['sql'];
-		}
-
-		// Work out the columns in the table currently
-		$table_lines = explode("\n", $table['sql']);
-		$table['columns'] = array();
-		foreach ($table_lines as $table_line)
-		{
-			$table_line = trim($table_line, " \t\n\r,"); // trim spaces, tabs, newlines, and commas
-			if (substr($table_line, 0, 12) == 'CREATE TABLE')
-				continue;
-			else if (substr($table_line, 0, 11) == 'PRIMARY KEY')
-				$table['primary_key'] = $table_line;
-			else if (substr($table_line, 0, 6) == 'UNIQUE')
-				$table['unique'] = $table_line;
-			else if (substr($table_line, 0, strpos($table_line, ' ')) != '')
-				$table['columns'][substr($table_line, 0, strpos($table_line, ' '))] = trim(substr($table_line, strpos($table_line, ' ')));
-		}
-
-		return $table;
-	}
-
-
-	function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = 0, $no_prefix = false)
-	{
-		if ($this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$table = $this->get_table_info($table_name, $no_prefix);
-
-		// Create temp table
-		$now = time();
-		$tmptable = str_replace('CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' (', 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now.' (', $table['sql']);
-		$result = $this->query($tmptable) ? true : false;
-		$result &= $this->query('INSERT INTO '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now.' SELECT * FROM '.($no_prefix ? '' : $this->prefix).$this->escape($table_name)) ? true : false;
-
-		// Create new table sql
-		$field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type);
-		$query = $field_type;
-		if (!$allow_null)
-			$query .= ' NOT NULL';
-		if ($default_value === null || $default_value === '')
-			$default_value = '\'\'';
-
-		$query .= ' DEFAULT '.$default_value;
-
-		$old_columns = array_keys($table['columns']);
-		array_insert($table['columns'], $after_field, $query, $field_name);
-
-		$new_table = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' (';
-
-		foreach ($table['columns'] as $cur_column => $column_details)
-			$new_table .= "\n".$cur_column.' '.$column_details.',';
-
-		if (isset($table['unique']))
-			$new_table .= "\n".$table['unique'].',';
-
-		if (isset($table['primary_key']))
-			$new_table .= "\n".$table['primary_key'].',';
-
-		$new_table = trim($new_table, ',')."\n".');';
-
-		// Drop old table
-		$result &= $this->drop_table(($no_prefix ? '' : $this->prefix).$this->escape($table_name));
-
-		// Create new table
-		$result &= $this->query($new_table) ? true : false;
-
-		// Recreate indexes
-		if (!empty($table['indices']))
-		{
-			foreach ($table['indices'] as $cur_index)
-				$result &= $this->query($cur_index) ? true : false;
-		}
-
-		// Copy content back
-		$result &= $this->query('INSERT INTO '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' ('.implode(', ', $old_columns).') SELECT * FROM '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now) ? true : false;
-
-		// Drop temp table
-		$result &= $this->drop_table(($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now);
-
-		return $result;
-	}
-
-
-	function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = 0, $no_prefix = false)
-	{
-		// Unneeded for SQLite
-		return true;
-	}
-
-
-	function drop_field($table_name, $field_name, $no_prefix = false)
-	{
-		if (!$this->field_exists($table_name, $field_name, $no_prefix))
-			return true;
-
-		$table = $this->get_table_info($table_name, $no_prefix);
-
-		// Create temp table
-		$now = time();
-		$tmptable = str_replace('CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' (', 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now.' (', $table['sql']);
-		$result = $this->query($tmptable) ? true : false;
-		$result &= $this->query('INSERT INTO '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now.' SELECT * FROM '.($no_prefix ? '' : $this->prefix).$this->escape($table_name)) ? true : false;
-
-		// Work out the columns we need to keep and the sql for the new table
-		unset($table['columns'][$field_name]);
-		$new_columns = array_keys($table['columns']);
-
-		$new_table = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' (';
-
-		foreach ($table['columns'] as $cur_column => $column_details)
-			$new_table .= "\n".$cur_column.' '.$column_details.',';
-
-		if (isset($table['unique']))
-			$new_table .= "\n".$table['unique'].',';
-
-		if (isset($table['primary_key']))
-			$new_table .= "\n".$table['primary_key'].',';
-
-		$new_table = trim($new_table, ',')."\n".');';
-
-		// Drop old table
-		$result &= $this->drop_table(($no_prefix ? '' : $this->prefix).$this->escape($table_name));
-
-		// Create new table
-		$result &= $this->query($new_table) ? true : false;
-
-		// Recreate indexes
-		if (!empty($table['indices']))
-		{
-			foreach ($table['indices'] as $cur_index)
-				if (!preg_match('%\('.preg_quote($field_name, '%').'\)%', $cur_index))
-					$result &= $this->query($cur_index) ? true : false;
-		}
-
-		// Copy content back
-		$result &= $this->query('INSERT INTO '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).' SELECT '.implode(', ', $new_columns).' FROM '.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now) ? true : false;
-
-		// Drop temp table
-		$result &= $this->drop_table(($no_prefix ? '' : $this->prefix).$this->escape($table_name).'_t'.$now);
-
-		return $result;
-	}
-
-
-	function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false)
-	{
-		if ($this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('CREATE '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ON '.($no_prefix ? '' : $this->prefix).$table_name.'('.implode(',', $index_fields).')') ? true : false;
-	}
-
-
-	function drop_index($table_name, $index_name, $no_prefix = false)
-	{
-		if (!$this->index_exists($table_name, $index_name, $no_prefix))
-			return true;
-
-		return $this->query('DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) ? true : false;
-	}
-
-	function truncate_table($table_name, $no_prefix = false)
-	{
-		return $this->query('DELETE FROM '.($no_prefix ? '' : $this->prefix).$table_name) ? true : false;
-	}
 }
Index: /trunk/web/punbb/include/email.php
===================================================================
--- /trunk/web/punbb/include/email.php	(revision 10)
+++ /trunk/web/punbb/include/email.php	(revision 1)
@@ -1,9 +1,26 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Make sure no one attempts to run this script "directly"
@@ -11,15 +28,14 @@
 	exit;
 
-require PUN_ROOT.'include/utf8/utils/ascii.php';
 
 //
-// Validate an email address
+// Validate an e-mail address
 //
 function is_valid_email($email)
 {
-	if (strlen($email) > 80)
+	if (strlen($email) > 50)
 		return false;
 
-	return preg_match('%^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|("[^"]+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$%', $email);
+	return preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email);
 }
 
@@ -30,5 +46,5 @@
 function is_banned_email($email)
 {
-	global $pun_bans;
+	global $db, $pun_bans;
 
 	foreach ($pun_bans as $cur_ban)
@@ -45,213 +61,34 @@
 
 //
-// Only encode with base64, if there is at least one unicode character in the string
-//
-function encode_mail_text($str)
-{
-	if (utf8_is_ascii($str))
-		return $str;
-
-	return '=?UTF-8?B?'.base64_encode($str).'?=';
-}
-
-
-//
-// Make a post email safe
-//
-function bbcode2email($text, $wrap_length = 72)
-{
-    static $base_url;
-
-    if (!isset($base_url))
-        $base_url = get_base_url();
-
-    $text = pun_trim($text, "\t\n ");
-
-    $shortcut_urls = array(
-        'topic' => '/viewtopic.php?id=$1',
-        'post' => '/viewtopic.php?pid=$1#p$1',
-        'forum' => '/viewforum.php?id=$1',
-        'user' => '/profile.php?id=$1',
-    );
-
-    // Split code blocks and text so BBcode in codeblocks won't be touched
-    list($code, $text) = extract_blocks($text, '[code]', '[/code]');
-
-    // Strip all bbcodes, except the quote, url, img, email, code and list items bbcodes
-    $text = preg_replace(array(
-        '%\[/?(?!(?:quote|url|topic|post|user|forum|img|email|code|list|\*))[a-z]+(?:=[^\]]+)?\]%i',
-        '%\n\[/?list(?:=[^\]]+)?\]%i' // A separate regex for the list tags to get rid of some whitespace
-    ), '', $text);
-
-    // Match the deepest nested bbcode
-    // An adapted example from Mastering Regular Expressions
-    $match_quote_regex = '%
-        \[(quote|\*|url|img|email|topic|post|user|forum)(?:=([^\]]+))?\]
-        (
-            (?>[^\[]*)
-            (?>
-                (?!\[/?\1(?:=[^\]]+)?\])
-                \[
-                [^\[]*
-            )*
-        )
-        \[/\1\]
-    %ix';
-
-    $url_index = 1;
-    $url_stack = array();
-    while (preg_match($match_quote_regex, $text, $matches))
-    {
-        // Quotes
-        if ($matches[1] == 'quote')
-        {
-            // Put '>' or '> ' at the start of a line
-            $replacement = preg_replace(
-                array('%^(?=\>)%m', '%^(?!\>)%m'),
-                array('>', '> '),
-                $matches[2]." said:\n".$matches[3]);
-        }
-
-        // List items
-        elseif ($matches[1] == '*')
-        {
-            $replacement = ' * '.$matches[3];
-        }
-
-        // URLs and emails
-        elseif (in_array($matches[1], array('url', 'email')))
-        {
-            if (!empty($matches[2]))
-            {
-                $replacement = '['.$matches[3].']['.$url_index.']';
-                $url_stack[$url_index] = $matches[2];
-                $url_index++;
-            }
-            else
-                $replacement = '['.$matches[3].']';
-        }
-
-        // Images
-        elseif ($matches[1] == 'img')
-        {
-            if (!empty($matches[2]))
-                $replacement = '['.$matches[2].']['.$url_index.']';
-            else
-                $replacement = '['.basename($matches[3]).']['.$url_index.']';
-
-            $url_stack[$url_index] = $matches[3];
-            $url_index++;
-        }
-
-        // Topic, post, forum and user URLs
-        elseif (in_array($matches[1], array('topic', 'post', 'forum', 'user')))
-        {
-            $url = isset($shortcut_urls[$matches[1]]) ? $base_url.$shortcut_urls[$matches[1]] : '';
-
-            if (!empty($matches[2]))
-            {
-                $replacement = '['.$matches[3].']['.$url_index.']';
-                $url_stack[$url_index] = str_replace('$1', $matches[2], $url);
-                $url_index++;
-            }
-            else
-                $replacement = '['.str_replace('$1', $matches[3], $url).']';
-        }
-
-        // Update the main text if there is a replacment
-        if (!is_null($replacement))
-        {
-            $text = str_replace($matches[0], $replacement, $text);
-            $replacement = null;
-        }
-    }
-
-    // Put code blocks and text together
-    if (isset($code))
-    {
-        $parts = explode("\1", $text);
-        $text = '';
-        foreach ($parts as $i => $part)
-        {
-            $text .= $part;
-            if (isset($code[$i]))
-                $text .= trim($code[$i], "\n\r");
-        }
-    }
-
-    // Put URLs at the bottom
-    if ($url_stack)
-    {
-        $text .= "\n\n";
-        foreach ($url_stack as $i => $url)
-            $text .= "\n".' ['.$i.']: '.$url;
-    }
-
-    // Wrap lines if $wrap_length is higher than -1
-    if ($wrap_length > -1)
-    {
-        // Split all lines and wrap them individually
-        $parts = explode("\n", $text);
-        foreach ($parts as $k => $part)
-        {
-            preg_match('%^(>+ )?(.*)%', $part, $matches);
-            $parts[$k] = wordwrap($matches[1].$matches[2], $wrap_length -
-                strlen($matches[1]), "\n".$matches[1]);
-        }
-
-        return implode("\n", $parts);
-    }
-    else
-        return $text;
-}
-
-
-//
 // Wrapper for PHP's mail()
 //
-function pun_mail($to, $subject, $message, $reply_to_email = '', $reply_to_name = '')
+function pun_mail($to, $subject, $message, $from = '')
 {
 	global $pun_config, $lang_common;
 
 	// Default sender/return address
-	$from_name = sprintf($lang_common['Mailer'], $pun_config['o_board_title']);
-	$from_email = $pun_config['o_webmaster_email'];
+	if (!$from)
+		$from = '"'.str_replace('"', '', $pun_config['o_board_title'].' '.$lang_common['Mailer']).'" <'.$pun_config['o_webmaster_email'].'>';
 
 	// Do a little spring cleaning
-	$to = pun_trim(preg_replace('%[\n\r]+%s', '', $to));
-	$subject = pun_trim(preg_replace('%[\n\r]+%s', '', $subject));
-	$from_email = pun_trim(preg_replace('%[\n\r:]+%s', '', $from_email));
-	$from_name = pun_trim(preg_replace('%[\n\r:]+%s', '', str_replace('"', '', $from_name)));
-	$reply_to_email = pun_trim(preg_replace('%[\n\r:]+%s', '', $reply_to_email));
-	$reply_to_name = pun_trim(preg_replace('%[\n\r:]+%s', '', str_replace('"', '', $reply_to_name)));
+	$to = trim(preg_replace('#[\n\r]+#s', '', $to));
+	$subject = trim(preg_replace('#[\n\r]+#s', '', $subject));
+	$from = trim(preg_replace('#[\n\r:]+#s', '', $from));
 
-	// Set up some headers to take advantage of UTF-8
-	$from = '"'.encode_mail_text($from_name).'" <'.$from_email.'>';
-	$subject = encode_mail_text($subject);
+	$headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer';
 
-	$headers = 'From: '.$from."\r\n".'Date: '.gmdate('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset=utf-8'."\r\n".'X-Mailer: FluxBB Mailer';
-
-	// If we specified a reply-to email, we deal with it here
-	if (!empty($reply_to_email))
-	{
-		$reply_to = '"'.encode_mail_text($reply_to_name).'" <'.$reply_to_email.'>';
-
-		$headers .= "\r\n".'Reply-To: '.$reply_to;
-	}
-
-	// Make sure all linebreaks are LF in message (and strip out any NULL bytes)
-	$message = str_replace("\0", '', pun_linebreaks($message));
+	// Make sure all linebreaks are CRLF in message
+	$message = str_replace("\n", "\r\n", pun_linebreaks($message));
 
 	if ($pun_config['o_smtp_host'] != '')
-	{
-		// Headers should be \r\n
-		// Message should be ??
-		$message = str_replace("\n", "\r\n", $message);
 		smtp_mail($to, $subject, $message, $headers);
-	}
 	else
 	{
-		// Headers should be \r\n
-		// Message should be \n
+		// Change the linebreaks used in the headers according to OS
+		if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC')
+			$headers = str_replace("\r\n", "\r", $headers);
+		else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
+			$headers = str_replace("\r\n", "\n", $headers);
+		
 		mail($to, $subject, $message, $headers);
 	}
@@ -260,6 +97,6 @@
 
 //
-// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com)
-// They deserve all the credit for writing it. I made small modifications for it to suit PunBB and it's coding standards
+// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com).
+// They deserve all the credit for writing it. I made small modifications for it to suit PunBB and it's coding standards.
 //
 function server_parse($socket, $expected_response)
@@ -269,14 +106,14 @@
 	{
 		if (!($server_response = fgets($socket, 256)))
-			error('Couldn\'t get mail server response codes. Please contact the forum administrator.', __FILE__, __LINE__);
+			error('N\'a pas pu obtenir les codes de rÃ©ponse du serveur mail. Veuillez contacter l\'administrateur de forum', __FILE__, __LINE__);
 	}
 
 	if (!(substr($server_response, 0, 3) == $expected_response))
-		error('Unable to send email. Please contact the forum administrator with the following error message reported by the SMTP server: "'.$server_response.'"', __FILE__, __LINE__);
+		error('Impossible d\'envoyer l\'e-mail. Veuillez contacter l\'administrateur des forums avec le message d\'erreur suivant rapportÃ© par le serveur SMTP : "'.$server_response.'"', __FILE__, __LINE__);
 }
 
 
 //
-// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com)
+// This function was originally a part of the phpBB Group forum software phpBB2 (http://www.phpbb.com).
 // They deserve all the credit for writing it. I made small modifications for it to suit PunBB and it's coding standards.
 //
@@ -286,8 +123,4 @@
 
 	$recipients = explode(',', $to);
-
-	// Sanitize the message
-	$message = str_replace("\r\n.", "\r\n..", $message);
-	$message = (substr($message, 0, 1) == '.' ? '.'.$message : $message);
 
 	// Are we using port 25 or a custom port?
@@ -300,9 +133,6 @@
 	}
 
-	if ($pun_config['o_smtp_ssl'] == '1')
-		$smtp_host = 'ssl://'.$smtp_host;
-
 	if (!($socket = fsockopen($smtp_host, $smtp_port, $errno, $errstr, 15)))
-		error('Could not connect to smtp host "'.$pun_config['o_smtp_host'].'" ('.$errno.') ('.$errstr.')', __FILE__, __LINE__);
+		error('Impossible de joindre l\'hÃŽte SMTP "'.$pun_config['o_smtp_host'].'" ('.$errno.') ('.$errstr.')', __FILE__, __LINE__);
 
 	server_parse($socket, '220');
@@ -331,8 +161,13 @@
 	server_parse($socket, '250');
 
-	foreach ($recipients as $email)
+	$to_header = 'To: ';
+
+	@reset($recipients);
+	while (list(, $email) = @each($recipients))
 	{
 		fwrite($socket, 'RCPT TO: <'.$email.'>'."\r\n");
 		server_parse($socket, '250');
+
+		$to_header .= '<'.$email.'>, ';
 	}
 
@@ -340,5 +175,5 @@
 	server_parse($socket, '354');
 
-	fwrite($socket, 'Subject: '.$subject."\r\n".'To: <'.implode('>, <', $recipients).'>'."\r\n".$headers."\r\n\r\n".$message."\r\n");
+	fwrite($socket, 'Subject: '.$subject."\r\n".$to_header."\r\n".$headers."\r\n\r\n".$message."\r\n");
 
 	fwrite($socket, '.'."\r\n");
Index: /trunk/web/punbb/include/functions.php
===================================================================
--- /trunk/web/punbb/include/functions.php	(revision 10)
+++ /trunk/web/punbb/include/functions.php	(revision 1)
@@ -1,19 +1,25 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-
-//
-// Return current timestamp (with microseconds) as a float
-//
-function get_microtime()
-{
-	list($usec, $sec) = explode(' ', microtime());
-	return ((float)$usec + (float)$sec);
-}
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
 
 //
@@ -22,27 +28,27 @@
 function check_cookie(&$pun_user)
 {
-	global $db, $db_type, $pun_config, $cookie_name, $cookie_seed;
+	global $db, $pun_config, $cookie_name, $cookie_seed;
 
 	$now = time();
-
-	// If the cookie is set and it matches the correct pattern, then read the values from it
-	if (isset($_COOKIE[$cookie_name]) && preg_match('%^(\d+)\|([0-9a-fA-F]+)\|(\d+)\|([0-9a-fA-F]+)$%', $_COOKIE[$cookie_name], $matches))
-	{
-		$cookie = array(
-			'user_id'			=> intval($matches[1]),
-			'password_hash' 	=> $matches[2],
-			'expiration_time'	=> intval($matches[3]),
-			'cookie_hash'		=> $matches[4],
-		);
-	}
-
-	// If it has a non-guest user, and hasn't expired
-	if (isset($cookie) && $cookie['user_id'] > 1 && $cookie['expiration_time'] > $now)
-	{
-		// If the cookie has been tampered with
-		if (forum_hmac($cookie['user_id'].'|'.$cookie['expiration_time'], $cookie_seed.'_cookie_hash') != $cookie['cookie_hash'])
-		{
-			$expire = $now + 31536000; // The cookie expires after a year
-			pun_setcookie(1, pun_hash(uniqid(rand(), true)), $expire);
+	$expire = $now + 31536000;	// The cookie expires after a year
+
+	// We assume it's a guest
+	$cookie = array('user_id' => 1, 'password_hash' => 'InvitÃ©');
+
+	// If a cookie is set, we get the user_id and password hash from it
+	if (isset($_COOKIE[$cookie_name]))
+		list($cookie['user_id'], $cookie['password_hash']) = @unserialize($_COOKIE[$cookie_name]);
+
+	if ($cookie['user_id'] > 1)
+	{
+		// Check if there's a user with the user ID and password hash from the cookie
+        $_query = 'SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id']);
+		$result = $db->query($_query) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+		$pun_user = $db->fetch_assoc($result);
+
+		// If user authorisation failed
+		if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash'])
+		{
+			pun_setcookie(0, random_pass(8), $expire);
 			set_default_user();
 
@@ -50,28 +56,10 @@
 		}
 
-		// Check if there's a user with the user ID and password hash from the cookie
-		$result = $db->query('SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error());
-		$pun_user = $db->fetch_assoc($result);
-
-		// If user authorisation failed
-		if (!isset($pun_user['id']) || forum_hmac($pun_user['password'], $cookie_seed.'_password_hash') !== $cookie['password_hash'])
-		{
-			$expire = $now + 31536000; // The cookie expires after a year
-			pun_setcookie(1, pun_hash(uniqid(rand(), true)), $expire);
-			set_default_user();
-
-			return;
-		}
-
-		// Send a new, updated cookie with a new expiration timestamp
-		$expire = ($cookie['expiration_time'] > $now + $pun_config['o_timeout_visit']) ? $now + 1209600 : $now + $pun_config['o_timeout_visit'];
-		pun_setcookie($pun_user['id'], $pun_user['password'], $expire);
-
 		// Set a default language if the user selected language no longer exists
-		if (!file_exists(PUN_ROOT.'lang/'.$pun_user['language']))
+		if (!$pun_user['language'] || !@file_exists(PUN_ROOT.'lang/'.$pun_user['language']))
 			$pun_user['language'] = $pun_config['o_default_lang'];
 
 		// Set a default style if the user selected style no longer exists
-		if (!file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css'))
+		if (!@file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css'))
 			$pun_user['style'] = $pun_config['o_default_style'];
 
@@ -81,4 +69,7 @@
 			$pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];
 
+		if ($pun_user['save_pass'] == '0')
+			$expire = 0;
+
 		// Define this if you want this visit to affect the online list and the users last visit data
 		if (!defined('PUN_QUIET_VISIT'))
@@ -86,26 +77,5 @@
 			// Update the online list
 			if (!$pun_user['logged'])
-			{
-				$pun_user['logged'] = $now;
-
-				// With MySQL/MySQLi/SQLite, REPLACE INTO avoids a user having two rows in the online table
-				switch ($db_type)
-				{
-					case 'mysql':
-					case 'mysqli':
-					case 'mysql_innodb':
-					case 'mysqli_innodb':
-					case 'sqlite':
-						$db->query('REPLACE INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
-						break;
-
-					default:
-						$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) SELECT '.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$pun_user['logged'].' WHERE NOT EXISTS (SELECT 1 FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
-						break;
-				}
-
-				// Reset tracked topics
-				set_tracked_topics(null);
-			}
+				$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES('.$pun_user['id'].', \''.$db->escape($pun_user['username']).'\', '.$now.')') or error('Impossbile d\'insÃ©rer dans la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 			else
 			{
@@ -113,24 +83,14 @@
 				if ($pun_user['logged'] < ($now-$pun_config['o_timeout_visit']))
 				{
-					$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
+					$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de mettre Ã  jour les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
 					$pun_user['last_visit'] = $pun_user['logged'];
 				}
 
 				$idle_sql = ($pun_user['idle'] == '1') ? ', idle=0' : '';
-				$db->query('UPDATE '.$db->prefix.'online SET logged='.$now.$idle_sql.' WHERE user_id='.$pun_user['id']) or error('Unable to update online list', __FILE__, __LINE__, $db->error());
-
-				// Update tracked topics with the current expire time
-				if (isset($_COOKIE[$cookie_name.'_track']))
-					forum_setcookie($cookie_name.'_track', $_COOKIE[$cookie_name.'_track'], $now + $pun_config['o_timeout_visit']);
+				$db->query('UPDATE '.$db->prefix.'online SET logged='.$now.$idle_sql.' WHERE user_id='.$pun_user['id']) or error('Impossible de mettre Ã  jour la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 			}
 		}
-		else
-		{
-			if (!$pun_user['logged'])
-				$pun_user['logged'] = $pun_user['last_visit'];
-		}
 
 		$pun_user['is_guest'] = false;
-		$pun_user['is_admmod'] = $pun_user['g_id'] == PUN_ADMIN || $pun_user['g_moderator'] == '1';
 	}
 	else
@@ -140,112 +100,16 @@
 
 //
-// Converts the CDATA end sequence ]]> into ]]&gt;
-//
-function escape_cdata($str)
-{
-	return str_replace(']]>', ']]&gt;', $str);
-}
-
-
-//
-// Authenticates the provided username and password against the user database
-// $user can be either a user ID (integer) or a username (string)
-// $password can be either a plaintext password or a password hash including salt ($password_is_hash must be set accordingly)
-//
-function authenticate_user($user, $password, $password_is_hash = false)
-{
-	global $db, $pun_user;
-
-	// Check if there's a user matching $user and $password
-	$result = $db->query('SELECT u.*, g.*, o.logged, o.idle FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE '.(is_int($user) ? 'u.id='.intval($user) : 'u.username=\''.$db->escape($user).'\'')) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-	$pun_user = $db->fetch_assoc($result);
-
-	if (!isset($pun_user['id']) ||
-		($password_is_hash && $password != $pun_user['password']) ||
-		(!$password_is_hash && pun_hash($password) != $pun_user['password']))
-		set_default_user();
-	else
-		$pun_user['is_guest'] = false;
-}
-
-
-//
-// Try to determine the current URL
-//
-function get_current_url($max_length = 0)
-{
-	$protocol = get_current_protocol();
-	$port = (isset($_SERVER['SERVER_PORT']) && (($_SERVER['SERVER_PORT'] != '80' && $protocol == 'http') || ($_SERVER['SERVER_PORT'] != '443' && $protocol == 'https')) && strpos($_SERVER['HTTP_HOST'], ':') === false) ? ':'.$_SERVER['SERVER_PORT'] : '';
-
-	$url = urldecode($protocol.'://'.$_SERVER['HTTP_HOST'].$port.$_SERVER['REQUEST_URI']);
-
-	if (strlen($url) <= $max_length || $max_length == 0)
-		return $url;
-
-	// We can't find a short enough url
-	return null;
-}
-
-
-//
-// Fetch the current protocol in use - http or https
-//
-function get_current_protocol()
-{
-	$protocol = 'http';
-
-	// Check if the server is claiming to using HTTPS
-	if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off')
-		$protocol = 'https';
-
-	// If we are behind a reverse proxy try to decide which protocol it is using
-	if (defined('FORUM_BEHIND_REVERSE_PROXY'))
-	{
-		// Check if we are behind a Microsoft based reverse proxy
-		if (!empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) != 'off')
-			$protocol = 'https';
-
-		// Check if we're behind a "proper" reverse proxy, and what protocol it's using
-		if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']))
-			$protocol = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);
-	}
-
-	return $protocol;
-}
-
-//
-// Fetch the base_url, optionally support HTTPS and HTTP
-//
-function get_base_url($support_https = false)
-{
-	global $pun_config;
-	static $base_url;
-
-	if (!$support_https)
-		return $pun_config['o_base_url'];
-
-	if (!isset($base_url))
-	{
-		// Make sure we are using the correct protocol
-		$base_url = str_replace(array('http://', 'https://'), get_current_protocol().'://', $pun_config['o_base_url']);
-	}
-
-	return $base_url;
-}
-
-
-//
 // Fill $pun_user with default values (for guests)
 //
 function set_default_user()
 {
-	global $db, $db_type, $pun_user, $pun_config;
+	global $db, $pun_user, $pun_config;
 
 	$remote_addr = get_remote_address();
 
 	// Fetch guest user
-	$result = $db->query('SELECT u.*, g.*, o.logged, o.last_post, o.last_search FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Impossible de retrouver les informations d\'invitÃ©', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
-		exit('Unable to fetch guest information. Your database must contain both a guest user and a guest user group.');
+		exit('Impossible de retrouver les informations invitÃ©. La table \''.$db->prefix.'users\' doit contenir une entrÃ©e avec un id = 1 qui reprÃ©sente les utilisateurs anonymes.');
 
 	$pun_user = $db->fetch_assoc($result);
@@ -253,98 +117,29 @@
 	// Update online list
 	if (!$pun_user['logged'])
-	{
-		$pun_user['logged'] = time();
-
-		// With MySQL/MySQLi/SQLite, REPLACE INTO avoids a user having two rows in the online table
-		switch ($db_type)
-		{
-			case 'mysql':
-			case 'mysqli':
-			case 'mysql_innodb':
-			case 'mysqli_innodb':
-			case 'sqlite':
-				$db->query('REPLACE INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.$pun_user['logged'].')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
-				break;
-
-			default:
-				$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) SELECT 1, \''.$db->escape($remote_addr).'\', '.$pun_user['logged'].' WHERE NOT EXISTS (SELECT 1 FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($remote_addr).'\')') or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
-				break;
-		}
-	}
+		$db->query('INSERT INTO '.$db->prefix.'online (user_id, ident, logged) VALUES(1, \''.$db->escape($remote_addr).'\', '.time().')') or error('Impossbile d\'insÃ©rer dans la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 	else
-		$db->query('UPDATE '.$db->prefix.'online SET logged='.time().' WHERE ident=\''.$db->escape($remote_addr).'\'') or error('Unable to update online list', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'online SET logged='.time().' WHERE ident=\''.$db->escape($remote_addr).'\'') or error('Impossible de mettre Ã  jour la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 	$pun_user['disp_topics'] = $pun_config['o_disp_topics_default'];
 	$pun_user['disp_posts'] = $pun_config['o_disp_posts_default'];
-	$pun_user['timezone'] = $pun_config['o_default_timezone'];
-	$pun_user['dst'] = $pun_config['o_default_dst'];
+	$pun_user['timezone'] = $pun_config['o_server_timezone'];
 	$pun_user['language'] = $pun_config['o_default_lang'];
 	$pun_user['style'] = $pun_config['o_default_style'];
 	$pun_user['is_guest'] = true;
-	$pun_user['is_admmod'] = false;
-}
-
-
-//
-// SHA1 HMAC with PHP 4 fallback
-//
-function forum_hmac($data, $key, $raw_output = false)
-{
-	if (function_exists('hash_hmac'))
-		return hash_hmac('sha1', $data, $key, $raw_output);
-
-	// If key size more than blocksize then we hash it once
-	if (strlen($key) > 64)
-		$key = pack('H*', sha1($key)); // we have to use raw output here to match the standard
-
-	// Ensure we're padded to exactly one block boundary
-	$key = str_pad($key, 64, chr(0x00));
-
-	$hmac_opad = str_repeat(chr(0x5C), 64);
-	$hmac_ipad = str_repeat(chr(0x36), 64);
-
-	// Do inner and outer padding
-	for ($i = 0;$i < 64;$i++) {
-		$hmac_opad[$i] = $hmac_opad[$i] ^ $key[$i];
-		$hmac_ipad[$i] = $hmac_ipad[$i] ^ $key[$i];
-	}
-
-	// Finally, calculate the HMAC
-	$hash = sha1($hmac_opad.pack('H*', sha1($hmac_ipad.$data)));
-
-	// If we want raw output then we need to pack the final result
-	if ($raw_output)
-		$hash = pack('H*', $hash);
-
-	return $hash;
-}
-
-
-//
-// Set a cookie, FluxBB style!
-// Wrapper for forum_setcookie
+
+}
+
+
+//
+// Set a cookie, PunBB style!
 //
 function pun_setcookie($user_id, $password_hash, $expire)
 {
-	global $cookie_name, $cookie_seed;
-
-	forum_setcookie($cookie_name, $user_id.'|'.forum_hmac($password_hash, $cookie_seed.'_password_hash').'|'.$expire.'|'.forum_hmac($user_id.'|'.$expire, $cookie_seed.'_cookie_hash'), $expire);
-}
-
-
-//
-// Set a cookie, FluxBB style!
-//
-function forum_setcookie($name, $value, $expire)
-{
-	global $cookie_path, $cookie_domain, $cookie_secure;
-
-	// Enable sending of a P3P header
-	header('P3P: CP="CUR ADM"');
-
-	if (version_compare(PHP_VERSION, '5.2.0', '>='))
-		setcookie($name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
-	else
-		setcookie($name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
+	global $cookie_name, $cookie_path, $cookie_domain, $cookie_secure, $cookie_seed;
+
+	// Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)
+//	@header('P3P: CP="CUR ADM"');
+
+	setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure);
 }
 
@@ -357,15 +152,11 @@
 	global $db, $pun_config, $lang_common, $pun_user, $pun_bans;
 
-	// Admins and moderators aren't affected
-	if ($pun_user['is_admmod'] || !$pun_bans)
+	// Admins aren't affected
+	if ($pun_user['g_id'] == PUN_ADMIN || !$pun_bans)
 		return;
 
-	// Add a dot or a colon (depending on IPv4/IPv6) at the end of the IP address to prevent banned address
-	// 192.168.0.5 from matching e.g. 192.168.0.50
-	$user_ip = get_remote_address();
-	$user_ip .= (strpos($user_ip, '.') !== false) ? '.' : ':';
-
+	// Add a dot at the end of the IP address to prevent banned address 192.168.0.5 from matching e.g. 192.168.0.50
+	$user_ip = get_remote_address().'.';
 	$bans_altered = false;
-	$is_banned = false;
 
 	foreach ($pun_bans as $cur_ban)
@@ -374,11 +165,14 @@
 		if ($cur_ban['expire'] != '' && $cur_ban['expire'] <= time())
 		{
-			$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$cur_ban['id']) or error('Unable to delete expired ban', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$cur_ban['id']) or error('Impossible de supprimÃ© le bannissement expirÃ©', __FILE__, __LINE__, $db->error());
 			$bans_altered = true;
 			continue;
 		}
 
-		if ($cur_ban['username'] != '' && utf8_strtolower($pun_user['username']) == utf8_strtolower($cur_ban['username']))
-			$is_banned = true;
+		if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))
+		{
+			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+			message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+		}
 
 		if ($cur_ban['ip'] != '')
@@ -386,26 +180,15 @@
 			$cur_ban_ips = explode(' ', $cur_ban['ip']);
 
-			$num_ips = count($cur_ban_ips);
-			for ($i = 0; $i < $num_ips; ++$i)
+			for ($i = 0; $i < count($cur_ban_ips); ++$i)
 			{
-				// Add the proper ending to the ban
-				if (strpos($user_ip, '.') !== false)
-					$cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
-				else
-					$cur_ban_ips[$i] = $cur_ban_ips[$i].':';
+				$cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
 
 				if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])
 				{
-					$is_banned = true;
-					break;
+					$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+					message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
 				}
 			}
 		}
-
-		if ($is_banned)
-		{
-			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
-			message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
-		}
 	}
 
@@ -413,7 +196,5 @@
 	if ($bans_altered)
 	{
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
+		require_once PUN_ROOT.'include/cache.php';
 		generate_bans_cache();
 	}
@@ -422,70 +203,19 @@
 
 //
-// Check username
-//
-function check_username($username, $exclude_id = null)
-{
-	global $db, $pun_config, $errors, $lang_prof_reg, $lang_register, $lang_common, $pun_bans;
-
-	// Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
-	$username = preg_replace('%\s+%s', ' ', $username);
-
-	// Validate username
-	if (pun_strlen($username) < 2)
-		$errors[] = $lang_prof_reg['Username too short'];
-	else if (pun_strlen($username) > 25) // This usually doesn't happen since the form element only accepts 25 characters
-		$errors[] = $lang_prof_reg['Username too long'];
-	else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest']))
-		$errors[] = $lang_prof_reg['Username guest'];
-	else if (preg_match('%[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}%', $username) || preg_match('%((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))%', $username))
-		$errors[] = $lang_prof_reg['Username IP'];
-	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
-		$errors[] = $lang_prof_reg['Username reserved chars'];
-	else if (preg_match('%(?:\[/?(?:b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|\*|topic|post|forum|user)\]|\[(?:img|url|quote|list)=)%i', $username))
-		$errors[] = $lang_prof_reg['Username BBCode'];
-
-	// Check username for any censored words
-	if ($pun_config['o_censoring'] == '1' && censor_words($username) != $username)
-		$errors[] = $lang_register['Username censor'];
-
-	// Check that the username (or a too similar username) is not already registered
-	$query = ($exclude_id) ? ' AND id!='.$exclude_id : '';
-
-	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE (UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(ucp_preg_replace('%[^\p{L}\p{N}]%u', '', $username)).'\')) AND id>1'.$query) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-
-	if ($db->num_rows($result))
-	{
-		$busy = $db->result($result);
-		$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
-	}
-
-	// Check username for any banned usernames
-	foreach ($pun_bans as $cur_ban)
-	{
-		if ($cur_ban['username'] != '' && utf8_strtolower($username) == utf8_strtolower($cur_ban['username']))
-		{
-			$errors[] = $lang_prof_reg['Banned username'];
-			break;
-		}
-	}
-}
-
-
-//
 // Update "Users online"
 //
 function update_users_online()
 {
-	global $db, $pun_config;
+	global $db, $pun_config, $pun_user;
 
 	$now = time();
 
 	// Fetch all online list entries that are older than "o_timeout_online"
-	$result = $db->query('SELECT user_id, ident, logged, idle FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to fetch old entries from online list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Impossible de retrouver les anciennes entrÃ©es de la liste des utilisateurs', __FILE__, __LINE__, $db->error());
 	while ($cur_user = $db->fetch_assoc($result))
 	{
 		// If the entry is a guest, delete it
 		if ($cur_user['user_id'] == '1')
-			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($cur_user['ident']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($cur_user['ident']).'\'') or error('Impossible de supprimer de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 		else
 		{
@@ -493,11 +223,69 @@
 			if ($cur_user['logged'] < ($now-$pun_config['o_timeout_visit']))
 			{
-				$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$cur_user['logged'].' WHERE id='.$cur_user['user_id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
-				$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$cur_user['user_id']) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
+				$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$cur_user['logged'].' WHERE id='.$cur_user['user_id']) or error('Impossible de mettre Ã  jour les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+				$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$cur_user['user_id']) or error('Impossible de supprimer de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 			}
 			else if ($cur_user['idle'] == '0')
-				$db->query('UPDATE '.$db->prefix.'online SET idle=1 WHERE user_id='.$cur_user['user_id']) or error('Unable to insert into online list', __FILE__, __LINE__, $db->error());
-		}
-	}
+				$db->query('UPDATE '.$db->prefix.'online SET idle=1 WHERE user_id='.$cur_user['user_id']) or error('Impossible d\'insÃ©rer Ã  la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
+		}
+	}
+}
+
+
+//
+// Generate the "navigator" that appears at the top of every page
+//
+function generate_navlinks()
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	// Index and Userlist should always be displayed
+	$links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
+	$links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';
+
+	if ($pun_config['o_rules'] == '1')
+		$links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
+
+	if ($pun_user['is_guest'])
+	{
+		if ($pun_user['g_search'] == '1')
+			$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+
+		$links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>';
+		$links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>';
+
+		$info = $lang_common['Not logged in'];
+	}
+	else
+	{
+		if ($pun_user['g_id'] > PUN_MOD)
+		{
+			if ($pun_user['g_search'] == '1')
+				$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+
+			$links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
+			$links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
+		}
+		else
+		{
+			$links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
+			$links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
+			$links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';
+			$links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
+		}
+	}
+
+	// Are there any additional navlinks we should insert into the array before imploding it?
+	if ($pun_config['o_additional_navlinks'] != '')
+	{
+		if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))
+		{
+			// Insert any additional links into the $links array (at the correct index)
+			for ($i = 0; $i < count($extra_links[1]); ++$i)
+				array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
+		}
+	}
+
+	return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';
 }
 
@@ -520,8 +308,8 @@
 					<li<?php if ($page == 'personal') echo ' class="isactive"'; ?>><a href="profile.php?section=personal&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section personal'] ?></a></li>
 					<li<?php if ($page == 'messaging') echo ' class="isactive"'; ?>><a href="profile.php?section=messaging&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section messaging'] ?></a></li>
-<?php if ($pun_config['o_avatars'] == '1' || $pun_config['o_signatures'] == '1'): ?>					<li<?php if ($page == 'personality') echo ' class="isactive"'; ?>><a href="profile.php?section=personality&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section personality'] ?></a></li>
-<?php endif; ?>					<li<?php if ($page == 'display') echo ' class="isactive"'; ?>><a href="profile.php?section=display&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section display'] ?></a></li>
+					<li<?php if ($page == 'personality') echo ' class="isactive"'; ?>><a href="profile.php?section=personality&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section personality'] ?></a></li>
+					<li<?php if ($page == 'display') echo ' class="isactive"'; ?>><a href="profile.php?section=display&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section display'] ?></a></li>
 					<li<?php if ($page == 'privacy') echo ' class="isactive"'; ?>><a href="profile.php?section=privacy&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section privacy'] ?></a></li>
-<?php if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && $pun_user['g_mod_ban_users'] == '1')): ?>					<li<?php if ($page == 'admin') echo ' class="isactive"'; ?>><a href="profile.php?section=admin&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section admin'] ?></a></li>
+<?php if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '1')): ?>					<li<?php if ($page == 'admin') echo ' class="isactive"'; ?>><a href="profile.php?section=admin&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Section admin'] ?></a></li>
 <?php endif; ?>				</ul>
 			</div>
@@ -534,111 +322,5 @@
 
 //
-// Outputs markup to display a user's avatar
-//
-function generate_avatar_markup($user_id)
-{
-	global $pun_config;
-
-	$filetypes = array('jpg', 'gif', 'png');
-	$avatar_markup = '';
-
-	foreach ($filetypes as $cur_type)
-	{
-		$path = $pun_config['o_avatars_dir'].'/'.$user_id.'.'.$cur_type;
-
-		if (file_exists(PUN_ROOT.$path) && $img_size = getimagesize(PUN_ROOT.$path))
-		{
-			$avatar_markup = '<img src="'.pun_htmlspecialchars(get_base_url(true).'/'.$path.'?m='.filemtime(PUN_ROOT.$path)).'" '.$img_size[3].' alt="" />';
-			break;
-		}
-	}
-
-	return $avatar_markup;
-}
-
-
-//
-// Generate browser's title
-//
-function generate_page_title($page_title, $p = null)
-{
-	global $pun_config, $lang_common;
-
-	$page_title = array_reverse($page_title);
-
-	if ($p != null)
-		$page_title[0] .= ' ('.sprintf($lang_common['Page'], forum_number_format($p)).')';
-
-	$crumbs = implode($lang_common['Title separator'], $page_title);
-
-	return $crumbs;
-}
-
-
-//
-// Save array of tracked topics in cookie
-//
-function set_tracked_topics($tracked_topics)
-{
-	global $cookie_name, $cookie_path, $cookie_domain, $cookie_secure, $pun_config;
-
-	$cookie_data = '';
-	if (!empty($tracked_topics))
-	{
-		// Sort the arrays (latest read first)
-		arsort($tracked_topics['topics'], SORT_NUMERIC);
-		arsort($tracked_topics['forums'], SORT_NUMERIC);
-
-		// Homebrew serialization (to avoid having to run unserialize() on cookie data)
-		foreach ($tracked_topics['topics'] as $id => $timestamp)
-			$cookie_data .= 't'.$id.'='.$timestamp.';';
-		foreach ($tracked_topics['forums'] as $id => $timestamp)
-			$cookie_data .= 'f'.$id.'='.$timestamp.';';
-
-		// Enforce a byte size limit (4096 minus some space for the cookie name - defaults to 4048)
-		if (strlen($cookie_data) > FORUM_MAX_COOKIE_SIZE)
-		{
-			$cookie_data = substr($cookie_data, 0, FORUM_MAX_COOKIE_SIZE);
-			$cookie_data = substr($cookie_data, 0, strrpos($cookie_data, ';')).';';
-		}
-	}
-
-	forum_setcookie($cookie_name.'_track', $cookie_data, time() + $pun_config['o_timeout_visit']);
-	$_COOKIE[$cookie_name.'_track'] = $cookie_data; // Set it directly in $_COOKIE as well
-}
-
-
-//
-// Extract array of tracked topics from cookie
-//
-function get_tracked_topics()
-{
-	global $cookie_name;
-
-	$cookie_data = isset($_COOKIE[$cookie_name.'_track']) ? $_COOKIE[$cookie_name.'_track'] : false;
-	if (!$cookie_data)
-		return array('topics' => array(), 'forums' => array());
-
-	if (strlen($cookie_data) > 4048)
-		return array('topics' => array(), 'forums' => array());
-
-	// Unserialize data from cookie
-	$tracked_topics = array('topics' => array(), 'forums' => array());
-	$temp = explode(';', $cookie_data);
-	foreach ($temp as $t)
-	{
-		$type = substr($t, 0, 1) == 'f' ? 'forums' : 'topics';
-		$id = intval(substr($t, 1));
-		$timestamp = intval(substr($t, strpos($t, '=') + 1));
-		if ($id > 0 && $timestamp > 0)
-			$tracked_topics[$type][$id] = $timestamp;
-	}
-
-	return $tracked_topics;
-}
-
-
-//
-// Update posts, topics, last_post, last_post_id and last_poster for a forum
+// Update posts, topics, last_post, last_post_id and last_poster for a forum (redirect topics are not included)
 //
 function update_forum($forum_id)
@@ -646,36 +328,18 @@
 	global $db;
 
-	$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$forum_id) or error('Impossible de retrouver le total de discussions du forum', __FILE__, __LINE__, $db->error());
 	list($num_topics, $num_posts) = $db->fetch_row($result);
 
-	$num_posts = $num_posts + $num_topics; // $num_posts is only the sum of all replies (we have to add the topic posts)
-
-	$result = $db->query('SELECT last_post, last_post_id, last_poster FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND moved_to IS NULL ORDER BY last_post DESC LIMIT 1') or error('Unable to fetch last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result)) // There are topics in the forum
+	$num_posts = $num_posts + $num_topics;		// $num_posts is only the sum of all replies (we have to add the topic posts)
+
+	$result = $db->query('SELECT last_post, last_post_id, last_poster FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND moved_to IS NULL ORDER BY last_post DESC LIMIT 1') or error('Impossible de retrouver last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))		// There are topics in the forum
 	{
 		list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);
 
-		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
-	}
-	else // There are no topics
-		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
-}
-
-
-//
-// Deletes any avatars owned by the specified user ID
-//
-function delete_avatar($user_id)
-{
-	global $pun_config;
-
-	$filetypes = array('jpg', 'gif', 'png');
-
-	// Delete user avatar
-	foreach ($filetypes as $cur_type)
-	{
-		if (file_exists(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$user_id.'.'.$cur_type))
-			@unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$user_id.'.'.$cur_type);
-	}
+		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
+	}
+	else	// There are no topics
+		$db->query('UPDATE '.$db->prefix.'forums SET num_topics=0, num_posts=0, last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Impossible de mettre Ã  jour last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
 }
 
@@ -689,13 +353,13 @@
 
 	// Delete the topic and any redirect topics
-	$db->query('DELETE FROM '.$db->prefix.'topics WHERE id='.$topic_id.' OR moved_to='.$topic_id) or error('Unable to delete topic', __FILE__, __LINE__, $db->error());
-
-	// Create a list of the post IDs in this topic
+	$db->query('DELETE FROM '.$db->prefix.'topics WHERE id='.$topic_id.' OR moved_to='.$topic_id) or error('Impossible de supprimer le sujet', __FILE__, __LINE__, $db->error());
+
+	// Create a list of the post ID's in this topic
 	$post_ids = '';
-	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
 	while ($row = $db->fetch_row($result))
 		$post_ids .= ($post_ids != '') ? ','.$row[0] : $row[0];
 
-	// Make sure we have a list of post IDs
+	// Make sure we have a list of post ID's
 	if ($post_ids != '')
 	{
@@ -703,9 +367,9 @@
 
 		// Delete posts in topic
-		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Unable to delete posts', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
 	}
 
 	// Delete any subscriptions for this topic
-	$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id='.$topic_id) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id='.$topic_id) or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
 }
 
@@ -718,15 +382,15 @@
 	global $db;
 
-	$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY id DESC LIMIT 2') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY id DESC LIMIT 2') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
 	list($last_id, ,) = $db->fetch_row($result);
 	list($second_last_id, $second_poster, $second_posted) = $db->fetch_row($result);
 
 	// Delete the post
-	$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.$post_id) or error('Unable to delete post', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.$post_id) or error('Impossible de supprimer le message', __FILE__, __LINE__, $db->error());
 
 	strip_search_index($post_id);
 
 	// Count number of replies in the topic
-	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Impossible de retrouver le total de messages pour la discussion', __FILE__, __LINE__, $db->error());
 	$num_replies = $db->result($result, 0) - 1;
 
@@ -736,27 +400,12 @@
 		// If there is a $second_last_id there is more than 1 reply to the topic
 		if (!empty($second_last_id))
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$second_posted.', last_post_id='.$second_last_id.', last_poster=\''.$db->escape($second_poster).'\', num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$second_posted.', last_post_id='.$second_last_id.', last_poster=\''.$db->escape($second_poster).'\', num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
 		else
 			// We deleted the only reply, so now last_post/last_post_id/last_poster is posted/id/poster from the topic itself
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post=posted, last_post_id=id, last_poster=poster, num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post=posted, last_post_id=id, last_poster=poster, num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
 	}
 	else
 		// Otherwise we just decrement the reply counter
-		$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
-}
-
-
-//
-// Delete every .php file in the forum's cache directory
-//
-function forum_clear_cache()
-{
-	$d = dir(FORUM_CACHE_DIR);
-	while (($entry = $d->read()) !== false)
-	{
-		if (substr($entry, -4) == '.php')
-			@unlink(FORUM_CACHE_DIR.$entry);
-	}
-	$d->close();
+		$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.' WHERE id='.$topic_id) or error('Impossible de mettre Ã  jour la discussion', __FILE__, __LINE__, $db->error());
 }
 
@@ -773,19 +422,17 @@
 	if (!isset($search_for))
 	{
-		if (file_exists(FORUM_CACHE_DIR.'cache_censoring.php'))
-			include FORUM_CACHE_DIR.'cache_censoring.php';
-
-		if (!defined('PUN_CENSOR_LOADED'))
-		{
-			if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-				require PUN_ROOT.'include/cache.php';
-
-			generate_censoring_cache();
-			require FORUM_CACHE_DIR.'cache_censoring.php';
+		$result = $db->query('SELECT search_for, replace_with FROM '.$db->prefix.'censoring') or error('Impossible de retrouver la liste des mots Ã  censurer', __FILE__, __LINE__, $db->error());
+		$num_words = $db->num_rows($result);
+
+		$search_for = array();
+		for ($i = 0; $i < $num_words; ++$i)
+		{
+			list($search_for[$i], $replace_with[$i]) = $db->fetch_row($result);
+			$search_for[$i] = '/\b('.str_replace('\*', '\w*?', preg_quote($search_for[$i], '/')).')\b/i';
 		}
 	}
 
 	if (!empty($search_for))
-		$text = substr(ucp_preg_replace($search_for, $replace_with, ' '.$text.' '), 1, -1);
+		$text = substr(preg_replace($search_for, $replace_with, ' '.$text.' '), 1, -1);
 
 	return $text;
@@ -812,16 +459,12 @@
 
 	// If not already loaded in a previous call, load the cached ranks
-	if ($pun_config['o_ranks'] == '1' && !defined('PUN_RANKS_LOADED'))
-	{
-		if (file_exists(FORUM_CACHE_DIR.'cache_ranks.php'))
-			include FORUM_CACHE_DIR.'cache_ranks.php';
-
+	if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
+	{
+		@include PUN_ROOT.'cache/cache_ranks.php';
 		if (!defined('PUN_RANKS_LOADED'))
 		{
-			if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-				require PUN_ROOT.'include/cache.php';
-
+			require_once PUN_ROOT.'include/cache.php';
 			generate_ranks_cache();
-			require FORUM_CACHE_DIR.'cache_ranks.php';
+			require PUN_ROOT.'cache/cache_ranks.php';
 		}
 	}
@@ -844,7 +487,8 @@
 		if ($pun_config['o_ranks'] == '1' && !empty($pun_ranks))
 		{
-			foreach ($pun_ranks as $cur_rank)
+			@reset($pun_ranks);
+			while (list(, $cur_rank) = @each($pun_ranks))
 			{
-				if ($user['num_posts'] >= $cur_rank['min_posts'])
+				if (intval($user['num_posts']) >= $cur_rank['min_posts'])
 					$user_title = pun_htmlspecialchars($cur_rank['rank']);
 			}
@@ -863,8 +507,6 @@
 // Generate a string with numbered links (for multipage scripts)
 //
-function paginate($num_pages, $cur_page, $link)
-{
-	global $lang_common;
-
+function paginate($num_pages, $cur_page, $link_to)
+{
 	$pages = array();
 	$link_to_all = false;
@@ -878,44 +520,36 @@
 
 	if ($num_pages <= 1)
-		$pages = array('<strong class="item1">1</strong>');
+		$pages = array('<strong>1</strong>');
 	else
 	{
-		// Add a previous page link
-		if ($num_pages > 1 && $cur_page > 1)
-			$pages[] = '<a'.(empty($pages) ? ' class="item1"' : '').' href="'.$link.'&amp;p='.($cur_page - 1).'">'.$lang_common['Previous'].'</a>';
-
 		if ($cur_page > 3)
 		{
-			$pages[] = '<a'.(empty($pages) ? ' class="item1"' : '').' href="'.$link.'&amp;p=1">1</a>';
-
-			if ($cur_page > 5)
-				$pages[] = '<span class="spacer">'.$lang_common['Spacer'].'</span>';
+			$pages[] = '<a href="'.$link_to.'&amp;p=1">1</a>';
+
+			if ($cur_page != 4)
+				$pages[] = '&hellip;';
 		}
 
 		// Don't ask me how the following works. It just does, OK? :-)
-		for ($current = ($cur_page == 5) ? $cur_page - 3 : $cur_page - 2, $stop = ($cur_page + 4 == $num_pages) ? $cur_page + 4 : $cur_page + 3; $current < $stop; ++$current)
+		for ($current = $cur_page - 2, $stop = $cur_page + 3; $current < $stop; ++$current)
 		{
 			if ($current < 1 || $current > $num_pages)
 				continue;
 			else if ($current != $cur_page || $link_to_all)
-				$pages[] = '<a'.(empty($pages) ? ' class="item1"' : '').' href="'.$link.'&amp;p='.$current.'">'.forum_number_format($current).'</a>';
+				$pages[] = '<a href="'.$link_to.'&amp;p='.$current.'">'.$current.'</a>';
 			else
-				$pages[] = '<strong'.(empty($pages) ? ' class="item1"' : '').'>'.forum_number_format($current).'</strong>';
+				$pages[] = '<strong>'.$current.'</strong>';
 		}
 
 		if ($cur_page <= ($num_pages-3))
 		{
-			if ($cur_page != ($num_pages-3) && $cur_page != ($num_pages-4))
-				$pages[] = '<span class="spacer">'.$lang_common['Spacer'].'</span>';
-
-			$pages[] = '<a'.(empty($pages) ? ' class="item1"' : '').' href="'.$link.'&amp;p='.$num_pages.'">'.forum_number_format($num_pages).'</a>';
-		}
-
-		// Add a next page link
-		if ($num_pages > 1 && !$link_to_all && $cur_page < $num_pages)
-			$pages[] = '<a'.(empty($pages) ? ' class="item1"' : '').' href="'.$link.'&amp;p='.($cur_page +1).'">'.$lang_common['Next'].'</a>';
-	}
-
-	return implode(' ', $pages);
+			if ($cur_page != ($num_pages-3))
+				$pages[] = '&hellip;';
+
+			$pages[] = '<a href="'.$link_to.'&amp;p='.$num_pages.'">'.$num_pages.'</a>';
+		}
+	}
+
+	return implode('&#160;', $pages);
 }
 
@@ -926,10 +560,12 @@
 function message($message, $no_back_link = false)
 {
-	global $db, $lang_common, $pun_config, $pun_start, $tpl_main, $pun_user;
+
+	global $db, $lang_common, $pun_config, $pun_start, $tpl_main, $env;
 
 	if (!defined('PUN_HEADER'))
 	{
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Info']);
-		define('PUN_ACTIVE_PAGE', 'index');
+		global $pun_user;
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Info'];
 		require PUN_ROOT.'header.php';
 	}
@@ -941,6 +577,6 @@
 	<div class="box">
 		<div class="inbox">
-			<p><?php echo $message ?></p>
-<?php if (!$no_back_link): ?>			<p><a href="javascript: history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+		<p><?php echo $message ?></p>
+<?php if (!$no_back_link): ?>		<p><a href="javascript: history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 <?php endif; ?>		</div>
 	</div>
@@ -953,241 +589,148 @@
 
 //
-// Format a time string according to $time_format and time zones
-//
-function format_time($timestamp, $date_only = false, $date_format = null, $time_format = null, $time_only = false, $no_text = false)
-{
-	global $pun_config, $lang_common, $pun_user, $forum_date_formats, $forum_time_formats;
+// Format a time string according to $time_format and timezones
+//
+function format_time($timestamp, $date_only = false)
+{
+	global $pun_config, $lang_common, $pun_user;
 
 	if ($timestamp == '')
 		return $lang_common['Never'];
 
-	$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
+	$diff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;
 	$timestamp += $diff;
 	$now = time();
 
-	if($date_format == null)
-		$date_format = $forum_date_formats[$pun_user['date_format']];
-
-	if($time_format == null)
-		$time_format = $forum_time_formats[$pun_user['time_format']];
-
-	$date = gmdate($date_format, $timestamp);
-	$today = gmdate($date_format, $now+$diff);
-	$yesterday = gmdate($date_format, $now+$diff-86400);
-
-	if(!$no_text)
-	{
-		if ($date == $today)
-			$date = $lang_common['Today'];
-		else if ($date == $yesterday)
-			$date = $lang_common['Yesterday'];
-	}
-
-	if ($date_only)
+	$date = date($pun_config['o_date_format'], $timestamp);
+	$today = date($pun_config['o_date_format'], $now+$diff);
+	$yesterday = date($pun_config['o_date_format'], $now+$diff-86400);
+
+	if ($date == $today)
+		$date = $lang_common['Today'];
+	else if ($date == $yesterday)
+		$date = $lang_common['Yesterday'];
+
+	if (!$date_only)
+		return $date.' '.date($pun_config['o_time_format'], $timestamp);
+	else
 		return $date;
-	else if ($time_only)
-		return gmdate($time_format, $timestamp);
+}
+
+
+//
+// If we are running pre PHP 4.3.0, we add our own implementation of file_get_contents
+//
+if (!function_exists('file_get_contents'))
+{
+	function file_get_contents($filename, $use_include_path = 0)
+	{
+		$data = '';
+
+		if ($fh = fopen($filename, 'rb', $use_include_path))
+		{
+			$data = fread($fh, filesize($filename));
+			fclose($fh);
+		}
+
+		return $data;
+	}
+}
+
+
+//
+// Make sure that HTTP_REFERER matches $pun_config['o_base_url']/$script
+//
+function confirm_referrer($script)
+{
+	global $pun_config, $lang_common;
+
+	if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
+		message($lang_common['Bad referrer']);
+}
+
+
+//
+// Generate a random password of length $len
+//
+function random_pass($len)
+{
+	$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+	$password = '';
+	for ($i = 0; $i < $len; ++$i)
+		$password .= substr($chars, (mt_rand() % strlen($chars)), 1);
+
+	return $password;
+}
+
+
+//
+// Compute a hash of $str
+// Uses sha1() if available. If not, SHA1 through mhash() if available. If not, fall back on md5().
+//
+function pun_hash($str)
+{
+	if (function_exists('sha1'))	// Only in PHP 4.3.0+
+		return sha1($str);
+	else if (function_exists('mhash'))	// Only if Mhash library is loaded
+		return bin2hex(mhash(MHASH_SHA1, $str));
 	else
-		return $date.' '.gmdate($time_format, $timestamp);
-}
-
-
-//
-// A wrapper for PHP's number_format function
-//
-function forum_number_format($number, $decimals = 0)
+		return md5($str);
+}
+
+
+//
+// Try to determine the correct remote IP-address
+//
+function get_remote_address()
+{
+	return $_SERVER['REMOTE_ADDR'];
+}
+
+
+//
+// Equivalent to htmlspecialchars(), but allows &#[0-9]+ (for unicode)
+//
+function pun_htmlspecialchars($str)
+{
+	$str = preg_replace('/&(?!#[0-9]+;)/s', '&amp;', $str);
+	$str = str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $str);
+
+	return $str;
+}
+
+
+//
+// Equivalent to strlen(), but counts &#[0-9]+ as one character (for unicode)
+//
+function pun_strlen($str)
+{
+	return strlen(preg_replace('/&#([0-9]+);/', '!', $str));
+}
+
+
+//
+// Convert \r\n and \r to \n
+//
+function pun_linebreaks($str)
+{
+	return str_replace("\r", "\n", str_replace("\r\n", "\n", $str));
+}
+
+
+//
+// A more aggressive version of trim()
+//
+function pun_trim($str)
 {
 	global $lang_common;
 
-	return is_numeric($number) ? number_format($number, $decimals, $lang_common['lang_decimal_point'], $lang_common['lang_thousands_sep']) : $number;
-}
-
-
-//
-// Generate a random key of length $len
-//
-function random_key($len, $readable = false, $hash = false)
-{
-	$key = '';
-
-	if ($hash)
-		$key = substr(pun_hash(uniqid(rand(), true)), 0, $len);
-	else if ($readable)
-	{
-		$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
-
-		for ($i = 0; $i < $len; ++$i)
-			$key .= substr($chars, (mt_rand() % strlen($chars)), 1);
+	if (strpos($lang_common['lang_encoding'], '8859') !== false)
+	{
+		$fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0));
+		return trim(str_replace($fishy_chars, ' ', $str));
 	}
 	else
-	{
-		for ($i = 0; $i < $len; ++$i)
-			$key .= chr(mt_rand(33, 126));
-	}
-
-	return $key;
-}
-
-
-//
-// Make sure that HTTP_REFERER matches base_url/script
-//
-function confirm_referrer($script, $error_msg = false)
-{
-	global $pun_config, $lang_common;
-
-	// There is no referrer
-	if (empty($_SERVER['HTTP_REFERER']))
-		message($error_msg ? $error_msg : $lang_common['Bad referrer']);
-
-	$referrer = parse_url(strtolower($_SERVER['HTTP_REFERER']));
-	// Remove www subdomain if it exists
-	if (strpos($referrer['host'], 'www.') === 0)
-		$referrer['host'] = substr($referrer['host'], 4);
-
-	$valid = parse_url(strtolower(get_base_url().'/'.$script));
-	// Remove www subdomain if it exists
-	if (strpos($valid['host'], 'www.') === 0)
-		$valid['host'] = substr($valid['host'], 4);
-
-	// Check the host and path match. Ignore the scheme, port, etc.
-	if ($referrer['host'] != $valid['host'] || $referrer['path'] != $valid['path'])
-		message($error_msg ? $error_msg : $lang_common['Bad referrer']);
-}
-
-
-//
-// Generate a random password of length $len
-// Compatibility wrapper for random_key
-//
-function random_pass($len)
-{
-	return random_key($len, true);
-}
-
-
-//
-// Compute a hash of $str
-//
-function pun_hash($str)
-{
-	return sha1($str);
-}
-
-
-//
-// Try to determine the correct remote IP-address
-//
-function get_remote_address()
-{
-	$remote_addr = $_SERVER['REMOTE_ADDR'];
-
-	// If we are behind a reverse proxy try to find the real users IP
-	if (defined('FORUM_BEHIND_REVERSE_PROXY'))
-	{
-		if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
-		{
-			// The general format of the field is:
-			// X-Forwarded-For: client1, proxy1, proxy2
-			// where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client,
-			// and each successive proxy that passed the request adding the IP address where it received the request from.
-			$forwarded_for = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
-			$forwarded_for = trim($forwarded_for[0]);
-
-			if (@preg_match('%^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$%', $forwarded_for) || @preg_match('%^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$%', $forwarded_for))
-				$remote_addr = $forwarded_for;
-		}
-	}
-
-	return $remote_addr;
-}
-
-
-//
-// Calls htmlspecialchars with a few options already set
-//
-function pun_htmlspecialchars($str)
-{
-	return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
-}
-
-
-//
-// Calls htmlspecialchars_decode with a few options already set
-//
-function pun_htmlspecialchars_decode($str)
-{
-	if (function_exists('htmlspecialchars_decode'))
-		return htmlspecialchars_decode($str, ENT_QUOTES);
-
-	static $translations;
-	if (!isset($translations))
-	{
-		$translations = get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES);
-		$translations['&#039;'] = '\''; // get_html_translation_table doesn't include &#039; which is what htmlspecialchars translates ' to, but apparently that is okay?! http://bugs.php.net/bug.php?id=25927
-		$translations = array_flip($translations);
-	}
-
-	return strtr($str, $translations);
-}
-
-
-//
-// A wrapper for utf8_strlen for compatibility
-//
-function pun_strlen($str)
-{
-	return utf8_strlen($str);
-}
-
-
-//
-// Convert \r\n and \r to \n
-//
-function pun_linebreaks($str)
-{
-	return str_replace("\r", "\n", str_replace("\r\n", "\n", $str));
-}
-
-
-//
-// A wrapper for utf8_trim for compatibility
-//
-function pun_trim($str, $charlist = false)
-{
-	return utf8_trim($str, $charlist);
-}
-
-//
-// Checks if a string is in all uppercase
-//
-function is_all_uppercase($string)
-{
-	return utf8_strtoupper($string) == $string && utf8_strtolower($string) != $string;
-}
-
-
-//
-// Inserts $element into $input at $offset
-// $offset can be either a numerical offset to insert at (eg: 0 inserts at the beginning of the array)
-// or a string, which is the key that the new element should be inserted before
-// $key is optional: it's used when inserting a new key/value pair into an associative array
-//
-function array_insert(&$input, $offset, $element, $key = null)
-{
-	if ($key == null)
-		$key = $offset;
-
-	// Determine the proper offset if we're using a string
-	if (!is_int($offset))
-		$offset = array_search($offset, array_keys($input), true);
-
-	// Out of bounds checks
-	if ($offset > count($input))
-		$offset = count($input);
-	else if ($offset < 0)
-		$offset = 0;
-
-	$input = array_merge(array_slice($input, 0, $offset), array($key => $element), array_slice($input, $offset));
+		return trim($str);
 }
 
@@ -1199,13 +742,4 @@
 {
 	global $db, $pun_config, $lang_common, $pun_user;
-
-	// Send no-cache headers
-	header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
-	header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: post-check=0, pre-check=0', false);
-	header('Pragma: no-cache'); // For HTTP/1.0 compatibility
-
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
 
 	// Deal with newlines, tabs and multiple spaces
@@ -1214,42 +748,7 @@
 	$message = str_replace($pattern, $replace, $pun_config['o_maintenance_message']);
 
-	if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/maintenance.tpl'))
-	{
-		$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/maintenance.tpl';
-		$tpl_inc_dir = PUN_ROOT.'style/'.$pun_user['style'].'/';
-	}
-	else
-	{
-		$tpl_file = PUN_ROOT.'include/template/maintenance.tpl';
-		$tpl_inc_dir = PUN_ROOT.'include/user/';
-	}
-
-	$tpl_maint = file_get_contents($tpl_file);
-
-	// START SUBST - <pun_include "*">
-	preg_match_all('%<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">%i', $tpl_maint, $pun_includes, PREG_SET_ORDER);
-
-	foreach ($pun_includes as $cur_include)
-	{
-		ob_start();
-
-		// Allow for overriding user includes, too.
-		if (file_exists($tpl_inc_dir.$cur_include[1].'.'.$cur_include[2]))
-			require $tpl_inc_dir.$cur_include[1].'.'.$cur_include[2];
-		else if (file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]))
-			require PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2];
-		else
-			error(sprintf($lang_common['Pun include error'], htmlspecialchars($cur_include[0]), basename($tpl_file)));
-
-		$tpl_temp = ob_get_contents();
-		$tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint);
-		ob_end_clean();
-	}
-	// END SUBST - <pun_include "*">
-
-
-	// START SUBST - <pun_language>
-	$tpl_maint = str_replace('<pun_language>', $lang_common['lang_identifier'], $tpl_maint);
-	// END SUBST - <pun_language>
+
+	// Load the maintenance template
+	$tpl_maint = trim(file_get_contents(PUN_ROOT.'include/template/maintenance.tpl'));
 
 
@@ -1259,11 +758,14 @@
 
 
+	// START SUBST - <pun_char_encoding>
+	$tpl_maint = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_maint);
+	// END SUBST - <pun_char_encoding>
+
+
 	// START SUBST - <pun_head>
 	ob_start();
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Maintenance']);
-
 ?>
-<title><?php echo generate_page_title($page_title) ?></title>
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Maintenance'] ?></title>
 <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
 <?php
@@ -1275,22 +777,12 @@
 
 
-	// START SUBST - <pun_maint_main>
-	ob_start();
-
-?>
-<div class="block">
-	<h2><?php echo $lang_common['Maintenance'] ?></h2>
-	<div class="box">
-		<div class="inbox">
-			<p><?php echo $message ?></p>
-		</div>
-	</div>
-</div>
-<?php
-
-	$tpl_temp = trim(ob_get_contents());
-	$tpl_maint = str_replace('<pun_maint_main>', $tpl_temp, $tpl_maint);
-	ob_end_clean();
-	// END SUBST - <pun_maint_main>
+	// START SUBST - <pun_maint_heading>
+	$tpl_maint = str_replace('<pun_maint_heading>', $lang_common['Maintenance'], $tpl_maint);
+	// END SUBST - <pun_maint_heading>
+
+
+	// START SUBST - <pun_maint_message>
+	$tpl_maint = str_replace('<pun_maint_message>', $message, $tpl_maint);
+	// END SUBST - <pun_maint_message>
 
 
@@ -1299,4 +791,19 @@
 
 
+	// START SUBST - <pun_include "*">
+	while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include))
+	{
+		if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
+	 	   error('Impossible de procÃ©der Ã  l\'inclusion utilisateur &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; depuis le template main.tpl. Il n\'y a pas de fichier dans le rÃ©pertoire /include/user/');
+
+		ob_start();
+		include PUN_ROOT.'include/user/'.$cur_include[1];
+		$tpl_temp = ob_get_contents();
+		$tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
+	    ob_end_clean();
+	}
+	// END SUBST - <pun_include "*">
+
+
 	// Close the db connection (and free up any result data)
 	$db->close();
@@ -1313,10 +820,6 @@
 	global $db, $pun_config, $lang_common, $pun_user;
 
-	// Prefix with base_url (unless there's already a valid URI)
-	if (strpos($destination_url, 'http://') !== 0 && strpos($destination_url, 'https://') !== 0 && strpos($destination_url, '/') !== 0)
-		$destination_url = get_base_url(true).'/'.$destination_url;
-
-	// Do a little spring cleaning
-	$destination_url = preg_replace('%([\r\n])|(\%0[ad])|(;\s*data\s*:)%i', '', $destination_url);
+	if ($destination_url == '')
+		$destination_url = 'index.php';
 
 	// If the delay is 0 seconds, we might as well skip the redirect all together
@@ -1324,51 +827,7 @@
 		header('Location: '.str_replace('&amp;', '&', $destination_url));
 
-	// Send no-cache headers
-	header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
-	header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: post-check=0, pre-check=0', false);
-	header('Pragma: no-cache'); // For HTTP/1.0 compatibility
-
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
-
-	if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/redirect.tpl'))
-	{
-		$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/redirect.tpl';
-		$tpl_inc_dir = PUN_ROOT.'style/'.$pun_user['style'].'/';
-	}
-	else
-	{
-		$tpl_file = PUN_ROOT.'include/template/redirect.tpl';
-		$tpl_inc_dir = PUN_ROOT.'include/user/';
-	}
-
-	$tpl_redir = file_get_contents($tpl_file);
-
-	// START SUBST - <pun_include "*">
-	preg_match_all('%<pun_include "([^/\\\\]*?)\.(php[45]?|inc|html?|txt)">%i', $tpl_redir, $pun_includes, PREG_SET_ORDER);
-
-	foreach ($pun_includes as $cur_include)
-	{
-		ob_start();
-
-		// Allow for overriding user includes, too.
-		if (file_exists($tpl_inc_dir.$cur_include[1].'.'.$cur_include[2]))
-			require $tpl_inc_dir.$cur_include[1].'.'.$cur_include[2];
-		else if (file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]))
-			require PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2];
-		else
-			error(sprintf($lang_common['Pun include error'], htmlspecialchars($cur_include[0]), basename($tpl_file)));
-
-		$tpl_temp = ob_get_contents();
-		$tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
-		ob_end_clean();
-	}
-	// END SUBST - <pun_include "*">
-
-
-	// START SUBST - <pun_language>
-	$tpl_redir = str_replace('<pun_language>', $lang_common['lang_identifier'], $tpl_redir);
-	// END SUBST - <pun_language>
+
+	// Load the redirect template
+	$tpl_redir = trim(file_get_contents(PUN_ROOT.'include/template/redirect.tpl'));
 
 
@@ -1378,12 +837,15 @@
 
 
+	// START SUBST - <pun_char_encoding>
+	$tpl_redir = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_redir);
+	// END SUBST - <pun_char_encoding>
+
+
 	// START SUBST - <pun_head>
 	ob_start();
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Redirecting']);
-
 ?>
 <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) ?>" />
-<title><?php echo generate_page_title($page_title) ?></title>
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>
 <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
 <?php
@@ -1395,22 +857,13 @@
 
 
-	// START SUBST - <pun_redir_main>
-	ob_start();
-
-?>
-<div class="block">
-	<h2><?php echo $lang_common['Redirecting'] ?></h2>
-	<div class="box">
-		<div class="inbox">
-			<p><?php echo $message.'<br /><br /><a href="'.$destination_url.'">'.$lang_common['Click redirect'].'</a>' ?></p>
-		</div>
-	</div>
-</div>
-<?php
-
-	$tpl_temp = trim(ob_get_contents());
-	$tpl_redir = str_replace('<pun_redir_main>', $tpl_temp, $tpl_redir);
-	ob_end_clean();
-	// END SUBST - <pun_redir_main>
+	// START SUBST - <pun_redir_heading>
+	$tpl_redir = str_replace('<pun_redir_heading>', $lang_common['Redirecting'], $tpl_redir);
+	// END SUBST - <pun_redir_heading>
+
+
+	// START SUBST - <pun_redir_text>
+	$tpl_temp = $message.'<br /><br />'.'<a href="'.$destination_url.'">'.$lang_common['Click redirect'].'</a>';
+	$tpl_redir = str_replace('<pun_redir_text>', $tpl_temp, $tpl_redir);
+	// END SUBST - <pun_redir_text>
 
 
@@ -1431,4 +884,16 @@
 
 
+	// START SUBST - <pun_include "*">
+	while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include))
+	{
+		ob_start();
+		include PUN_ROOT.$cur_include[1];
+		$tpl_temp = ob_get_contents();
+		$tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir);
+	    ob_end_clean();
+	}
+	// END SUBST - <pun_include "*">
+
+
 	// Close the db connection (and free up any result data)
 	$db->close();
@@ -1441,49 +906,25 @@
 // Display a simple error message
 //
-function error($message, $file = null, $line = null, $db_error = false)
-{
-	global $pun_config, $lang_common;
-
-	// Set some default settings if the script failed before $pun_config could be populated
+function error($message, $file, $line, $db_error = false)
+{
+	global $pun_config;
+
+	// Set a default title if the script failed before $pun_config could be populated
 	if (empty($pun_config))
-	{
-		$pun_config = array(
-			'o_board_title'	=> 'FluxBB',
-			'o_gzip'		=> '0'
-		);
-	}
-
-	// Set some default translations if the script failed before $lang_common could be populated
-	if (empty($lang_common))
-	{
-		$lang_common = array(
-			'Title separator'	=> ' / ',
-			'Page'				=> 'Page %s'
-		);
-	}
-
-	// Empty all output buffers and stop buffering
-	while (@ob_end_clean());
+		$pun_config['o_board_title'] = 'PunBB';
+
+	// Empty output buffer and stop buffering
+	@ob_end_clean();
 
 	// "Restart" output buffering if we are using ob_gzhandler (since the gzip header is already sent)
-	if ($pun_config['o_gzip'] && extension_loaded('zlib'))
+	if (!empty($pun_config['o_gzip']) && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
 		ob_start('ob_gzhandler');
-
-	// Send no-cache headers
-	header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
-	header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
-	header('Cache-Control: post-check=0, pre-check=0', false);
-	header('Pragma: no-cache'); // For HTTP/1.0 compatibility
-
-	// Send the Content-type header in case the web server is setup to send something else
-	header('Content-type: text/html; charset=utf-8');
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
+<html dir="ltr">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<?php $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), 'Error') ?>
-<title><?php echo generate_page_title($page_title) ?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang_common["lang_encoding"] ?>" />
+<title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title>
 <style type="text/css">
 <!--
@@ -1498,22 +939,22 @@
 
 <div id="errorbox">
-	<h2>An error was encountered</h2>
+	<h2>Une erreur s'est produite</h2>
 	<div>
 <?php
 
-	if (defined('PUN_DEBUG') && $file !== null && $line !== null)
-	{
-		echo "\t\t".'<strong>File:</strong> '.$file.'<br />'."\n\t\t".'<strong>Line:</strong> '.$line.'<br /><br />'."\n\t\t".'<strong>FluxBB reported</strong>: '.$message."\n";
+	if (defined('PUN_DEBUG'))
+	{
+		echo "\t\t".'<strong>Fichier :</strong> '.$file.'<br />'."\n\t\t".'<strong>Ligne :</strong> '.$line.'<br /><br />'."\n\t\t".'<strong>PunBB a rapportÃ© :</strong> '.$message."\n";
 
 		if ($db_error)
 		{
-			echo "\t\t".'<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n";
+			echo "\t\t".'<br /><br /><strong>La base de donnÃ©es a rapportÃ© :</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n";
 
 			if ($db_error['error_sql'] != '')
-				echo "\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n";
+				echo "\t\t".'<br /><br /><strong>RequÃªte Ã©chouÃ©e :</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n";
 		}
 	}
 	else
-		echo "\t\t".'Error: <strong>'.$message.'.</strong>'."\n";
+		echo "\t\t".'Erreur : <strong>'.$message.'.</strong>'."\n";
 
 ?>
@@ -1530,445 +971,4 @@
 
 	exit;
-}
-
-
-//
-// Unset any variables instantiated as a result of register_globals being enabled
-//
-function forum_unregister_globals()
-{
-	$register_globals = ini_get('register_globals');
-	if ($register_globals === '' || $register_globals === '0' || strtolower($register_globals) === 'off')
-		return;
-
-	// Prevent script.php?GLOBALS[foo]=bar
-	if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
-		exit('I\'ll have a steak sandwich and... a steak sandwich.');
-
-	// Variables that shouldn't be unset
-	$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
-
-	// Remove elements in $GLOBALS that are present in any of the superglobals
-	$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
-	foreach ($input as $k => $v)
-	{
-		if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
-		{
-			unset($GLOBALS[$k]);
-			unset($GLOBALS[$k]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
-		}
-	}
-}
-
-
-//
-// Removes any "bad" characters (characters which mess with the display of a page, are invisible, etc) from user input
-//
-function forum_remove_bad_characters()
-{
-	$_GET = remove_bad_characters($_GET);
-	$_POST = remove_bad_characters($_POST);
-	$_COOKIE = remove_bad_characters($_COOKIE);
-	$_REQUEST = remove_bad_characters($_REQUEST);
-}
-
-//
-// Removes any "bad" characters (characters which mess with the display of a page, are invisible, etc) from the given string
-// See: http://kb.mozillazine.org/Network.IDN.blacklist_chars
-//
-function remove_bad_characters($array)
-{
-	static $bad_utf8_chars;
-
-	if (!isset($bad_utf8_chars))
-	{
-		$bad_utf8_chars = array(
-			"\xcc\xb7"		=> '',		// COMBINING SHORT SOLIDUS OVERLAY		0337	*
-			"\xcc\xb8"		=> '',		// COMBINING LONG SOLIDUS OVERLAY		0338	*
-			"\xe1\x85\x9F"	=> '',		// HANGUL CHOSEONG FILLER				115F	*
-			"\xe1\x85\xA0"	=> '',		// HANGUL JUNGSEONG FILLER				1160	*
-			"\xe2\x80\x8b"	=> '',		// ZERO WIDTH SPACE						200B	*
-			"\xe2\x80\x8c"	=> '',		// ZERO WIDTH NON-JOINER				200C
-			"\xe2\x80\x8d"	=> '',		// ZERO WIDTH JOINER					200D
-			"\xe2\x80\x8e"	=> '',		// LEFT-TO-RIGHT MARK					200E
-			"\xe2\x80\x8f"	=> '',		// RIGHT-TO-LEFT MARK					200F
-			"\xe2\x80\xaa"	=> '',		// LEFT-TO-RIGHT EMBEDDING				202A
-			"\xe2\x80\xab"	=> '',		// RIGHT-TO-LEFT EMBEDDING				202B
-			"\xe2\x80\xac"	=> '', 		// POP DIRECTIONAL FORMATTING			202C
-			"\xe2\x80\xad"	=> '',		// LEFT-TO-RIGHT OVERRIDE				202D
-			"\xe2\x80\xae"	=> '',		// RIGHT-TO-LEFT OVERRIDE				202E
-			"\xe2\x80\xaf"	=> '',		// NARROW NO-BREAK SPACE				202F	*
-			"\xe2\x81\x9f"	=> '',		// MEDIUM MATHEMATICAL SPACE			205F	*
-			"\xe2\x81\xa0"	=> '',		// WORD JOINER							2060
-			"\xe3\x85\xa4"	=> '',		// HANGUL FILLER						3164	*
-			"\xef\xbb\xbf"	=> '',		// ZERO WIDTH NO-BREAK SPACE			FEFF
-			"\xef\xbe\xa0"	=> '',		// HALFWIDTH HANGUL FILLER				FFA0	*
-			"\xef\xbf\xb9"	=> '',		// INTERLINEAR ANNOTATION ANCHOR		FFF9	*
-			"\xef\xbf\xba"	=> '',		// INTERLINEAR ANNOTATION SEPARATOR		FFFA	*
-			"\xef\xbf\xbb"	=> '',		// INTERLINEAR ANNOTATION TERMINATOR	FFFB	*
-			"\xef\xbf\xbc"	=> '',		// OBJECT REPLACEMENT CHARACTER			FFFC	*
-			"\xef\xbf\xbd"	=> '',		// REPLACEMENT CHARACTER				FFFD	*
-			"\xe2\x80\x80"	=> ' ',		// EN QUAD								2000	*
-			"\xe2\x80\x81"	=> ' ',		// EM QUAD								2001	*
-			"\xe2\x80\x82"	=> ' ',		// EN SPACE								2002	*
-			"\xe2\x80\x83"	=> ' ',		// EM SPACE								2003	*
-			"\xe2\x80\x84"	=> ' ',		// THREE-PER-EM SPACE					2004	*
-			"\xe2\x80\x85"	=> ' ',		// FOUR-PER-EM SPACE					2005	*
-			"\xe2\x80\x86"	=> ' ',		// SIX-PER-EM SPACE						2006	*
-			"\xe2\x80\x87"	=> ' ',		// FIGURE SPACE							2007	*
-			"\xe2\x80\x88"	=> ' ',		// PUNCTUATION SPACE					2008	*
-			"\xe2\x80\x89"	=> ' ',		// THIN SPACE							2009	*
-			"\xe2\x80\x8a"	=> ' ',		// HAIR SPACE							200A	*
-			"\xE3\x80\x80"	=> ' ',		// IDEOGRAPHIC SPACE					3000	*
-		);
-	}
-
-	if (is_array($array))
-		return array_map('remove_bad_characters', $array);
-
-	// Strip out any invalid characters
-	$array = utf8_bad_strip($array);
-
-	// Remove control characters
-	$array = preg_replace('%[\x{00}-\x{08}\x{0b}-\x{0c}\x{0e}-\x{1f}]%', '', $array);
-
-	// Replace some "bad" characters
-	$array = str_replace(array_keys($bad_utf8_chars), array_values($bad_utf8_chars), $array);
-
-	return $array;
-}
-
-
-//
-// Converts the file size in bytes to a human readable file size
-//
-function file_size($size)
-{
-	global $lang_common;
-
-	$units = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB');
-
-	for ($i = 0; $size > 1024; $i++)
-		$size /= 1024;
-
-	return sprintf($lang_common['Size unit '.$units[$i]], round($size, 2));;
-}
-
-
-//
-// Fetch a list of available styles
-//
-function forum_list_styles()
-{
-	$styles = array();
-
-	$d = dir(PUN_ROOT.'style');
-	while (($entry = $d->read()) !== false)
-	{
-		if ($entry{0} == '.')
-			continue;
-
-		if (substr($entry, -4) == '.css')
-			$styles[] = substr($entry, 0, -4);
-	}
-	$d->close();
-
-	natcasesort($styles);
-
-	return $styles;
-}
-
-
-//
-// Fetch a list of available language packs
-//
-function forum_list_langs()
-{
-	$languages = array();
-
-	$d = dir(PUN_ROOT.'lang');
-	while (($entry = $d->read()) !== false)
-	{
-		if ($entry{0} == '.')
-			continue;
-
-		if (is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
-			$languages[] = $entry;
-	}
-	$d->close();
-
-	natcasesort($languages);
-
-	return $languages;
-}
-
-
-//
-// Generate a cache ID based on the last modification time for all stopwords files
-//
-function generate_stopwords_cache_id()
-{
-	$files = glob(PUN_ROOT.'lang/*/stopwords.txt');
-	if ($files === false)
-		return 'cache_id_error';
-
-	$hash = array();
-
-	foreach ($files as $file)
-	{
-		$hash[] = $file;
-		$hash[] = filemtime($file);
-	}
-
-	return sha1(implode('|', $hash));
-}
-
-
-//
-// Fetch a list of available admin plugins
-//
-function forum_list_plugins($is_admin)
-{
-	$plugins = array();
-
-	$d = dir(PUN_ROOT.'plugins');
-	while (($entry = $d->read()) !== false)
-	{
-		if ($entry{0} == '.')
-			continue;
-
-		$prefix = substr($entry, 0, strpos($entry, '_'));
-		$suffix = substr($entry, strlen($entry) - 4);
-
-		if ($suffix == '.php' && ((!$is_admin && $prefix == 'AMP') || ($is_admin && ($prefix == 'AP' || $prefix == 'AMP'))))
-			$plugins[$entry] = substr($entry, strpos($entry, '_') + 1, -4);
-	}
-	$d->close();
-
-	natcasesort($plugins);
-
-	return $plugins;
-}
-
-
-//
-// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
-//
-function split_text($text, $start, $end, &$errors, $retab = true)
-{
-	global $pun_config, $lang_common;
-
-	$result = array(0 => array(), 1 => array()); // 0 = inside, 1 = outside
-
-	// split the text into parts
-	$parts = preg_split('%'.preg_quote($start, '%').'(.*)'.preg_quote($end, '%').'%Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
-	$num_parts = count($parts);
-
-	// preg_split results in outside parts having even indices, inside parts having odd
-	for ($i = 0;$i < $num_parts;$i++)
-		$result[1 - ($i % 2)][] = $parts[$i];
-
-	if ($pun_config['o_indent_num_spaces'] != 8 && $retab)
-	{
-		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
-		$result[1] = str_replace("\t", $spaces, $result[1]);
-	}
-
-	return $result;
-}
-
-
-//
-// Extract blocks from a text with a starting and ending string
-// This function always matches the most outer block so nesting is possible
-//
-function extract_blocks($text, $start, $end, &$errors = array(), $retab = true)
-{
-	global $pun_config;
-
-	$code = array();
-	$start_len = strlen($start);
-	$end_len = strlen($end);
-	$regex = '%(?:'.preg_quote($start, '%').'|'.preg_quote($end, '%').')%';
-	$matches = array();
-
-	if (preg_match_all($regex, $text, $matches))
-	{
-		$counter = $offset = 0;
-		$start_pos = $end_pos = false;
-
-		foreach ($matches[0] as $match)
-		{
-			if ($match == $start)
-			{
-				if ($counter == 0)
-					$start_pos = strpos($text, $start);
-				$counter++;
-			}
-			elseif ($match == $end)
-			{
-				$counter--;
-				if ($counter == 0)
-					$end_pos = strpos($text, $end, $offset + 1);
-				$offset = strpos($text, $end, $offset + 1);
-			}
-
-			if ($start_pos !== false && $end_pos !== false)
-			{
-				$code[] = substr($text, $start_pos + $start_len,
-					$end_pos - $start_pos - $start_len);
-				$text = substr_replace($text, "\1", $start_pos,
-					$end_pos - $start_pos + $end_len);
-				$start_pos = $end_pos = false;
-				$offset = 0;
-			}
-		}
-	}
-
-	if ($pun_config['o_indent_num_spaces'] != 8 && $retab)
-	{
-		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
-		$text = str_replace("\t", $spaces, $text);
-	}
-
-	return array($code, $text);
-}
-
-
-//
-// function url_valid($url) {
-//
-// Return associative array of valid URI components, or FALSE if $url is not
-// RFC-3986 compliant. If the passed URL begins with: "www." or "ftp.", then
-// "http://" or "ftp://" is prepended and the corrected full-url is stored in
-// the return array with a key name "url". This value should be used by the caller.
-//
-// Return value: FALSE if $url is not valid, otherwise array of URI components:
-// e.g.
-// Given: "http://www.jmrware.com:80/articles?height=10&width=75#fragone"
-// Array(
-//	  [scheme] => http
-//	  [authority] => www.jmrware.com:80
-//	  [userinfo] =>
-//	  [host] => www.jmrware.com
-//	  [IP_literal] =>
-//	  [IPV6address] =>
-//	  [ls32] =>
-//	  [IPvFuture] =>
-//	  [IPv4address] =>
-//	  [regname] => www.jmrware.com
-//	  [port] => 80
-//	  [path_abempty] => /articles
-//	  [query] => height=10&width=75
-//	  [fragment] => fragone
-//	  [url] => http://www.jmrware.com:80/articles?height=10&width=75#fragone
-// )
-function url_valid($url)
-{
-	if (strpos($url, 'www.') === 0) $url = 'http://'. $url;
-	if (strpos($url, 'ftp.') === 0) $url = 'ftp://'. $url;
-	if (!preg_match('/# Valid absolute URI having a non-empty, valid DNS host.
-		^
-		(?P<scheme>[A-Za-z][A-Za-z0-9+\-.]*):\/\/
-		(?P<authority>
-		  (?:(?P<userinfo>(?:[A-Za-z0-9\-._~!$&\'()*+,;=:]|%[0-9A-Fa-f]{2})*)@)?
-		  (?P<host>
-			(?P<IP_literal>
-			  \[
-			  (?:
-				(?P<IPV6address>
-				  (?:												 (?:[0-9A-Fa-f]{1,4}:){6}
-				  |												   ::(?:[0-9A-Fa-f]{1,4}:){5}
-				  | (?:							 [0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}
-				  | (?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}
-				  | (?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}
-				  | (?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::	[0-9A-Fa-f]{1,4}:
-				  | (?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::
-				  )
-				  (?P<ls32>[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}
-				  | (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}
-					   (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
-				  )
-				|	(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::	[0-9A-Fa-f]{1,4}
-				|	(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::
-				)
-			  | (?P<IPvFuture>[Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&\'()*+,;=:]+)
-			  )
-			  \]
-			)
-		  | (?P<IPv4address>(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}
-							   (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))
-		  | (?P<regname>(?:[A-Za-z0-9\-._~!$&\'()*+,;=]|%[0-9A-Fa-f]{2})+)
-		  )
-		  (?::(?P<port>[0-9]*))?
-		)
-		(?P<path_abempty>(?:\/(?:[A-Za-z0-9\-._~!$&\'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)
-		(?:\?(?P<query>		  (?:[A-Za-z0-9\-._~!$&\'()*+,;=:@\\/?]|%[0-9A-Fa-f]{2})*))?
-		(?:\#(?P<fragment>	  (?:[A-Za-z0-9\-._~!$&\'()*+,;=:@\\/?]|%[0-9A-Fa-f]{2})*))?
-		$
-		/mx', $url, $m)) return FALSE;
-	switch ($m['scheme'])
-	{
-	case 'https':
-	case 'http':
-		if ($m['userinfo']) return FALSE; // HTTP scheme does not allow userinfo.
-		break;
-	case 'ftps':
-	case 'ftp':
-		break;
-	default:
-		return FALSE;	// Unrecognised URI scheme. Default to FALSE.
-	}
-	// Validate host name conforms to DNS "dot-separated-parts".
-	if ($m{'regname'}) // If host regname specified, check for DNS conformance.
-	{
-		if (!preg_match('/# HTTP DNS host name.
-			^					   # Anchor to beginning of string.
-			(?!.{256})			   # Overall host length is less than 256 chars.
-			(?:					   # Group dot separated host part alternatives.
-			  [0-9A-Za-z]\.		   # Either a single alphanum followed by dot
-			|					   # or... part has more than one char (63 chars max).
-			  [0-9A-Za-z]		   # Part first char is alphanum (no dash).
-			  [\-0-9A-Za-z]{0,61}  # Internal chars are alphanum plus dash.
-			  [0-9A-Za-z]		   # Part last char is alphanum (no dash).
-			  \.				   # Each part followed by literal dot.
-			)*					   # One or more parts before top level domain.
-			(?:					   # Explicitly specify top level domains.
-			  com|edu|gov|int|mil|net|org|biz|
-			  info|name|pro|aero|coop|museum|
-			  asia|cat|jobs|mobi|tel|travel|
-			  [A-Za-z]{2})		   # Country codes are exqactly two alpha chars.
-			$					   # Anchor to end of string.
-			/ix', $m['host'])) return FALSE;
-	}
-	$m['url'] = $url;
-	for ($i = 0; isset($m[$i]); ++$i) unset($m[$i]);
-	return $m; // return TRUE == array of useful named $matches plus the valid $url.
-}
-
-//
-// Replace string matching regular expression
-//
-// This function takes care of possibly disabled unicode properties in PCRE builds
-//
-function ucp_preg_replace($pattern, $replace, $subject)
-{
-	$replaced = preg_replace($pattern, $replace, $subject);
-
-	// If preg_replace() returns false, this probably means unicode support is not built-in, so we need to modify the pattern a little
-	if ($replaced === false)
-	{
-		if (is_array($pattern))
-		{
-			foreach ($pattern as $cur_key => $cur_pattern)
-				$pattern[$cur_key] = str_replace('\p{L}\p{N}', '\w', $cur_pattern);
-
-			$replaced = preg_replace($pattern, $replace, $subject);
-		}
-		else
-			$replaced = preg_replace(str_replace('\p{L}\p{N}', '\w', $pattern), $replace, $subject);
-	}
-
-	return $replaced;
 }
 
@@ -1994,6 +994,6 @@
 			<thead>
 				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_common['Query times'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_common['Query'] ?></th>
+					<th class="tcl" scope="col">Temps (s)</th>
+					<th class="tcr" scope="col">RequÃªte</th>
 				</tr>
 			</thead>
@@ -2002,5 +1002,5 @@
 
 	$query_time_total = 0.0;
-	foreach ($saved_queries as $cur_query)
+	while (list(, $cur_query) = @each($saved_queries))
 	{
 		$query_time_total += $cur_query[1];
@@ -2017,5 +1017,5 @@
 ?>
 				<tr>
-					<td class="tcl" colspan="2"><?php printf($lang_common['Total query time'], $query_time_total.' s') ?></td>
+					<td class="tcl" colspan="2">Temps total requÃªte : <?php echo $query_time_total ?> s</td>
 				</tr>
 			</tbody>
@@ -2030,4 +1030,26 @@
 
 //
+// Unset any variables instantiated as a result of register_globals being enabled
+//
+function unregister_globals()
+{
+	// Prevent script.php?GLOBALS[foo]=bar
+	if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
+		exit('I\'ll have a steak sandwich and... a steak sandwich.');
+	
+	// Variables that shouldn't be unset
+	$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
+	
+	// Remove elements in $GLOBALS that are present in any of the superglobals
+	$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
+	foreach ($input as $k => $v)
+	{
+		if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
+			unset($GLOBALS[$k]);
+	}
+}
+
+
+//
 // Dump contents of variable(s)
 //
Index: unk/web/punbb/include/index.html
===================================================================
--- /trunk/web/punbb/include/index.html	(revision 10)
+++ 	(revision )
@@ -1,1 +1,0 @@
-<html><head><title>.</title></head><body>.</body></html>
Index: /trunk/web/punbb/include/parser.php
===================================================================
--- /trunk/web/punbb/include/parser.php	(revision 10)
+++ /trunk/web/punbb/include/parser.php	(revision 1)
@@ -1,9 +1,25 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
 
 // Make sure no one attempts to run this script "directly"
@@ -11,52 +27,14 @@
 	exit;
 
-// Global variables
-/* regular expression to match nested BBCode LIST tags
-'%
-\[list                # match opening bracket and tag name of outermost LIST tag
-(?:=([1a*]))?+        # optional attribute capture in group 1
-\]                    # closing bracket of outermost opening LIST tag
-(                     # capture contents of LIST tag in group 2
-  (?:                 # non capture group for either contents or whole nested LIST
-	[^\[]*+           # unroll the loop! consume everything up to next [ (normal *)
-	(?:               # (See "Mastering Regular Expressions" chapter 6 for details)
-	  (?!             # negative lookahead ensures we are NOT on [LIST*] or [/LIST]
-		\[list        # opening LIST tag
-		(?:=[1a*])?+  # with optional attribute
-		\]            # closing bracket of opening LIST tag
-		|             # or...
-		\[/list\]     # a closing LIST tag
-	  )               # end negative lookahead assertion (we are not on a LIST tag)
-	  \[              # match the [ which is NOT the start of LIST tag (special)
-	  [^\[]*+         # consume everything up to next [ (normal *)
-	)*+               # finish up "unrolling the loop" technique (special (normal*))*
-  |                   # or...
-	(?R)              # recursively match a whole nested LIST element
-  )*                  # as many times as necessary until deepest nested LIST tag grabbed
-)                     # end capturing contents of LIST tag into group 2
-\[/list\]             # match outermost closing LIST tag
-%iex' */
-$re_list = '%\[list(?:=([1a*]))?+\]((?:[^\[]*+(?:(?!\[list(?:=[1a*])?+\]|\[/list\])\[[^\[]*+)*+|(?R))*)\[/list\]%ie';
-
-// Here you can add additional smilies if you like (please note that you must escape single quote and backslash)
-$smilies = array(
-	':)' => 'smile.png',
-	'=)' => 'smile.png',
-	':|' => 'neutral.png',
-	'=|' => 'neutral.png',
-	':(' => 'sad.png',
-	'=(' => 'sad.png',
-	':D' => 'big_smile.png',
-	'=D' => 'big_smile.png',
-	':o' => 'yikes.png',
-	':O' => 'yikes.png',
-	';)' => 'wink.png',
-	':/' => 'hmm.png',
-	':P' => 'tongue.png',
-	':p' => 'tongue.png',
-	':lol:' => 'lol.png',
-	':mad:' => 'mad.png',
-	':rolleyes:' => 'roll.png',
-	':cool:' => 'cool.png');
+
+// Load cache smiley
+@include_once PUN_ROOT.'cache/cache_smilies.php';
+if (!defined('PUN_CACHE_SMILEY'))
+{
+	require_once PUN_ROOT.'include/cache_smilies.php';
+	generate_smiley_cache();
+	require PUN_ROOT.'cache/cache_smilies.php';
+}
+
 
 //
@@ -65,800 +43,384 @@
 function preparse_bbcode($text, &$errors, $is_signature = false)
 {
-	global $pun_config, $lang_common, $lang_post, $re_list;
-
-	if ($is_signature)
-	{
-		global $lang_profile;
-
-		if (preg_match('%\[/?(?:quote|code|list|h)\b[^\]]*\]%i', $text))
-			$errors[] = $lang_profile['Signature quote/code/list/h'];
-	}
+	// Change all simple BBCodes to lower case
+	$a = array('[B]', '[I]', '[U]', '[/B]', '[/I]', '[/U]');
+	$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
+	$text = str_replace($a, $b, $text);
+
+	// Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
+	$a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[url\]\s*#i',
+				'#\s*\[/url\]#i',
+				'#\[email=("|\'|)(.*?)\\1\]\s*#i',
+				'#\[email\]\s*#i',
+				'#\s*\[/email\]#i',
+				'#\[img\]\s*(.*?)\s*\[/img\]#is',
+				'#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
+
+	$b = array(	'[url=$2]',
+				'[url]',
+				'[/url]',
+				'[email=$2]',
+				'[email]',
+				'[/email]',
+				'[img]$1[/img]',
+				'[color=$2]$3[/color]');
+
+	if (!$is_signature)
+	{
+		// For non-signatures, we have to do the quote and code tags as well
+		$a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
+		$a[] = '#\[quote\]\s*#i';
+		$a[] = '#\s*\[/quote\]\s*#i';
+		$a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
+
+		$b[] = '[quote=$1$2$1]';
+		$b[] = '[quote]';
+		$b[] = '[/quote]'."\n";
+		$b[] = '[code]$1[/code]'."\n";
+	}
+
+	// Run this baby!
+	$text = preg_replace($a, $b, $text);
+
+	if (!$is_signature)
+	{
+		$overflow = check_tag_order($text, $error);
+
+		if ($error)
+			// A BBCode error was spotted in check_tag_order()
+			$errors[] = $error;
+		else if ($overflow)
+			// The quote depth level was too high, so we strip out the inner most quote(s)
+			$text = substr($text, 0, $overflow[0]).substr($text, $overflow[1], (strlen($text) - $overflow[0]));
+	}
+	else
+	{
+		global $lang_prof_reg;
+
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
+			message($lang_prof_reg['Signature quote/code']);
+	}
+
+	return trim($text);
+}
+
+
+//
+// Parse text and make sure that [code] and [quote] syntax is correct
+//
+function check_tag_order($text, &$error)
+{
+	global $lang_common;
+
+	// The maximum allowed quote depth
+	$max_depth = 3;
+
+	$cur_index = 0;
+	$q_depth = 0;
+
+	while (true)
+	{
+		// Look for regular code and quote tags
+		$c_start = strpos($text, '[code]');
+		$c_end = strpos($text, '[/code]');
+		$q_start = strpos($text, '[quote]');
+		$q_end = strpos($text, '[/quote]');
+
+		// Look for [quote=username] style quote tags
+		if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]#sU', $text, $matches))
+			$q2_start = strpos($text, $matches[0]);
+		else
+			$q2_start = 65536;
+
+		// Deal with strpos() returning false when the string is not found
+		// (65536 is one byte longer than the maximum post length)
+		if ($c_start === false) $c_start = 65536;
+		if ($c_end === false) $c_end = 65536;
+		if ($q_start === false) $q_start = 65536;
+		if ($q_end === false) $q_end = 65536;
+
+		// If none of the strings were found
+		if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536)
+			break;
+
+		// We are interested in the first quote (regardless of the type of quote)
+		$q3_start = ($q_start < $q2_start) ? $q_start : $q2_start;
+
+		// We found a [quote] or a [quote=username]
+		if ($q3_start < min($q_end, $c_start, $c_end))
+		{
+			$step = ($q_start < $q2_start) ? 7 : strlen($matches[0]);
+
+			$cur_index += $q3_start + $step;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_begin = $cur_index - $step;
+
+			++$q_depth;
+			$text = substr($text, $q3_start + $step);
+		}
+
+		// We found a [/quote]
+		else if ($q_end < min($q_start, $c_start, $c_end))
+		{
+			if ($q_depth == 0)
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 1'];
+				return;
+			}
+
+			$q_depth--;
+			$cur_index += $q_end+8;
+
+			// Did we reach $max_depth?
+			if ($q_depth == $max_depth)
+				$overflow_end = $cur_index;
+
+			$text = substr($text, $q_end+8);
+		}
+
+		// We found a [code]
+		else if ($c_start < min($c_end, $q_start, $q_end))
+		{
+			// Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
+			$tmp = strpos($text, '[/code]');
+			$tmp2 = strpos(substr($text, $c_start+6), '[code]');
+			if ($tmp2 !== false)
+				$tmp2 += $c_start+6;
+				
+			if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
+			{
+				$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
+				return;
+			}
+			else
+				$text = substr($text, $tmp+7);
+
+			$cur_index += $tmp+7;
+		}
+
+		// We found a [/code] (this shouldn't happen since we handle both start and end tag in the if clause above)
+		else if ($c_end < min($c_start, $q_start, $q_end))
+		{
+			$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 3'];
+			return;
+		}
+	}
+
+	// If $q_depth <> 0 something is wrong with the quote syntax
+	if ($q_depth)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 4'];
+		return;
+	}
+	else if ($q_depth < 0)
+	{
+		$error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 5'];
+		return;
+	}
+
+	// If the quote depth level was higher than $max_depth we return the index for the
+	// beginning and end of the part we should strip out
+	if (isset($overflow_begin))
+		return array($overflow_begin, $overflow_end);
+	else
+		return null;
+}
+
+
+//
+// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
+//
+function split_text($text, $start, $end)
+{
+	global $pun_config;
+
+	$tokens = explode($start, $text);
+
+	$outside[] = $tokens[0];
+
+	$num_tokens = count($tokens);
+	for ($i = 1; $i < $num_tokens; ++$i)
+	{
+		$temp = explode($end, $tokens[$i]);
+		$inside[] = $temp[0];
+		$outside[] = $temp[1];
+	}
+
+	if ($pun_config['o_indent_num_spaces'] != 8 && $start == '[code]')
+	{
+		$spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
+		$inside = str_replace("\t", $spaces, $inside);
+	}
+
+	return array($inside, $outside);
+}
+
+
+//
+// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
+//
+function handle_url_tag($url, $link = '')
+{
+	global $pun_user;
+
+	$full_url = str_replace(array(' ', '\'', '`'), array('%20', '', ''), $url);
+	if (strpos($url, 'www.') === 0)			// If it starts with www, we add http://
+		$full_url = 'http://'.$full_url;
+	else if (strpos($url, 'ftp.') === 0)	// Else if it starts with ftp, we add ftp://
+		$full_url = 'ftp://'.$full_url;
+	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah)) 	// Else if it doesn't start with abcdef://, we add http://
+		$full_url = 'http://'.$full_url;
+
+	// Ok, not very pretty :-)
+	$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);
+
+	return '<a href="'.$full_url.'" target=\"_blank\">'.$link.'</a>';
+}
+
+
+//
+// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
+//
+function handle_img_tag($url, $is_signature = false)
+{
+	global $lang_common, $pun_config, $pun_user;
+
+	$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';
+
+	if ($is_signature && $pun_user['show_img_sig'] != '0')
+		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+	else if (!$is_signature && $pun_user['show_img'] != '0')
+		$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
+
+	return $img_tag;
+}
+
+
+//
+// Convert BBCodes to their HTML equivalent
+//
+function do_bbcode($text)
+{
+	global $lang_common, $pun_user;
+
+	if (strpos($text, 'quote') !== false)
+	{
+		$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
+		$text = preg_replace('#\[quote=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
+		$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
+	}
+	
+	$pattern = array('#\[b\](.*?)\[/b\]#s',
+					 '#\[i\](.*?)\[/i\]#s',
+					 '#\[u\](.*?)\[/u\]#s',
+					 '#\[url\]([^\[]*?)\[/url\]#e',
+					 '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
+					 '#\[email\]([^\[]*?)\[/email\]#',
+					 '#\[email=([^\[]*?)\](.*?)\[/email\]#',
+					 '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
+					 '#\[font=(.*?)](.*?)\[/font\]#s',
+					 '#\[align=(.*?)\](.*?)\[/align\]#s',
+					 '#\[hr /\]#',
+					 '#\[hr\]#',
+					 '#\[s\](.*?)\[/s\]#s',
+					 '#\[h\](.*?)\[/h\]#s',
+                               '#\[size=([0-9]{1,2})](.*?)\[/size\]#s');
+
+	$replace = array('<strong>$1</strong>',
+					 '<em>$1</em>',
+					 '<span class="bbu">$1</span>',
+					 'handle_url_tag(\'$1\')',
+					 'handle_url_tag(\'$1\', \'$2\')',
+					 '<a href="mailto:$1">$1</a>',
+					 '<a href="mailto:$1">$2</a>',
+					 '<span style="color: $1">$2</span>',
+					 '<span style="font-family: $1">$2</span>',
+					 '<div align="$1">$2</div>',
+					 '<hr />',
+					 '<hr />',
+					 '<del>$1</del>',
+					 '<span style="background-color: #FFFF00; color: #000000">$1</span>',
+                               '<span style="font-size: $1pt;">$2</span>');
+
+	// This thing takes a while! :)
+	$text = preg_replace($pattern, $replace, $text);
+
+	return $text;
+}
+
+
+//
+// Make hyperlinks clickable
+//
+function do_clickable($text)
+{
+	global $pun_user;
+
+	$text = ' '.$text;
+
+	$text = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2://$3\')', $text);
+	$text = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2.$3\', \'$2.$3\')', $text);
+
+	return substr($text, 1);
+}
+
+
+//
+// Convert a series of smilies to images
+//
+function do_smilies($text)
+{
+	global $smiley_text, $smiley_img;
+
+	$text = ' '.$text.' ';
+
+	$num_smilies = count($smiley_text);
+	for ($i = 0; $i < $num_smilies; ++$i)
+		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="'.PUN_ROOT.'img/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
+
+	return substr($text, 1, -1);
+}
+
+
+//
+// Parse message text
+//
+function parse_message($text, $hide_smilies)
+{
+	global $pun_config, $lang_common, $pun_user;
+
+	if ($pun_config['o_censoring'] == '1')
+		$text = censor_words($text);
+
+	// Convert applicable characters to HTML entities
+	$text = pun_htmlspecialchars($text);
 
 	// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
 	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
-		list($inside, $text) = extract_blocks($text, '[code]', '[/code]', $errors);
-
-	// Tidy up lists
-	$temp = preg_replace($re_list, 'preparse_list_tag(\'$2\', \'$1\', $errors)', $text);
-
-	// If the regex failed
-	if ($temp === null)
-		$errors[] = $lang_common['BBCode list size error'];
-	else
-		$text = str_replace('*'."\0".']', '*]', $temp);
+	{
+		list($inside, $outside) = split_text($text, '[code]', '[/code]');
+		$outside = array_map('ltrim', $outside);
+		$text = implode('<">', $outside);
+	}
 
 	if ($pun_config['o_make_links'] == '1')
 		$text = do_clickable($text);
 
-	// If we split up the message before we have to concatenate it together again (code tags)
-	if (isset($inside))
-	{
-		$outside = explode("\1", $text);
-		$text = '';
-
-		$num_tokens = count($outside);
-		for ($i = 0; $i < $num_tokens; ++$i)
-		{
-			$text .= $outside[$i];
-			if (isset($inside[$i]))
-				$text .= '[code]'.$inside[$i].'[/code]';
-		}
-
-		unset($inside);
-	}
-
-	$temp_text = false;
-	if (empty($errors))
-		$temp_text = preparse_tags($text, $errors, $is_signature);
-
-	if ($temp_text !== false)
-		$text = $temp_text;
-
-	// Remove empty tags
-	while (($new_text = strip_empty_bbcode($text, $errors)) !== false)
-	{
-		if ($new_text != $text)
-		{
-			$text = $new_text;
-			if ($new_text == '')
-			{
-				$errors[] = $lang_post['Empty after strip'];
-				break;
-			}
-		}
-		else
-			break;
-	}
-
-	return pun_trim($text);
-}
-
-
-//
-// Strip empty bbcode tags from some text
-//
-function strip_empty_bbcode($text, &$errors)
-{
-	// If the message contains a code tag we have to split it up (empty tags within [code][/code] are fine)
-	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
-		list($inside, $text) = extract_blocks($text, '[code]', '[/code]', $errors);
-
-	// Remove empty tags
-	while (($new_text = preg_replace('%\[(b|u|s|ins|del|em|i|h|colou?r|quote|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]\s*\[/\1\]%', '', $text)) !== NULL)
-	{
-		if ($new_text != $text)
-			$text = $new_text;
-		else
-			break;
-	}
-
-	// If we split up the message before we have to concatenate it together again (code tags)
-    if (isset($inside)) {
-        $parts = explode("\1", $text);
-        $text = '';
-        foreach ($parts as $i => $part)
-        {
-            $text .= $part;
-            if (isset($inside[$i]))
-                $text .= '[code]'.$inside[$i].'[/code]';
-        }
-    }
-
-	// Remove empty code tags
-	while (($new_text = preg_replace('%\[(code)\]\s*\[/\1\]%', '', $text)) !== NULL)
-	{
-		if ($new_text != $text)
-			$text = $new_text;
-		else
-			break;
-	}
-
-	return $text;
-}
-
-
-//
-// Check the structure of bbcode tags and fix simple mistakes where possible
-//
-function preparse_tags($text, &$errors, $is_signature = false)
-{
-	global $lang_common, $pun_config;
-
-	// Start off by making some arrays of bbcode tags and what we need to do with each one
-
-	// List of all the tags
-	$tags = array('quote', 'code', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'img', 'list', '*', 'h', 'topic', 'post', 'forum', 'user');
-	// List of tags that we need to check are open (You could not put b,i,u in here then illegal nesting like [b][i][/b][/i] would be allowed)
-	$tags_opened = $tags;
-	// and tags we need to check are closed (the same as above, added it just in case)
-	$tags_closed = $tags;
-	// Tags we can nest and the depth they can be nested to
-	$tags_nested = array('quote' => $pun_config['o_quote_depth'], 'list' => 5, '*' => 5);
-	// Tags to ignore the contents of completely (just code)
-	$tags_ignore = array('code');
-	// Block tags, block tags can only go within another block tag, they cannot be in a normal tag
-	$tags_block = array('quote', 'code', 'list', 'h', '*');
-	// Inline tags, we do not allow new lines in these
-	$tags_inline = array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'h', 'topic', 'post', 'forum', 'user');
-	// Tags we trim interior space
-	$tags_trim = array('img');
-	// Tags we remove quotes from the argument
-	$tags_quotes = array('url', 'email', 'img', 'topic', 'post', 'forum', 'user');
-	// Tags we limit bbcode in
-	$tags_limit_bbcode = array(
-		'*' 	=> array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'list', 'img', 'code', 'topic', 'post', 'forum', 'user'),
-		'list' 	=> array('*'),
-		'url' 	=> array('img'),
-		'email' => array('img'),
-		'topic' => array('img'),
-		'post'  => array('img'),
-		'forum' => array('img'),
-		'user'  => array('img'),
-		'img' 	=> array(),
-		'h'		=> array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'topic', 'post', 'forum', 'user'),
-	);
-	// Tags we can automatically fix bad nesting
-	$tags_fix = array('quote', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'h', 'topic', 'post', 'forum', 'user');
-
-	$split_text = preg_split('%(\[[\*a-zA-Z0-9-/]*?(?:=.*?)?\])%', $text, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
-
-	$open_tags = array('fluxbb-bbcode');
-	$open_args = array('');
-	$opened_tag = 0;
-	$new_text = '';
-	$current_ignore = '';
-	$current_nest = '';
-	$current_depth = array();
-	$limit_bbcode = $tags;
-	$count_ignored = array();
-
-	foreach ($split_text as $current)
-	{
-		if ($current == '')
-			continue;
-
-		// Are we dealing with a tag?
-		if (substr($current, 0, 1) != '[' || substr($current, -1, 1) != ']')
-		{
-			// It's not a bbcode tag so we put it on the end and continue
-			// If we are nested too deeply don't add to the end
-			if ($current_nest)
-				continue;
-
-			$current = str_replace("\r\n", "\n", $current);
-			$current = str_replace("\r", "\n", $current);
-			if (in_array($open_tags[$opened_tag], $tags_inline) && strpos($current, "\n") !== false)
-			{
-				// Deal with new lines
-				$split_current = preg_split('%(\n\n+)%', $current, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
-				$current = '';
-
-				if (!pun_trim($split_current[0], "\n")) // The first part is a linebreak so we need to handle any open tags first
-					array_unshift($split_current, '');
-
-				for ($i = 1; $i < count($split_current); $i += 2)
-				{
-					$temp_opened = array();
-					$temp_opened_arg = array();
-					$temp = $split_current[$i - 1];
-					while (!empty($open_tags))
-					{
-						$temp_tag = array_pop($open_tags);
-						$temp_arg = array_pop($open_args);
-
-						if (in_array($temp_tag , $tags_inline))
-						{
-							array_push($temp_opened, $temp_tag);
-							array_push($temp_opened_arg, $temp_arg);
-							$temp .= '[/'.$temp_tag.']';
-						}
-						else
-						{
-							array_push($open_tags, $temp_tag);
-							array_push($open_args, $temp_arg);
-							break;
-						}
-					}
-					$current .= $temp.$split_current[$i];
-					$temp = '';
-					while (!empty($temp_opened))
-					{
-						$temp_tag = array_pop($temp_opened);
-						$temp_arg = array_pop($temp_opened_arg);
-						if (empty($temp_arg))
-							$temp .= '['.$temp_tag.']';
-						else
-							$temp .= '['.$temp_tag.'='.$temp_arg.']';
-						array_push($open_tags, $temp_tag);
-						array_push($open_args, $temp_arg);
-					}
-					$current .= $temp;
-				}
-
-				if (array_key_exists($i - 1, $split_current))
-					$current .= $split_current[$i - 1];
-			}
-
-			if (in_array($open_tags[$opened_tag], $tags_trim))
-				$new_text .= pun_trim($current);
-			else
-				$new_text .= $current;
-
-			continue;
-		}
-
-		// Get the name of the tag
-		$current_arg = '';
-		if (strpos($current, '/') === 1)
-		{
-			$current_tag = substr($current, 2, -1);
-		}
-		else if (strpos($current, '=') === false)
-		{
-			$current_tag = substr($current, 1, -1);
-		}
-		else
-		{
-			$current_tag = substr($current, 1, strpos($current, '=')-1);
-			$current_arg = substr($current, strpos($current, '=')+1, -1);
-		}
-		$current_tag = strtolower($current_tag);
-
-		// Is the tag defined?
-		if (!in_array($current_tag, $tags))
-		{
-			// It's not a bbcode tag so we put it on the end and continue
-			if (!$current_nest)
-				$new_text .= $current;
-
-			continue;
-		}
-
-		// We definitely have a bbcode tag
-
-		// Make the tag string lower case
-		if ($equalpos = strpos($current,'='))
-		{
-			// We have an argument for the tag which we don't want to make lowercase
-			if (strlen(substr($current, $equalpos)) == 2)
-			{
-				// Empty tag argument
-				$errors[] = sprintf($lang_common['BBCode error empty attribute'], $current_tag);
-				return false;
-			}
-			$current = strtolower(substr($current, 0, $equalpos)).substr($current, $equalpos);
-		}
-		else
-			$current = strtolower($current);
-
-		// This is if we are currently in a tag which escapes other bbcode such as code
-		// We keep a cound of ignored bbcodes (code tags) so we can nest them, but
-		// only balanced sets of tags can be nested
-		if ($current_ignore)
-		{
-			// Increase the current ignored tags counter
-			if ('['.$current_ignore.']' == $current)
-			{
-				if (!isset($count_ignored[$current_tag]))
-					$count_ignored[$current_tag] = 2;
-				else
-					$count_ignored[$current_tag]++;
-			}
-
-			// Decrease the current ignored tags counter
-			if ('[/'.$current_ignore.']' == $current)
-				$count_ignored[$current_tag]--;
-
-			if ('[/'.$current_ignore.']' == $current && $count_ignored[$current_tag] == 0)
-			{
-				// We've finished the ignored section
-				$current = '[/'.$current_tag.']';
-				$current_ignore = '';
-				$count_ignored = array();
-			}
-
-			$new_text .= $current;
-
-			continue;
-		}
-
-		if ($current_nest)
-		{
-			// We are currently too deeply nested so lets see if we are closing the tag or not
-			if ($current_tag != $current_nest)
-				continue;
-
-			if (substr($current, 1, 1) == '/')
-				$current_depth[$current_nest]--;
-			else
-				$current_depth[$current_nest]++;
-
-			if ($current_depth[$current_nest] <= $tags_nested[$current_nest])
-				$current_nest = '';
-
-			continue;
-		}
-
-		// Check the current tag is allowed here
-		if (!in_array($current_tag, $limit_bbcode) && $current_tag != $open_tags[$opened_tag])
-		{
-			$errors[] = sprintf($lang_common['BBCode error invalid nesting'], $current_tag, $open_tags[$opened_tag]);
-			return false;
-		}
-
-		if (substr($current, 1, 1) == '/')
-		{
-			// This is if we are closing a tag
-			if ($opened_tag == 0 || !in_array($current_tag, $open_tags))
-			{
-				// We tried to close a tag which is not open
-				if (in_array($current_tag, $tags_opened))
-				{
-					$errors[] = sprintf($lang_common['BBCode error no opening tag'], $current_tag);
-					return false;
-				}
-			}
-			else
-			{
-				// Check nesting
-				while (true)
-				{
-					// Nesting is ok
-					if ($open_tags[$opened_tag] == $current_tag)
-					{
-						array_pop($open_tags);
-						array_pop($open_args);
-						$opened_tag--;
-						break;
-					}
-
-					// Nesting isn't ok, try to fix it
-					if (in_array($open_tags[$opened_tag], $tags_closed) && in_array($current_tag, $tags_closed))
-					{
-						if (in_array($current_tag, $open_tags))
-						{
-							$temp_opened = array();
-							$temp_opened_arg = array();
-							$temp = '';
-							while (!empty($open_tags))
-							{
-								$temp_tag = array_pop($open_tags);
-								$temp_arg = array_pop($open_args);
-
-								if (!in_array($temp_tag, $tags_fix))
-								{
-									// We couldn't fix nesting
-									$errors[] = sprintf($lang_common['BBCode error no closing tag'], array_pop($temp_opened));
-									return false;
-								}
-								array_push($temp_opened, $temp_tag);
-								array_push($temp_opened_arg, $temp_arg);
-
-								if ($temp_tag == $current_tag)
-									break;
-								else
-									$temp .= '[/'.$temp_tag.']';
-							}
-							$current = $temp.$current;
-							$temp = '';
-							array_pop($temp_opened);
-							array_pop($temp_opened_arg);
-
-							while (!empty($temp_opened))
-							{
-								$temp_tag = array_pop($temp_opened);
-								$temp_arg = array_pop($temp_opened_arg);
-								if (empty($temp_arg))
-									$temp .= '['.$temp_tag.']';
-								else
-									$temp .= '['.$temp_tag.'='.$temp_arg.']';
-								array_push($open_tags, $temp_tag);
-								array_push($open_args, $temp_arg);
-							}
-							$current .= $temp;
-							$opened_tag--;
-							break;
-						}
-						else
-						{
-							// We couldn't fix nesting
-							$errors[] = sprintf($lang_common['BBCode error no opening tag'], $current_tag);
-							return false;
-						}
-					}
-					else if (in_array($open_tags[$opened_tag], $tags_closed))
-						break;
-					else
-					{
-						array_pop($open_tags);
-						array_pop($open_args);
-						$opened_tag--;
-					}
-				}
-			}
-
-			if (in_array($current_tag, array_keys($tags_nested)))
-			{
-				if (isset($current_depth[$current_tag]))
-					$current_depth[$current_tag]--;
-			}
-
-			if (in_array($open_tags[$opened_tag], array_keys($tags_limit_bbcode)))
-				$limit_bbcode = $tags_limit_bbcode[$open_tags[$opened_tag]];
-			else
-				$limit_bbcode = $tags;
-
-			$new_text .= $current;
-
-			continue;
-		}
-		else
-		{
-			// We are opening a tag
-			if (in_array($current_tag, array_keys($tags_limit_bbcode)))
-				$limit_bbcode = $tags_limit_bbcode[$current_tag];
-			else
-				$limit_bbcode = $tags;
-
-			if (in_array($current_tag, $tags_block) && !in_array($open_tags[$opened_tag], $tags_block) && $opened_tag != 0)
-			{
-				// We tried to open a block tag within a non-block tag
-				$errors[] = sprintf($lang_common['BBCode error invalid nesting'], $current_tag, $open_tags[$opened_tag]);
-				return false;
-			}
-
-			if (in_array($current_tag, $tags_ignore))
-			{
-				// It's an ignore tag so we don't need to worry about what's inside it
-				$current_ignore = $current_tag;
-				$new_text .= $current;
-				continue;
-			}
-
-			// Deal with nested tags
-			if (in_array($current_tag, $open_tags) && !in_array($current_tag, array_keys($tags_nested)))
-			{
-				// We nested a tag we shouldn't
-				$errors[] = sprintf($lang_common['BBCode error invalid self-nesting'], $current_tag);
-				return false;
-			}
-			else if (in_array($current_tag, array_keys($tags_nested)))
-			{
-				// We are allowed to nest this tag
-
-				if (isset($current_depth[$current_tag]))
-					$current_depth[$current_tag]++;
-				else
-					$current_depth[$current_tag] = 1;
-
-				// See if we are nested too deep
-				if ($current_depth[$current_tag] > $tags_nested[$current_tag])
-				{
-					$current_nest = $current_tag;
-					continue;
-				}
-			}
-
-			// Remove quotes from arguments for certain tags
-			if (strpos($current, '=') !== false && in_array($current_tag, $tags_quotes))
-			{
-				$current = preg_replace('%\['.$current_tag.'=("|\'|)(.*?)\\1\]\s*%i', '['.$current_tag.'=$2]', $current);
-			}
-
-			if (in_array($current_tag, array_keys($tags_limit_bbcode)))
-				$limit_bbcode = $tags_limit_bbcode[$current_tag];
-
-			$open_tags[] = $current_tag;
-			$open_args[] = $current_arg;
-			$opened_tag++;
-			$new_text .= $current;
-			continue;
-		}
-	}
-
-	// Check we closed all the tags we needed to
-	foreach ($tags_closed as $check)
-	{
-		if (in_array($check, $open_tags))
-		{
-			// We left an important tag open
-			$errors[] = sprintf($lang_common['BBCode error no closing tag'], $check);
-			return false;
-		}
-	}
-
-	if ($current_ignore)
-	{
-		// We left an ignore tag open
-		$errors[] = sprintf($lang_common['BBCode error no closing tag'], $current_ignore);
-		return false;
-	}
-
-	return $new_text;
-}
-
-
-//
-// Preparse the contents of [list] bbcode
-//
-function preparse_list_tag($content, $type = '*', &$errors)
-{
-	global $lang_common, $re_list;
-
-	if (strlen($type) != 1)
-		$type = '*';
-
-	if (strpos($content,'[list') !== false)
-	{
-		$content = preg_replace($re_list, 'preparse_list_tag(\'$2\', \'$1\', $errors)', $content);
-	}
-
-	$items = explode('[*]', str_replace('\"', '"', $content));
-
-	$content = '';
-	foreach ($items as $item)
-	{
-		if (pun_trim($item) != '')
-			$content .= '[*'."\0".']'.str_replace('[/*]', '', pun_trim($item)).'[/*'."\0".']'."\n";
-	}
-
-	return '[list='.$type.']'."\n".$content.'[/list]';
-}
-
-
-//
-// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
-//
-function handle_url_tag($url, $link = '', $bbcode = false)
-{
-	$url = pun_trim($url);
-	$full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
-	if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
-		$full_url = 'http://'.$full_url;
-	else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp://
-		$full_url = 'ftp://'.$full_url;
-	else if (strpos($url, '/') === 0) // Allow for relative URLs that start with a slash
-		$full_url = get_base_url(true).$full_url;
-	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url)) // Else if it doesn't start with abcdef://, we add http://
-		$full_url = 'http://'.$full_url;
-
-	// Ok, not very pretty :-)
-	if ($bbcode)
-	{
-		if ($full_url == $link)
-			return '[url]'.$link.'[/url]';
-		else
-			return '[url='.$full_url.']'.$link.'[/url]';
-	}
-	else
-	{
-		if ($link == '' || $link == $url)
-		{
-			$url = pun_htmlspecialchars_decode($url);
-			$link = utf8_strlen($url) > 55 ? utf8_substr($url, 0 , 39).' âŠ '.utf8_substr($url, -10) : $url;
-			$link = pun_htmlspecialchars($link);
-		}
-		else
-			$link = stripslashes($link);
-
-		return '<a href="'.$full_url.'">'.$link.'</a>';
-	}
-}
-
-
-//
-// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
-//
-function handle_img_tag($url, $is_signature = false, $alt = null)
-{
-	global $lang_common, $pun_user;
-
-	if ($alt == null)
-		$alt = basename($url);
-
-	$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].' - '.$alt.'&gt;</a>';
-
-	if ($is_signature && $pun_user['show_img_sig'] != '0')
-		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.$alt.'" />';
-	else if (!$is_signature && $pun_user['show_img'] != '0')
-		$img_tag = '<span class="postimg"><img src="'.$url.'" alt="'.$alt.'" /></span>';
-
-	return $img_tag;
-}
-
-
-//
-// Parse the contents of [list] bbcode
-//
-function handle_list_tag($content, $type = '*')
-{
-	global $re_list;
-
-	if (strlen($type) != 1)
-		$type = '*';
-
-	if (strpos($content,'[list') !== false)
-	{
-		$content = preg_replace($re_list, 'handle_list_tag(\'$2\', \'$1\')', $content);
-	}
-
-	$content = preg_replace('#\s*\[\*\](.*?)\[/\*\]\s*#s', '<li><p>$1</p></li>', pun_trim($content));
-
-	if ($type == '*')
-		$content = '<ul>'.$content.'</ul>';
-	else
-		if ($type == 'a')
-			$content = '<ol class="alpha">'.$content.'</ol>';
-		else
-			$content = '<ol class="decimal">'.$content.'</ol>';
-
-	return '</p>'.$content.'<p>';
-}
-
-
-//
-// Convert BBCodes to their HTML equivalent
-//
-function do_bbcode($text, $is_signature = false)
-{
-	global $lang_common, $pun_user, $pun_config, $re_list;
-
-	if (strpos($text, '[quote') !== false)
-	{
-		$text = preg_replace('%\[quote\]\s*%', '</p><div class="quotebox"><blockquote><div><p>', $text);
-		$text = preg_replace('%\[quote=(&quot;|&\#039;|"|\'|)(.*?)\\1\]%se', '"</p><div class=\"quotebox\"><cite>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\']."</cite><blockquote><div><p>"', $text);
-		$text = preg_replace('%\s*\[\/quote\]%S', '</p></div></blockquote></div><p>', $text);
-	}
-
-	if (!$is_signature)
-	{
-		$pattern[] = $re_list;
-		$replace[] = 'handle_list_tag(\'$2\', \'$1\')';
-	}
-
-	$pattern[] = '%\[b\](.*?)\[/b\]%ms';
-	$pattern[] = '%\[i\](.*?)\[/i\]%ms';
-	$pattern[] = '%\[u\](.*?)\[/u\]%ms';
-	$pattern[] = '%\[s\](.*?)\[/s\]%ms';
-	$pattern[] = '%\[del\](.*?)\[/del\]%ms';
-	$pattern[] = '%\[ins\](.*?)\[/ins\]%ms';
-	$pattern[] = '%\[em\](.*?)\[/em\]%ms';
-	$pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';
-	$pattern[] = '%\[h\](.*?)\[/h\]%ms';
-
-	$replace[] = '<strong>$1</strong>';
-	$replace[] = '<em>$1</em>';
-	$replace[] = '<span class="bbu">$1</span>';
-	$replace[] = '<span class="bbs">$1</span>';
-	$replace[] = '<del>$1</del>';
-	$replace[] = '<ins>$1</ins>';
-	$replace[] = '<em>$1</em>';
-	$replace[] = '<span style="color: $1">$2</span>';
-	$replace[] = '</p><h5>$1</h5><p>';
-
-	if (($is_signature && $pun_config['p_sig_img_tag'] == '1') || (!$is_signature && $pun_config['p_message_img_tag'] == '1'))
-	{
-		$pattern[] = '%\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%e';
-		$pattern[] = '%\[img=([^\[]*?)\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%e';
-		if ($is_signature)
-		{
-			$replace[] = 'handle_img_tag(\'$1$3\', true)';
-			$replace[] = 'handle_img_tag(\'$2$4\', true, \'$1\')';
-		}
-		else
-		{
-			$replace[] = 'handle_img_tag(\'$1$3\', false)';
-			$replace[] = 'handle_img_tag(\'$2$4\', false, \'$1\')';
-		}
-	}
-
-	$pattern[] = '%\[url\]([^\[]*?)\[/url\]%e';
-	$pattern[] = '%\[url=([^\[]+?)\](.*?)\[/url\]%e';
-	$pattern[] = '%\[email\]([^\[]*?)\[/email\]%';
-	$pattern[] = '%\[email=([^\[]+?)\](.*?)\[/email\]%';
-	$pattern[] = '%\[topic\]([^\[]*?)\[/topic\]%e';
-	$pattern[] = '%\[topic=([^\[]+?)\](.*?)\[/topic\]%e';
-	$pattern[] = '%\[post\]([^\[]*?)\[/post\]%e';
-	$pattern[] = '%\[post=([^\[]+?)\](.*?)\[/post\]%e';
-	$pattern[] = '%\[forum\]([^\[]*?)\[/forum\]%e';
-	$pattern[] = '%\[forum=([^\[]+?)\](.*?)\[/forum\]%e';
-	$pattern[] = '%\[user\]([^\[]*?)\[/user\]%e';
-	$pattern[] = '%\[user=([^\[]+?)\](.*?)\[/user\]%e';
-
-	$replace[] = 'handle_url_tag(\'$1\')';
-	$replace[] = 'handle_url_tag(\'$1\', \'$2\')';
-	$replace[] = '<a href="mailto:$1">$1</a>';
-	$replace[] = '<a href="mailto:$1">$2</a>';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=$1\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=$1\', \'$2\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=$1#p$1\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=$1#p$1\', \'$2\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=$1\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=$1\', \'$2\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=$1\')';
-	$replace[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=$1\', \'$2\')';
-
-	// This thing takes a while! :)
-	$text = preg_replace($pattern, $replace, $text);
-
-	return $text;
-}
-
-
-//
-// Make hyperlinks clickable
-//
-function do_clickable($text)
-{
-	$text = ' '.$text;
-
-	$text = ucp_preg_replace('%(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(https?|ftp|news){1}://([\p{L}\p{N}\-]+\.([\p{L}\p{N}\-]+\.)*[\p{L}\p{N}]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])%uie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5://$6\', \'$5://$6\', true).stripslashes(\'$4$10$11$12\')', $text);
-	$text = ucp_preg_replace('%(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(www|ftp)\.(([\p{L}\p{N}\-]+\.)*[\p{L}\p{N}]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])%uie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5.$6\', \'$5.$6\', true).stripslashes(\'$4$10$11$12\')', $text);
-
-	return substr($text, 1);
-}
-
-
-//
-// Convert a series of smilies to images
-//
-function do_smilies($text)
-{
-	global $pun_config, $smilies;
-
-	$text = ' '.$text.' ';
-
-	foreach ($smilies as $smiley_text => $smiley_img)
-	{
-		if (strpos($text, $smiley_text) !== false)
-			$text = ucp_preg_replace('%(?<=[>\s])'.preg_quote($smiley_text, '%').'(?=[^\p{L}\p{N}])%um', '<img src="'.pun_htmlspecialchars(get_base_url(true).'/img/smilies/'.$smiley_img).'" width="15" height="15" alt="'.substr($smiley_img, 0, strrpos($smiley_img, '.')).'" />', $text);
-	}
-
-	return substr($text, 1, -1);
-}
-
-
-//
-// Parse message text
-//
-function parse_message($text, $hide_smilies)
-{
-	global $pun_config, $lang_common, $pun_user;
-
-	if ($pun_config['o_censoring'] == '1')
-		$text = censor_words($text);
-
-	// Convert applicable characters to HTML entities
-	$text = pun_htmlspecialchars($text);
-
-	// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
-	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
-		list($inside, $text) = extract_blocks($text, '[code]', '[/code]', $errors);
-
-	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
-		$text = do_bbcode($text);
-
 	if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
 		$text = do_smilies($text);
+
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_message_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
+		}
+	}
 
 	// Deal with newlines, tabs and multiple spaces
@@ -868,22 +430,35 @@
 
 	// If we split up the message before we have to concatenate it together again (code tags)
-    if (isset($inside)) {
-        $parts = explode("\1", $text);
-        $text = '';
-        foreach ($parts as $i => $part)
-        {
-            $text .= $part;
-            if (isset($inside[$i]))
-            {
-                $num_lines = (substr_count($inside[$i], "\n"));
-                $text .= '</p><div class="codebox"><pre'.(($num_lines > 28) ? ' class="vscroll"' : '').'><code>'.pun_trim($inside[$i], "\n\r").'</code></pre></div><p>';
-            }
-        }
-    }
+	if (isset($inside))
+	{
+		$outside = explode('<">', $text);
+		$text = '';
+
+		$num_tokens = count($outside);
+
+		for ($i = 0; $i < $num_tokens; ++$i)
+		{
+			$text .= $outside[$i];
+			if (isset($inside[$i]))
+			{
+				$num_lines = ((substr_count($inside[$i], "\n")) + 3) * 1.5;
+				$height_str = ($num_lines > 35) ? '35em' : $num_lines.'em';
+				$text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';
+			}
+		}
+	}
 
 	// Add paragraph tag around post, but make sure there are no empty paragraphs
-	$text = preg_replace('%<br />\s*?<br />((\s*<br />)*)%i', "</p>$1<p>", $text);
-	$text = str_replace('<p><br />', '<p>', $text);
 	$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
+
+	// Mod: Flash MP3 Player (8 nouvelles lignes suivent)
+	$player_url     = 'dewplayer-multi.swf';
+	$player_bgcolor = 'ffffff';
+	$player_width   = 240;
+	$player_height  = 20;
+	$player_param   = '?bgcolor='.$player_bgcolor.'&amp;mp3=$1';  // Pour plus d'options: http://www.alsacreations.fr/?dewplayer
+	$player_alternative = '<strong>Flash non dÃ©tÃ©ctÃ©</strong>';
+	$player_code = "\n\t\t\t\t\t<object type=\"application/x-shockwave-flash\" data=\"".$player_url.$player_param."\" width=\"".$player_width."\" height=\"".$player_height."\">\n\t\t\t\t\t  <param name=\"movie\" value=\"".$player_url.$player_param."\" />\n\t\t\t\t\t  <param name=\"bgcolor\" value=\"#".$player_bgcolor."\" />\n\t\t\t\t\t  ".$player_alternative."\n\t\t\t\t\t</object>\n\t\t\t\t\t";
+	$text = preg_replace("/\[mp3 url=([^ ]+)\]/", $player_code, $text);
 
 	return $text;
@@ -901,13 +476,22 @@
 		$text = censor_words($text);
 
-	// Convert applicable characters to HTML entities
 	$text = pun_htmlspecialchars($text);
 
+	if ($pun_config['o_make_links'] == '1')
+		$text = do_clickable($text);
+
+	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
+		$text = do_smilies($text);
+
 	if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
-		$text = do_bbcode($text, true);
-
-	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] == '1')
-		$text = do_smilies($text);
-
+	{
+		$text = do_bbcode($text);
+
+		if ($pun_config['p_sig_img_tag'] == '1')
+		{
+//			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
+			$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
+		}
+	}
 
 	// Deal with newlines, tabs and multiple spaces
@@ -916,9 +500,5 @@
 	$text = str_replace($pattern, $replace, $text);
 
-	// Add paragraph tag around post, but make sure there are no empty paragraphs
-	$text = preg_replace('%<br />\s*?<br />((\s*<br />)*)%i', "</p>$1<p>", $text);
-	$text = str_replace('<p><br />', '<p>', $text);
-	$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
-
 	return $text;
 }
+?>
Index: /trunk/web/punbb/include/search_idx.php
===================================================================
--- /trunk/web/punbb/include/search_idx.php	(revision 10)
+++ /trunk/web/punbb/include/search_idx.php	(revision 1)
@@ -1,12 +1,29 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // The contents of this file are very much inspired by the file functions_search.php
-// from the phpBB Group forum software phpBB2 (http://www.phpbb.com)
+// from the phpBB Group forum software phpBB2 (http://www.phpbb.com). 
 
 
@@ -16,138 +33,50 @@
 
 
-// Make a regex that will match CJK or Hangul characters
-define('PUN_CJK_HANGUL_REGEX', '['.
-	'\x{1100}-\x{11FF}'.		// Hangul Jamo							1100-11FF		(http://www.fileformat.info/info/unicode/block/hangul_jamo/index.htm)
-	'\x{3130}-\x{318F}'.		// Hangul Compatibility Jamo			3130-318F		(http://www.fileformat.info/info/unicode/block/hangul_compatibility_jamo/index.htm)
-	'\x{AC00}-\x{D7AF}'.		// Hangul Syllables						AC00-D7AF		(http://www.fileformat.info/info/unicode/block/hangul_syllables/index.htm)
-
-	// Hiragana
-	'\x{3040}-\x{309F}'.		// Hiragana								3040-309F		(http://www.fileformat.info/info/unicode/block/hiragana/index.htm)
-
-	// Katakana
-	'\x{30A0}-\x{30FF}'.		// Katakana								30A0-30FF		(http://www.fileformat.info/info/unicode/block/katakana/index.htm)
-	'\x{31F0}-\x{31FF}'.		// Katakana Phonetic Extensions			31F0-31FF		(http://www.fileformat.info/info/unicode/block/katakana_phonetic_extensions/index.htm)
-
-	// CJK Unified Ideographs	(http://en.wikipedia.org/wiki/CJK_Unified_Ideographs)
-	'\x{2E80}-\x{2EFF}'.		// CJK Radicals Supplement				2E80-2EFF		(http://www.fileformat.info/info/unicode/block/cjk_radicals_supplement/index.htm)
-	'\x{2F00}-\x{2FDF}'.		// Kangxi Radicals						2F00-2FDF		(http://www.fileformat.info/info/unicode/block/kangxi_radicals/index.htm)
-	'\x{2FF0}-\x{2FFF}'.		// Ideographic Description Characters	2FF0-2FFF		(http://www.fileformat.info/info/unicode/block/ideographic_description_characters/index.htm)
-	'\x{3000}-\x{303F}'.		// CJK Symbols and Punctuation			3000-303F		(http://www.fileformat.info/info/unicode/block/cjk_symbols_and_punctuation/index.htm)
-	'\x{31C0}-\x{31EF}'.		// CJK Strokes							31C0-31EF		(http://www.fileformat.info/info/unicode/block/cjk_strokes/index.htm)
-	'\x{3200}-\x{32FF}'.		// Enclosed CJK Letters and Months		3200-32FF		(http://www.fileformat.info/info/unicode/block/enclosed_cjk_letters_and_months/index.htm)
-	'\x{3400}-\x{4DBF}'.		// CJK Unified Ideographs Extension A	3400-4DBF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs_extension_a/index.htm)
-	'\x{4E00}-\x{9FFF}'.		// CJK Unified Ideographs				4E00-9FFF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs/index.htm)
-	'\x{20000}-\x{2A6DF}'.		// CJK Unified Ideographs Extension B	20000-2A6DF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs_extension_b/index.htm)
-']');
-
-
 //
 // "Cleans up" a text string and returns an array of unique words
 // This function depends on the current locale setting
 //
-function split_words($text, $idx)
+function split_words($text)
 {
-	// Remove BBCode
-	$text = preg_replace('%\[/?(b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list)(?:\=[^\]]*)?\]%', ' ', $text);
-
-	// Remove any apostrophes or dashes which aren't part of words
-	$text = substr(ucp_preg_replace('%((?<=[^\p{L}\p{N}])[\'\-]|[\'\-](?=[^\p{L}\p{N}]))%u', '', ' '.$text.' '), 1, -1);
-
-	// Remove punctuation and symbols (actually anything that isn't a letter or number), allow apostrophes and dashes (and % * if we aren't indexing)
-	$text = ucp_preg_replace('%(?![\'\-'.($idx ? '' : '\%\*').'])[^\p{L}\p{N}]+%u', ' ', $text);
-
-	// Replace multiple whitespace or dashes
-	$text = preg_replace('%(\s){2,}%u', '\1', $text);
+	global $pun_user;
+	static $noise_match, $noise_replace, $stopwords;
+
+	if (empty($noise_match))
+	{
+		$noise_match = array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*');
+		$noise_replace = array('',       '',      '',     '',     '',       '',       '',        '',       '',      '',     '',     '',       '',       '',        ' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ', ' ', ' ');
+
+		$stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt');
+		$stopwords = array_map('trim', $stopwords);
+	}
+
+	// Clean up
+	$patterns[] = '#&[\#a-z0-9]+?;#i';
+	$patterns[] = '#\b[\w]+:\/\/[a-z0-9\.\-]+(\/[a-z0-9\?\.%_\-\+=&\/~]+)?#';
+	$patterns[] = '#\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]#';
+	$text = preg_replace($patterns, ' ', ' '.strtolower($text).' ');
+
+	// Filter out junk
+	$text = str_replace($noise_match, $noise_replace, $text);
+
+	// Strip out extra whitespace between words
+	$text = trim(preg_replace('#\s+#', ' ', $text));
 
 	// Fill an array with all the words
-	$words = array_unique(explode(' ', $text));
-
-	// Remove any words that should not be indexed
-	foreach ($words as $key => $value)
-	{
-		// If the word shouldn't be indexed, remove it
-		if (!validate_search_word($value, $idx))
-			unset($words[$key]);
-	}
-
-	return $words;
-}
-
-
-//
-// Checks if a word is a valid searchable word
-//
-function validate_search_word($word, $idx)
-{
-	static $stopwords;
-
-	// If the word is a keyword we don't want to index it, but we do want to be allowed to search it
-	if (is_keyword($word))
-		return !$idx;
-
-	if (!isset($stopwords))
-	{
-		if (file_exists(FORUM_CACHE_DIR.'cache_stopwords.php'))
-			include FORUM_CACHE_DIR.'cache_stopwords.php';
-
-		if (!defined('PUN_STOPWORDS_LOADED'))
-		{
-			if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-				require PUN_ROOT.'include/cache.php';
-
-			generate_stopwords_cache();
-			require FORUM_CACHE_DIR.'cache_stopwords.php';
-		}
-	}
-
-	// If it is a stopword it isn't valid
-	if (in_array($word, $stopwords))
-		return false;
-
-	// If the word if CJK we don't want to index it, but we do want to be allowed to search it
-	if (is_cjk($word))
-		return !$idx;
-
-	// Check the word is within the min/max length
-	$num_chars = pun_strlen($word);
-	return $num_chars >= PUN_SEARCH_MIN_WORD && $num_chars <= PUN_SEARCH_MAX_WORD;
-}
-
-
-//
-// Check a given word is a search keyword.
-//
-function is_keyword($word)
-{
-	return $word == 'and' || $word == 'or' || $word == 'not';
-}
-
-
-//
-// Check if a given word is CJK or Hangul.
-//
-function is_cjk($word)
-{
-	return preg_match('%^'.PUN_CJK_HANGUL_REGEX.'+$%u', $word) ? true : false;
-}
-
-
-//
-// Strip [img] [url] and [email] out of the message so we don't index their contents
-//
-function strip_bbcode($text)
-{
-	static $patterns;
-
-	if (!isset($patterns))
-	{
-		$patterns = array(
-			'%\[img=([^\]]*+)\]([^[]*+)\[/img\]%'									=>	'$2 $1',	// Keep the url and description
-			'%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'	=>	'$2 $3',	// Keep the url and text
-			'%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'			=>	'$2',		// Keep the url
-		);
-	}
-
-	return preg_replace(array_keys($patterns), array_values($patterns), $text);
+	$words = explode(' ', $text);
+
+	if (!empty($words))
+	{
+		while (list($i, $word) = @each($words))
+		{
+			$words[$i] = trim($word, '.');
+			$num_chars = pun_strlen($word);
+
+			if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
+				unset($words[$i]);
+		}
+	}
+
+	return array_unique($words);
 }
 
@@ -160,17 +89,11 @@
 	global $db_type, $db;
 
-	$message = utf8_strtolower($message);
-	$subject = utf8_strtolower($subject);
-
-	// Remove any bbcode that we shouldn't index
-	$message = strip_bbcode($message);
-
 	// Split old and new post/subject to obtain array of 'words'
-	$words_message = split_words($message, true);
-	$words_subject = ($subject) ? split_words($subject, true) : array();
+	$words_message = split_words($message);
+	$words_subject = ($subject) ? split_words($subject) : array();
 
 	if ($mode == 'edit')
 	{
-		$result = $db->query('SELECT w.id, w.word, m.subject_match FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON w.id=m.word_id WHERE m.post_id='.$post_id, true) or error('Unable to fetch search index words', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT w.id, w.word, m.subject_match FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON w.id=m.word_id WHERE m.post_id='.$post_id, true) or error('Impossible de retrouver les mots index de recherches', __FILE__, __LINE__, $db->error());
 
 		// Declare here to stop array_keys() and array_diff() from complaining if not set
@@ -207,5 +130,5 @@
 	if (!empty($unique_words))
 	{
-		$result = $db->query('SELECT id, word FROM '.$db->prefix.'search_words WHERE word IN(\''.implode('\',\'', array_map(array($db, 'escape'), $unique_words)).'\')', true) or error('Unable to fetch search index words', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT id, word FROM '.$db->prefix.'search_words WHERE word IN('.implode(',', preg_replace('#^(.*)$#', '\'\1\'', $unique_words)).')', true) or error('Impossible de retrouver les mots index de recherches', __FILE__, __LINE__, $db->error());
 
 		$word_ids = array();
@@ -224,12 +147,10 @@
 				case 'mysql':
 				case 'mysqli':
-				case 'mysql_innodb':
-				case 'mysqli_innodb':
-					$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.implode('\'),(\'', array_map(array($db, 'escape'), $new_words)).'\')');
+					$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Impossible d\'ajouter les mots index de recherche', __FILE__, __LINE__, $db->error());
 					break;
 
 				default:
-					foreach ($new_words as $word)
-						$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.$db->escape($word).'\')');
+					while (list(, $word) = @each($new_words))
+						$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.$word.'\')') or error('Impossible d\'ajouter les mots index de recherche', __FILE__, __LINE__, $db->error());
 					break;
 			}
@@ -240,5 +161,5 @@
 
 	// Delete matches (only if editing a post)
-	foreach ($words['del'] as $match_in => $wordlist)
+	while (list($match_in, $wordlist) = @each($words['del']))
 	{
 		$subject_match = ($match_in == 'subject') ? 1 : 0;
@@ -247,18 +168,18 @@
 		{
 			$sql = '';
-			foreach ($wordlist as $word)
+			while (list(, $word) = @each($wordlist))
 				$sql .= (($sql != '') ? ',' : '').$cur_words[$match_in][$word];
 
-			$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE word_id IN('.$sql.') AND post_id='.$post_id.' AND subject_match='.$subject_match) or error('Unable to delete search index word matches', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE word_id IN('.$sql.') AND post_id='.$post_id.' AND subject_match='.$subject_match) or error('Impossible de supprimer des mots index de recherche', __FILE__, __LINE__, $db->error());
 		}
 	}
 
 	// Add new matches
-	foreach ($words['add'] as $match_in => $wordlist)
+	while (list($match_in, $wordlist) = @each($words['add']))
 	{
 		$subject_match = ($match_in == 'subject') ? 1 : 0;
 
 		if (!empty($wordlist))
-			$db->query('INSERT INTO '.$db->prefix.'search_matches (post_id, word_id, subject_match) SELECT '.$post_id.', id, '.$subject_match.' FROM '.$db->prefix.'search_words WHERE word IN(\''.implode('\',\'', array_map(array($db, 'escape'), $wordlist)).'\')') or error('Unable to insert search index word matches', __FILE__, __LINE__, $db->error());
+			$db->query('INSERT INTO '.$db->prefix.'search_matches (post_id, word_id, subject_match) SELECT '.$post_id.', id, '.$subject_match.' FROM '.$db->prefix.'search_words WHERE word IN('.implode(',', preg_replace('#^(.*)$#', '\'\1\'', $wordlist)).')') or error('Impossible d\'ajouter les correspondances index de recherche', __FILE__, __LINE__, $db->error());
 	}
 
@@ -278,8 +199,6 @@
 		case 'mysql':
 		case 'mysqli':
-		case 'mysql_innodb':
-		case 'mysqli_innodb':
-		{
-			$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());
+		{
+			$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Impossible de retrouver les correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
 
 			if ($db->num_rows($result))
@@ -289,5 +208,5 @@
 					$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];
 
-				$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN('.$word_ids.') GROUP BY word_id HAVING COUNT(word_id)=1') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN('.$word_ids.') GROUP BY word_id HAVING COUNT(word_id)=1') or error('Impossible de retrouver les correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
 
 				if ($db->num_rows($result))
@@ -297,5 +216,5 @@
 						$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];
 
-					$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN('.$word_ids.')') or error('Unable to delete search index word', __FILE__, __LINE__, $db->error());
+					$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN('.$word_ids.')') or error('Impossible de supprimer des mots index de recherche', __FILE__, __LINE__, $db->error());
 				}
 			}
@@ -305,8 +224,8 @@
 
 		default:
-			$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id) GROUP BY word_id HAVING COUNT(word_id)=1)') or error('Unable to delete from search index', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id) GROUP BY word_id HAVING COUNT(word_id)=1)') or error('Impossible de supprimer depuis l\'index de recherche', __FILE__, __LINE__, $db->error());
 			break;
 	}
 
-	$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.')') or error('Unable to delete search index word match', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.')') or error('Impossible de supprimer des correspondances de mots index de recherche', __FILE__, __LINE__, $db->error());
 }
Index: /trunk/web/punbb/include/template/admin.tpl
===================================================================
--- /trunk/web/punbb/include/template/admin.tpl	(revision 10)
+++ /trunk/web/punbb/include/template/admin.tpl	(revision 1)
@@ -1,14 +1,13 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
+
+<html dir="<pun_content_direction>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
 <pun_head>
 </head>
-
 <body>
 
+<div id="punwrap">
 <div id="punadmin" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
 
 <div id="brdheader" class="block">
@@ -25,12 +24,9 @@
 <pun_announcement>
 
-<div id="brdmain">
 <pun_main>
-</div>
 
 <pun_footer>
 
 </div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
Index: /trunk/web/punbb/include/template/help.tpl
===================================================================
--- /trunk/web/punbb/include/template/help.tpl	(revision 10)
+++ /trunk/web/punbb/include/template/help.tpl	(revision 1)
@@ -1,21 +1,17 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
+
+<html dir="<pun_content_direction>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
 <pun_head>
 </head>
-
 <body>
 
-<div id="punhelp" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
+<div id="punwrap">
+<div id="helpfile" class="pun">
 
-<div id="brdmain">
 <pun_main>
-</div>
 
 </div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
Index: /trunk/web/punbb/include/template/index.html
===================================================================
--- /trunk/web/punbb/include/template/index.html	(revision 10)
+++ /trunk/web/punbb/include/template/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/include/template/main.tpl
===================================================================
--- /trunk/web/punbb/include/template/main.tpl	(revision 10)
+++ /trunk/web/punbb/include/template/main.tpl	(revision 1)
@@ -1,19 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
+
+<html dir="<pun_content_direction>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
 <pun_head>
 </head>
-
 <body>
-
+<div id="punwrap">
 <div id="pun<pun_page>" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div id="brdheader" class="block">
+  <div id="brdheader" class="block">
 	<div class="box">
 		<div id="brdtitle" class="inbox">
-			<pun_title>
 			<pun_desc>
 		</div>
@@ -21,16 +17,13 @@
 		<pun_status>
 	</div>
-</div>
+  </div>
 
 <pun_announcement>
 
-<div id="brdmain">
 <pun_main>
-</div>
 
 <pun_footer>
 
 </div>
-<div class="end-box"><div><!-- Bottom corners --></div></div>
 </div>
 
Index: /trunk/web/punbb/include/template/maintenance.tpl
===================================================================
--- /trunk/web/punbb/include/template/maintenance.tpl	(revision 10)
+++ /trunk/web/punbb/include/template/maintenance.tpl	(revision 1)
@@ -1,21 +1,24 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
+
+<html dir="<pun_content_direction>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
 <pun_head>
 </head>
-
 <body>
 
+<div id="punwrap">
 <div id="punmaint" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
 
-<div id="brdmain">
-<pun_maint_main>
+<div class="block">
+	<h2><pun_maint_heading></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><pun_maint_message></p>
+		</div>
+	</div>
 </div>
 
 </div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
Index: /trunk/web/punbb/include/template/redirect.tpl
===================================================================
--- /trunk/web/punbb/include/template/redirect.tpl	(revision 10)
+++ /trunk/web/punbb/include/template/redirect.tpl	(revision 1)
@@ -1,17 +1,21 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
+
+<html dir="<pun_content_direction>">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
 <pun_head>
 </head>
-
 <body>
 
+<div id="punwrap">
 <div id="punredirect" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
 
-<div id="brdmain">
-<pun_redir_main>
+<div class="block">
+	<h2><pun_redir_heading></h2>
+	<div class="box">
+		<div class="inbox">
+			<p><pun_redir_text></p>
+		</div>
+	</div>
 </div>
 
@@ -19,5 +23,4 @@
 
 </div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
Index: /trunk/web/punbb/index.php
===================================================================
--- /trunk/web/punbb/index.php	(revision 10)
+++ /trunk/web/punbb/index.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -18,43 +35,18 @@
 require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
 
-// Get list of forums and topics with new posts since last visit
-if (!$pun_user['is_guest'])
-{
-	$result = $db->query('SELECT t.forum_id, t.id, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL') or error('Unable to fetch new topics', __FILE__, __LINE__, $db->error());
-
-	$new_topics = array();
-	while ($cur_topic = $db->fetch_assoc($result))
-		$new_topics[$cur_topic['forum_id']][$cur_topic['id']] = $cur_topic['last_post'];
-
-	$tracked_topics = get_tracked_topics();
-}
-
-if ($pun_config['o_feed_type'] == '1')
-	$page_head = array('feed' => '<link rel="alternate" type="application/rss+xml" href="extern.php?action=feed&amp;type=rss" title="'.$lang_common['RSS active topics feed'].'" />');
-else if ($pun_config['o_feed_type'] == '2')
-	$page_head = array('feed' => '<link rel="alternate" type="application/atom+xml" href="extern.php?action=feed&amp;type=atom" title="'.$lang_common['Atom active topics feed'].'" />');
-
-$forum_actions = array();
-
-// Display a "mark all as read" link
-if (!$pun_user['is_guest'])
-	$forum_actions[] = '<a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a>';
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']));
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
 define('PUN_ALLOW_INDEX', 1);
-define('PUN_ACTIVE_PAGE', 'index');
 require PUN_ROOT.'header.php';
 
 // Print the categories and forums
-$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums.', __FILE__, __LINE__, $db->error());
 
 $cur_category = 0;
 $cat_count = 0;
-$forum_count = 0;
 while ($cur_forum = $db->fetch_assoc($result))
 {
 	$moderators = '';
 
-	if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 	{
 		if ($cur_category != 0)
@@ -62,5 +54,4 @@
 
 		++$cat_count;
-		$forum_count = 0;
 
 ?>
@@ -84,24 +75,14 @@
 	}
 
-	++$forum_count;
-	$item_status = ($forum_count % 2 == 0) ? 'roweven' : 'rowodd';
-	$forum_field_new = '';
+	$item_status = '';
+	$icon_text = $lang_common['Normal icon'];
 	$icon_type = 'icon';
 
-	// Are there new posts since our last visit?
-	if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit'] && (empty($tracked_topics['forums'][$cur_forum['fid']]) || $cur_forum['last_post'] > $tracked_topics['forums'][$cur_forum['fid']]))
-	{
-		// There are new posts in this forum, but have we read all of them already?
-		foreach ($new_topics[$cur_forum['fid']] as $check_topic_id => $check_last_post)
-		{
-			if ((empty($tracked_topics['topics'][$check_topic_id]) || $tracked_topics['topics'][$check_topic_id] < $check_last_post) && (empty($tracked_topics['forums'][$cur_forum['fid']]) || $tracked_topics['forums'][$cur_forum['fid']] < $check_last_post))
-			{
-				$item_status .= ' inew';
-				$forum_field_new = '<span class="newtext">[ <a href="search.php?action=show_new&amp;fid='.$cur_forum['fid'].'">'.$lang_common['New posts'].'</a> ]</span>';
-				$icon_type = 'icon icon-new';
-
-				break;
-			}
-		}
+	// Are there new posts?
+	if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit'])
+	{
+		$item_status = 'inew';
+		$icon_text = $lang_common['New icon'];
+		$icon_type = 'icon inew';
 	}
 
@@ -109,12 +90,13 @@
 	if ($cur_forum['redirect_url'] != '')
 	{
-		$forum_field = '<h3><span class="redirtext">'.$lang_index['Link to'].'</span> <a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
-		$num_topics = $num_posts = '-';
-		$item_status .= ' iredirect';
+		$forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
+		$num_topics = $num_posts = '&#160;';
+		$item_status = 'iredirect';
+		$icon_text = $lang_common['Redirect icon'];
 		$icon_type = 'icon';
 	}
 	else
 	{
-		$forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a>'.(!empty($forum_field_new) ? ' '.$forum_field_new : '').'</h3>';
+		$forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
 		$num_topics = $cur_forum['num_topics'];
 		$num_posts = $cur_forum['num_posts'];
@@ -122,13 +104,12 @@
 
 	if ($cur_forum['forum_desc'] != '')
-		$forum_field .= "\n\t\t\t\t\t\t\t\t".'<div class="forumdesc">'.$cur_forum['forum_desc'].'</div>';
-
-	// If there is a last_post/last_poster
+		$forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc'];
+
+
+	// If there is a last_post/last_poster.
 	if ($cur_forum['last_post'] != '')
 		$last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
-	else if ($cur_forum['redirect_url'] != '')
-		$last_post = '- - -';
 	else
-		$last_post = $lang_common['Never'];
+		$last_post = '&#160;';
 
 	if ($cur_forum['moderators'] != '')
@@ -137,27 +118,22 @@
 		$moderators = array();
 
-		foreach ($mods_array as $mod_username => $mod_id)
-		{
-			if ($pun_user['g_view_users'] == '1')
-				$moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
-			else
-				$moderators[] = pun_htmlspecialchars($mod_username);
-		}
-
-		$moderators = "\t\t\t\t\t\t\t\t".'<p class="modlist">(<em>'.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
-	}
-
-?>
-				<tr class="<?php echo $item_status ?>">
+		while (list($mod_username, $mod_id) = @each($mods_array))
+			$moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
+
+		$moderators = "\t\t\t\t\t\t\t\t".'<p><em>('.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
+	}
+
+?>
+ 				<tr<?php if ($item_status != '') echo ' class="'.$item_status.'"'; ?>>
 					<td class="tcl">
-						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($forum_count) ?></div></div>
-						<div class="tclcon">
-							<div>
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo $icon_text ?></div></div>
+							<div class="tclcon">
 								<?php echo $forum_field."\n".$moderators ?>
 							</div>
 						</div>
 					</td>
-					<td class="tc2"><?php echo forum_number_format($num_topics) ?></td>
-					<td class="tc3"><?php echo forum_number_format($num_posts) ?></td>
+					<td class="tc2"><?php echo $num_topics ?></td>
+					<td class="tc3"><?php echo $num_posts ?></td>
 					<td class="tcr"><?php echo $last_post ?></td>
 				</tr>
@@ -172,37 +148,14 @@
 	echo '<div id="idx0" class="block"><div class="box"><div class="inbox"><p>'.$lang_index['Empty board'].'</p></div></div></div>';
 
+
 // Collect some statistics from the database
-if (file_exists(FORUM_CACHE_DIR.'cache_users_info.php'))
-	include FORUM_CACHE_DIR.'cache_users_info.php';
-
-if (!defined('PUN_USERS_INFO_LOADED'))
-{
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
-	generate_users_info_cache();
-	require FORUM_CACHE_DIR.'cache_users_info.php';
-}
-
-$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Impossible de retrouver le nombre total d\utilisateurs', __FILE__, __LINE__, $db->error());
+$stats['total_users'] = $db->result($result);
+
+$result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Impossible de retrouver le dernier membre inscrit', __FILE__, __LINE__, $db->error());
+$stats['last_user'] = $db->fetch_assoc($result);
+
+$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Impossible de retrouver le nombre de discussions et de messages', __FILE__, __LINE__, $db->error());
 list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);
-
-if ($pun_user['g_view_users'] == '1')
-	$stats['newest_user'] = '<a href="profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a>';
-else
-	$stats['newest_user'] = pun_htmlspecialchars($stats['last_user']['username']);
-
-if (!empty($forum_actions))
-{
-
-?>
-<div class="linksb">
-	<div class="inbox crumbsplus">
-		<p class="subscribelink clearb"><?php echo implode(' - ', $forum_actions); ?></p>
-	</div>
-</div>
-<?php
-
-}
 
 ?>
@@ -213,11 +166,11 @@
 			<dl class="conr">
 				<dt><strong><?php echo $lang_index['Board stats'] ?></strong></dt>
-				<dd><span><?php printf($lang_index['No of users'], '<strong>'.forum_number_format($stats['total_users']).'</strong>') ?></span></dd>
-				<dd><span><?php printf($lang_index['No of topics'], '<strong>'.forum_number_format($stats['total_topics']).'</strong>') ?></span></dd>
-				<dd><span><?php printf($lang_index['No of posts'], '<strong>'.forum_number_format($stats['total_posts']).'</strong>') ?></span></dd>
+				<dd><?php echo $lang_index['No of users'].': <strong>'. $stats['total_users'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of topics'].': <strong>'.$stats['total_topics'] ?></strong></dd>
+				<dd><?php echo $lang_index['No of posts'].': <strong>'.$stats['total_posts'] ?></strong></dd>
 			</dl>
 			<dl class="conl">
 				<dt><strong><?php echo $lang_index['User info'] ?></strong></dt>
-				<dd><span><?php printf($lang_index['Newest user'], $stats['newest_user']) ?></span></dd>
+				<dd><?php echo $lang_index['Newest user'] ?>: <a href="profile.php?id=<?php echo $stats['last_user']['id'] ?>"><?php echo pun_htmlspecialchars($stats['last_user']['username']) ?></a></dd>
 <?php
 
@@ -227,15 +180,10 @@
 	$num_guests = 0;
 	$users = array();
-	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Impossible de retrouver la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 	while ($pun_user_online = $db->fetch_assoc($result))
 	{
 		if ($pun_user_online['user_id'] > 1)
-		{
-			if ($pun_user['g_view_users'] == '1')
-				$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
-			else
-				$users[] = "\n\t\t\t\t".'<dd>'.pun_htmlspecialchars($pun_user_online['ident']);
-		}
+			$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
 		else
 			++$num_guests;
@@ -243,9 +191,9 @@
 
 	$num_users = count($users);
-	echo "\t\t\t\t".'<dd><span>'.sprintf($lang_index['Users online'], '<strong>'.forum_number_format($num_users).'</strong>').'</span></dd>'."\n\t\t\t\t".'<dd><span>'.sprintf($lang_index['Guests online'], '<strong>'.forum_number_format($num_guests).'</strong>').'</span></dd>'."\n\t\t\t".'</dl>'."\n";
+	echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";
 
 
 	if ($num_users > 0)
-		echo "\t\t\t".'<dl id="onlinelist" class="clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].' </strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
+		echo "\t\t\t".'<dl id="onlinelist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].':&#160;</strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
 	else
 		echo "\t\t\t".'<div class="clearer"></div>'."\n";
@@ -253,5 +201,5 @@
 }
 else
-	echo "\t\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
+	echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
 
 
@@ -261,4 +209,125 @@
 </div>
 <?php
+$hide_smilies = 0;
+$nb_messages_max = 50;
+$nom_fichier = 'chatbox.txt';
+$hauteur_parloire = '200px';
+$largeur_parloire = '100%';
+$color_box = '#666666';
+$color_title = '#FFFFFF';
+
+$anti_flood_msg = '<strong>ATTENTION : Vous avez dÃ©jÃ  postÃ© exactement le mÃªme message dans la chatbox auparavant. Pour Ã©viter d\'encombrer la chatbox, votre message n\'a pas Ã©tÃ© postÃ©.</strong>';
+$anti_blanc_msg = '<strong>ATTENTION : Vous avez postÃ© un message sans aucun texte ! Votre "message" n\'a pas Ã©tÃ© postÃ©.</strong>';
+$no_membre_msg = '<strong>Vous devez Ãªtre membre pour accÃ©der Ã  la chatbox</strong>';
+$actualiser_msg = 'Actualiser';
+$poster_msg = 'Poster';
+
+
+require PUN_ROOT.'include/parser.php';
+
+$tpl_parloir = file_get_contents(PUN_ROOT.$nom_fichier);
+
+$messages = explode("</MESSAGE>", $tpl_parloir);
+
+$nb_messages = count($messages);
+
+$parloir = '';
+$parloir_txt = '';
+$anti_flood = 0;
+
+if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
+  $parloir_tmp_flood = '<MESSAGE><ID>'.$pun_user['id'].'</ID><TEXTE>'.$_POST['message'].'</TEXTE>';
+else
+  $parloir_tmp_flood = '<no_post>';
+
+  
+for($i=0;$i<$nb_messages - 1;$i++)
+{
+  $grab = ereg("<ID>(.*)</ID>", $messages[$i], $mess_id);
+  $grab = ereg("<PSEUDO>(.*)</PSEUDO>", $messages[$i], $mess_pseudo);
+  $grab = ereg("<DATE>(.*)</DATE>", $messages[$i], $mess_date);
+  $grab = ereg("<TEXTE>(.*)</TEXTE>", $messages[$i], $mess_texte);
+
+  $parloir .= '<a href="profile.php?id='.$mess_id[1].'"><strong>'.pun_htmlspecialchars($mess_pseudo[1]).'</strong></a> - '.format_time($mess_date[1])."\n".'<br />'."\n".parse_message($mess_texte[1], $hide_smilies)."\n"."\n"."\n";
+  if ($i+1 < $nb_messages_max)
+  {
+
+  $parloir_txt_flood = '<MESSAGE><ID>'.$mess_id[1].'</ID><TEXTE>'.$mess_texte[1].'</TEXTE>';
+
+   if ($parloir_tmp_flood == $parloir_txt_flood)
+    $anti_flood = 1;
+
+    $parloir_txt .= '<MESSAGE>'."\r".' <ID>'.$mess_id[1].'</ID>'."\r".' <PSEUDO>'.$mess_pseudo[1].'</PSEUDO>'."\r".' <DATE>'.$mess_date[1].'</DATE>'."\r".' <TEXTE>'.$mess_texte[1].'</TEXTE>'."\r".'</MESSAGE>'."\n\n";
+
+  }
+
+}
+
+if (isset($_GET['option']) && isset($_POST['message']) && !$pun_user['is_guest'])
+{
+    if ($anti_flood == 0 && $_POST['message'] != '')
+    {
+      $fp = fopen(PUN_ROOT.$nom_fichier, "w");
+      if ($fp)
+      {
+        $parloir_txt = '<MESSAGE>'."\r".' <ID>'.$pun_user['id'].'</ID>'."\r".' <PSEUDO>'.$pun_user['username'].'</PSEUDO>'."\r".' <DATE>'.time().'</DATE>'."\r".' <TEXTE>'.$_POST['message'].'</TEXTE>'."\r".'</MESSAGE>'."\n\n".$parloir_txt;
+        $r = fwrite($fp, $parloir_txt);
+      }
+      fclose($fp); 
+      $parloir = '<a href="profile.php?id='.$pun_user['id'].'"><strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></a> - '.format_time(time())."\n".'<br />'."\n".parse_message($_POST['message'], $hide_smilies)."\n"."\n"."\n".$parloir;
+    }
+    elseif ($anti_flood == 1)
+    {
+      $parloir = $anti_flood_msg."\n".'<br />'."\n".'<br />'."\n".$parloir;
+    }
+    else
+    {
+      $parloir = $anti_blanc_msg."\n".'<br />'."\n".'<br />'."\n".$parloir;
+    }
+}
+
+
+
+?>
+  <div style="border:1px solid <?php echo $color_box; ?>;width:<?php echo $largeur_parloire; ?>;">
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;"><strong>Chatbox</strong></td>
+          </tr>
+    </table>
+  <div style="background-color:#1f1f1f;padding:5px;margin:0;overflow:auto;height:<?php echo $hauteur_parloire; ?>;">
+<?php echo $parloir; ?>
+
+  </div>
+<?php
+
+if ($pun_user['is_guest'])
+{
+?>
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;"><?php echo $no_membre_msg; ?></td>
+          </tr>
+    </table>
+<?php
+}
+else
+{
+?>
+    <table border="0" cellspacing="0" cellpadding="0">
+          <tr style="background: <?php echo $color_box; ?>;color: <?php echo $color_title; ?>;">
+            <td style="border:none;vertical-align:middle;">
+          <form method="post" name="form_parloir" action="?option=post">
+            <NOBR><strong>Message : </strong> <input type="text" name="message"  size="35" maxlength="255" /> <input type="submit" name="ajouter" value="<?php echo $poster_msg; ?>" /> <a href="?refresh=1"><input type="button" value="<?php echo $actualiser_msg; ?>" /></a></NOBR>
+                </form>
+        </td>
+          </tr>
+    </table>
+<?php
+}
+
+?>
+  </div>
+<?php
 
 $footer_style = 'index';
Index: /trunk/web/punbb/install.php
===================================================================
--- /trunk/web/punbb/install.php	(revision 10)
+++ /trunk/web/punbb/install.php	(revision 1)
@@ -1,235 +1,60 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-// The FluxBB version this script installs
-define('FORUM_VERSION', '1.4.7');
-
-define('FORUM_DB_REVISION', 15);
-define('FORUM_SI_REVISION', 2);
-define('FORUM_PARSER_REVISION', 2);
-
-define('MIN_PHP_VERSION', '4.4.0');
-define('MIN_MYSQL_VERSION', '4.1.2');
-define('MIN_PGSQL_VERSION', '7.0.0');
-define('PUN_SEARCH_MIN_WORD', 3);
-define('PUN_SEARCH_MAX_WORD', 20);
-
-
-define('PUN_ROOT', dirname(__FILE__).'/');
-
-// Load the functions script
-require PUN_ROOT.'include/functions.php';
-
-// Load UTF-8 functions
-require PUN_ROOT.'include/utf8/utf8.php';
-
-// Strip out "bad" UTF-8 characters
-forum_remove_bad_characters();
-
-// Reverse the effect of register_globals
-forum_unregister_globals();
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+// The PunBB version this script installs
+$punbb_version = '1.2.10';
+$punbb_version_fr = '1.2.10';
+
+
+define('PUN_ROOT', './');
+if (file_exists(PUN_ROOT.'config.php'))
+	exit('Le fichier \'config.php\' existe dÃ©jÃ , ce qui signifie trÃšs probablement que PunBB est dÃ©jÃ  installÃ©. Vous devriez plutÃŽt <a href="index.php">aller ici</a>.');
+
+
+// Make sure we are running at least PHP 4.1.0
+if (intval(str_replace('.', '', phpversion())) < 410)
+	exit('Vous utilisez la version '.PHP_VERSION.' de PHP. PunBB nÃ©cÃ©ssite au minimum PHP 4.1.0 pour fonctionner correctement. Vous devez mettre Ã  jour votre installation de PHP afin que vous ne puissiez continuer.');
 
 // Disable error reporting for uninitialized variables
 error_reporting(E_ALL);
 
-// Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
-setlocale(LC_CTYPE, 'C');
-
-// Turn off magic_quotes_runtime
-if (get_magic_quotes_runtime())
-	set_magic_quotes_runtime(0);
-
-// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
-if (get_magic_quotes_gpc())
-{
-	function stripslashes_array($array)
-	{
-		return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
-	}
-
-	$_GET = stripslashes_array($_GET);
-	$_POST = stripslashes_array($_POST);
-	$_COOKIE = stripslashes_array($_COOKIE);
-	$_REQUEST = stripslashes_array($_REQUEST);
-}
-
 // Turn off PHP time limit
 @set_time_limit(0);
 
 
-// If we've been passed a default language, use it
-$install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';
-
-// If such a language pack doesn't exist, or isn't up-to-date enough to translate this page, default to English
-if (!file_exists(PUN_ROOT.'lang/'.$install_lang.'/install.php'))
-	$install_lang = 'English';
-
-require PUN_ROOT.'lang/'.$install_lang.'/install.php';
-
-if (file_exists(PUN_ROOT.'config.php'))
-{
-	// Check to see whether FluxBB is already installed
-	include PUN_ROOT.'config.php';
-
-	// If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
-	if (defined('FORUM'))
-		define('PUN', FORUM);
-
-	// If PUN is defined, config.php is probably valid and thus the software is installed
-	if (defined('PUN'))
-		exit($lang_install['Already installed']);
-}
-
-// Define PUN because email.php requires it
-define('PUN', 1);
-
-// If the cache directory is not specified, we use the default setting
-if (!defined('FORUM_CACHE_DIR'))
-	define('FORUM_CACHE_DIR', PUN_ROOT.'cache/');
-
-// Make sure we are running at least MIN_PHP_VERSION
-if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
-	exit(sprintf($lang_install['You are running error'], 'PHP', PHP_VERSION, FORUM_VERSION, MIN_PHP_VERSION));
-
-
-//
-// Generate output to be used for config.php
-//
-function generate_config_file()
-{
-	global $db_type, $db_host, $db_name, $db_username, $db_password, $db_prefix, $cookie_name, $cookie_seed;
-
-	return '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.addslashes($db_name)."';\n".'$db_username = \''.addslashes($db_username)."';\n".'$db_password = \''.addslashes($db_password)."';\n".'$db_prefix = \''.addslashes($db_prefix)."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'".$cookie_name."';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.random_key(16, false, true)."';\n\ndefine('PUN', 1);\n";
-}
-
-
-if (isset($_POST['generate_config']))
-{
-	header('Content-Type: text/x-delimtext; name="config.php"');
-	header('Content-disposition: attachment; filename=config.php');
-
-	$db_type = $_POST['db_type'];
-	$db_host = $_POST['db_host'];
-	$db_name = $_POST['db_name'];
-	$db_username = $_POST['db_username'];
-	$db_password = $_POST['db_password'];
-	$db_prefix = $_POST['db_prefix'];
-	$cookie_name = $_POST['cookie_name'];
-	$cookie_seed = $_POST['cookie_seed'];
-
-	echo generate_config_file();
-	exit;
-}
-
-
 if (!isset($_POST['form_sent']))
-{
-	// Make an educated guess regarding base_url
-	$base_url  = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';	// protocol
-	$base_url .= preg_replace('%:(80|443)$%', '', $_SERVER['HTTP_HOST']);							// host[:port]
-	$base_url .= str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));							// path
-
-	if (substr($base_url, -1) == '/')
-		$base_url = substr($base_url, 0, -1);
-
-	$db_type = $db_name = $db_username = $db_prefix = $username = $email = '';
-	$db_host = 'localhost';
-	$title = $lang_install['My FluxBB Forum'];
-	$description = '<p><span>'.$lang_install['Description'].'</span></p>';
-	$default_lang = $install_lang;
-	$default_style = 'Air';
-}
-else
-{
-	$db_type = $_POST['req_db_type'];
-	$db_host = pun_trim($_POST['req_db_host']);
-	$db_name = pun_trim($_POST['req_db_name']);
-	$db_username = pun_trim($_POST['db_username']);
-	$db_password = pun_trim($_POST['db_password']);
-	$db_prefix = pun_trim($_POST['db_prefix']);
-	$username = pun_trim($_POST['req_username']);
-	$email = strtolower(pun_trim($_POST['req_email']));
-	$password1 = pun_trim($_POST['req_password1']);
-	$password2 = pun_trim($_POST['req_password2']);
-	$title = pun_trim($_POST['req_title']);
-	$description = pun_trim($_POST['desc']);
-	$base_url = pun_trim($_POST['req_base_url']);
-	$default_lang = pun_trim($_POST['req_default_lang']);
-	$default_style = pun_trim($_POST['req_default_style']);
-	$alerts = array();
-
-	// Make sure base_url doesn't end with a slash
-	if (substr($base_url, -1) == '/')
-		$base_url = substr($base_url, 0, -1);
-
-	// Validate username and passwords
-	if (pun_strlen($username) < 2)
-		$alerts[] = $lang_install['Username 1'];
-	else if (pun_strlen($username) > 25) // This usually doesn't happen since the form element only accepts 25 characters
-		$alerts[] = $lang_install['Username 2'];
-	else if (!strcasecmp($username, 'Guest'))
-		$alerts[] = $lang_install['Username 3'];
-	else if (preg_match('%[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}%', $username) || preg_match('%((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))%', $username))
-		$alerts[] = $lang_install['Username 4'];
-	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
-		$alerts[] = $lang_install['Username 5'];
-	else if (preg_match('%(?:\[/?(?:b|u|i|h|colou?r|quote|code|img|url|email|list)\]|\[(?:code|quote|list)=)%i', $username))
-		$alerts[] = $lang_install['Username 6'];
-
-	if (pun_strlen($password1) < 4)
-		$alerts[] = $lang_install['Short password'];
-	else if ($password1 != $password2)
-		$alerts[] = $lang_install['Passwords not match'];
-
-	// Validate email
-	require PUN_ROOT.'include/email.php';
-
-	if (!is_valid_email($email))
-		$alerts[] = $lang_install['Wrong email'];
-
-	if ($title == '')
-		$alerts[] = $lang_install['No board title'];
-
-	$languages = forum_list_langs();
-	if (!in_array($default_lang, $languages))
-		$alerts[] = $lang_install['Error default language'];
-
-	$styles = forum_list_styles();
-	if (!in_array($default_style, $styles))
-		$alerts[] = $lang_install['Error default style'];
-}
-
-// Check if the cache directory is writable
-if (!@is_writable(FORUM_CACHE_DIR))
-	$alerts[] = sprintf($lang_install['Alert cache'], FORUM_CACHE_DIR);
-
-// Check if default avatar directory is writable
-if (!@is_writable(PUN_ROOT.'img/avatars/'))
-	$alerts[] = sprintf($lang_install['Alert avatar'], PUN_ROOT.'img/avatars/');
-
-if (!isset($_POST['form_sent']) || !empty($alerts))
 {
 	// Determine available database extensions
 	$dual_mysql = false;
 	$db_extensions = array();
-	$mysql_innodb = false;
 	if (function_exists('mysqli_connect'))
-	{
-		$db_extensions[] = array('mysqli', 'MySQL Improved');
-		$db_extensions[] = array('mysqli_innodb', 'MySQL Improved (InnoDB)');
-		$mysql_innodb = true;
-	}
+		$db_extensions[] = array('mysqli', 'MySQL amÃ©liorÃ© (MySQL Improved)');
 	if (function_exists('mysql_connect'))
 	{
 		$db_extensions[] = array('mysql', 'MySQL Standard');
-		$db_extensions[] = array('mysql_innodb', 'MySQL Standard (InnoDB)');
-		$mysql_innodb = true;
-
-		if (count($db_extensions) > 2)
+
+		if (count($db_extensions) > 1)
 			$dual_mysql = true;
 	}
@@ -240,141 +65,86 @@
 
 	if (empty($db_extensions))
-		error($lang_install['No DB extensions']);
-
-	// Fetch a list of installed languages
-	$languages = forum_list_langs();
+		exit('Cet environnement PHP n\'a le support pour aucune bases de donnÃ©es que PunBB peut utiliser. Afin d\'installer PunBB, PHP doit supporter soit MySQL, PostgreSQL ou SQLite.');
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
+
+<html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_install['FluxBB Installation'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Installation de PunBB</title>
+<link rel="stylesheet" type="text/css" href="style/Oxygen.css" />
 <script type="text/javascript">
-/* <![CDATA[ */
+<!--
 function process_form(the_form)
 {
-	var element_names = {
-		"req_db_type": "<?php echo $lang_install['Database type'] ?>",
-		"req_db_host": "<?php echo $lang_install['Database server hostname'] ?>",
-		"req_db_name": "<?php echo $lang_install['Database name'] ?>",
-		"db_prefix": "<?php echo $lang_install['Table prefix'] ?>",
-		"req_username": "<?php echo $lang_install['Administrator username'] ?>",
-		"req_password1": "<?php echo $lang_install['Administrator password 1'] ?>",
-		"req_password2": "<?php echo $lang_install['Administrator password 2'] ?>",
-		"req_email": "<?php echo $lang_install['Administrator email'] ?>",
-		"req_title": "<?php echo $lang_install['Board title'] ?>",
-		"req_base_url": "<?php echo $lang_install['Base URL'] ?>"
-	};
+	var element_names = new Object()
+	element_names["req_db_type"] = "Type de base de donnÃ©es"
+	element_names["req_db_host"] = "HÃŽte serveur de base de donnÃ©es"
+	element_names["req_db_name"] = "Nom de base de donnÃ©es"
+	element_names["db_prefix"] = "PrÃ©fixe tables"
+	element_names["req_username"] = "Nom utilisateur administrateur"
+	element_names["req_password1"] = "Mot de passe administrateur 1"
+	element_names["req_password2"] = "Mot de passe administrateur 2"
+	element_names["req_email"] = "E-mail administrateur"
+	element_names["req_base_url"] = "URL de base"
+
 	if (document.all || document.getElementById)
 	{
-		for (var i = 0; i < the_form.length; ++i)
+		for (i = 0; i < the_form.length; ++i)
 		{
-			var elem = the_form.elements[i];
-			if (elem.name && (/^req_/.test(elem.name)))
+			var elem = the_form.elements[i]
+			if (elem.name && elem.name.substring(0, 4) == "req_")
 			{
-				if (!elem.value && elem.type && (/^(?:text(?:area)?|password|file)$/i.test(elem.type)))
+				if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" || elem.type=="file") && elem.value=='')
 				{
-					alert('"' + element_names[elem.name] + '" <?php echo $lang_install['Required field'] ?>');
-					elem.focus();
-					return false;
+					alert("\"" + element_names[elem.name] + "\" est un champ requis pour ce formulaire.")
+					elem.focus()
+					return false
 				}
 			}
 		}
 	}
-	return true;
+
+	return true
 }
-/* ]]> */
+// -->
 </script>
 </head>
-<body onload="document.getElementById('install').req_db_type.focus();document.getElementById('install').start.disabled=false;" onunload="">
-
-<div id="puninstall" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div id="brdheader" class="block">
+<body onload="document.getElementById('install').req_db_type.focus()">
+
+<div id="puninstall" style="margin: auto 10% auto 10%">
+<div class="pun">
+
+<div class="block">
+	<h2><span>Installation de PunBB</span></h2>
 	<div class="box">
-		<div id="brdtitle" class="inbox">
-			<h1><span><?php echo $lang_install['FluxBB Installation'] ?></span></h1>
-			<div id="brddesc"><p><?php echo $lang_install['Install message'] ?></p><p><?php echo $lang_install['Welcome'] ?></p></div>
+		<div class="inbox">
+			<p>Bienvenue sur l'application d'installation de  PunBB ! Vous vous apprÃªtez Ã  installer PunBB. Afin d'installer celui-ci vous devez remplir le formulaire ci-dessous. Si vous rencontrez des difficultÃ©s avec l'installation, veuillez s'il vous plait vous rÃ©fÃ©rer Ã  la documentation.</p>
 		</div>
 	</div>
 </div>
 
-<div id="brdmain">
-<?php if (count($languages) > 1): ?><div class="blockform">
-	<h2><span><?php echo $lang_install['Choose install language'] ?></span></h2>
-	<div class="box">
-		<form id="install" method="post" action="install.php">
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_install['Install language'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_install['Choose install language info'] ?></p>
-						<label><strong><?php echo $lang_install['Install language'] ?></strong>
-						<br /><select name="install_lang">
-<?php
-
-		foreach ($languages as $temp)
-		{
-			if ($temp == $install_lang)
-				echo "\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
-			else
-				echo "\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
-		}
-
-?>
-						</select>
-						<br /></label>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="start" value="<?php echo $lang_install['Change language'] ?>" /></p>
-		</form>
-	</div>
-</div>
-<?php endif; ?>
-
 <div class="blockform">
-	<h2><span><?php echo $lang_install['Install'] ?></span></h2>
+	<h2><span>Installer PunBB</span></h2>
 	<div class="box">
 		<form id="install" method="post" action="install.php" onsubmit="this.start.disabled=true;if(process_form(this)){return true;}else{this.start.disabled=false;return false;}">
-		<div><input type="hidden" name="form_sent" value="1" /><input type="hidden" name="install_lang" value="<?php echo pun_htmlspecialchars($install_lang) ?>" /></div>
-			<div class="inform">
-<?php if (!empty($alerts)): ?>				<div class="forminfo error-info">
-					<h3><?php echo $lang_install['Errors'] ?></h3>
-					<ul class="error-list">
-<?php
-
-foreach ($alerts as $cur_alert)
-	echo "\t\t\t\t\t\t".'<li><strong>'.$cur_alert.'</strong></li>'."\n";
-?>
-					</ul>
-				</div>
-<?php endif; ?>			</div>
+		<div><input type="hidden" name="form_sent" value="1" /></div>
 			<div class="inform">
 				<div class="forminfo">
-					<h3><?php echo $lang_install['Database setup'] ?></h3>
-					<p><?php echo $lang_install['Info 1'] ?></p>
+					<h3>RÃ©glages de la base de donnÃ©es</h3>
+					<p>Afin d'installer votre base de donnÃ©es pour PunBB, veuillez saisir les informations demandÃ©es ci-dessous. Vous devez connaÃ®tre toutes les informations demandÃ©es avant de procÃ©der Ã  l'installation.</p>
 				</div>
 				<fieldset>
-				<legend><?php echo $lang_install['Select database'] ?></legend>
+				<legend>SÃ©lectionnez le type de votre base de donnÃ©es</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 2'] ?></p>
-<?php if ($dual_mysql): ?>						<p><?php echo $lang_install['Dual MySQL'] ?></p>
-<?php endif; ?><?php if ($mysql_innodb): ?>						<p><?php echo $lang_install['InnoDB'] ?></p>
-<?php endif; ?>						<label class="required"><strong><?php echo $lang_install['Database type'] ?> <span><?php echo $lang_install['Required'] ?></span></strong>
+						<p>PunBB supporte actuellement MySQL, PostgreSQL et SQLite. Si votre base de donnÃ©es est absente du menu dÃ©roulant ci-dessous, cela signifie que cet environnement <acronym title="PHP: Hypertext Preprocessor" lang="en">PHP</acronym> n'a pas le support pour cette base de donnÃ©es particuliÃšre. Plus d'information concernant le support des versions particuliÃšres de chaque base de donnÃ©es pourra Ãªtre trouvÃ©e dans la <acronym title="Frequently Asked Questions" lang="en">FAQ</acronym>.</p>
+<?php if ($dual_mysql): ?>						<p>PunBB a dÃ©tectÃ© que votre environnement PHP supporte deux maniÃšres diffÃ©rentes de communiquer avec MySQL. Les deux options s'appellent "standard" (MySQL) et "amÃ©liorÃ©" (MySQLi ; "i" comme "improved"). Si vous n'Ãªtes pas certain de laquelle utiliser, commencez par essayer "amÃ©liorÃ©" et si cela Ã©choue, essayez "standard".</p>
+<?php endif; ?>						<label><strong>Type de base de donnÃ©es</strong>
 						<br /><select name="req_db_type">
 <?php
 
-	foreach ($db_extensions as $temp)
-	{
-		if ($temp[0] == $db_type)
-			echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'" selected="selected">'.$temp[1].'</option>'."\n";
-		else
-			echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'">'.$temp[1].'</option>'."\n";
-	}
+	foreach ($db_extensions as $db_type)
+		echo "\t\t\t\t\t\t\t".'<option value="'.$db_type[0].'">'.$db_type[1].'</option>'."\n";
 
 ?>
@@ -386,8 +156,8 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Database hostname'] ?></legend>
+					<legend>Saisissez l'adresse de votre serveur de base de donnÃ©es</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 3'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Database server hostname'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="text" name="req_db_host" value="<?php echo pun_htmlspecialchars($db_host) ?>" size="50" /><br /></label>
+						<p>L'adresse du serveur de base de donnÃ©es  (exemples : localhost, db.monhote.com ou 192.168.0.15). Vous pouvez indiquer un numÃ©ro de port personnalisÃ© au cas oÃ¹ votre base de donnÃ©e ne fonctionne pas sur le port par dÃ©faut  (exemple : localhost:3580). Pour le support de SQLite, Ã©crivez n'importe quoi ou laissez 'localhost'.</p>
+						<label><strong>HÃŽte serveur de base de donnÃ©es</strong><br /><input type="text" name="req_db_host" value="localhost" size="50" maxlength="100" /><br /></label>
 					</div>
 				</fieldset>
@@ -395,8 +165,8 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Database enter name'] ?></legend>
+					<legend>Saisissez le nom de votre base de donnÃ©es</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 4'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Database name'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_db_name" type="text" name="req_db_name" value="<?php echo pun_htmlspecialchars($db_name) ?>" size="30" /><br /></label>
+						<p>Le nom de la base de donnÃ©es sur laquelle PunBB sera installÃ©. La base de donnÃ©es doit exister. Pour SQLite, il s'agit du chemin relatif vers le fichier de base de donnÃ©es. Si ce fichier de base de donnÃ©es SQLite n'existe pas, PunBB essayera de le crÃ©er.</p>
+						<label for="req_db_name"><strong>Nom de la base de donnÃ©es</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label>
 					</div>
 				</fieldset>
@@ -404,9 +174,9 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Database enter informations'] ?></legend>
+					<legend>Saisissez votre nom d'utilisateur et votre mot de passe de la base de donnÃ©es</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 5'] ?></p>
-						<label class="conl"><?php echo $lang_install['Database username'] ?><br /><input type="text" name="db_username" value="<?php echo pun_htmlspecialchars($db_username) ?>" size="30" /><br /></label>
-						<label class="conl"><?php echo $lang_install['Database password'] ?><br /><input type="password" name="db_password" size="30" /><br /></label>
+						<p>Saisissez le nom d'utilisateur et le mot de passe que vous utilisez pour vous connecter Ã  la base de donnÃ©es. Ignorez pour SQLite.</p>
+						<label class="conl">Nom d'utilisateur <acronym title="Base de donnÃ©es">BDD</acronym><br /><input type="text" name="db_username" size="30" maxlength="50" /><br /></label>
+						<label class="conl">Mot de passe <acronym title="Base de donnÃ©es">BDD</acronym><br /><input type="text" name="db_password" size="30" maxlength="50" /><br /></label>
 						<div class="clearer"></div>
 					</div>
@@ -415,8 +185,8 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Database enter prefix'] ?></legend>
+					<legend>Saisissez le prÃ©fixe des tables</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 6'] ?></p>
-						<label><?php echo $lang_install['Table prefix'] ?><br /><input id="db_prefix" type="text" name="db_prefix" value="<?php echo pun_htmlspecialchars($db_prefix) ?>" size="20" maxlength="30" /><br /></label>
+						<p>Si vous le souhaitez vous pouvez indiquer un prÃ©fixe de tables. De cette faÃ§on vous pouvez utiliser plusieurs installations de PunBB sur la mÃªme base de donnÃ©es. (exemple : pun_).</p>
+						<label>PrÃ©fixe tables<br /><input id="db_prefix" type="text" name="db_prefix" size="20" maxlength="30" /><br /></label>
 					</div>
 				</fieldset>
@@ -424,12 +194,12 @@
 			<div class="inform">
 				<div class="forminfo">
-					<h3><?php echo $lang_install['Administration setup'] ?></h3>
-					<p><?php echo $lang_install['Info 7'] ?></p>
+					<h3>RÃ©glages d'administration</h3>
+					<p>Veuillez saisir les informations demandÃ©es ci-dessous afin de dÃ©finir un administrateur pour votre installation de PunBB.</p>
 				</div>
 				<fieldset>
-					<legend><?php echo $lang_install['Admin enter username'] ?></legend>
+					<legend>Saisissez le nom d'utilisateur de l'administrateur</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 8'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Administrator username'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="text" name="req_username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
+						<p>Le nom d'utilisateur de l'administrateur des forums. Vous pourrez par la suite crÃ©er de nouveaux administrateurs ainsi que des modÃ©rateurs. Ce nom d'utilisateur peut faire entre 2 et 25 caractÃšres de long.</p>
+						<label><strong>Nom d'utilisateur administrateur</strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
 					</div>
 				</fieldset>
@@ -437,9 +207,9 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Admin enter password'] ?></legend>
+					<legend>Saisissez et confirmez le mot de passe administrateur</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 9'] ?></p>
-						<label class="conl required"><strong><?php echo $lang_install['Password'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_password1" type="password" name="req_password1" size="16" /><br /></label>
-						<label class="conl required"><strong><?php echo $lang_install['Confirm password'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="password" name="req_password2" size="16" /><br /></label>
+					<p>Les mots de passe peuvent faire entre 4 et 16 caractÃšres de long. Les mots de passe sont sensibles Ã  la casse.</p>
+						<label class="conl"><strong>Mot de passe</strong><br /><input id="req_password1" type="text" name="req_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong>Confirmez le mot de passe</strong><br /><input type="text" name="req_password2" size="16" maxlength="16" /><br /></label>
 						<div class="clearer"></div>
 					</div>
@@ -448,21 +218,8 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Admin enter email'] ?></legend>
+					<legend>Saisissez l'adresse e-mail de l'administrateur</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 10'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Administrator email'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_email" type="text" name="req_email" value="<?php echo pun_htmlspecialchars($email) ?>" size="50" maxlength="80" /><br /></label>
-					</div>
-				</fieldset>
-			</div>
-			<div class="inform">
-				<div class="forminfo">
-					<h3><?php echo $lang_install['Board setup'] ?></h3>
-					<p><?php echo $lang_install['Info 11'] ?></p>
-				</div>
-				<fieldset>
-					<legend><?php echo $lang_install['Enter board title'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_install['Info 12'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Board title'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_title" type="text" name="req_title" value="<?php echo pun_htmlspecialchars($title) ?>" size="60" maxlength="255" /><br /></label>
+						<p>L'adresse e-mail de l'administrateur des forums.</p>
+						<label for="req_email"><strong>E-mail administrateur</strong><br /><input id="req_email" type="text" name="req_email" size="50" maxlength="50" /><br /></label>
 					</div>
 				</fieldset>
@@ -470,72 +227,17 @@
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_install['Enter board description'] ?></legend>
+					<legend>Saisissez l'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base de votre installation de PunBB</legend>
 					<div class="infldset">
-						<p><?php echo $lang_install['Info 13'] ?></p>
-						<label><?php echo $lang_install['Board description'] ?><br /><input id="desc" type="text" name="desc" value="<?php echo pun_htmlspecialchars($description) ?>" size="60" maxlength="255" /><br /></label>
+						<p>L'<acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base (sans slash Ã  la fin) de vos forums PunBB (exemple : http://forum.mondomaine.com ou http://monhote.com/~utilisateur). Ceci <strong>doit Ãªtre correct</strong> ou les administrateurs et modÃ©rateurs ne pourront valider aucun des formulaires. Veuillez noter que la valeur prÃ©-rÃ©glÃ©e ci-dessous est juste une proposition devinÃ©e par PunBB.</p>
+						<label><strong><acronym title="Uniform Resource Locator" lang="en">URL</acronym> de base</strong><br /><input type="text" name="req_base_url" value="http://<?php echo $_SERVER['SERVER_NAME'].str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])) ?>" size="60" maxlength="100" /><br /></label>
 					</div>
 				</fieldset>
 			</div>
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_install['Enter base URL'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_install['Info 14'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Base URL'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_base_url" type="text" name="req_base_url" value="<?php echo pun_htmlspecialchars($base_url) ?>" size="60" maxlength="100" /><br /></label>
-					</div>
-				</fieldset>
-			</div>
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_install['Choose the default language'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_install['Info 15'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Default language'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><select id="req_default_lang" name="req_default_lang">
-<?php
-
-		$languages = forum_list_langs();
-		foreach ($languages as $temp)
-		{
-			if ($temp == $default_lang)
-				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
-			else
-				echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
-		}
-
-?>
-						</select><br /></label>
-					</div>
-				</fieldset>
-			</div>
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_install['Choose the default style'] ?></legend>
-					<div class="infldset">
-						<p><?php echo $lang_install['Info 16'] ?></p>
-						<label class="required"><strong><?php echo $lang_install['Default style'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><select id="req_default_style" name="req_default_style">
-<?php
-
-		$styles = forum_list_styles();
-		foreach ($styles as $temp)
-		{
-			if ($temp == $default_style)
-				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
-			else
-				echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
-		}
-
-?>
-						</select><br /></label>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="start" value="<?php echo $lang_install['Start install'] ?>" /></p>
+			<p><input type="submit" name="start" value="Lancer l'installation" /></p>
 		</form>
 	</div>
 </div>
+
 </div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
@@ -547,4 +249,87 @@
 else
 {
+	//
+	// Strip slashes only if magic_quotes_gpc is on.
+	//
+	function unescape($str)
+	{
+		return (get_magic_quotes_gpc() == 1) ? stripslashes($str) : $str;
+	}
+
+
+	//
+	// Compute a hash of $str.
+	// Uses sha1() if available. If not, SHA1 through mhash() if available. If not, fall back on md5().
+	//
+	function pun_hash($str)
+	{
+		if (function_exists('sha1'))	// Only in PHP 4.3.0+
+			return sha1($str);
+		else if (function_exists('mhash'))	// Only if Mhash library is loaded
+			return bin2hex(mhash(MHASH_SHA1, $str));
+		else
+			return md5($str);
+	}
+
+
+	//
+	// A temporary replacement for the full error handler found in functions.php.
+	// It's here because a function called error() must be callable in the database abstraction layer.
+	//
+	function error($message, $file = false, $line = false, $db_error = false)
+	{
+		if ($file !== false && $line !== false)
+			echo '<strong style="color: A00000">Une erreur s\'est produite Ã  la ligne '.$line.' dans le fichier '.$file.'.</strong><br /><br />';
+		else
+			echo '<strong style="color: A00000">Une erreur s\'est produite.</strong><br /><br />';
+
+		echo '<strong>PunBB a rapportÃ©&#160;:</strong> '.htmlspecialchars($message).'<br /><br />';
+
+		if ($db_error !== false)
+			echo '<strong>La base de donnÃ©es a rapportÃ©&#160;:</strong> '.htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '');
+
+		exit;
+	}
+
+
+	$db_type = $_POST['req_db_type'];
+	$db_host = trim($_POST['req_db_host']);
+	$db_name = trim($_POST['req_db_name']);
+	$db_username = unescape(trim($_POST['db_username']));
+	$db_password = unescape(trim($_POST['db_password']));
+	$db_prefix = trim($_POST['db_prefix']);
+	$username = unescape(trim($_POST['req_username']));
+	$email = strtolower(trim($_POST['req_email']));
+	$password1 = unescape(trim($_POST['req_password1']));
+	$password2 = unescape(trim($_POST['req_password2']));
+
+
+	// Make sure base_url doesn't end with a slash
+	if (substr($_POST['req_base_url'], -1) == '/')
+		$base_url = substr($_POST['req_base_url'], 0, -1);
+	else
+		$base_url = $_POST['req_base_url'];
+
+
+	// Validate username and passwords
+	if (strlen($username) < 2)
+		error('Le nom d\'utilisateur administrateur doit faire au moins 2 caractÃšres de long. Veuillez retourner en arriÃšre et corriger.');
+	if (strlen($password1) < 4)
+		error('Le mot de passe administrateur doit faire au moins 4 caractÃšres de long. Veuillez retourner en arriÃšre et corriger.');
+	if ($password1 != $password2)
+		error('Les mots de passe administrateur ne correspondent pas. Veuillez retourner en arriÃšre et corriger.');
+	if (!strcasecmp($username, 'invitÃ©'))
+		error('Le nom d\'utilisateur \'invitÃ©\' est rÃ©servÃ©. Veuillez retourner en arriÃšre et corriger.');
+	if (!strcasecmp($username, 'guest'))
+		error('Le nom d\'utilisateur \'guest\' est rÃ©servÃ©. Veuillez retourner en arriÃšre et corriger.');
+	if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+		error('Les noms d\'utilisateur ne peuvent Ãªtre de la forme d\'une adresse IP. Veuillez retourner en arriÃšre et corriger.');
+	if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+		error('Le nom d\'utilisateur ne peut contenir aucune des balise de formatage (BBCode) que les forums utilisent. Veuillez retourner en arriÃšre et corriger.');
+
+	if (strlen($email) > 50 || !preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email))
+		error('L\'adresse e-mail administrateur que vous avez saisie est incorrecte. Veuillez retourner en arriÃšre et corriger.');
+
+
 	// Load the appropriate DB layer class
 	switch ($db_type)
@@ -554,16 +339,8 @@
 			break;
 
-		case 'mysql_innodb':
-			require PUN_ROOT.'include/dblayer/mysql_innodb.php';
-			break;
-
 		case 'mysqli':
 			require PUN_ROOT.'include/dblayer/mysqli.php';
 			break;
 
-		case 'mysqli_innodb':
-			require PUN_ROOT.'include/dblayer/mysqli_innodb.php';
-			break;
-
 		case 'pgsql':
 			require PUN_ROOT.'include/dblayer/pgsql.php';
@@ -573,7 +350,7 @@
 			require PUN_ROOT.'include/dblayer/sqlite.php';
 			break;
-
+			
 		default:
-			error(sprintf($lang_install['DB type not valid'], pun_htmlspecialchars($db_type)));
+			error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es valable.');
 	}
 
@@ -581,7 +358,4 @@
 	$db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, false);
 
-	// Validate prefix
-	if (strlen($db_prefix) > 0 && (!preg_match('%^[a-zA-Z_][a-zA-Z0-9_]*$%', $db_prefix) || strlen($db_prefix) > 40))
-		error(sprintf($lang_install['Table prefix error'], $db->prefix));
 
 	// Do some DB type specific checks
@@ -590,1010 +364,933 @@
 		case 'mysql':
 		case 'mysqli':
-		case 'mysql_innodb':
-		case 'mysqli_innodb':
-			$mysql_info = $db->get_version();
-			if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<'))
-				error(sprintf($lang_install['You are running error'], 'MySQL', $mysql_info['version'], FORUM_VERSION, MIN_MYSQL_VERSION));
-			break;
-
-		case 'pgsql':
-			$pgsql_info = $db->get_version();
-			if (version_compare($pgsql_info['version'], MIN_PGSQL_VERSION, '<'))
-				error(sprintf($lang_install['You are running error'], 'PostgreSQL', $pgsql_info['version'], FORUM_VERSION, MIN_PGSQL_VERSION));
+			break;
+
+		case 'pgsql':
+			// Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL)
+			if (version_compare(PHP_VERSION, '4.3.0', '<'))
+				error('Vous utilisez la version '.PHP_VERSION.'de PHP. PunBB nÃ©cÃ©ssite au minimum PHP 4.3.0 pour fonctionner correctement avec PostgreSQL. Vous devez mettre Ã  jour votre installation de PHP ou utiliser une base de donnÃ©es diffÃ©rente pour continuer.');
 			break;
 
 		case 'sqlite':
 			if (strtolower($db_prefix) == 'sqlite_')
-				error($lang_install['Prefix reserved']);
-			break;
-	}
-
-
-	// Make sure FluxBB isn't already installed
+				error('Le prÃ©fixe de tables \'sqlite_\' est rÃ©servÃ© pour l\'utilisation du moteur SQLite. Veuillez choisir un prÃ©fixe diffÃ©rent.');
+			break;
+	}
+
+
+	// Make sure PunBB isn't already installed
 	$result = $db->query('SELECT 1 FROM '.$db_prefix.'users WHERE id=1');
 	if ($db->num_rows($result))
-		error(sprintf($lang_install['Existing table error'], $db_prefix, $db_name));
-
-	// Check if InnoDB is available
-	if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-	{
-		$result = $db->query('SHOW VARIABLES LIKE \'have_innodb\'');
-		list (, $result) = $db->fetch_row($result);
-		if ((strtoupper($result) != 'YES'))
-			error($lang_install['InnoDB off']);
-	}
-
-
-	// Start a transaction
-	$db->start_transaction();
+		error('Une table nommÃ©e "'.$db_prefix.'users" est dÃ©jÃ  prÃ©sente dans la base de donnÃ©es "'.$db_name.'". Ceci pourrait signifier que PunBB est dÃ©jÃ  installÃ© ou qu\'un autre logiciel est installÃ© et occupe un ou plusieurs des noms de tables nÃ©cÃ©ssaires Ã  PunBB. Si vous souhaitez installer plusieurs copies de PunBB sur la mÃªme base de donnÃ©s, vous devez choisir des prÃ©fixes de tables diffÃ©rents.');
 
 
 	// Create all tables
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'username'		=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> true
-			),
-			'ip'			=> array(
-				'datatype'		=> 'VARCHAR(255)',
-				'allow_null'	=> true
-			),
-			'email'			=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> true
-			),
-			'message'		=> array(
-				'datatype'		=> 'VARCHAR(255)',
-				'allow_null'	=> true
-			),
-			'expire'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'ban_creator'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'INDEXES'		=> array(
-			'username_idx'	=> array('username')
-		)
-	);
-
-	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-		$schema['INDEXES']['username_idx'] = array('username(25)');
-
-	$db->create_table('bans', $schema) or error('Unable to create bans table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'cat_name'		=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> false,
-				'default'		=> '\'New Category\''
-			),
-			'disp_position'	=> array(
-				'datatype'		=> 'INT(10)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id')
-	);
-
-	$db->create_table('categories', $schema) or error('Unable to create categories table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'search_for'	=> array(
-				'datatype'		=> 'VARCHAR(60)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'replace_with'	=> array(
-				'datatype'		=> 'VARCHAR(60)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			)
-		),
-		'PRIMARY KEY'	=> array('id')
-	);
-
-	$db->create_table('censoring', $schema) or error('Unable to create censoring table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'conf_name'		=> array(
-				'datatype'		=> 'VARCHAR(255)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'conf_value'	=> array(
-				'datatype'		=> 'TEXT',
-				'allow_null'	=> true
-			)
-		),
-		'PRIMARY KEY'	=> array('conf_name')
-	);
-
-	$db->create_table('config', $schema) or error('Unable to create config table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'group_id'		=> array(
-				'datatype'		=> 'INT(10)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'forum_id'		=> array(
-				'datatype'		=> 'INT(10)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'read_forum'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'post_replies'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'post_topics'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			)
-		),
-		'PRIMARY KEY'	=> array('group_id', 'forum_id')
-	);
-
-	$db->create_table('forum_perms', $schema) or error('Unable to create forum_perms table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'forum_name'	=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> false,
-				'default'		=> '\'New forum\''
-			),
-			'forum_desc'	=> array(
-				'datatype'		=> 'TEXT',
-				'allow_null'	=> true
-			),
-			'redirect_url'	=> array(
-				'datatype'		=> 'VARCHAR(100)',
-				'allow_null'	=> true
-			),
-			'moderators'	=> array(
-				'datatype'		=> 'TEXT',
-				'allow_null'	=> true
-			),
-			'num_topics'	=> array(
-				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'num_posts'		=> array(
-				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_post'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_post_id'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_poster'	=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> true
-			),
-			'sort_by'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'disp_position'	=> array(
-				'datatype'		=> 'INT(10)',
-				'allow_null'	=> false,
-				'default'		=>	'0'
-			),
-			'cat_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=>	'0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id')
-	);
-
-	$db->create_table('forums', $schema) or error('Unable to create forums table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'g_id'						=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'g_title'					=> array(
-				'datatype'		=> 'VARCHAR(50)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'g_user_title'				=> array(
-				'datatype'		=> 'VARCHAR(50)',
-				'allow_null'	=> true
-			),
-			'g_moderator'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'g_mod_edit_users'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'g_mod_rename_users'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'g_mod_change_passwords'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'g_mod_ban_users'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'g_read_board'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_view_users'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_post_replies'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_post_topics'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_edit_posts'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_delete_posts'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_delete_topics'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_set_title'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_search'					=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_search_users'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_send_email'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'g_post_flood'				=> array(
-				'datatype'		=> 'SMALLINT(6)',
-				'allow_null'	=> false,
-				'default'		=> '30'
-			),
-			'g_search_flood'			=> array(
-				'datatype'		=> 'SMALLINT(6)',
-				'allow_null'	=> false,
-				'default'		=> '30'
-			),
-			'g_email_flood'				=> array(
-				'datatype'		=> 'SMALLINT(6)',
-				'allow_null'	=> false,
-				'default'		=> '60'
-			),
-			'g_report_flood'			=> array(
-				'datatype'		=> 'SMALLINT(6)',
-				'allow_null'	=> false,
-				'default'		=> '60'
-			)
-		),
-		'PRIMARY KEY'	=> array('g_id')
-	);
-
-	$db->create_table('groups', $schema) or error('Unable to create groups table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'user_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'ident'			=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'logged'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'idle'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_post'			=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_search'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-		),
-		'UNIQUE KEYS'	=> array(
-			'user_id_ident_idx'	=> array('user_id', 'ident')
-		),
-		'INDEXES'		=> array(
-			'ident_idx'		=> array('ident'),
-			'logged_idx'	=> array('logged')
-		)
-	);
-
-	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-	{
-		$schema['UNIQUE KEYS']['user_id_ident_idx'] = array('user_id', 'ident(25)');
-		$schema['INDEXES']['ident_idx'] = array('ident(25)');
-	}
-
-	if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-		$schema['ENGINE'] = 'InnoDB';
-
-	$db->create_table('online', $schema) or error('Unable to create online table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'poster'		=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'poster_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'poster_ip'		=> array(
-				'datatype'		=> 'VARCHAR(39)',
-				'allow_null'	=> true
-			),
-			'poster_email'	=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> true
-			),
-			'message'		=> array(
-				'datatype'		=> 'MEDIUMTEXT',
-				'allow_null'	=> true
-			),
-			'hide_smilies'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'posted'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'edited'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'edited_by'		=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> true
-			),
-			'topic_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'INDEXES'		=> array(
-			'topic_id_idx'	=> array('topic_id'),
-			'multi_idx'		=> array('poster_id', 'topic_id')
-		)
-	);
-
-	$db->create_table('posts', $schema) or error('Unable to create posts table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'rank'			=> array(
-				'datatype'		=> 'VARCHAR(50)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'min_posts'		=> array(
-				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id')
-	);
-
-	$db->create_table('ranks', $schema) or error('Unable to create ranks table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'post_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'topic_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'forum_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'reported_by'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'created'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'message'		=> array(
-				'datatype'		=> 'TEXT',
-				'allow_null'	=> true
-			),
-			'zapped'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'zapped_by'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			)
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'INDEXES'		=> array(
-			'zapped_idx'	=> array('zapped')
-		)
-	);
-
-	$db->create_table('reports', $schema) or error('Unable to create reports table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'ident'			=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'search_data'	=> array(
-				'datatype'		=> 'MEDIUMTEXT',
-				'allow_null'	=> true
-			)
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'INDEXES'		=> array(
-			'ident_idx'	=> array('ident')
-		)
-	);
-
-	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-		$schema['INDEXES']['ident_idx'] = array('ident(8)');
-
-	$db->create_table('search_cache', $schema) or error('Unable to create search_cache table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'post_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'word_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'subject_match'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'INDEXES'		=> array(
-			'word_id_idx'	=> array('word_id'),
-			'post_id_idx'	=> array('post_id')
-		)
-	);
-
-	$db->create_table('search_matches', $schema) or error('Unable to create search_matches table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'word'			=> array(
-				'datatype'		=> 'VARCHAR(20)',
-				'allow_null'	=> false,
-				'default'		=> '\'\'',
-				'collation'		=> 'bin'
-			)
-		),
-		'PRIMARY KEY'	=> array('word'),
-		'INDEXES'		=> array(
-			'id_idx'	=> array('id')
-		)
-	);
-
-	if ($db_type == 'sqlite')
-	{
-		$schema['PRIMARY KEY'] = array('id');
-		$schema['UNIQUE KEYS'] = array('word_idx'	=> array('word'));
-	}
-
-	$db->create_table('search_words', $schema) or error('Unable to create search_words table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'user_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'topic_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('user_id', 'topic_id')
-	);
-
-	$db->create_table('topic_subscriptions', $schema) or error('Unable to create topic subscriptions table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'user_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'forum_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('user_id', 'forum_id')
-	);
-
-	$db->create_table('forum_subscriptions', $schema) or error('Unable to create forum subscriptions table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'			=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'poster'		=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'subject'		=> array(
-				'datatype'		=> 'VARCHAR(255)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'posted'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'first_post_id'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_post'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_post_id'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_poster'	=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> true
-			),
-			'num_views'		=> array(
-				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'num_replies'	=> array(
-				'datatype'		=> 'MEDIUMINT(8) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'closed'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'sticky'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'moved_to'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'forum_id'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			)
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'INDEXES'		=> array(
-			'forum_id_idx'		=> array('forum_id'),
-			'moved_to_idx'		=> array('moved_to'),
-			'last_post_idx'		=> array('last_post'),
-			'first_post_id_idx'	=> array('first_post_id')
-		)
-	);
-
-	$db->create_table('topics', $schema) or error('Unable to create topics table', __FILE__, __LINE__, $db->error());
-
-
-	$schema = array(
-		'FIELDS'		=> array(
-			'id'				=> array(
-				'datatype'		=> 'SERIAL',
-				'allow_null'	=> false
-			),
-			'group_id'			=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '3'
-			),
-			'username'			=> array(
-				'datatype'		=> 'VARCHAR(200)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'password'			=> array(
-				'datatype'		=> 'VARCHAR(40)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'email'				=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> false,
-				'default'		=> '\'\''
-			),
-			'title'				=> array(
-				'datatype'		=> 'VARCHAR(50)',
-				'allow_null'	=> true
-			),
-			'realname'			=> array(
-				'datatype'		=> 'VARCHAR(40)',
-				'allow_null'	=> true
-			),
-			'url'				=> array(
-				'datatype'		=> 'VARCHAR(100)',
-				'allow_null'	=> true
-			),
-			'jabber'			=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> true
-			),
-			'icq'				=> array(
-				'datatype'		=> 'VARCHAR(12)',
-				'allow_null'	=> true
-			),
-			'msn'				=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> true
-			),
-			'aim'				=> array(
-				'datatype'		=> 'VARCHAR(30)',
-				'allow_null'	=> true
-			),
-			'yahoo'				=> array(
-				'datatype'		=> 'VARCHAR(30)',
-				'allow_null'	=> true
-			),
-			'location'			=> array(
-				'datatype'		=> 'VARCHAR(30)',
-				'allow_null'	=> true
-			),
-			'signature'			=> array(
-				'datatype'		=> 'TEXT',
-				'allow_null'	=> true
-			),
-			'disp_topics'		=> array(
-				'datatype'		=> 'TINYINT(3) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'disp_posts'		=> array(
-				'datatype'		=> 'TINYINT(3) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'email_setting'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'notify_with_post'	=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'auto_notify'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'show_smilies'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'show_img'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'show_img_sig'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'show_avatars'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'show_sig'			=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '1'
-			),
-			'timezone'			=> array(
-				'datatype'		=> 'FLOAT',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'dst'				=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'time_format'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'date_format'		=> array(
-				'datatype'		=> 'TINYINT(1)',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'language'			=> array(
-				'datatype'		=> 'VARCHAR(25)',
-				'allow_null'	=> false,
-				'default'		=> '\''.$db->escape($default_lang).'\''
-			),
-			'style'				=> array(
-				'datatype'		=> 'VARCHAR(25)',
-				'allow_null'	=> false,
-				'default'		=> '\''.$db->escape($default_style).'\''
-			),
-			'num_posts'			=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'last_post'			=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_search'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_email_sent'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'last_report_sent'	=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> true
-			),
-			'registered'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'registration_ip'	=> array(
-				'datatype'		=> 'VARCHAR(39)',
-				'allow_null'	=> false,
-				'default'		=> '\'0.0.0.0\''
-			),
-			'last_visit'		=> array(
-				'datatype'		=> 'INT(10) UNSIGNED',
-				'allow_null'	=> false,
-				'default'		=> '0'
-			),
-			'admin_note'		=> array(
-				'datatype'		=> 'VARCHAR(30)',
-				'allow_null'	=> true
-			),
-			'activate_string'	=> array(
-				'datatype'		=> 'VARCHAR(80)',
-				'allow_null'	=> true
-			),
-			'activate_key'		=> array(
-				'datatype'		=> 'VARCHAR(8)',
-				'allow_null'	=> true
-			),
-		),
-		'PRIMARY KEY'	=> array('id'),
-		'UNIQUE KEYS'	=> array(
-			'username_idx'		=> array('username')
-		),
-		'INDEXES'		=> array(
-			'registered_idx'	=> array('registered')
-		)
-	);
-
-	if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
-		$schema['UNIQUE KEYS']['username_idx'] = array('username(25)');
-
-	$db->create_table('users', $schema) or error('Unable to create users table', __FILE__, __LINE__, $db->error());
-
-
-	$now = time();
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					username VARCHAR(200),
+					ip VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INT(10) UNSIGNED,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$db->start_transaction();
+
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id SERIAL,
+					username VARCHAR(200),
+					ip VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INT,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$db->start_transaction();
+
+			$sql = 'CREATE TABLE '.$db_prefix."bans (
+					id INTEGER NOT NULL,
+					username VARCHAR(200),
+					ip  VARCHAR(255),
+					email VARCHAR(50),
+					message VARCHAR(255),
+					expire INTEGER,
+					PRIMARY KEY (id)
+					)";
+			break;
+			
+		
+		default:  
+			error('\''.$db_type.'\' n\'est pas un type de base de donnÃ©es correct.'); 
+
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'bans. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INT(10) NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id SERIAL,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."categories (
+					id INTEGER NOT NULL,
+					cat_name VARCHAR(80) NOT NULL DEFAULT 'New Category',
+					disp_position INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'categories. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id SERIAL,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."censoring (
+					id INTEGER NOT NULL,
+					search_for VARCHAR(60) NOT NULL DEFAULT '',
+					replace_with VARCHAR(60) NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'censoring. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."config (
+					conf_name VARCHAR(255) NOT NULL DEFAULT '',
+					conf_value TEXT,
+					PRIMARY KEY (conf_name)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'config. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INT(10) NOT NULL DEFAULT 0,
+					forum_id INT(10) NOT NULL DEFAULT 0,
+					read_forum TINYINT(1) NOT NULL DEFAULT 1,
+					post_replies TINYINT(1) NOT NULL DEFAULT 1,
+					post_topics TINYINT(1) NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INT NOT NULL DEFAULT 0,
+					forum_id INT NOT NULL DEFAULT 0,
+					read_forum SMALLINT NOT NULL DEFAULT 1,
+					post_replies SMALLINT NOT NULL DEFAULT 1,
+					post_topics SMALLINT NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."forum_perms (
+					group_id INTEGER NOT NULL DEFAULT 0,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					read_forum INTEGER NOT NULL DEFAULT 1,
+					post_replies INTEGER NOT NULL DEFAULT 1,
+					post_topics INTEGER NOT NULL DEFAULT 1,
+					PRIMARY KEY (group_id, forum_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'forum_perms. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					num_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED,
+					last_post_id INT(10) UNSIGNED,
+					last_poster VARCHAR(200),
+					sort_by TINYINT(1) NOT NULL DEFAULT 0,
+					disp_position INT(10) NOT NULL DEFAULT 0,
+					cat_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id SERIAL,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics INT NOT NULL DEFAULT 0,
+					num_posts INT NOT NULL DEFAULT 0,
+					last_post INT,
+					last_post_id INT,
+					last_poster VARCHAR(200),
+					sort_by SMALLINT NOT NULL DEFAULT 0,
+					disp_position INT NOT NULL DEFAULT 0,
+					cat_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."forums (
+					id INTEGER NOT NULL,
+					forum_name VARCHAR(80) NOT NULL DEFAULT 'New forum',
+					forum_desc TEXT,
+					redirect_url VARCHAR(100),
+					moderators TEXT,
+					num_topics INTEGER NOT NULL DEFAULT 0,
+					num_posts INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER,
+					last_post_id INTEGER,
+					last_poster VARCHAR(200),
+					sort_by INTEGER NOT NULL DEFAULT 0,
+					disp_position INTEGER NOT NULL DEFAULT 0,
+					cat_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'forums. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_replies TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_topics TINYINT(1) NOT NULL DEFAULT 1,
+					g_post_polls TINYINT(1) NOT NULL DEFAULT 1,
+					g_edit_posts TINYINT(1) NOT NULL DEFAULT 1,
+					g_delete_posts TINYINT(1) NOT NULL DEFAULT 1,
+					g_delete_topics TINYINT(1) NOT NULL DEFAULT 1,
+					g_set_title TINYINT(1) NOT NULL DEFAULT 1,
+					g_search TINYINT(1) NOT NULL DEFAULT 1,
+					g_search_users TINYINT(1) NOT NULL DEFAULT 1,
+					g_edit_subjects_interval SMALLINT(6) NOT NULL DEFAULT 300,
+					g_post_flood SMALLINT(6) NOT NULL DEFAULT 30,
+					g_search_flood SMALLINT(6) NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id SERIAL,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board SMALLINT NOT NULL DEFAULT 1,
+					g_post_replies SMALLINT NOT NULL DEFAULT 1,
+					g_post_topics SMALLINT NOT NULL DEFAULT 1,
+					g_post_polls SMALLINT NOT NULL DEFAULT 1,
+					g_edit_posts SMALLINT NOT NULL DEFAULT 1,
+					g_delete_posts SMALLINT NOT NULL DEFAULT 1,
+					g_delete_topics SMALLINT NOT NULL DEFAULT 1,
+					g_set_title SMALLINT NOT NULL DEFAULT 1,
+					g_search SMALLINT NOT NULL DEFAULT 1,
+					g_search_users SMALLINT NOT NULL DEFAULT 1,
+					g_edit_subjects_interval SMALLINT NOT NULL DEFAULT 300,
+					g_post_flood SMALLINT NOT NULL DEFAULT 30,
+					g_search_flood SMALLINT NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."groups (
+					g_id INTEGER NOT NULL,
+					g_title VARCHAR(50) NOT NULL DEFAULT '',
+					g_user_title VARCHAR(50),
+					g_read_board INTEGER NOT NULL DEFAULT 1,
+					g_post_replies INTEGER NOT NULL DEFAULT 1,
+					g_post_topics INTEGER NOT NULL DEFAULT 1,
+					g_post_polls INTEGER NOT NULL DEFAULT 1,
+					g_edit_posts INTEGER NOT NULL DEFAULT 1,
+					g_delete_posts INTEGER NOT NULL DEFAULT 1,
+					g_delete_topics INTEGER NOT NULL DEFAULT 1,
+					g_set_title INTEGER NOT NULL DEFAULT 1,
+					g_search INTEGER NOT NULL DEFAULT 1,
+					g_search_users INTEGER NOT NULL DEFAULT 1,
+					g_edit_subjects_interval INTEGER NOT NULL DEFAULT 300,
+					g_post_flood INTEGER NOT NULL DEFAULT 30,
+					g_search_flood INTEGER NOT NULL DEFAULT 30,
+					PRIMARY KEY (g_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'groups. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					idle TINYINT(1) NOT NULL DEFAULT 0
+					) TYPE=HEAP;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INT NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INT NOT NULL DEFAULT 0,
+					idle SMALLINT NOT NULL DEFAULT 0
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."online (
+					user_id INTEGER NOT NULL DEFAULT 1,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					logged INTEGER NOT NULL DEFAULT 0,
+					idle INTEGER NOT NULL DEFAULT 0
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'online. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies TINYINT(1) NOT NULL DEFAULT 0,
+					posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					edited INT(10) UNSIGNED,
+					edited_by VARCHAR(200),
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id SERIAL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INT NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies SMALLINT NOT NULL DEFAULT 0,
+					posted INT NOT NULL DEFAULT 0,
+					edited INT,
+					edited_by VARCHAR(200),
+					topic_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."posts (
+					id INTEGER NOT NULL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					poster_id INTEGER NOT NULL DEFAULT 1,
+					poster_ip VARCHAR(15),
+					poster_email VARCHAR(50),
+					message TEXT NOT NULL DEFAULT '',
+					hide_smilies INTEGER NOT NULL DEFAULT 0,
+					posted INTEGER NOT NULL DEFAULT 0,
+					edited INTEGER,
+					edited_by VARCHAR(200),
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'posts. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id SERIAL,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."ranks (
+					id INTEGER NOT NULL,
+					rank VARCHAR(50) NOT NULL DEFAULT '',
+					min_posts INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'titles. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					created INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INT(10) UNSIGNED,
+					zapped_by INT(10) UNSIGNED,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id SERIAL,
+					post_id INT NOT NULL DEFAULT 0,
+					topic_id INT NOT NULL DEFAULT 0,
+					forum_id INT NOT NULL DEFAULT 0,
+					reported_by INT NOT NULL DEFAULT 0,
+					created INT NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INT,
+					zapped_by INT,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."reports (
+					id INTEGER NOT NULL,
+					post_id INTEGER NOT NULL DEFAULT 0,
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					reported_by INTEGER NOT NULL DEFAULT 0,
+					created INTEGER NOT NULL DEFAULT 0,
+					message TEXT NOT NULL DEFAULT '',
+					zapped INTEGER,
+					zapped_by INTEGER,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'reports. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INT NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_cache (
+					id INTEGER NOT NULL DEFAULT 0,
+					ident VARCHAR(200) NOT NULL DEFAULT '',
+					search_data TEXT NOT NULL DEFAULT '',
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_cache. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					word_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					subject_match TINYINT(1) NOT NULL DEFAULT 0
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INT NOT NULL DEFAULT 0,
+					word_id INT NOT NULL DEFAULT 0,
+					subject_match SMALLINT NOT NULL DEFAULT 0
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_matches (
+					post_id INTEGER NOT NULL DEFAULT 0,
+					word_id INTEGER NOT NULL DEFAULT 0,
+					subject_match INTEGER NOT NULL DEFAULT 0
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_matches. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
+					word VARCHAR(20) BINARY NOT NULL DEFAULT '',
+					PRIMARY KEY (word),
+					KEY ".$db_prefix."search_words_id_idx (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id SERIAL,
+					word VARCHAR(20) NOT NULL DEFAULT '',
+					PRIMARY KEY (word)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."search_words (
+					id INTEGER NOT NULL,
+					word VARCHAR(20) NOT NULL DEFAULT '',
+					PRIMARY KEY (id),
+					UNIQUE (word)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'search_words. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					topic_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INT NOT NULL DEFAULT 0,
+					topic_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."subscriptions (
+					user_id INTEGER NOT NULL DEFAULT 0,
+					topic_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (user_id, topic_id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'subscriptions. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					num_replies MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0,
+					closed TINYINT(1) NOT NULL DEFAULT 0,
+					sticky TINYINT(1) NOT NULL DEFAULT 0,
+					moved_to INT(10) UNSIGNED,
+					forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id SERIAL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INT NOT NULL DEFAULT 0,
+					last_post INT NOT NULL DEFAULT 0,
+					last_post_id INT NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views INT NOT NULL DEFAULT 0,
+					num_replies INT NOT NULL DEFAULT 0,
+					closed SMALLINT NOT NULL DEFAULT 0,
+					sticky SMALLINT NOT NULL DEFAULT 0,
+					moved_to INT,
+					forum_id INT NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."topics (
+					id INTEGER NOT NULL,
+					poster VARCHAR(200) NOT NULL DEFAULT '',
+					subject VARCHAR(255) NOT NULL DEFAULT '',
+					posted INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER NOT NULL DEFAULT 0,
+					last_post_id INTEGER NOT NULL DEFAULT 0,
+					last_poster VARCHAR(200),
+					num_views INTEGER NOT NULL DEFAULT 0,
+					num_replies INTEGER NOT NULL DEFAULT 0,
+					closed INTEGER NOT NULL DEFAULT 0,
+					sticky INTEGER NOT NULL DEFAULT 0,
+					moved_to INTEGER,
+					forum_id INTEGER NOT NULL DEFAULT 0,
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'topics. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+					group_id INT(10) UNSIGNED NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar TINYINT(1) NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics TINYINT(3) UNSIGNED,
+					disp_posts TINYINT(3) UNSIGNED,
+					email_setting TINYINT(1) NOT NULL DEFAULT 1,
+					save_pass TINYINT(1) NOT NULL DEFAULT 1,
+					notify_with_post TINYINT(1) NOT NULL DEFAULT 0,
+					show_smilies TINYINT(1) NOT NULL DEFAULT 1,
+					show_img TINYINT(1) NOT NULL DEFAULT 1,
+					show_img_sig TINYINT(1) NOT NULL DEFAULT 1,
+					show_avatars TINYINT(1) NOT NULL DEFAULT 1,
+					show_sig TINYINT(1) NOT NULL DEFAULT 1,
+					timezone FLOAT NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					last_post INT(10) UNSIGNED,
+					registered INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INT(10) UNSIGNED NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					) TYPE=MyISAM;";
+			break;
+
+		case 'pgsql':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id SERIAL,
+					group_id INT NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar SMALLINT NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics SMALLINT,
+					disp_posts SMALLINT,
+					email_setting SMALLINT NOT NULL DEFAULT 1,
+					save_pass SMALLINT NOT NULL DEFAULT 1,
+					notify_with_post SMALLINT NOT NULL DEFAULT 0,
+					show_smilies SMALLINT NOT NULL DEFAULT 1,
+					show_img SMALLINT NOT NULL DEFAULT 1,
+					show_img_sig SMALLINT NOT NULL DEFAULT 1,
+					show_avatars SMALLINT NOT NULL DEFAULT 1,
+					show_sig SMALLINT NOT NULL DEFAULT 1,
+					timezone REAL NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INT NOT NULL DEFAULT 0,
+					last_post INT,
+					registered INT NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INT NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					)";
+			break;
+
+		case 'sqlite':
+			$sql = 'CREATE TABLE '.$db_prefix."users (
+					id INTEGER NOT NULL,
+					group_id INTEGER NOT NULL DEFAULT 4,
+					username VARCHAR(200) NOT NULL DEFAULT '',
+					password VARCHAR(40) NOT NULL DEFAULT '',
+					email VARCHAR(50) NOT NULL DEFAULT '',
+					title VARCHAR(50),
+					realname VARCHAR(40),
+					url VARCHAR(100),
+					jabber VARCHAR(75),
+					icq VARCHAR(12),
+					msn VARCHAR(50),
+					aim VARCHAR(30),
+					yahoo VARCHAR(30),
+					location VARCHAR(30),
+					use_avatar INTEGER NOT NULL DEFAULT 0,
+					signature TEXT,
+					disp_topics INTEGER,
+					disp_posts INTEGER,
+					email_setting INTEGER NOT NULL DEFAULT 1,
+					save_pass INTEGER NOT NULL DEFAULT 1,
+					notify_with_post INTEGER NOT NULL DEFAULT 0,
+					show_smilies INTEGER NOT NULL DEFAULT 1,
+					show_img INTEGER NOT NULL DEFAULT 1,
+					show_img_sig INTEGER NOT NULL DEFAULT 1,
+					show_avatars INTEGER NOT NULL DEFAULT 1,
+					show_sig INTEGER NOT NULL DEFAULT 1,
+					timezone FLOAT NOT NULL DEFAULT 0,
+					language VARCHAR(25) NOT NULL DEFAULT 'English',
+					style VARCHAR(25) NOT NULL DEFAULT 'Oxygen',
+					num_posts INTEGER NOT NULL DEFAULT 0,
+					last_post INTEGER,
+					registered INTEGER NOT NULL DEFAULT 0,
+					registration_ip VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+					last_visit INTEGER NOT NULL DEFAULT 0,
+					admin_note VARCHAR(30),
+					activate_string VARCHAR(50),
+					activate_key VARCHAR(8),
+					PRIMARY KEY (id)
+					)";
+			break;
+	}
+
+	$db->query($sql) or error('Impossible de crÃ©er la table '.$db_prefix.'users. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
+
+	// Add some indexes
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			// We use MySQL's ALTER TABLE ... ADD INDEX syntax instead of CREATE INDEX to avoid problems with users lacking the INDEX privilege
+			$queries[] = 'ALTER TABLE '.$db_prefix.'online ADD INDEX '.$db_prefix.'online_user_id_idx(user_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_topic_id_idx(topic_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'posts ADD INDEX '.$db_prefix.'posts_multi_idx(poster_id, topic_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'reports ADD INDEX '.$db_prefix.'reports_zapped_idx(zapped)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX '.$db_prefix.'search_matches_word_id_idx(word_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_matches ADD INDEX '.$db_prefix.'search_matches_post_id_idx(post_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX '.$db_prefix.'topics_forum_id_idx(forum_id)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'topics ADD INDEX '.$db_prefix.'topics_moved_to_idx(moved_to)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX '.$db_prefix.'users_registered_idx(registered)';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'search_cache ADD INDEX '.$db_prefix.'search_cache_ident_idx(ident(8))';
+			$queries[] = 'ALTER TABLE '.$db_prefix.'users ADD INDEX '.$db_prefix.'users_username_idx(username(8))';
+			break;
+
+		default:
+			$queries[] = 'CREATE INDEX '.$db_prefix.'online_user_id_idx ON '.$db_prefix.'online(user_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'posts_topic_id_idx ON '.$db_prefix.'posts(topic_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'posts_multi_idx ON '.$db_prefix.'posts(poster_id, topic_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'reports_zapped_idx ON '.$db_prefix.'reports(zapped)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_word_id_idx ON '.$db_prefix.'search_matches(word_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_matches_post_id_idx ON '.$db_prefix.'search_matches(post_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'topics_forum_id_idx ON '.$db_prefix.'topics(forum_id)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'topics_moved_to_idx ON '.$db_prefix.'topics(moved_to)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'users_registered_idx ON '.$db_prefix.'users(registered)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'users_username_idx ON '.$db_prefix.'users(username)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_cache_ident_idx ON '.$db_prefix.'search_cache(ident)';
+			$queries[] = 'CREATE INDEX '.$db_prefix.'search_words_id_idx ON '.$db_prefix.'search_words(id)';
+			break;
+	}
+
+	@reset($queries);
+	while (list(, $sql) = @each($queries))
+		$db->query($sql) or error('Impossible de crÃ©er les index. Veuillez vÃ©rifier vos rÃ©glages et essayer Ã  nouveau.',  __FILE__, __LINE__, $db->error());
+
 
 	// Insert the four preset groups
-	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES('.($db_type != 'pgsql' ? '1, ' : '').'\''.$db->escape($lang_install['Administrators']).'\', \''.$db->escape($lang_install['Administrator']).'\', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES('.($db_type != 'pgsql' ? '2, ' : '').'\''.$db->escape($lang_install['Moderators']).'\', \''.$db->escape($lang_install['Moderator']).'\', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES('.($db_type != 'pgsql' ? '3, ' : '').'\''.$db->escape($lang_install['Guests']).'\', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 60, 30, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db->prefix.'groups ('.($db_type != 'pgsql' ? 'g_id, ' : '').'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES('.($db_type != 'pgsql' ? '4, ' : '').'\''.$db->escape($lang_install['Members']).'\', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
-
-	// Insert guest and first admin user
-	$db->query('INSERT INTO '.$db_prefix.'users (group_id, username, password, email) VALUES(3, \''.$db->escape($lang_install['Guest']).'\', \''.$db->escape($lang_install['Guest']).'\', \''.$db->escape($lang_install['Guest']).'\')')
-		or error('Unable to add guest user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'users (group_id, username, password, email, language, style, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, \''.$db->escape($username).'\', \''.pun_hash($password1).'\', \''.$email.'\', \''.$db->escape($default_lang).'\', \''.$db->escape($default_style).'\', 1, '.$now.', '.$now.', \''.get_remote_address().'\', '.$now.')')
-		or error('Unable to add administrator user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	// Enable/disable avatars depending on file_uploads setting in PHP configuration
-	$avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1')) ? 1 : 0;
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Administrateurs', 'Administrateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('ModÃ©rateurs', 'ModÃ©rateur', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('InvitÃ©s', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+	$db->query('INSERT INTO '.$db->prefix."groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Membres', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30)") or error('Impossible d\ajouter un groupe', __FILE__, __LINE__, $db->error());
+
 
 	// Insert config data
 	$config = array(
-		'o_cur_version'				=> "'".FORUM_VERSION."'",
-		'o_database_revision'		=> "'".FORUM_DB_REVISION."'",
-		'o_searchindex_revision'	=> "'".FORUM_SI_REVISION."'",
-		'o_parser_revision'			=> "'".FORUM_PARSER_REVISION."'",
-		'o_board_title'				=> "'".$db->escape($title)."'",
-		'o_board_desc'				=> "'".$db->escape($description)."'",
-		'o_default_timezone'		=> "'0'",
+		'o_cur_version'				=> "'$punbb_version'",
+		'o_cur_version_fr'			=> "'$punbb_version_fr'",
+		'o_board_title'				=> "'Mon forum PunBB'",
+		'o_board_desc'				=> "'Malheureusement personne ne peut vous dire ce que PunBB est - vous devez le voir par vous-mÃªme.'",
+		'o_server_timezone'			=> "'0'",
 		'o_time_format'				=> "'H:i:s'",
-		'o_date_format'				=> "'Y-m-d'",
-		'o_timeout_visit'			=> "'1800'",
+		'o_date_format'				=> "'d-m-Y'",
+		'o_timeout_visit'			=> "'600'",
 		'o_timeout_online'			=> "'300'",
 		'o_redirect_delay'			=> "'1'",
@@ -1601,10 +1298,9 @@
 		'o_show_user_info'			=> "'1'",
 		'o_show_post_count'			=> "'1'",
-		'o_signatures'				=> "'1'",
 		'o_smilies'					=> "'1'",
 		'o_smilies_sig'				=> "'1'",
 		'o_make_links'				=> "'1'",
-		'o_default_lang'			=> "'".$db->escape($default_lang)."'",
-		'o_default_style'			=> "'".$db->escape($default_style)."'",
+		'o_default_lang'			=> "'French'",
+		'o_default_style'			=> "'Oxygen'",
 		'o_default_user_group'		=> "'4'",
 		'o_topic_review'			=> "'15'",
@@ -1612,5 +1308,4 @@
 		'o_disp_posts_default'		=> "'25'",
 		'o_indent_num_spaces'		=> "'4'",
-		'o_quote_depth'				=> "'3'",
 		'o_quickpost'				=> "'1'",
 		'o_users_online'			=> "'1'",
@@ -1618,5 +1313,4 @@
 		'o_ranks'					=> "'1'",
 		'o_show_dot'				=> "'0'",
-		'o_topic_views'				=> "'1'",
 		'o_quickjump'				=> "'1'",
 		'o_gzip'					=> "'0'",
@@ -1624,7 +1318,6 @@
 		'o_report_method'			=> "'0'",
 		'o_regs_report'				=> "'0'",
-		'o_default_email_setting'	=> "'1'",
-		'o_mailing_list'			=> "'".$email."'",
-		'o_avatars'					=> "'".$avatars."'",
+		'o_mailing_list'			=> "'$email'",
+		'o_avatars'					=> "'1'",
 		'o_avatars_dir'				=> "'img/avatars'",
 		'o_avatars_width'			=> "'60'",
@@ -1632,24 +1325,23 @@
 		'o_avatars_size'			=> "'10240'",
 		'o_search_all_forums'		=> "'1'",
-		'o_base_url'				=> "'".$db->escape($base_url)."'",
-		'o_admin_email'				=> "'".$email."'",
-		'o_webmaster_email'			=> "'".$email."'",
-		'o_forum_subscriptions'		=> "'1'",
-		'o_topic_subscriptions'		=> "'1'",
+		'o_base_url'				=> "'$base_url'",
+		'o_admin_email'				=> "'$email'",
+		'o_webmaster_email'			=> "'$email'",
+		'o_subscriptions'			=> "'1'",
 		'o_smtp_host'				=> "NULL",
 		'o_smtp_user'				=> "NULL",
 		'o_smtp_pass'				=> "NULL",
-		'o_smtp_ssl'				=> "'0'",
 		'o_regs_allow'				=> "'1'",
 		'o_regs_verify'				=> "'0'",
 		'o_announcement'			=> "'0'",
-		'o_announcement_message'	=> "'".$db->escape($lang_install['Announcement'])."'",
+		'o_announcement_message'	=> "'Saisissez votre annonce ici.'",
 		'o_rules'					=> "'0'",
-		'o_rules_message'			=> "'".$db->escape($lang_install['Rules'])."'",
+		'o_rules_message'			=> "'Saisissez vos rÃšgles ici.'",
 		'o_maintenance'				=> "'0'",
-		'o_maintenance_message'		=> "'".$db->escape($lang_install['Maintenance message'])."'",
-		'o_default_dst'				=> "'0'",
-		'o_feed_type'				=> "'2'",
-		'o_feed_ttl'				=> "'0'",
+		'o_maintenance_message'		=> "'Les forums sont temporairement fermÃ©s pour des raisons de maintenance. Veuillez essayer Ã  nouveau dans quelques minutes.<br />\\n<br />\\n/Administrateur'",
+		'p_mod_edit_users'			=> "'1'",
+		'p_mod_rename_users'		=> "'0'",
+		'p_mod_change_passwords'	=> "'0'",
+		'p_mod_ban_users'			=> "'0'",
 		'p_message_bbcode'			=> "'1'",
 		'p_message_img_tag'			=> "'1'",
@@ -1666,65 +1358,56 @@
 	);
 
-	foreach ($config as $conf_name => $conf_value)
+	while (list($conf_name, $conf_value) = @each($config))
 	{
 		$db->query('INSERT INTO '.$db_prefix."config (conf_name, conf_value) VALUES('$conf_name', $conf_value)")
-			or error('Unable to insert into table '.$db_prefix.'config. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-	}
+			or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'config. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+	}
+
+
+	$now = time();
+	// Insert guest and first admin user
+	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email) VALUES(3, 'InvitÃ©', 'InvitÃ©', 'InvitÃ©')")
+		or error('Impossible d\'ajouter l\'utilisateur "invitÃ©".');
+
+	$db->query('INSERT INTO '.$db_prefix."users (group_id, username, password, email, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, '".$db->escape($username)."', '".pun_hash($password1)."', '$email', 1, ".$now.", ".$now.", '127.0.0.1', ".$now.')')
+		or error('Impossible d\'ajouter le compte administrateur.');
 
 	// Insert some other default data
-	$subject = $lang_install['Test post'];
-	$message = $lang_install['Message'];
-
-	$db->query('INSERT INTO '.$db_prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($lang_install['New member']).'\', 0)')
-		or error('Unable to insert into table '.$db_prefix.'ranks. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'ranks (rank, min_posts) VALUES(\''.$db->escape($lang_install['Member']).'\', 10)')
-		or error('Unable to insert into table '.$db_prefix.'ranks. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'categories (cat_name, disp_position) VALUES(\''.$db->escape($lang_install['Test category']).'\', 1)')
-		or error('Unable to insert into table '.$db_prefix.'categories. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, disp_position, cat_id) VALUES(\''.$db->escape($lang_install['Test forum']).'\', \''.$db->escape($lang_install['This is just a test forum']).'\', 1, 1, '.$now.', 1, \''.$db->escape($username).'\', 1, 1)')
-		or error('Unable to insert into table '.$db_prefix.'forums. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', 1, '.$now.', 1, \''.$db->escape($username).'\', 1)')
-		or error('Unable to insert into table '.$db_prefix.'topics. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	$db->query('INSERT INTO '.$db_prefix.'posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(\''.$db->escape($username).'\', 2, \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$now.', 1)')
-		or error('Unable to insert into table '.$db_prefix.'posts. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
-
-	// Index the test post so searching for it works
-	require PUN_ROOT.'include/search_idx.php';
-	$pun_config['o_default_lang'] = $default_lang;
-	update_search_index('post', 1, $message, $subject);
-
-	$db->end_transaction();
-
-
-	$alerts = array();
-
-	// Check if we disabled uploading avatars because file_uploads was disabled
-	if ($avatars == '0')
-		$alerts[] = $lang_install['Alert upload'];
-
-	// Add some random bytes at the end of the cookie name to prevent collisions
-	$cookie_name = 'pun_cookie_'.random_key(6, false, true);
-
-	// Generate the config.php file data
-	$config = generate_config_file();
-
-	// Attempt to write config.php and serve it up for download if writing fails
-	$written = false;
-	if (is_writable(PUN_ROOT))
-	{
-		$fh = @fopen(PUN_ROOT.'config.php', 'wb');
-		if ($fh)
-		{
-			fwrite($fh, $config);
-			fclose($fh);
-
-			$written = true;
-		}
-	}
+	$db->query('INSERT INTO '.$db_prefix."categories (cat_name, disp_position) VALUES('CatÃ©gorie test', 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'categories. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, disp_position, cat_id) VALUES('Forum test', 'Ceci est juste un forum de test.', 1, 1, ".$now.", 1, '".$db->escape($username)."', 1, 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'forums. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."topics (poster, subject, posted, last_post, last_post_id, last_poster, forum_id) VALUES('".$db->escape($username)."', 'Message de test', ".$now.", ".$now.", 1, '".$db->escape($username)."', 1)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'topics. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES('".$db->escape($username)."', 2, '127.0.0.1', 'Si vous lisez ceci (et je devine que vous Ãªtes Ã©videment en train de la faire), l\'installation de PunBB semble avoir fonctionnÃ©e ! Maintenant identifiez vous au panneau de contrÃŽle d\'administration pour configurer vos forums.', ".$now.', 1)')
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'posts. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Nouveau membre', 0)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'ranks. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+	$db->query('INSERT INTO '.$db_prefix."ranks (rank, min_posts) VALUES('Membre', 10)")
+		or error('Impossible d\'insÃ©rer dans la table '.$db_prefix.'ranks. Veuillez vÃ©rifier votre configuration et essayez Ã  nouveau.');
+
+
+	if ($db_type == 'pgsql' || $db_type == 'sqlite')
+		$db->end_transaction();
+
+
+
+	$alerts = '';
+	// Check if the cache directory is writable
+	if (!@is_writable('./cache/'))
+		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>Le rÃ©pertoire du cache n\'est actuellement pas inscriptible !</strong></span> Afin que PunBB fonctionne corretement, le rÃ©pertoire nommÃ© <em>cache</em> doit Ãªtre inscriptible par PHP. Utilisez chmod pour rÃ©gler les permissions appropriÃ©e Ã  ce rÃ©pertoire. Si vous avez un doute, chmod 0777.</p>';
+
+	// Check if default avatar directory is writable
+	if (!@is_writable('./img/avatars/'))
+		$alerts .= '<p style="font-size: 1.1em"><span style="color: #C03000"><strong>Le rÃ©pertoire des avatars n\'est actuellement pas inscriptible !</strong></span> Si vous voulez que les utilisateurs puissent envoyer sur le serveur leur propres avatars vous devez rÃ©gler les permissions du dossier <em>img/avatars</em> pour que PHP puisse Ã©crire dedans. Utilisez chmod pour rÃ©gler les permissions appropriÃ©e Ã  ce rÃ©pertoire. Si vous avez un doute, chmod 0777.</p>';
+
+
+	/// Display config.php and give further instructions
+	$config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);";
 
 
@@ -1734,89 +1417,40 @@
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title><?php echo $lang_install['FluxBB Installation'] ?></title>
-<link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Installation de PunBB</title>
+<link rel="stylesheet" type="text/css" href="style/Oxygen.css" />
 </head>
 <body>
 
-<div id="puninstall" class="pun">
-<div class="top-box"><div><!-- Top Corners --></div></div>
-<div class="punwrap">
-
-<div id="brdheader" class="block">
+<div id="puninstall" style="margin: auto 10% auto 10%">
+<div class="pun">
+
+<div class="blockform">
+	<h2>Instructions finales</h2>
 	<div class="box">
-		<div id="brdtitle" class="inbox">
-			<h1><span><?php echo $lang_install['FluxBB Installation'] ?></span></h1>
-			<div id="brddesc"><p><?php echo $lang_install['FluxBB has been installed'] ?></p></div>
+		<div class="fakeform">
+			<div class="inform">
+				<div class="forminfo">
+					<p>Afin de terminer l'installation tout ce que vous avez Ã  faire est de <strong>copier et coller le texte de la boite ci-dessous dans un fichier que vous nommerez <em>config.php</em> et qu'ensuite vous enverrez sur votre serveur dans le rÃ©pertoire racine de votre installation de PunBB</strong>. Assurez-vous qu'il n'y a aucun saut de ligne ou d'espace avant &lt;?php et aprÃšs ?&gt; dans ce fichier. Vous pourrez par la suite modifier config.php si vous reconfigurez votre installation (ex. modification du mot de passe base de donnÃ©s ... ).</p>
+<?php if ($alerts != ''): ?>					<?php echo $alerts."\n" ?>
+<?php endif; ?>				</div>
+				<fieldset>
+					<legend>Copiez ce contenu dans config.php</legend>
+					<div class="infldset">
+						<textarea cols="80" rows="20"><?php echo htmlspecialchars($config) ?></textarea>
+					</div>
+				</fieldset>
+			</div>
+			<div class="inform">
+				<div class="forminfo">
+					<p>Une fois que vous aurez crÃ©Ã© config.php avec le contenu ci-dessus, PunBB sera installÃ© !</p>
+					<p><a href="index.php">Aller Ã  l'index des forums</a></p>
+				</div>
+			</div>
 		</div>
 	</div>
 </div>
 
-<div id="brdmain">
-
-<div class="blockform">
-	<h2><span><?php echo $lang_install['Final instructions'] ?></span></h2>
-	<div class="box">
-<?php
-
-if (!$written)
-{
-
-?>
-		<form method="post" action="install.php">
-			<div class="inform">
-				<div class="forminfo">
-					<p><?php echo $lang_install['Info 17'] ?></p>
-					<p><?php echo $lang_install['Info 18'] ?></p>
-				</div>
-				<input type="hidden" name="generate_config" value="1" />
-				<input type="hidden" name="db_type" value="<?php echo $db_type; ?>" />
-				<input type="hidden" name="db_host" value="<?php echo $db_host; ?>" />
-				<input type="hidden" name="db_name" value="<?php echo pun_htmlspecialchars($db_name); ?>" />
-				<input type="hidden" name="db_username" value="<?php echo pun_htmlspecialchars($db_username); ?>" />
-				<input type="hidden" name="db_password" value="<?php echo pun_htmlspecialchars($db_password); ?>" />
-				<input type="hidden" name="db_prefix" value="<?php echo pun_htmlspecialchars($db_prefix); ?>" />
-				<input type="hidden" name="cookie_name" value="<?php echo pun_htmlspecialchars($cookie_name); ?>" />
-				<input type="hidden" name="cookie_seed" value="<?php echo pun_htmlspecialchars($cookie_seed); ?>" />
-
-<?php if (!empty($alerts)): ?>				<div class="forminfo error-info">
-					<ul class="error-list">
-<?php
-
-foreach ($alerts as $cur_alert)
-	echo "\t\t\t\t\t".'<li>'.$cur_alert.'</li>'."\n";
-?>
-					</ul>
-				</div>
-<?php endif; ?>			</div>
-			<p class="buttons"><input type="submit" value="<?php echo $lang_install['Download config.php file'] ?>" /></p>
-		</form>
-
-<?php
-
-}
-else
-{
-
-?>
-		<div class="fakeform">
-			<div class="inform">
-				<div class="forminfo">
-					<p><?php echo $lang_install['FluxBB fully installed'] ?></p>
-				</div>
-			</div>
-		</div>
-<?php
-
-}
-
-?>
-	</div>
 </div>
-
-</div>
-
-</div>
-<div class="end-box"><div><!-- Bottom Corners --></div></div>
 </div>
 
Index: unk/web/punbb/lang/English/admin_bans.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_bans.php	(revision 10)
+++ 	(revision )
@@ -1,67 +1,0 @@
-<?php
-
-// Language definitions used in admin_bans.php
-$lang_admin_bans = array(
-
-'No user message'			=>	'No user by that username registered. If you want to add a ban not tied to a specific username just leave the username blank.',
-'No user ID message'		=>	'No user by that ID registered.',
-'User is admin message'		=>	'The user %s is an administrator and can\'t be banned. If you want to ban an administrator, you must first demote him/her.',
-'User is mod message'		=>	'The user %s is a moderator and can\'t be banned. If you want to ban a moderator, you must first demote him/her.',
-'Must enter message'		=>	'You must enter either a username, an IP address or an email address (at least).',
-'Cannot ban guest message'	=>	'The guest user cannot be banned.',
-'Invalid IP message'		=>	'You entered an invalid IP/IP-range.',
-'Invalid e-mail message'	=>	'The email address (e.g. user@domain.com) or partial email address domain (e.g. domain.com) you entered is invalid.',
-'Invalid date message'		=>	'You entered an invalid expire date.',
-'Invalid date reasons'		=>	'The format should be YYYY-MM-DD and the date must be at least one day in the future.',
-'Ban added redirect'		=>	'Ban added. Redirecting âŠ' ,
-'Ban edited redirect'		=>	'Ban edited. Redirecting âŠ',
-'Ban removed redirect'		=>	'Ban removed. Redirecting âŠ',
-
-'New ban head'				=>	'New ban',
-'Add ban subhead'			=>	'Add ban',
-'Username label'			=>	'Username',
-'Username help'				=>	'The username to ban (case-insensitive).',
-'Username advanced help'	=>	'The username to ban (case-insensitive). The next page will let you enter a custom IP and email. If you just want to ban a specific IP/IP-range or email just leave it blank.',
-
-'Ban search head'			=>	'Ban search',
-'Ban search subhead'		=>	'Enter search criteria',
-'Ban search info'			=>	'Search for bans in the database. You can enter one or more terms to search for. Wildcards in the form of asterisks (*) are accepted. To show all bans leave all fields empty.',
-'Date help'					=>	'(yyyy-mm-dd)',
-'Message label'				=>	'Message',
-'Expire after label'		=>	'Expire after',
-'Expire before label'		=>	'Expire before',
-'Order by label'			=>	'Order by',
-'Order by username'			=>	'Username',
-'Order by ip'				=>	'IP',
-'Order by e-mail'			=>	'Email',
-'Order by expire'			=>	'Expire date',
-'Ascending'					=>	'Ascending',
-'Descending'				=>	'Descending',
-'Submit search'				=>	'Submit search',
-
-'E-mail label'				=>	'Email',
-'E-mail help'				=>	'The email or email domain you wish to ban (e.g. someone@somewhere.com or somewhere.com). See "Allow banned email addresses" in Permissions for more info.',
-'IP label'					=>	'IP address/IP-ranges',
-'IP help'					=>	'The IP address or IP-ranges you wish to ban (e.g. 150.11.110.1 or 150.11.110). Separate addresses with spaces. If an IP is entered already it is the last known IP of this user in the database.',
-'IP help link'				=>	'Click %s to see IP statistics for this user.',
-'Ban advanced head'			=>	'Ban advanced settings',
-'Ban advanced subhead'		=>	'Supplement ban with IP and email',
-'Ban message label'			=>	'Ban message',
-'Ban message help'			=>	'A message that will be displayed to the banned user when he/she visits the board.',
-'Message expiry subhead'	=>	'Ban message and expiry',
-'Ban IP range info'			=>	'You should be very careful when banning an IP-range because of the possibility of multiple users matching the same partial IP.',
-'Expire date label'			=>	'Expire date',
-'Expire date help'			=>	'The date when this ban should be automatically removed (format: yyyy-mm-dd). Leave blank to remove manually.',
-
-'Results head'				=>	'Search Results',
-'Results username head'		=>	'Username',
-'Results e-mail head'		=>	'Email',
-'Results IP address head'	=>	'IP/IP-ranges',
-'Results expire head'		=>	'Expires',
-'Results message head'		=>	'Message',
-'Results banned by head'	=>	'Banned by',
-'Results actions head'		=>	'Actions',
-'No match'					=>	'No match',
-'Unknown'					=>	'Unknown',
-
-);
Index: unk/web/punbb/lang/English/admin_categories.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_categories.php	(revision 10)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-// Language definitions used in admin-categories.php
-$lang_admin_categories = array(
-
-'Must enter name message'		=>	'You must enter a name for the category',
-'Category added redirect'		=>	'Category added. Redirecting âŠ',
-'Category deleted redirect'		=>	'Category deleted. Redirecting âŠ',
-'Delete category head'			=>	'Delete category (together with all forums and posts it contains)',
-'Confirm delete subhead'		=>	'Confirm delete category',
-'Confirm delete info'			=>	'Are you sure that you want to delete the category <strong>%s</strong>?',
-'Delete category warn'			=>	'<strong>WARNING!</strong> Deleting a category will delete all forums and posts (if any) in this category!',
-'Must enter integer message'	=>	'Position must be a positive integer value.',
-'Categories updated redirect'	=>	'Categories updated. Redirecting âŠ',
-'Add categories head'			=>	'Add categories',
-'Add categories subhead'		=>	'Add categories',
-'Add category label'			=>	'Add a new category',
-'Add new submit'				=>	'Add new',
-'Add category help'				=>	'The name of the new category you want to add. You can edit the name of the category later (see below). Go to %s to add forums to your new category.',
-'Delete categories head'		=>	'Delete categories',
-'Delete categories subhead'		=>	'Delete categories',
-'Delete category label'			=>	'Delete a category',
-'Delete category help'			=>	'Select the name of the category you want to delete. You will be asked to confirm your choice of category for deletion before it is deleted.',
-'Edit categories head'			=>	'Edit categories',
-'Edit categories subhead'		=>	'Edit categories',
-'Category position label'		=>	'Position',
-'Category name label'			=>	'Name',
-
-);
Index: unk/web/punbb/lang/English/admin_censoring.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_censoring.php	(revision 10)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-// Language definitions used in admin_censoring.php
-$lang_admin_censoring = array(
-
-'Must enter word message'	=>	'You must enter a word to censor.',
-'Word updated redirect'		=>	'Censor word updated. Redirecting âŠ',
-'Word added redirect'		=>	'Censor word added. Redirecting âŠ',
-'Word removed redirect'		=>	'Censor word removed. Redirecting âŠ',
-'Censoring head'			=>	'Censoring',
-'Add word subhead'			=>	'Add word',
-'Add word info'				=>	'Enter a word that you want to censor and the replacement text for this word. Wildcards are accepted (i.e. *some* would match somewhere and lonesome). Censor words also affect usernames. New users will not be able to register with usernames containing any censored words. The search is case insensitive.',
-'Censoring enabled'			=>	'<strong>Censoring is enabled in %s.</strong>',
-'Censoring disabled'		=>	'<strong>Censoring is disabled in %s.</strong>',
-'Censored word label'		=>	'Censored word',
-'Replacement label'			=>	'Replacement word(s)',
-'Action label'				=>	'Action',
-'Edit remove subhead'		=>	'Edit or remove words',
-'No words in list'			=>	'No censor words in list.',
-
-);
Index: unk/web/punbb/lang/English/admin_common.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_common.php	(revision 10)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?php
-
-// Language definitions used in admin_common
-$lang_admin_common = array(
-
-// The menu
-'Admin menu'			=>	'Admin menu',
-'Plugins menu'			=>	'Plugins menu',
-'Moderator menu'		=>	'Moderator menu',
-'Index'					=>	'Index',
-'Categories'			=>	'Categories',
-'Forums'				=>	'Forums',
-'Users'					=>	'Users',
-'User groups'			=>	'User groups',
-'Options'				=>	'Options',
-'Permissions'			=>	'Permissions',
-'Censoring'				=>	'Censoring',
-'Ranks'					=>	'Ranks',
-'Bans'					=>	'Bans',
-'Prune'					=>	'Prune',
-'Maintenance'			=>	'Maintenance',
-'Reports'				=>	'Reports',
-
-'Admin'					=>	'Admin',
-'Go back'				=>	'Go back',
-'Delete'				=>	'Delete',
-'Update'				=>	'Update',
-'Add'					=>	'Add',
-'Edit'					=>	'Edit',
-'Remove'				=>	'Remove',
-'Yes'					=>	'Yes',
-'No'					=>	'No',
-'Save changes'			=>	'Save changes',
-'Save'					=>	'Save',
-'here'					=>	'here',
-'Action'				=>	'Action',
-'None'					=>	'None',
-'Maintenance mode'		=>	'maintenance mode', // Used for link text in more than one file
-
-// Admin loader
-'No plugin message'		=>	'There is no plugin called %s in the plugin directory.',
-'Plugin failed message'	=>	'Loading of the plugin - <strong>%s</strong> - failed.',
-
-);
Index: unk/web/punbb/lang/English/admin_forums.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_forums.php	(revision 10)
+++ 	(revision )
@@ -1,53 +1,0 @@
-<?php
-
-// Language definitions used in admin-forums.php
-$lang_admin_forums = array(
-
-'Forum added redirect'		=>	'Forum added. Redirecting âŠ',
-'Forum deleted redirect'	=>	'Forum deleted. Redirecting âŠ',
-'Forums updated redirect'	=>	'Forums updated. Redirecting âŠ',
-'Forum updated redirect'	=>	'Forum updated. Redirecting âŠ',
-'Perms reverted redirect'	=>	'Permissions reverted to defaults. Redirecting âŠ',
-'Must enter name message'	=>	'You must enter a forum name.',
-'Must be integer message'	=>	'Position must be a positive integer value.',
-'New forum'					=>	'New forum',
-
-// Entry page
-'Add forum head'			=>	'Add forum',
-'Create new subhead'		=>	'Create a new forum',
-'Add forum label'			=>	'Add forum to category',
-'Add forum help'			=>	'Select the category to which you wish to add a new forum.',
-'Add forum'					=>	'Add forum',
-'No categories exist'		=>	'No categories exist',
-'Edit forums head'			=>	'Edit forums',
-'Category subhead'			=>	'Category:',
-'Forum label'				=>	'Forum',
-'Edit link'					=>	'Edit',
-'Delete link'				=>	'Delete',
-'Position label'			=>	'Position',
-'Update positions'			=>	'Update positions',
-'Confirm delete head'		=>	'Confirm delete forum',
-'Confirm delete subhead'	=>	'Important! Read before deleting',
-'Confirm delete info'		=>	'Are you sure that you want to delete the forum <strong>%s</strong>?',
-'Confirm delete warn'		=>	'WARNING! Deleting a forum will delete all posts (if any) in that forum!',
-
-// Detailed edit page
-'Edit forum head'			=>	'Edit forum',
-'Edit details subhead'		=>	'Edit forum details',
-'Forum name label'			=>	'Forum name',
-'Forum description label'	=>	'Description (HTML)',
-'Category label'			=>	'Category',
-'Sort by label'				=>	'Sort topics by',
-'Last post'					=>	'Last post',
-'Topic start'				=>	'Topic start',
-'Subject'					=>	'Subject',
-'Redirect label'			=>	'Redirect URL',
-'Redirect help'				=>	'Only available in empty forums',
-'Group permissions subhead'	=>	'Edit group permissions for this forum',
-'Group permissions info'	=>	'In this form, you can set the forum specific permissions for the different user groups. If you haven\'t made any changes to this forum\'s group permissions, what you see below is the default based on settings in %s. Administrators always have full permissions and are thus excluded. Permission settings that differ from the default permissions for the user group are marked red. The "Read forum" permission checkbox will be disabled if the group in question lacks the "Read board" permission. For redirect forums, only the "Read forum" permission is editable.',
-'Read forum label'			=>	'Read forum',
-'Post replies label'		=>	'Post replies',
-'Post topics label'			=>	'Post topics',
-'Revert to default'			=>	'Revert to default',
-
-);
Index: unk/web/punbb/lang/English/admin_groups.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_groups.php	(revision 10)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-// Language definitions used in admin-groups.php
-$lang_admin_groups = array(
-
-'Must enter title message'		=>	'You must enter a group title.',
-'Title already exists message'	=>	'There is already a group with the title <strong>%s</strong>.',
-'Default group redirect'		=>	'Default group set. Redirecting âŠ',
-'Cannot remove default message'	=>	'The default group cannot be removed. In order to delete this group, you must first setup a different group as the default.',
-'Group removed redirect'		=>	'Group removed. Redirecting âŠ',
-'Group added redirect'			=>	'Group added. Redirecting âŠ',
-'Group edited redirect'			=>	'Group edited. Redirecting âŠ',
-
-'Add groups head'				=>	'Add/setup groups',
-'Add group subhead'				=>	'Add new group',
-'New group label'				=>	'Base new group on',
-'New group help'				=>	'Select a user group from which the new group will inherit its permission settings. The next page will let you fine-tune its settings.',
-'Default group subhead'			=>	'Set default group',
-'Default group label'			=>	'Default group',
-'Default group help'			=>	'This is the default user group, e.g. the group users are placed in when they register. For security reasons, users can\'t be placed in either the moderator or administrator user groups by default.',
-'Existing groups head'			=>	'Existing groups',
-'Edit groups subhead'			=>	'Edit/delete groups',
-'Edit groups info'				=>	'The pre-defined groups Guests, Administrators, Moderators and Members cannot be removed. However, they can be edited. Please note that in some groups, some options are unavailable (e.g. the <em>edit posts</em> permission for guests). Administrators always have full permissions.',
-'Edit link'						=>	'Edit',
-'Delete link'					=>	'Delete',
-'Group delete head'				=>	'Group delete',
-'Confirm delete subhead'		=>	'Confirm delete group',
-'Confirm delete info'			=>	'Are you sure that you want to delete the group <strong>%s</strong>?',
-'Confirm delete warn'			=>	'WARNING! After you deleted a group you cannot restore it.',
-'Delete group head'				=>	'Delete group',
-'Move users subhead'			=>	'Move users currently in group',
-'Move users info'				=>	'The group <strong>%s</strong> currently has <strong>%s</strong> members. Please select a group to which these members will be assigned upon deletion.',
-'Move users label'				=>	'Move users to',
-'Delete group'					=>	'Delete group',
-
-'Group settings head'			=>	'Group settings',
-'Group settings subhead'		=>	'Setup group options and permissions',
-'Group settings info'			=>	'Below options and permissions are the default permissions for the user group. These options apply if no forum specific permissions are in effect.',
-'Group title label'				=>	'Group title',
-'User title label'				=>	'User title',
-'User title help'				=>	'This title will override any rank users in this group have attained. Leave blank to use default title or rank.',
-'Mod privileges label'			=>	'Allow users moderator privileges',
-'Mod privileges help'			=>	'In order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user\'s profile.',
-'Edit profile label'			=>	'Allow moderators to edit user profiles',
-'Edit profile help'				=>	'If moderator privileges are enabled, allow users in this group to edit user profiles.',
-'Rename users label'			=>	'Allow moderators to rename users',
-'Rename users help'				=>	'If moderator privileges are enabled, allow users in this group to rename users.',
-'Change passwords label'		=>	'Allow moderators to change passwords',
-'Change passwords help'			=>	'If moderator privileges are enabled, allow users in this group to change user passwords.',
-'Ban users label'				=>	'Allow moderators to ban users',
-'Ban users help'				=>	'If moderator privileges are enabled, allow users in this group to ban users.',
-'Read board label'				=>	'Read board',
-'Read board help'				=>	'Allow users in this group to view the board. This setting applies to every aspect of the board and can therefore not be overridden by forum specific settings. If this is set to "No", users in this group will only be able to login/logout and register.',
-'View user info label'			=>	'View user information',
-'View user info help'			=>	'Allow users to view the user list and user profiles.',
-'Post replies label'			=>	'Post replies',
-'Post replies help'				=>	'Allow users in this group to post replies in topics.',
-'Post topics label'				=>	'Post topics',
-'Post topics help'				=>	'Allow users in this group to post new topics.',
-'Edit posts label'				=>	'Edit posts',
-'Edit posts help'				=>	'Allow users in this group to edit their own posts.',
-'Delete posts label'			=>	'Delete posts',
-'Delete posts help'				=>	'Allow users in this group to delete their own posts.',
-'Delete topics label'			=>	'Delete topics',
-'Delete topics help'			=>	'Allow users in this group to delete their own topics (including any replies).',
-'Set own title label'			=>	'Set own user title',
-'Set own title help'			=>	'Allow users in this group to set their own user title.',
-'User search label'				=>	'Use search',
-'User search help'				=>	'Allow users in this group to use the search feature.',
-'User list search label'		=>	'Search user list',
-'User list search help'			=>	'Allow users in this group to freetext search for users in the user list.',
-'Send e-mails label'			=>	'Send e-mails',
-'Send e-mails help'				=>	'Allow users in this group to send e-mails to other users.',
-'Post flood label'				=>	'Post flood interval',
-'Post flood help'				=>	'Number of seconds that users in this group have to wait between posts. Set to 0 to disable.',
-'Search flood label'			=>	'Search flood interval',
-'Search flood help'				=>	'Number of seconds that users in this group have to wait between searches. Set to 0 to disable.',
-'E-mail flood label'			=>	'Email flood interval',
-'E-mail flood help'				=>	'Number of seconds that users in this group have to wait between emails. Set to 0 to disable.',
-'Report flood label'			=>	'Report flood interval',
-'Report flood help'				=>	'Number of seconds that users in this group have to wait between reports. Set to 0 to disable.',
-'Moderator info'				=>	'Please note that in order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user\'s profile.',
-
-);
Index: unk/web/punbb/lang/English/admin_index.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_index.php	(revision 10)
+++ 	(revision )
@@ -1,51 +1,0 @@
-<?php
-
-// Language definitions used in admin_index.php
-$lang_admin_index = array(
-
-'fopen disabled message'			=>	'Unable to check for upgrade since \'allow_url_fopen\' is disabled on this system.',
-'Upgrade check failed message'		=>	'Check for upgrade failed for unknown reasons.',
-'Running latest version message'	=>	'You are running the latest version of FluxBB.',
-'New version available message'		=>	'A new version of FluxBB has been released. You can download the latest version at %s.',
-'PHPinfo disabled message'			=>	'The PHP function phpinfo() has been disabled on this server.',
-'Not available'						=>	'Not available',
-'Forum admin head'					=>	'Forum administration',
-'NA'								=>	'N/A',
-'Welcome to admin'					=>	'Welcome to the FluxBB administration control panel. From here you can control vital aspects of the board. Depending on whether you are an administrator or a moderator you can:',
-'Welcome 1'							=>	'Organize categories and forums.',
-'Welcome 2'							=>	'Set forum-wide options and preferences.',
-'Welcome 3'							=>	'Control permissions for users and guests.',
-'Welcome 4'							=>	'View IP statistics for users.',
-'Welcome 5'							=>	'Ban users.',
-'Welcome 6'							=>	'Censor words.',
-'Welcome 7'							=>	'Set up user ranks.',
-'Welcome 8'							=>	'Prune old posts.',
-'Welcome 9'							=>	'Handle post reports.',
-'Statistics head'					=>	'Statistics',
-'FluxBB version label'				=>	'FluxBB version',
-'Check for upgrade'					=>	'Check for upgrade',
-'FluxBB version data'				=>	'v%s - %s',
-'Server load label'					=>	'Server load',
-'Server load data'					=>	'%s - %s user(s) online',
-'Environment label'					=>	'Environment',
-'Environment data OS'				=>	'Operating system: %s',
-'Show info'							=>	'Show info',
-'Environment data version'			=>	'PHP: %s - %s',
-'Environment data acc'				=>	'Accelerator: %s',
-'Turck MMCache'						=>	'Turck MMCache',
-'Turck MMCache link'				=>	'turck-mmcache.sourceforge.net/',
-'ionCube PHP Accelerator'			=>	'ionCube PHP Accelerator',
-'ionCube PHP Accelerator link'		=>	'www.php-accelerator.co.uk/',
-'Alternative PHP Cache (APC)'		=>	'Alternative PHP Cache (APC)',
-'Alternative PHP Cache (APC) link'	=>	'www.php.net/apc/',
-'Zend Optimizer'					=>	'Zend Optimizer',
-'Zend Optimizer link'				=>	'www.zend.com/products/guard/zend-optimizer/',
-'eAccelerator'						=>	'eAccelerator',
-'eAccelerator link'					=>	'www.eaccelerator.net/',
-'XCache'							=>	'XCache',
-'XCache link'						=>	'xcache.lighttpd.net/',
-'Database label'					=>	'Database',
-'Database data rows'				=>	'Rows: %s',
-'Database data size'				=>	'Size: %s',
-
-);
Index: unk/web/punbb/lang/English/admin_maintenance.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_maintenance.php	(revision 10)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-// Language definitions used in admin_maintenance.php
-$lang_admin_maintenance = array(
-
-'Maintenance head'				=>	'Forum maintenance',
-'Rebuild index subhead'			=>	'Rebuild search index',
-'Rebuild index info'			=>	'If you\'ve added, edited or removed posts manually in the database or if you\'re having problems searching, you should rebuild the search index. For best performance, you should put the forum in %s during rebuilding. <strong>Rebuilding the search index can take a long time and will increase server load during the rebuild process!</strong>',
-'Posts per cycle label'			=>	'Posts per cycle',
-'Posts per cycle help'			=>	'The number of posts to process per pageview. E.g. if you were to enter 300, three hundred posts would be processed and then the page would refresh. This is to prevent the script from timing out during the rebuild process.',
-'Starting post label'			=>	'Starting post ID',
-'Starting post help'			=>	'The post ID to start rebuilding at. The default value is the first available ID in the database. Normally you wouldn\'t want to change this.',
-'Empty index label'				=>	'Empty index',
-'Empty index help'				=>	'Select this if you want the search index to be emptied before rebuilding (see below).',
-'Rebuild completed info'		=>	'Once the process has completed, you will be redirected back to this page. It is highly recommended that you have JavaScript enabled in your browser during rebuilding (for automatic redirect when a cycle has completed). If you are forced to abort the rebuild process, make a note of the last processed post ID and enter that ID+1 in "Starting post ID" when/if you want to continue ("Empty index" must not be selected).',
-'Rebuild index'					=>	'Rebuild index',
-'Rebuilding search index'		=>	'Rebuilding search index',
-'Rebuilding index info'			=>	'Rebuilding index. This might be a good time to put on some coffee :-)',
-'Processing post'				=>	'Processing post <strong>%s</strong> âŠ',
-'Click here'					=>	'Click here',
-'Javascript redirect failed'	=>	'JavaScript redirect unsuccessful. %s to continue âŠ',
-'Posts must be integer message'	=>	'Posts per cycle must be a positive integer value.',
-'Days must be integer message'	=>	'Days to prune must be a positive integer value.',
-'No old topics message'			=>	'There are no topics that are %s days old. Please decrease the value of "Days old" and try again.',
-'Posts pruned redirect'			=>	'Posts pruned. Redirecting âŠ',
-'Prune head'					=>	'Prune',
-'Prune subhead'					=>	'Prune old posts',
-'Days old label'				=>	'Days old',
-'Days old help'					=>	'The number of days "old" a topic must be to be pruned. E.g. if you were to enter 30, every topic that didn\'t contain a post dated less than 30 days old would be deleted.',
-'Prune sticky label'			=>	'Prune sticky topics',
-'Prune sticky help'				=>	'When enabled, sticky topics will also be pruned.',
-'Prune from label'				=>	'Prune from forum',
-'All forums'					=>	'All forums',
-'Prune from help'				=>	'The forum from which you want to prune posts.',
-'Prune info'					=>	'Use this feature with caution. <strong>Pruned posts can never be recovered.</strong> For best performance, you should put the forum in %s during pruning.',
-'Confirm prune subhead'			=>	'Confirm prune posts',
-'Confirm prune info'			=>	'Are you sure that you want to prune all topics older than %s days from %s (%s topics).',
-'Confirm prune warn'			=>	'WARNING! Pruning posts deletes them permanently.',
-
-);
Index: unk/web/punbb/lang/English/admin_options.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_options.php	(revision 10)
+++ 	(revision )
@@ -1,228 +1,0 @@
-<?php
-
-// Language definitions used in admin-options.php
-$lang_admin_options = array(
-
-'Bad HTTP Referer message'			=>	'Bad HTTP_REFERER. If you have moved these forums from one location to another or switched domains, you need to update the Base URL manually in the database (look for o_base_url in the config table) and then clear the cache by deleting all .php files in the /cache directory.',
-'Must enter title message'			=>	'You must enter a board title.',
-'Invalid e-mail message'			=>	'The admin email address you entered is invalid.',
-'Invalid webmaster e-mail message'	=>	'The webmaster email address you entered is invalid.',
-'SMTP passwords did not match'		=>	'You need to enter the SMTP password twice exactly the same to change it.',
-'Enter announcement here'			=>	'Enter your announcement here.',
-'Enter rules here'					=>	'Enter your rules here.',
-'Default maintenance message'		=>	'The forums are temporarily down for maintenance. Please try again in a few minutes.',
-'Timeout error message'				=>	'The value of "Timeout online" must be smaller than the value of "Timeout visit".',
-'Options updated redirect'			=>	'Options updated. Redirecting âŠ',
-'Options head'						=>	'Options',
-
-// Essentials section
-'Essentials subhead'				=>	'Essentials',
-'Board title label'					=>	'Board title',
-'Board title help'					=>	'The title of this bulletin board (shown at the top of every page). This field may <strong>not</strong> contain HTML.',
-'Board desc label'					=>	'Board description',
-'Board desc help'					=>	'A short description of this bulletin board (shown at the top of every page). This field may contain HTML.',
-'Base URL label'					=>	'Base URL',
-'Base URL help'						=>	'The complete URL of the board without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it\'s probably incorrect.',
-'Timezone label'					=>	'Default time zone',
-'Timezone help'						=>	'The default time zone for guests and users attempting to register for the board.',
-'DST label'							=>	'Adjust for DST',
-'DST help'							=>	'Check if daylight savings is in effect (advances times by 1 hour).',
-'Language label'					=>	'Default language',
-'Language help'						=>	'The default language for guests and users who haven\'t changed from the default in their profile. If you remove a language pack, this must be updated.',
-'Default style label'				=>	'Default style',
-'Default style help'				=>	'The default style for guests and users who haven\'t changed from the default in their profile.',
-
-// Essentials section timezone options
-'UTC-12:00'							=>	'(UTC-12:00) International Date Line West',
-'UTC-11:00'							=>	'(UTC-11:00) Niue, Samoa',
-'UTC-10:00'							=>	'(UTC-10:00) Hawaii-Aleutian, Cook Island',
-'UTC-09:30'							=>	'(UTC-09:30) Marquesas Islands',
-'UTC-09:00'							=>	'(UTC-09:00) Alaska, Gambier Island',
-'UTC-08:30'							=>	'(UTC-08:30) Pitcairn Islands',
-'UTC-08:00'							=>	'(UTC-08:00) Pacific',
-'UTC-07:00'							=>	'(UTC-07:00) Mountain',
-'UTC-06:00'							=>	'(UTC-06:00) Central',
-'UTC-05:00'							=>	'(UTC-05:00) Eastern',
-'UTC-04:00'							=>	'(UTC-04:00) Atlantic',
-'UTC-03:30'							=>	'(UTC-03:30) Newfoundland',
-'UTC-03:00'							=>	'(UTC-03:00) Amazon, Central Greenland',
-'UTC-02:00'							=>	'(UTC-02:00) Mid-Atlantic',
-'UTC-01:00'							=>	'(UTC-01:00) Azores, Cape Verde, Eastern Greenland',
-'UTC'								=>	'(UTC) Western European, Greenwich',
-'UTC+01:00'							=>	'(UTC+01:00) Central European, West African',
-'UTC+02:00'							=>	'(UTC+02:00) Eastern European, Central African',
-'UTC+03:00'							=>	'(UTC+03:00) Moscow, Eastern African',
-'UTC+03:30'							=>	'(UTC+03:30) Iran',
-'UTC+04:00'							=>	'(UTC+04:00) Gulf, Samara',
-'UTC+04:30'							=>	'(UTC+04:30) Afghanistan',
-'UTC+05:00'							=>	'(UTC+05:00) Pakistan, Yekaterinburg',
-'UTC+05:30'							=>	'(UTC+05:30) India, Sri Lanka',
-'UTC+05:45'							=>	'(UTC+05:45) Nepal',
-'UTC+06:00'							=>	'(UTC+06:00) Bangladesh, Bhutan, Novosibirsk',
-'UTC+06:30'							=>	'(UTC+06:30) Cocos Islands, Myanmar',
-'UTC+07:00'							=>	'(UTC+07:00) Indochina, Krasnoyarsk',
-'UTC+08:00'							=>	'(UTC+08:00) Greater China, Australian Western, Irkutsk',
-'UTC+08:45'							=>	'(UTC+08:45) Southeastern Western Australia',
-'UTC+09:00'							=>	'(UTC+09:00) Japan, Korea, Chita',
-'UTC+09:30'							=>	'(UTC+09:30) Australian Central',
-'UTC+10:00'							=>	'(UTC+10:00) Australian Eastern, Vladivostok',
-'UTC+10:30'							=>	'(UTC+10:30) Lord Howe',
-'UTC+11:00'							=>	'(UTC+11:00) Solomon Island, Magadan',
-'UTC+11:30'							=>	'(UTC+11:30) Norfolk Island',
-'UTC+12:00'							=>	'(UTC+12:00) New Zealand, Fiji, Kamchatka',
-'UTC+12:45'							=>	'(UTC+12:45) Chatham Islands',
-'UTC+13:00'							=>	'(UTC+13:00) Tonga, Phoenix Islands',
-'UTC+14:00'							=>	'(UTC+14:00) Line Islands',
-
-// Timeout Section
-'Timeouts subhead'					=>	'Time and timeouts',
-'Time format label'					=>	'Time format',
-'PHP manual'						=>	'PHP manual',
-'Time format help'					=>	'[Current format: %s]. See %s for formatting options.',
-'Date format label'					=>	'Date format',
-'Date format help'					=>	'[Current format: %s]. See %s for formatting options.',
-'Visit timeout label'				=>	'Visit timeout',
-'Visit timeout help'				=>	'Number of seconds a user must be idle before his/hers last visit data is updated (primarily affects new message indicators).',
-'Online timeout label'				=>	'Online timeout',
-'Online timeout help'				=>	'Number of seconds a user must be idle before being removed from the online users list.',
-'Redirect time label'				=>	'Redirect time',
-'Redirect time help'				=>	'Number of seconds to wait when redirecting. If set to 0, no redirect page will be displayed (not recommended).',
-
-// Display Section
-'Display subhead'					=>	'Display',
-'Version number label'				=>	'Version number',
-'Version number help'				=>	'Show FluxBB version number in footer.',
-'Info in posts label'				=>	'User info in posts',
-'Info in posts help'				=>	'Show information about the poster under the username in topic view. The information affected is location, register date, post count and the contact links (email and URL).',
-'Post count label'					=>	'User post count',
-'Post count help'					=>	'Show the number of posts a user has made (affects topic view, profile and user list).',
-'Smilies label'						=>	'Smilies in posts',
-'Smilies help'						=>	'Convert smilies to small graphic icons.',
-'Smilies sigs label'				=>	'Smilies in signatures',
-'Smilies sigs help'					=>	'Convert smilies to small graphic icons in user signatures.',
-'Clickable links label'				=>	'Make clickable links',
-'Clickable links help'				=>	'When enabled, FluxBB will automatically detect any URLs in posts and make them clickable hyperlinks.',
-'Topic review label'				=>	'Topic review',
-'Topic review help'					=>	'Maximum number of posts to display when posting (newest first). Set to 0 to disable.',
-'Topics per page label'				=>	'Topics per page',
-'Topics per page help'				=>	'The default number of topics to display per page in a forum. Users can personalize this setting.',
-'Posts per page label'				=>	'Posts per page',
-'Posts per page help'				=>	'The default number of posts to display per page in a topic. Users can personalize this setting.',
-'Indent label'						=>	'Indent size',
-'Indent help'						=>	'If set to 8, a regular tab will be used when displaying text within the [code][/code] tag. Otherwise this many spaces will be used to indent the text.',
-'Quote depth label'					=>	'Maximum [quote] depth',
-'Quote depth help'					=>	'The maximum times a [quote] tag can go inside other [quote] tags, any tags deeper than this will be discarded.',
-
-// Features section
-'Features subhead'					=>	'Features',
-'Quick post label'					=>	'Quick post',
-'Quick post help'					=>	'When enabled, FluxBB will add a quick post form at the bottom of topics. This way users can post directly from the topic view.',
-'Users online label'				=>	'Users online',
-'Users online help'					=>	'Display info on the index page about guests and registered users currently browsing the board.',
-'Censor words label'				=>	'Censor words',
-'Censor words help'					=>	'Enable this to censor specific words in the board. See %s for more info.',
-'Signatures label'					=>	'Signatures',
-'Signatures help'					=>	'Allow users to attach a signature to their posts.',
-'User ranks label'					=>	'User ranks',
-'User ranks help'					=>	'Enable this to use user ranks. See %s for more info.',
-'User has posted label'				=>	'User has posted earlier',
-'User has posted help'				=>	'This feature displays a dot in front of topics in viewforum.php in case the currently logged in user has posted in that topic earlier. Disable if you are experiencing high server load.',
-'Topic views label'					=>	'Topic views',
-'Topic views help'					=>	'Keep track of the number of views a topic has. Disable if you are experiencing high server load in a busy forum.',
-'Quick jump label'					=>	'Quick jump',
-'Quick jump help'					=>	'Enable the quick jump (jump to forum) drop list.',
-'GZip label'						=>	'GZip output',
-'GZip help'							=>	'If enabled, FluxBB will gzip the output sent to browsers. This will reduce bandwidth usage, but use a little more CPU. This feature requires that PHP is configured with zlib (--with-zlib). Note: If you already have one of the Apache modules mod_gzip or mod_deflate set up to compress PHP scripts, you should disable this feature.',
-'Search all label'					=>	'Search all forums',
-'Search all help'					=>	'When disabled, searches will only be allowed in one forum at a time. Disable if server load is high due to excessive searching.',
-'Menu items label'					=>	'Additional menu items',
-'Menu items help'					=>	'By entering HTML hyperlinks into this textbox, any number of items can be added to the navigation menu at the top of all pages. The format for adding new links is X = &lt;a href="URL"&gt;LINK&lt;/a&gt; where X is the position at which the link should be inserted (e.g. 0 to insert at the beginning and 2 to insert after "User list"). Separate entries with a linebreak.',
-
-// Feeds section
-'Feed subhead'						=>	'Syndication',
-'Default feed label'				=>	'Default feed type',
-'Default feed help'					=>	'Select the type of syndication feed to display. Note: Choosing none will not disable feeds, only hide them by default.',
-'None'								=>	'None',
-'RSS'								=>	'RSS',
-'Atom'								=>	'Atom',
-'Feed TTL label'					=>	'Duration to cache feeds',
-'Feed TTL help'						=>	'Feeds can be cached to lower the resource usage of feeds.',
-'No cache'							=>	'Don\'t cache',
-'Minutes'							=>	'%d minutes',
-
-// Reports section
-'Reports subhead'					=>	'Reports',
-'Reporting method label'			=>	'Reporting method',
-'Internal'							=>	'Internal',
-'By e-mail'							=>	'Email',
-'Both'								=>	'Both',
-'Reporting method help'				=>	'Select the method for handling topic/post reports. You can choose whether topic/post reports should be handled by the internal report system, emailed to the addresses on the mailing list (see below) or both.',
-'Mailing list label'				=>	'Mailing list',
-'Mailing list help'					=>	'A comma separated list of subscribers. The people on this list are the recipients of reports.',
-
-// Avatars section
-'Avatars subhead'					=>	'Avatars',
-'Use avatars label'					=>	'Use avatars',
-'Use avatars help'					=>	'When enabled, users will be able to upload an avatar which will be displayed under their title/rank.',
-'Upload directory label'			=>	'Upload directory',
-'Upload directory help'				=>	'The upload directory for avatars (relative to the FluxBB root directory). PHP must have write permissions to this directory.',
-'Max width label'					=>	'Max width',
-'Max width help'					=>	'The maximum allowed width of avatars in pixels (60 is recommended).',
-'Max height label'					=>	'Max height',
-'Max height help'					=>	'The maximum allowed height of avatars in pixels (60 is recommended).',
-'Max size label'					=>	'Max size',
-'Max size help'						=>	'The maximum allowed size of avatars in bytes (10240 is recommended).',
-
-// E-mail section
-'E-mail subhead'					=>	'Email',
-'Admin e-mail label'				=>	'Admin email',
-'Admin e-mail help'					=>	'The email address of the board administrator.',
-'Webmaster e-mail label'			=>	'Webmaster email',
-'Webmaster e-mail help'				=>	'This is the address that all emails sent by the board will be addressed from.',
-'Forum subscriptions label'			=>	'Forum subscriptions',
-'Forum subscriptions help'			=>	'Enable users to subscribe to forums (receive email when someone creates a new topic).',
-'Topic subscriptions label'			=>	'Topic subscriptions',
-'Topic subscriptions help'			=>	'Enable users to subscribe to topics (receive email when someone replies).',
-'SMTP address label'				=>	'SMTP server address',
-'SMTP address help'					=>	'The address of an external SMTP server to send emails with. You can specify a custom port number if the SMTP server doesn\'t run on the default port 25 (example: mail.myhost.com:3580). Leave blank to use the local mail program.',
-'SMTP username label'				=>	'SMTP username',
-'SMTP username help'				=>	'Username for SMTP server. Only enter a username if it is required by the SMTP server (most servers <strong>do not</strong> require authentication).',
-'SMTP password label'				=>	'SMTP password',
-'SMTP change password help'			=>	'Check this if you want to change or delete the currently stored password.',
-'SMTP password help'				=>	'Password for SMTP server. Only enter a password if it is required by the SMTP server (most servers <strong>do not</strong> require authentication). Please enter your password twice to confirm.',
-'SMTP SSL label'					=>	'Encrypt SMTP using SSL',
-'SMTP SSL help'						=>	'Encrypts the connection to the SMTP server using SSL. Should only be used if your SMTP server requires it and your version of PHP supports SSL.',
-
-// Registration Section
-'Registration subhead'				=>	'Registration',
-'Allow new label'					=>	'Allow new registrations',
-'Allow new help'					=>	'Controls whether this board accepts new registrations. Disable only under special circumstances.',
-'Verify label'						=>	'Verify registrations',
-'Verify help'						=>	'When enabled, users are emailed a random password when they register. They can then log in and change the password in their profile if they see fit. This feature also requires users to verify new email addresses if they choose to change from the one they registered with. This is an effective way of avoiding registration abuse and making sure that all users have "correct" email addresses in their profiles.',
-'Report new label'					=>	'Report new registrations',
-'Report new help'					=>	'If enabled, FluxBB will notify users on the mailing list (see above) when a new user registers in the forums.',
-'Use rules label'					=>	'User forum rules',
-'Use rules help'					=>	'When enabled, users must agree to a set of rules when registering (enter text below). The rules will always be available through a link in the navigation table at the top of every page.',
-'Rules label'						=>	'Enter your rules here',
-'Rules help'						=>	'Here you can enter any rules or other information that the user must review and accept when registering. If you enabled rules above you have to enter something here, otherwise it will be disabled. This text will not be parsed like regular posts and thus may contain HTML.',
-'E-mail default label'				=>	'Default email setting',
-'E-mail default help'				=>	'Choose the default privacy setting for new user registrations.',
-'Display e-mail label'				=>	'Display email address to other users.',
-'Hide allow form label'				=>	'Hide email address but allow form e-mail.',
-'Hide both label'					=>	'Hide email address and disallow form email.',
-
-// Announcement Section
-'Announcement subhead'				=>	'Announcements',
-'Display announcement label'		=>	'Display announcement',
-'Display announcement help'			=>	'Enable this to display the below message in the board.',
-'Announcement message label'		=>	'Announcement message',
-'Announcement message help'			=>	'This text will not be parsed like regular posts and thus may contain HTML.',
-
-// Maintenance Section
-'Maintenance subhead'				=>	'Maintenance',
-'Maintenance mode label'			=>	'Maintenance mode',
-'Maintenance mode help'				=>	'When enabled, the board will only be available to administrators. This should be used if the board needs to be taken down temporarily for maintenance. <strong>WARNING! Do not log out when the board is in maintenance mode.</strong> You will not be able to login again.',
-'Maintenance message label'			=>	'Maintenance message',
-'Maintenance message help'			=>	'The message that will be displayed to users when the board is in maintenance mode. If left blank, a default message will be used. This text will not be parsed like regular posts and thus may contain HTML.',
-
-);
Index: unk/web/punbb/lang/English/admin_permissions.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_permissions.php	(revision 10)
+++ 	(revision )
@@ -1,36 +1,0 @@
-<?php
-
-// Language definitions used in admin-permissions.php
-$lang_admin_permissions = array(
-
-'Perms updated redirect'	=>	'Permissions updated. Redirecting âŠ',
-'Permissions head'			=>	'Permissions',
-'Posting subhead'			=>	'Posting',
-'BBCode label'				=>	'BBCode',
-'BBCode help'				=>	'Allow BBCode in posts (recommended).',
-'Image tag label'			=>	'Image tag',
-'Image tag help'			=>	'Allow the BBCode [img][/img] tag in posts.',
-'All caps message label'	=>	'All caps message',
-'All caps message help'		=>	'Allow a message to contain only capital letters.',
-'All caps subject label'	=>	'All caps subject',
-'All caps subject help'		=>	'Allow a subject to contain only capital letters.',
-'Require e-mail label'		=>	'Require guest email',
-'Require e-mail help'		=>	'Require guests to supply an email address when posting.',
-'Signatures subhead'		=>	'Signatures',
-'BBCode sigs label'			=>	'BBCodes in signatures',
-'BBCode sigs help'			=>	'Allow BBCodes in user signatures.',
-'Image tag sigs label'		=>	'Image tag in signatures',
-'Image tag sigs help'		=>	'Allow the BBCode [img][/img] tag in user signatures (not recommended).',
-'All caps sigs label'		=>	'All caps signature',
-'All caps sigs help'		=>	'Allow a signature to contain only capital letters.',
-'Max sig length label'		=>	'Maximum signature length',
-'Max sig length help'		=>	'The maximum number of characters a user signature may contain.',
-'Max sig lines label'		=>	'Maximum signature lines',
-'Max sig lines help'		=>	'The maximum number of lines a user signature may contain.',
-'Registration subhead'		=>	'Registration',
-'Banned e-mail label'		=>	'Allow banned email addresses',
-'Banned e-mail help'		=>	'Allow users to register with or change to a banned email address/domain. If left at its default setting (yes), this action will be allowed, but an alert email will be sent to the mailing list (an effective way of detecting multiple registrations).',
-'Duplicate e-mail label'	=>	'Allow duplicate email addresses',
-'Duplicate e-mail help'		=>	'Controls whether users should be allowed to register with an email address that another user already has. If allowed, an alert email will be sent to the mailing list if a duplicate is detected.',
-
-);
Index: unk/web/punbb/lang/English/admin_ranks.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_ranks.php	(revision 10)
+++ 	(revision )
@@ -1,23 +1,0 @@
-<?php
-
-// Language definitions used in admin_ranks.php
-$lang_admin_ranks = array(
-
-'Must be integer message'	=>	'Minimum posts must be a positive integer value.',
-'Dupe min posts message'	=>	'There is already a rank with a minimun posts value of %s.',
-'Must enter title message'	=>	'You must enter a rank title.',
-'Rank added redirect'		=>	'Rank added. Redirecting âŠ',
-'Rank updated redirect'		=>	'Rank updated. Redirecting âŠ',
-'Rank removed redirect'		=>	'Rank removed. Redirecting âŠ',
-'Ranks head'				=>	'Ranks',
-'Add rank subhead'			=>	'Add rank',
-'Add rank info'				=>	'Enter a rank and the minimum number of posts a user must have made to attain the rank. Different ranks cannot have the same value for minimum posts. If a title is set for a user, the title will be displayed instead of any rank.',
-'Ranks enabled'				=>	'<strong>User ranks is enabled in %s.</strong>',
-'Ranks disabled'			=>	'<strong>User ranks is disabled in %s.</strong>',
-'Rank title label'			=>	'Rank title',
-'Minimum posts label'		=>	'Minimum posts',
-'Actions label'				=>	'Actions',
-'Edit remove subhead'		=>	'Edit/remove ranks',
-'No ranks in list'			=>	'No ranks in list',
-
-);
Index: unk/web/punbb/lang/English/admin_reports.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_reports.php	(revision 10)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-// Language definitions used in admin_reports.php
-$lang_admin_reports = array(
-
-'Report zapped redirect'	=>	'Report marked as read. Redirecting âŠ',
-'New reports head'			=>	'New reports',
-'Deleted user'				=>	'Deleted user',
-'Deleted'					=>	'Deleted',
-'Post ID'					=>	'Post #%s',
-'Report subhead'			=>	'Reported %s',
-'Reported by'				=>	'Reported by %s',
-'Reason'					=>	'Reason',
-'Zap'						=>	'Mark as read',
-'No new reports'			=>	'There are no new reports.',
-'Last 10 head'				=>	'10 last read reports',
-'NA'						=>	'N/A',
-'Zapped subhead'			=>	'Marked as read %s by %s',
-'No zapped reports'			=>	'There are no read reports.',
-
-);
Index: unk/web/punbb/lang/English/admin_users.php
===================================================================
--- /trunk/web/punbb/lang/English/admin_users.php	(revision 10)
+++ 	(revision )
@@ -1,110 +1,0 @@
-<?php
-
-// Language definitions used in admin-users.php
-$lang_admin_users = array(
-
-'Non numeric message'		=>	'You entered a non-numeric value into a numeric only column.',
-'Invalid date time message'	=>	'You entered an invalid date/time.',
-'Not verified'				=>	'Not verified',
-
-// Actions: mass delete/ban etc.
-'No users selected'			=>	'No users selected.',
-'No move admins message'	=>	'For security reasons, you are not allowed to move multiple administrators to another group. If you want to move these administrators, you can do so on their respective user profiles.',
-'No delete admins message'	=>	'Administrators cannot be deleted. In order to delete administrators, you must first move them to a different user group.',
-'No ban admins message'		=>	'Administrators cannot be banned. In order to ban administrators, you must first move them to a different user group.',
-'No ban mods message'		=>	'Moderators cannot be banned. In order to ban moderators, you must first move them to a different user group.',
-'Move users'				=>	'Change user group',
-'Move users subhead'		=>	'Select new user group',
-'New group label'			=>	'New group',
-'New group help'			=>	'Select the group to which the selected users will be moved. For security reasons, it is not possible to move multiple users to the administrator group.',
-'Invalid group message'		=>	'Invalid group ID.',
-'Users move redirect'		=>	'User group changed. Redirecting âŠ',
-'Delete users'				=>	'Delete users',
-'Confirm delete legend'		=>	'Important: read before deleting users',
-'Confirm delete info'		=>	'Please confirm that you want to delete these users.',
-'Delete posts'				=>	'Delete any posts and topics these users have made.',
-'Delete warning'			=>	'Warning! Deleted users and/or posts cannot be restored. If you choose not to delete the posts made by these users, the posts can only be deleted manually at a later time.',
-'Users delete redirect'		=>	'Users deleted. Redirecting âŠ',
-'Ban users'					=>	'Ban users',
-'Message expiry subhead'	=>	'Ban message and expiry',
-'Ban message label'			=>	'Ban message',
-'Ban message help'			=>	'A message that will be displayed to the banned users when they visit the board.',
-'Expire date label'			=>	'Expire date',
-'Expire date help'			=>	'The date when these bans should be automatically removed (format: yyyy-mm-dd). Leave blank to remove manually.',
-'Ban IP label'				=>	'Ban IP addresses',
-'Ban IP help'				=>	'Also ban the IP addresses of the banned users to make registering a new account more difficult for them.',
-'Invalid date message'		=>	'You entered an invalid expire date.',
-'Invalid date reasons'		=>	'The format should be YYYY-MM-DD and the date must be at least one day in the future.',
-'Users banned redirect'		=>	'Users banned. Redirecting âŠ',
-
-'User search head'			=>	'User search',
-'User search subhead'		=>	'Enter search criteria',
-'User search info'			=>	'Search for users in the database. You can enter one or more terms to search for. Wildcards in the form of asterisks (*) are accepted.',
-'Username label'			=>	'Username',
-'E-mail address label'		=>	'Email address',
-'Title label'				=>	'Title',
-'Real name label'			=>	'Real name',
-'Website label'				=>	'Website',
-'Jabber label'				=>	'Jabber',
-'ICQ label'					=>	'ICQ',
-'MSN label'					=>	'MSN Messenger',
-'AOL label'					=>	'AOL IM',
-'Yahoo label'				=>	'Yahoo Messenger',
-'Location label'			=>	'Location',
-'Signature label'			=>	'Signature',
-'Admin note label'			=>	'Admin note',
-'Posts more than label'		=>	'Number of posts greater than',
-'Posts less than label'		=>	'Number of posts less than',
-'Last post after label'		=>	'Last post is after',
-'Date help'					=>	'(yyyy-mm-dd hh:mm:ss)',
-'Last post before label'	=>	'Last post is before',
-'Last visit after label'	=>	'Last visit is after',
-'Last visit before label'	=>	'Last visit is before',
-'Registered after label'	=>	'Registered after',
-'Registered before label'	=>	'Registered before',
-'Order by label'			=>	'Order by',
-'Order by username'			=>	'Username',
-'Order by e-mail'			=>	'Email',
-'Order by posts'			=>	'Number of posts',
-'Order by last post'		=>	'Last post',
-'Order by last visit'		=>	'Last visit',
-'Order by registered'		=>	'Registered',
-'Ascending'					=>	'Ascending',
-'Descending'				=>	'Descending',
-'User group label'			=>	'User group',
-'All groups'				=>	'All groups',
-'Unverified users'			=>	'Unverified users',
-'Submit search'				=>	'Submit search',
-'IP search head'			=>	'IP search',
-'IP search subhead'			=>	'Enter IP to search for',
-'IP address label'			=>	'IP address',
-'IP address help'			=>	'The IP address to search for in the post database.',
-'Find IP address'			=>	'Find IP address',
-
-'Results head'				=>	'Search Results',
-'Results username head'		=>	'Username',
-'Results e-mail head'		=>	'Email',
-'Results title head'		=>	'Title/Status',
-'Results posts head'		=>	'Posts',
-'Results admin note head'	=>	'Admin note',
-'Results actions head'		=>	'Actions',
-'Results IP address head'	=>	'IP address',
-'Results last used head'	=>	'Last used',
-'Results times found head'	=>	'Times found',
-'Results action head'		=>	'Action',
-'Results find more link'	=>	'Find more users for this ip',
-'Results no posts found'	=>	'There are currently no posts by that user in the forum.',
-'Select'					=>	'Select',
-'Select all'				=>	'Select all',
-'Unselect all'				=>	'Unselect all',
-'Ban'						=>	'Ban',
-'Delete'					=>	'Delete',
-'Change group'				=>	'Change group',
-'Bad IP message'			=>	'The supplied IP address is not correctly formatted.',
-'Results view IP link'		=>	'View IP stats',
-'Results show posts link'	=>	'Show posts',
-'Results guest'				=>	'Guest',
-'Results no IP found'		=>	'The supplied IP address could not be found in the database.',
-'No match'					=>	'No match'
-
-);
Index: /trunk/web/punbb/lang/English/common.php
===================================================================
--- /trunk/web/punbb/lang/English/common.php	(revision 10)
+++ /trunk/web/punbb/lang/English/common.php	(revision 1)
@@ -1,163 +1,154 @@
 <?php
 
+/*
+// Determine what locale to use
+switch (PHP_OS)
+{
+	case 'WINNT':
+	case 'WIN32':
+		$locale = 'english';
+		break;
+
+	case 'FreeBSD':
+	case 'NetBSD':
+	case 'OpenBSD':
+		$locale = 'en_US.US-ASCII';
+		break;
+
+	default:
+		$locale = 'en_US';
+		break;
+}
+
+// Attempt to set the locale
+setlocale(LC_CTYPE, $locale);
+*/
+
 // Language definitions for frequently used strings
+
 $lang_common = array(
 
 // Text orientation and encoding
-'lang_direction'					=>	'ltr', // ltr (Left-To-Right) or rtl (Right-To-Left)
-'lang_identifier'					=>	'en',
-
-// Number formatting
-'lang_decimal_point'				=>	'.',
-'lang_thousands_sep'				=>	',',
+'lang_direction'		=>	'ltr',	// ltr (Left-To-Right) or rtl (Right-To-Left)
+'lang_encoding'			=>	'iso-8859-1',
+'lang_multibyte'		=>	false,
 
 // Notices
-'Bad request'						=>	'Bad request. The link you followed is incorrect or outdated.',
-'No view'							=>	'You do not have permission to view these forums.',
-'No permission'						=>	'You do not have permission to access this page.',
-'Bad referrer'						=>	'Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that \'Base URL\' is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the FluxBB documentation.',
-'No cookie'							=>	'You appear to have logged in successfully, however a cookie has not been set. Please check your settings and if applicable, enable cookies for this website.',
-'Pun include error'					=>	'Unable to process user include %s from template %s. There is no such file in neither the template directory nor in the user include directory.',
+'Bad request'			=>	'Bad request. The link you followed is incorrect or outdated.',
+'No view'				=>	'You do not have permission to view these forums.',
+'No permission'			=>	'You do not have permission to access this page.',
+'Bad referrer'			=>	'Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that \'Base URL\' is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the PunBB documentation.',
+
+// Topic/forum indicators
+'New icon'				=>	'There are new posts',
+'Normal icon'			=>	'<!-- -->',
+'Closed icon'			=>	'This topic is closed',
+'Redirect icon'			=>	'Redirected forum',
 
 // Miscellaneous
-'Announcement'						=>	'Announcement',
-'Options'							=>	'Options',
-'Submit'							=>	'Submit', // "Name" of submit buttons
-'Ban message'						=>	'You are banned from this forum.',
-'Ban message 2'						=>	'The ban expires at the end of',
-'Ban message 3'						=>	'The administrator or moderator that banned you left the following message:',
-'Ban message 4'						=>	'Please direct any inquiries to the forum administrator at',
-'Never'								=>	'Never',
-'Today'								=>	'Today',
-'Yesterday'							=>	'Yesterday',
-'Info'								=>	'Info', // A common table header
-'Go back'							=>	'Go back',
-'Maintenance'						=>	'Maintenance',
-'Redirecting'						=>	'Redirecting',
-'Click redirect'					=>	'Click here if you do not want to wait any longer (or if your browser does not automatically forward you)',
-'on'								=>	'on', // As in "BBCode is on"
-'off'								=>	'off',
-'Invalid email'						=>	'The email address you entered is invalid.',
-'Required'							=>	'(Required)',
-'required field'					=>	'is a required field in this form.', // For javascript form validation
-'Last post'							=>	'Last post',
-'by'								=>	'by', // As in last post by someuser
-'New posts'							=>	'New posts', // The link that leads to the first new post
-'New posts info'					=>	'Go to the first new post in this topic.', // The popup text for new posts links
-'Username'							=>	'Username',
-'Password'							=>	'Password',
-'Email'								=>	'Email',
-'Send email'						=>	'Send email',
-'Moderated by'						=>	'Moderated by',
-'Registered'						=>	'Registered',
-'Subject'							=>	'Subject',
-'Message'							=>	'Message',
-'Topic'								=>	'Topic',
-'Forum'								=>	'Forum',
-'Posts'								=>	'Posts',
-'Replies'							=>	'Replies',
-'Pages'								=>	'Pages:',
-'Page'								=>	'Page %s',
-'BBCode'							=>	'BBCode:', // You probably shouldn't change this
-'img tag'							=>	'[img] tag:',
-'Smilies'							=>	'Smilies:',
-'and'								=>	'and',
-'Image link'						=>	'image', // This is displayed (i.e. <image>) instead of images when "Show images" is disabled in the profile
-'wrote'								=>	'wrote:', // For [quote]'s
-'Mailer'							=>	'%s Mailer', // As in "MyForums Mailer" in the signature of outgoing emails
-'Important information'				=>	'Important information',
-'Write message legend'				=>	'Write your message and submit',
-'Previous'							=>	'Previous',
-'Next'								=>	'Next',
-'Spacer'							=>	'âŠ', // Ellipsis for paginate
+'Announcement'			=>	'Announcement',
+'Options'				=>	'Options',
+'Actions'				=>	'Actions',
+'Submit'				=>	'Submit',	// "name" of submit buttons
+'Ban message'			=>	'You are banned from this forum.',
+'Ban message 2'			=>	'The ban expires at the end of',
+'Ban message 3'			=>	'The administrator or moderator that banned you left the following message:',
+'Ban message 4'			=>	'Please direct any inquiries to the forum administrator at',
+'Never'					=>	'Never',
+'Today'					=>	'Today',
+'Yesterday'				=>	'Yesterday',
+'Info'					=>	'Info',		// a common table header
+'Go back'				=>	'Go back',
+'Maintenance'			=>	'Maintenance',
+'Redirecting'			=>	'Redirecting',
+'Click redirect'		=>	'Click here if you do not want to wait any longer (or if your browser does not automatically forward you)',
+'on'					=>	'on',		// as in "BBCode is on"
+'off'					=>	'off',
+'Invalid e-mail'		=>	'The e-mail address you entered is invalid.',
+'required field'		=>	'is a required field in this form.',	// for javascript form validation
+'Last post'				=>	'Last post',
+'by'					=>	'by',	// as in last post by someuser
+'New posts'				=>	'New&#160;posts',	// the link that leads to the first new post (use &#160; for spaces)
+'New posts info'		=>	'Go to the first new post in this topic.',	// the popup text for new posts links
+'Username'				=>	'Username',
+'Password'				=>	'Password',
+'E-mail'				=>	'E-mail',
+'Send e-mail'			=>	'Send e-mail',
+'Moderated by'			=>	'Moderated by',
+'Registered'			=>	'Registered',
+'Subject'				=>	'Subject',
+'Message'				=>	'Message',
+'Topic'					=>	'Topic',
+'Forum'					=>	'Forum',
+'Posts'					=>	'Posts',
+'Replies'				=>	'Replies',
+'Author'				=>	'Author',
+'Pages'					=>	'Pages',
+'BBCode'				=>	'BBCode',	// You probably shouldn't change this
+'img tag'				=>	'[img] tag',
+'Smilies'				=>	'Smilies',
+'and'					=>	'and',
+'Image link'			=>	'image',	// This is displayed (i.e. <image>) instead of images when "Show images" is disabled in the profile
+'wrote'					=>	'wrote',	// For [quote]'s
+'Code'					=>	'Code',		// For [code]'s
+'Mailer'				=>	'Mailer',	// As in "MyForums Mailer" in the signature of outgoing e-mails
+'Important information'	=>	'Important information',
+'Write message legend'	=>	'Write your message and submit',
 
 // Title
-'Title'								=>	'Title',
-'Member'							=>	'Member', // Default title
-'Moderator'							=>	'Moderator',
-'Administrator'						=>	'Administrator',
-'Banned'							=>	'Banned',
-'Guest'								=>	'Guest',
+'Title'					=>	'Title',
+'Member'				=>	'Member',	// Default title
+'Moderator'				=>	'Moderator',
+'Administrator'			=>	'Administrator',
+'Banned'				=>	'Banned',
+'Guest'					=>	'Guest',
 
 // Stuff for include/parser.php
-'BBCode error no opening tag'		=>	'[/%1$s] was found without a matching [%1$s]',
-'BBCode error invalid nesting'		=>	'[%1$s] was opened within [%2$s], this is not allowed',
-'BBCode error invalid self-nesting'	=>	'[%s] was opened within itself, this is not allowed',
-'BBCode error no closing tag'		=>	'[%1$s] was found without a matching [/%1$s]',
-'BBCode error empty attribute'		=>	'[%s] tag had an empty attribute section',
-'BBCode code problem'				=>	'There is a problem with your [code] tags',
-'BBCode list size error'			=>	'Your list was too long to parse, please make it smaller!',
+'BBCode error'			=>	'The BBCode syntax in the message is incorrect.',
+'BBCode error 1'		=>	'Missing start tag for [/quote].',
+'BBCode error 2'		=>	'Missing end tag for [code].',
+'BBCode error 3'		=>	'Missing start tag for [/code].',
+'BBCode error 4'		=>	'Missing one or more end tags for [quote].',
+'BBCode error 5'		=>	'Missing one or more start tags for [/quote].',
 
 // Stuff for the navigator (top of every page)
-'Index'								=>	'Index',
-'User list'							=>	'User list',
-'Rules'								=>	'Rules',
-'Search'							=>	'Search',
-'Register'							=>	'Register',
-'Login'								=>	'Login',
-'Not logged in'						=>	'You are not logged in.',
-'Profile'							=>	'Profile',
-'Logout'							=>	'Logout',
-'Logged in as'						=>	'Logged in as',
-'Admin'								=>	'Administration',
-'Last visit'						=>	'Last visit: %s',
-'Topic searches'					=>	'Topics:',
-'New posts header'					=>	'New',
-'Active topics'						=>	'Active',
-'Unanswered topics'					=>	'Unanswered',
-'Posted topics'						=>	'Posted',
-'Show new posts'					=>	'Find topics with new posts since your last visit.',
-'Show active topics'				=>	'Find topics with recent posts.',
-'Show unanswered topics'			=>	'Find topics with no replies.',
-'Show posted topics'				=>	'Find topics you have posted to.',
-'Mark all as read'					=>	'Mark all topics as read',
-'Mark forum read'					=>	'Mark this forum as read',
-'Title separator'					=>	' / ',
+'Index'					=>	'Index',
+'User list'				=>	'User list',
+'Rules'					=>  'Rules',
+'Search'				=>  'Search',
+'Register'				=>  'Register',
+'Login'					=>  'Login',
+'Not logged in'			=>  'You are not logged in.',
+'Profile'				=>	'Profile',
+'Logout'				=>	'Logout',
+'Logged in as'			=>	'Logged in as',
+'Admin'					=>	'Administration',
+'Last visit'			=>	'Last visit',
+'Show new posts'		=>	'Show new posts since last visit',
+'Mark all as read'		=>	'Mark all topics as read',
+'Link separator'		=>	'',	// The text that separates links in the navigator
 
 // Stuff for the page footer
-'Board footer'						=>	'Board footer',
-'Jump to'							=>	'Jump to',
-'Go'								=>	' Go ', // Submit button in forum jump
-'Moderate topic'					=>	'Moderate topic',
-'Move topic'						=>	'Move topic',
-'Open topic'						=>	'Open topic',
-'Close topic'						=>	'Close topic',
-'Unstick topic'						=>	'Unstick topic',
-'Stick topic'						=>	'Stick topic',
-'Moderate forum'					=>	'Moderate forum',
-'Powered by'						=>	'Powered by %s',
-
-// Debug information
-'Debug table'						=>	'Debug information',
-'Querytime'							=>	'Generated in %1$s seconds, %2$s queries executed',
-'Memory usage'						=>	'Memory usage: %1$s',
-'Peak usage'						=>	'(Peak: %1$s)',
-'Query times'						=>	'Time (s)',
-'Query'								=>	'Query',
-'Total query time'					=>	'Total query time: %s',
+'Board footer'			=>	'Board footer',
+'Search links'			=>	'Search links',
+'Show recent posts'		=>	'Show recent posts',
+'Show unanswered posts'	=>	'Show unanswered posts',
+'Show your posts'		=>	'Show your posts',
+'Show subscriptions'	=>	'Show your subscribed topics',
+'Jump to'				=>	'Jump to',
+'Go'					=>	' Go ',		// submit button in forum jump
+'Move topic'			=>  'Move topic',
+'Open topic'			=>  'Open topic',
+'Close topic'			=>  'Close topic',
+'Unstick topic'			=>  'Unstick topic',
+'Stick topic'			=>  'Stick topic',
+'Moderate forum'		=>	'Moderate forum',
+'Delete posts'			=>	'Delete multiple posts',
+'Debug table'			=>	'Debug information',
 
 // For extern.php RSS feed
-'RSS description'					=>	'The most recent topics at %s.',
-'RSS description topic'				=>	'The most recent posts in %s.',
-'RSS reply'							=>	'Re: ', // The topic subject will be appended to this string (to signify a reply)
-'RSS active topics feed'			=>	'RSS active topics feed',
-'Atom active topics feed'			=>	'Atom active topics feed',
-'RSS forum feed'					=>	'RSS forum feed',
-'Atom forum feed'					=>	'Atom forum feed',
-'RSS topic feed'					=>	'RSS topic feed',
-'Atom topic feed'					=>	'Atom topic feed',
-
-// Admin related stuff in the header
-'New reports'						=>	'There are new reports',
-'Maintenance mode enabled'			=>	'Maintenance mode is enabled!',
-
-// Units for file sizes
-'Size unit B'						=>	'%s B',
-'Size unit KiB'						=>	'%s KiB',
-'Size unit MiB'						=>	'%s MiB',
-'Size unit GiB'						=>	'%s GiB',
-'Size unit TiB'						=>	'%s TiB',
-'Size unit PiB'						=>	'%s PiB',
-'Size unit EiB'						=>	'%s EiB',
+'RSS Desc Active'		=>	'The most recently active topics at',	// board_title will be appended to this string
+'RSS Desc New'			=>	'The newest topics at',					// board_title will be appended to this string
+'Posted'				=>	'Posted'	// The date/time a topic was started
 
 );
Index: /trunk/web/punbb/lang/English/delete.php
===================================================================
--- /trunk/web/punbb/lang/English/delete.php	(revision 10)
+++ /trunk/web/punbb/lang/English/delete.php	(revision 1)
@@ -5,12 +5,8 @@
 
 'Delete post'			=>	'Delete post',
-'Warning'				=>	'You are about to permanently delete this post.',
-'Topic warning'			=>	'Warning! This is the first post in the topic, the whole topic will be permanently deleted.',
-'Delete info'			=>	'The post you have chosen to delete is set out below for you to review before proceeding.',
-'Reply by'				=>	'Reply by %s - %s',
-'Topic by'				=>	'Topic started by %s - %s',
-'Delete'				=>	'Delete', // The submit button
-'Post del redirect'		=>	'Post deleted. Redirecting âŠ',
-'Topic del redirect'	=>	'Topic deleted. Redirecting âŠ'
+'Warning'				=>	'Warning! If this is the first post in the topic, the whole topic will be deleted.',
+'Delete'				=>	'Delete',	// The submit button
+'Post del redirect'		=>	'Post deleted. Redirection ...',
+'Topic del redirect'	=>	'Topic deleted. Redirection ...'
 
 );
Index: /trunk/web/punbb/lang/English/forum.php
===================================================================
--- /trunk/web/punbb/lang/English/forum.php	(revision 10)
+++ /trunk/web/punbb/lang/English/forum.php	(revision 1)
@@ -6,12 +6,7 @@
 'Post topic'	=>	'Post new topic',
 'Views'			=>	'Views',
-'Moved'			=>	'Moved:',
-'Sticky'		=>	'Sticky:',
-'Closed'		=>	'Closed:',
-'Empty forum'	=>	'Forum is empty.',
-'Mod controls'	=>	'Moderator controls',
-'Is subscribed'	=>	'You are currently subscribed to this forum',
-'Unsubscribe'	=>	'Unsubscribe',
-'Subscribe'		=>	'Subscribe to this forum'
+'Moved'			=>	'Moved',
+'Sticky'		=>	'Sticky',
+'Empty forum'	=>	'Forum is empty.'
 
 );
Index: /trunk/web/punbb/lang/English/help.php
===================================================================
--- /trunk/web/punbb/lang/English/help.php	(revision 10)
+++ /trunk/web/punbb/lang/English/help.php	(revision 1)
@@ -7,5 +7,4 @@
 'produces'				=>	'produces',
 
-'BBCode'				=>	'BBCode',
 'BBCode info 1'			=>	'BBCode is a collection of formatting tags that are used to change the look of text in this forum. BBCode is based on the same principal as, and is very similar to, HTML. Below is a list of all the available BBCodes and instructions on how to use them.',
 'BBCode info 2'			=>	'Administrators have the ability to enable or disable BBCode. You can tell if BBCode is enabled or disabled out in the left margin whenever you post a message or edit your signature.',
@@ -16,23 +15,11 @@
 'Underlined text'		=>	'Underlined text',
 'Italic text'			=>	'Italic text',
-'Strike-through text'	=>	'Strike-through text',
 'Red text'				=>	'Red text',
 'Blue text'				=>	'Blue text',
-'Heading text'			=>	'Heading text',
-'Deleted text'			=>	'Deleted text',
-'Inserted text'			=>	'Inserted text',
-'Emphasised text'		=>	'Emphasised text',
 
 'Links and images'		=>	'Links and images',
-'Links info'			=>	'You can create links to other documents or to email addresses using the following tags:',
-'This help page'		=>	'This help page',
-'My email address'		=>	'My email address',
-'Images info'			=>	'If you want to display an image you can use the img tag. The text appearing after the "=" sign in the opening tag is used for the alt attribute and should be included whenever possible.',
-'FluxBB bbcode test'	=>	'FluxBB bbcode test',
-
-'Test topic'			=>	'Test topic',
-'Test post'				=>	'Test post',
-'Test forum'			=>	'Test forum',
-'Test user'				=>	'Test user',
+'Links info'			=>	'You can create links to other documents or to e-mail addresses using the following tags:',
+'My e-mail address'		=>	'My e-mail address',
+'Images info'			=>	'If you want to display an image you can use the img tag.',
 
 'Quotes'				=>	'Quotes',
@@ -41,5 +28,4 @@
 'Quote text'			=>	'This is the text i want to quote.',
 'produces quote box'	=>	'produces a quote box like this:',
-'quote note'			=>	'Note: If a username contains the characters [ or ] you can enclose it in quote marks.',
 
 'Code'					=>	'Code',
@@ -52,14 +38,4 @@
 'Bold, underlined text'	=>	'Bold, underlined text',
 
-'Lists'					=>	'Lists',
-'List info'				=>	'To create a list you can use the list tag. You can create 3 types of lists using the list tag.',
-'List text 1'			=>	'Example list item 1.',
-'List text 2'			=>	'Example list item 2.',
-'List text 3'			=>	'Example list item 3.',
-'produces list'			=>	'produces a bulleted list.',
-'produces decimal list'	=>	'produces a numbered list.',
-'produces alpha list'	=>	'produces an alphabetically labelled list.',
-
-'Smilies'				=>	'Smilies',
 'Smilies info'			=>	'If you like (and if it is enabled), the forum can convert a series of smilies to images representations of that smiley. This forum recognizes the following smilies and replaces them with images:'
 
Index: /trunk/web/punbb/lang/English/index.html
===================================================================
--- /trunk/web/punbb/lang/English/index.html	(revision 10)
+++ /trunk/web/punbb/lang/English/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/lang/English/index.php
===================================================================
--- /trunk/web/punbb/lang/English/index.php	(revision 10)
+++ /trunk/web/punbb/lang/English/index.php	(revision 1)
@@ -4,17 +4,18 @@
 $lang_index = array(
 
-'Topics'		=>	'Topics',
-'Link to'		=>	'Link to:', // As in "Link to: http://fluxbb.org/"
-'Empty board'	=>	'Board is empty.',
-'Newest user'	=>	'Newest registered user: %s',
-'Users online'	=>	'Registered users online: %s',
-'Guests online'	=>	'Guests online: %s',
-'No of users'	=>	'Total number of registered users: %s',
-'No of topics'	=>	'Total number of topics: %s',
-'No of posts'	=>	'Total number of posts: %s',
-'Online'		=>	'Online:', // As in "Online: User A, User B etc."
-'Board info'	=>	'Board information',
-'Board stats'	=>	'Board statistics',
-'User info'		=>	'User information'
+'Topics'				=>  'Topics',
+'Moderators'			=>  'Moderators',
+'Link to'				=>	'Link to',	// As in "Link to http://www.punbb.org/"
+'Empty board'			=>	'Board is empty.',
+'Newest user'			=>	'Newest registered user',
+'Users online'			=>	'Registered users online',
+'Guests online'			=>	'Guests online',
+'No of users'			=>	'Total number of registered users',
+'No of topics'			=>	'Total number of topics',
+'No of posts'			=>	'Total number of posts',
+'Online'				=>	'Online',	// As in "Online: User A, User B etc."
+'Board info'			=>	'Board information',
+'Board stats'			=>	'Board statistics',
+'User info'				=>	'User information'
 
 );
Index: unk/web/punbb/lang/English/install.php
===================================================================
--- /trunk/web/punbb/lang/English/install.php	(revision 10)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?php
-
-// Language definitions used in install.php, localized by adaur
-
-$lang_install = array(
-
-'Install message'				=>	'The file \'config.php\' doesn\'t exist or is corrupt. This implies that FluxBB has not yet been installed.',
-'Choose install language'		=>	'Choose the install script language',
-'Choose install language info'	=>	'The language used for this install script. The default language used for the board itself can be set below.',
-'Install language'				=>	'Install language',
-'Change language'				=>	'Change language',
-'Next'							=>	'Next',
-'Already installed'				=>	'It seems like FluxBB is already installed. You should go <a href="index.php">here</a> instead.',
-'You are running error'			=>	'You are running %1$s version %2$s. FluxBB %3$s requires at least %1$s %4$s to run properly. You must upgrade your %1$s installation before you can continue.',
-'My FluxBB Forum'				=>	'My FluxBB Forum',
-'Description'					=>	'Unfortunately no one can be told what FluxBB is - you have to see it for yourself.',
-'Username 1'					=>	'Usernames must be at least 2 characters long.',
-'Username 2'					=>	'Usernames must not be more than 25 characters long.',
-'Username 3'					=>	'The username guest is reserved.',
-'Username 4'					=>	'Usernames may not be in the form of an IP address.',
-'Username 5'					=>	'Usernames may not contain all the characters \', " and [ or ] at once.',
-'Username 6'					=>	'Usernames may not contain any of the text formatting tags (BBCode) that the forum uses.',
-'Short password'				=>	'Passwords must be at least 4 characters long.',
-'Passwords not match'			=>	'Passwords do not match.',
-'Wrong email'					=>	'The administrator email address you entered is invalid.',
-'No board title'				=>	'You must enter a board title.',
-'Error default language'		=>	'The default language chosen doesn\'t seem to exist.',
-'Error default style'			=>	'The default style chosen doesn\'t seem to exist.',
-'No DB extensions'				=>	'This PHP environment does not have support for any of the databases that FluxBB supports. PHP needs to have support for either MySQL, PostgreSQL or SQLite in order for FluxBB to be installed.',
-'Administrator username'		=>	'Administrator\'s username',
-'Administrator password 1'		=>	'Administrator password 1',
-'Administrator password 2'		=>	'Administrator password 2',
-'Administrator email'			=>	'Administrator\'s email',
-'Board title'					=>	'Board title',
-'Base URL'						=>	'Base URL',
-'Required field'				=>	'is a required field in this form.',
-'FluxBB Installation'			=>	'FluxBB Installation',
-'Welcome'						=>	'You are about to install FluxBB. In order to install FluxBB, you must complete the form set out below. If you encounter any difficulties with the installation, please refer to the documentation.',
-'Install'						=>	'Install FluxBB 1.4',
-'Errors'						=>	'The following errors need to be corrected:',
-'Database setup'				=>	'Database setup',
-'Info 1'						=>	'Please enter the requested information in order to setup your database for FluxBB. You must know all the information asked for before proceeding with the installation.',
-'Select database'				=>	'Select your database type',
-'Info 2'						=>	'FluxBB currently supports MySQL, PostgreSQL and SQLite. If your database of choice is missing from the drop-down menu below, it means this PHP environment does not have support for that particular database. More information regarding support for particular versions of each database can be found in the FAQ.',
-'Dual MySQL'					=>	'FluxBB has detected that your PHP environment supports two different ways of communicating with MySQL. The two options are called standard and improved. If you are uncertain which one to use, start by trying improved and if that fails, try standard.',
-'InnoDB'						=>	'FluxBB has detected that your MySQL server might support <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb.html">InnoDB</a>. This would be a good choice if you are planning to run a large forum. If you are uncertain, it is recommended that you do not use InnoDB.',
-'Database type'					=>	'Database type',
-'Required'						=>	'(Required)',
-'Database hostname'				=>	'Enter your database server hostname',
-'Info 3'						=>	'The address of the database server (example: localhost, db.myhost.com or 192.168.0.15). You can specify a custom port number if your database doesn\'t run on the default port (example: localhost:3580). For SQLite support, just enter anything or leave it at \'localhost\'.',
-'Database server hostname'		=>'Database server hostname',
-'Database enter name'			=>	'Enter the name of your database',
-'Info 4'						=>	'The name of the database that FluxBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. For security reasons, it is highly recommended to place the SQLite database in a private (not web accessible) directory whenever possible. If the SQLite database file does not exist, FluxBB will attempt to create it.',
-'Database name'					=>	'Database name',
-'Database enter informations'	=>	'Enter your database username and password',
-'Database username'				=>	'Database username',
-'Info 5'						=>	'Enter the username and password with which you connect to the database. Ignore for SQLite.',
-'Database password'				=>	'Database password',
-'Database enter prefix'			=>	'Enter database table prefix',
-'Info 6'						=>	'If you like, you can specify a table prefix. This way you can run multiple copies of FluxBB in the same database (example: foo_).',
-'Table prefix'					=>	'Table prefix',
-'Administration setup'			=>	'Administration setup',
-'Info 7'						=>	'Please enter the requested information in order to setup an administrator for your FluxBB installation.',
-'Admin enter username'			=>	'Enter Administrator\'s username',
-'Info 8'						=>	'The username of the forum administrator. You can later create more administrators and moderators. Usernames can be between 2 and 25 characters long.',
-'Admin enter password'			=>	'Enter and confirm Administrator\'s password',
-'Info 9'						=>	'Passwords must be at least 4 characters long. Passwords are case sensitive.',
-'Password'						=>	'Password',
-'Confirm password'				=>	'Confirm password',
-'Admin enter email'				=>	'Enter Administrator\'s email',
-'Info 10'						=>	'The email address of the forum administrator.',
-'Board setup'					=>	'Board setup',
-'Info 11'						=>	'Please enter the requested information in order to setup your FluxBB board.',
-'Enter board title'				=>	'Enter your board\'s title',
-'Info 12'						=>	'The title of this bulletin board (shown at the top of every page).',
-'Enter board description'		=>	'Enter your board\'s description',
-'Info 13'						=>	'A short description of this bulletin board (shown at the top of every page). This field may contain HTML.',
-'Board description'				=>	'Board description',
-'Enter base URL'				=>	'Enter the Base URL of your FluxBB installation',
-'Info 14'						=>	'The URL (without trailing slash) of your FluxBB forum (example: http://forum.myhost.com or http://myhost.com/~myuser). This <strong>must</strong> be correct, otherwise, administrators and moderators will not be able to submit any forms. Please note that the preset value below is just an educated guess by FluxBB.',
-'Choose the default language'	=>	'Choose the default language',
-'Info 15'						=>	'The default language used for guests and users who haven\'t changed from the default in their profile.',
-'Default language'				=>	'Default language',
-'Choose the default style'		=>	'Choose the default style',
-'Info 16'						=>	'The default style used for guests and users who haven\'t changed from the default in their profile.',
-'Default style'					=>	'Default style',
-'Start install'					=>	'Start install',
-'DB type not valid'				=>	'\'%s\' is not a valid database type',
-'Table prefix error'			=>	'The table prefix \'%s\' contains illegal characters or is too long. The prefix may contain the letters a to z, any numbers and the underscore character. They must however not start with a number. The maximum length is 40 characters. Please choose a different prefix',
-'Prefix reserved'				=>	'The table prefix \'sqlite_\' is reserved for use by the SQLite engine. Please choose a different prefix',
-'Existing table error'			=>	'A table called \'%susers\' is already present in the database \'%s\'. This could mean that FluxBB is already installed or that another piece of software is installed and is occupying one or more of the table names FluxBB requires. If you want to install multiple copies of FluxBB in the same database, you must choose a different table prefix',
-'InnoDB off'					=>	'InnoDB does not seem to be enabled. Please choose a database layer that does not have InnoDB support, or enable InnoDB on your MySQL server',
-'Administrators'				=>	'Administrators',
-'Administrator'					=>	'Administrator',
-'Moderators'					=>	'Moderators',
-'Moderator'						=>	'Moderator',
-'Guests'						=>	'Guests',
-'Guest'							=>	'Guest',
-'New member'					=>	'New member',
-'Members'						=>	'Members',
-'Member'						=>	'Member',
-'Announcement'					=>	'Enter your announcement here.',
-'Rules'							=>	'Enter your rules here',
-'Maintenance message'			=>	'The forums are temporarily down for maintenance. Please try again in a few minutes.',
-'Test post'						=>	'Test post',
-'Message'						=>	'If you are looking at this (which I guess you are), the install of FluxBB appears to have worked! Now log in and head over to the administration control panel to configure your forum.',
-'Test category'					=>	'Test category',
-'Test forum'					=>	'Test forum',
-'This is just a test forum'		=>	'This is just a test forum',
-'Alert cache'					=>	'<strong>The cache directory is currently not writable!</strong> In order for FluxBB to function properly, the directory <em>%s</em> must be writable by PHP. Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.',
-'Alert avatar'					=>	'<strong>The avatar directory is currently not writable!</strong> If you want users to be able to upload their own avatar images you must see to it that the directory <em>%s</em> is writable by PHP. You can later choose to save avatar images in a different directory (see Admin/Options). Use chmod to set the appropriate directory permissions. If in doubt, chmod to 0777.',
-'Alert upload'					=>	'<strong>File uploads appear to be disallowed on this server!</strong> If you want users to be able to upload their own avatar images you must enable the file_uploads configuration setting in PHP. Once file uploads have been enabled, avatar uploads can be enabled in Administration/Options/Features.',
-'FluxBB has been installed'		=>	'FluxBB has been installed. To finalize the installation please follow the instructions below.',
-'Final instructions'			=>	'Final instructions',
-'Info 17'						=>	'To finalize the installation, you need to click on the button below to download a file called config.php. You then need to upload this file to the root directory of your FluxBB installation.',
-'Info 18'						=>	'Once you have uploaded config.php, FluxBB will be fully installed! At that point, you may <a href="index.php">go to the forum index</a>.',
-'Download config.php file'		=>	'Download config.php file',
-'FluxBB fully installed'		=>	'FluxBB has been fully installed! You may now <a href="index.php">go to the forum index</a>.',
-
-);
Index: /trunk/web/punbb/lang/English/login.php
===================================================================
--- /trunk/web/punbb/lang/English/login.php	(revision 10)
+++ /trunk/web/punbb/lang/English/login.php	(revision 1)
@@ -1,26 +1,22 @@
 <?php
 
-// Language definitions used in login.php
+// Language definitions used in delete.php
 $lang_login = array(
 
 // Miscellaneous
-'Wrong user/pass'			=>	'Wrong username and/or password.',
-'Forgotten pass'			=>	'Forgotten your password?',
-'Login redirect'			=>	'Logged in successfully. Redirecting âŠ',
-'Logout redirect'			=>	'Logged out. Redirecting âŠ',
-'No email match'			=>	'There is no user registered with the email address',
-'Request pass'				=>	'Request password',
-'Request pass legend'		=>	'Enter the email address with which you registered',
-'Request pass info'			=>	'A new password together with a link to activate the new password will be sent to that address.',
-'Not registered'			=>	'Not registered yet?',
-'Login legend'				=>	'Enter your username and password below',
-'Remember me'				=>	'Log me in automatically each time I visit.',
-'Login info'				=>	'If you have not registered or have forgotten your password click on the appropriate link below.',
-'New password errors'		=>	'Password request error',
-'New passworderrors info'	=>	'The following error needs to be corrected before a new password can be sent:',
+'Wrong user/pass'		=>	'Wrong username and/or password.',
+'Forgotten pass'		=>	'Forgotten your password?',
+'Login redirect'		=>	'Logged in successfully. Redirection ...',
+'Logout redirect'		=>	'Logged out. Redirection ...',
+'No e-mail match'		=>	'There is no user registered with the e-mail address',
+'Request pass'			=>	'Request password',
+'Request pass legend'	=>	'Enter the e-mail address with which you registered',
+'Request pass info'		=>	'A new password together with a link to activate the new password will be sent to that address.',
+'Not registered'		=>	'Not registered yet?',
+'Login legend'			=>	'Enter your username and password below',
+'Login info'			=>	'If you have not registered or have forgotten your password click on the appropriate link below.',
 
 // Forget password mail stuff
-'Forget mail'				=>	'An email has been sent to the specified address with instructions on how to change your password. If it does not arrive you can contact the forum administrator at',
-'Email flood'				=>	'This account has already requested a password reset in the past hour. Please wait a while before requesting a new password again.'
+'Forget mail'			=>	'An e-mail has been sent to the specified address with instructions on how to change your password. If it does not arrive you can contact the forum administrator at'
 
 );
Index: /trunk/web/punbb/lang/English/mail_templates/activate_email.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/activate_email.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/activate_email.tpl	(revision 1)
@@ -1,12 +1,12 @@
-Subject: Change email address requested
+Subject: Change e-mail address requested
 
 Hello <username>,
 
-You have requested to have a new email address assigned to your account in the discussion forum at <base_url>. If you didn't request this or if you don't want to change your email address you should just ignore this message. Only if you visit the activation page below will your email address be changed. In order for the activation page to work, you must be logged in to the forum.
+You have requested to have a new e-mail address assigned to your account in the discussion forum at <base_url>. If you didn't request this or if you don't want to change your e-mail address you should just ignore this message. Only if you visit the activation page below will your e-mail address be changed. In order for the activation page to work, you must be logged in to the forum.
 
-To change your email address, please visit the following page:
+To change your e-mail address, please visit the following page:
 <activation_url>
 
---
-<board_mailer> Mailer
+-- 
+<board_mailer>
 (Do not reply to this message)
Index: /trunk/web/punbb/lang/English/mail_templates/activate_password.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/activate_password.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/activate_password.tpl	(revision 1)
@@ -10,5 +10,5 @@
 <activation_url>
 
---
-<board_mailer> Mailer
+-- 
+<board_mailer>
 (Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/banned_email_change.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/banned_email_change.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - Banned email detected
-
-User '<username>' changed to banned email address: <email>
-
-User profile: <profile_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/banned_email_post.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/banned_email_post.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - Banned email detected
-
-User '<username>' posted with banned email address: <email>
-
-Post URL: <post_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/banned_email_register.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/banned_email_register.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - Banned email detected
-
-User '<username>' registered with banned email address: <email>
-
-User profile: <profile_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/dupe_email_change.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/dupe_email_change.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - Duplicate email detected
-
-User '<username>' changed to an email address that also belongs to: <dupe_list>
-
-User profile: <profile_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/dupe_email_register.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/dupe_email_register.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - Duplicate email detected
-
-User '<username>' registered with an email address that also belongs to: <dupe_list>
-
-User profile: <profile_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: /trunk/web/punbb/lang/English/mail_templates/form_email.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/form_email.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/form_email.tpl	(revision 1)
@@ -1,5 +1,5 @@
 Subject: <mail_subject>
 
-<sender> from <board_title> has sent you a message. You can reply to <sender> by replying to this email.
+<sender> from <board_title> has sent you a message. You can reply to <sender> by replying to this e-mail.
 
 The message reads as follows:
@@ -10,4 +10,4 @@
 -----------------------------------------------------------------------
 
---
-<board_mailer> Mailer
+-- 
+<board_mailer>
Index: /trunk/web/punbb/lang/English/mail_templates/index.html
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/index.html	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/lang/English/mail_templates/new_reply.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_reply.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/new_reply.tpl	(revision 1)
@@ -1,5 +1,5 @@
-Subject: Reply to topic: '<topic_subject>'
+Subject: Reply to topic: <topic_subject>
 
-<replier> has replied to the topic '<topic_subject>' to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
+<replier> has replied to the topic <topic_subject> to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
 
 The post is located at <post_url>
@@ -7,5 +7,5 @@
 You can unsubscribe by going to <unsubscribe_url>
 
---
-<board_mailer> Mailer
+-- 
+<board_mailer>
 (Do not reply to this message)
Index: /trunk/web/punbb/lang/English/mail_templates/new_reply_full.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_reply_full.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/new_reply_full.tpl	(revision 1)
@@ -1,5 +1,5 @@
-Subject: Reply to topic: '<topic_subject>'
+Subject: Reply to topic: <topic_subject>
 
-<replier> has replied to the topic '<topic_subject>' to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
+<replier> has replied to the topic <topic_subject> to which you are subscribed. There may be more new replies, but this is the only notification you will receive until you visit the board again.
 
 The message reads as follows:
@@ -14,5 +14,5 @@
 You can unsubscribe by going to <unsubscribe_url>
 
---
-<board_mailer> Mailer
+-- 
+<board_mailer>
 (Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/new_report.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_report.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Report(<forum_id>) - '<topic_subject>'
-
-User '<username>' has reported the following message: <post_url>
-
-Reason: <reason>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/new_topic.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_topic.tpl	(revision 10)
+++ 	(revision )
@@ -1,11 +1,0 @@
-Subject: New topic in forum: '<forum_name>'
-
-<poster> has posted a new topic '<topic_subject>' in the forum '<forum_name>', to which you are subscribed.
-
-The topic is located at <topic_url>
-
-You can unsubscribe by going to <unsubscribe_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/new_topic_full.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_topic_full.tpl	(revision 10)
+++ 	(revision )
@@ -1,18 +1,0 @@
-Subject: New topic in forum: '<forum_name>'
-
-<poster> has posted a new topic '<topic_subject>' in the forum '<forum_name>', to which you are subscribed.
-
-The message reads as follows:
------------------------------------------------------------------------
-
-<message>
-
------------------------------------------------------------------------
-
-The topic is located at <topic_url>
-
-You can unsubscribe by going to <unsubscribe_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/new_user.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/new_user.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Alert - New registration
-
-User '<username>' registered in the forums at <base_url>
-
-User profile: <profile_url>
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: unk/web/punbb/lang/English/mail_templates/rename.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/rename.tpl	(revision 10)
+++ 	(revision )
@@ -1,12 +1,0 @@
-Subject: User account renamed
-
-During an upgrade to the forums at <base_url> it was determined your username is too similar to an existing user. Your username has been changed accordingly.
-
-Old username: <old_username>
-New username: <new_username>
-
-We apologise for any inconvenience caused.
-
---
-<board_mailer> Mailer
-(Do not reply to this message)
Index: /trunk/web/punbb/lang/English/mail_templates/welcome.tpl
===================================================================
--- /trunk/web/punbb/lang/English/mail_templates/welcome.tpl	(revision 10)
+++ /trunk/web/punbb/lang/English/mail_templates/welcome.tpl	(revision 1)
@@ -9,4 +9,4 @@
 
 --
-<board_mailer> Mailer
+<board_mailer>
 (Do not reply to this message)
Index: /trunk/web/punbb/lang/English/misc.php
===================================================================
--- /trunk/web/punbb/lang/English/misc.php	(revision 10)
+++ /trunk/web/punbb/lang/English/misc.php	(revision 1)
@@ -4,90 +4,64 @@
 $lang_misc = array(
 
-'Mark read redirect'			=>	'All topics and forums have been marked as read. Redirecting âŠ',
-'Mark forum read redirect'		=>	'All topics in the specified forum have been marked as read. Redirecting âŠ',
+'Mark read redirect'		=>	'All topics and forums have been marked as read. Redirection ...',
 
-// Send email
-'Form email disabled'			=>	'The user you are trying to send an email to has disabled form email.',
-'No email subject'				=>	'You must enter a subject.',
-'No email message'				=>	'You must enter a message.',
-'Too long email message'		=>	'Messages cannot be longer than 65535 characters (64 KB).',
-'Email flood'					=>	'At least %s seconds have to pass between sent emails. Please wait a while and try sending again.',
-'Email sent redirect'			=>	'Email sent. Redirecting âŠ',
-'Send email to'					=>	'Send email to',
-'Email subject'					=>	'Subject',
-'Email message'					=>	'Message',
-'Email disclosure note'			=>	'Please note that by using this form, your email address will be disclosed to the recipient.',
-'Write email'					=>	'Write and submit your email message',
+// Send e-mail
+'Form e-mail disabled'		=>	'The user you are trying to send an e-mail to has disabled form e-mail.',
+'No e-mail subject'			=>	'You must enter a subject.',
+'No e-mail message'			=>	'You must enter a message.',
+'Too long e-mail message'	=>	'Messages cannot be longer than 65535 characters (64 KB).',
+'E-mail sent redirect'		=>	'E-mail sent. Redirection ...',
+'Send e-mail to'			=>	'Send e-mail to',
+'E-mail subject'			=>	'Subject',
+'E-mail message'			=>	'Message',
+'E-mail disclosure note'	=>	'Please note that by using this form, your e-mail address will be disclosed to the recipient.',
+'Write e-mail'				=>	'Write and submit your e-mail message',
 
 // Report
-'No reason'						=>	'You must enter a reason.',
-'Reason too long'				=>	'Your message must be under 65535 bytes (~64kb).',
-'Report flood'					=>	'At least %s seconds have to pass between reports. Please wait a while and try sending again.',
-'Report redirect'				=>	'Post reported. Redirecting âŠ',
-'Report post'					=>	'Report post',
-'Reason'						=>	'Reason',
-'Reason desc'					=>	'Please enter a short reason why you are reporting this post',
+'No reason'					=>	'You must enter a reason.',
+'Report redirect'			=>	'Post reported. Redirection ...',
+'Report post'				=>	'Report post',
+'Reason'					=>	'Reason',
+'Reason desc'				=>	'Please enter a short reason why you are reporting this post',
 
 // Subscriptions
-'Already subscribed topic'		=>	'You are already subscribed to this topic.',
-'Already subscribed forum'		=>	'You are already subscribed to this forum.',
-'Subscribe redirect'			=>	'Your subscription has been added. Redirecting âŠ',
-'Not subscribed topic'			=>	'You are not subscribed to this topic.',
-'Not subscribed forum'			=>	'You are not subscribed to this forum.',
-'Unsubscribe redirect'			=>	'Your subscription has been removed. Redirecting âŠ',
+'Already subscribed'		=>	'You are already subscribed to this topic.',
+'Subscribe redirect'		=>	'Your subscription has been added. Redirection ...',
+'Not subscribed'			=>	'You are not subscribed to this topic.',
+'Unsubscribe redirect'		=>	'Your subscription has been removed. Redirection ...',
 
 // General forum and topic moderation
-'Moderate'						=>	'Moderate',
-'Select'						=>	'Select', // the header of a column of checkboxes
-'Move'							=>	'Move',
-'Split'							=>	'Split',
-'Delete'						=>	'Delete',
-'Merge'							=>	'Merge',
+'Moderate'					=>	'Moderate',
+'Select'					=>	'Select',	// the header of a column of checkboxes
+'Move'						=>	'Move',
+'Delete'					=>	'Delete',
 
 // Moderate forum
-'Open'							=>	'Open',
-'Close'							=>	'Close',
-'Move topic'					=>	'Move topic',
-'Move topics'					=>	'Move topics',
-'Move legend'					=>	'Select destination of move',
-'Move to'						=>	'Move to',
-'Nowhere to move'				=>	'There are no forums into which you can move topics.',
-'Leave redirect'				=>	'Leave redirect topic(s)',
-'Move topic redirect'			=>	'Topic moved. Redirecting âŠ',
-'Move topics redirect'			=>	'Topics moved. Redirecting âŠ',
-'Confirm delete legend'			=>	'Please confirm deletion',
-'Delete topics'					=>	'Delete topics',
-'Delete topics comply'			=>	'Are you sure you want to delete the selected topics?',
-'Delete topics redirect'		=>	'Topics deleted. Redirecting âŠ',
-'Open topic redirect'			=>	'Topic opened. Redirecting âŠ',
-'Open topics redirect'			=>	'Topics opened. Redirecting âŠ',
-'Close topic redirect'			=>	'Topic closed. Redirecting âŠ',
-'Close topics redirect'			=>	'Topics closed. Redirecting âŠ',
-'No topics selected'			=>	'You must select at least one topic for move/delete/open/close.',
-'Not enough topics selected'	=>	'You must select at least two topics for merge.',
-'Stick topic redirect'			=>	'Topic sticked. Redirecting âŠ',
-'Unstick topic redirect'		=>	'Topic unsticked. Redirecting âŠ',
-'Merge topics'					=>	'Merge topics',
-'Merge topics redirect'			=>	'Topics merged. Redirecting âŠ',
-'Confirm merge legend'			=>	'Please confirm merge',
-'New subject'					=>	'New subject',
-
-// Split multiple posts in topic
-'Confirm split legend'			=>	'Please confirm split of selected posts and select destination of move.',
-'Split posts'					=>	'Split posts',
-'Split posts comply'			=>	'Are you sure you want to split the selected posts?',
-'Split posts redirect'			=>	'Posts have been split. Redirecting âŠ',
+'Open'						=>	'Open',
+'Close'						=>	'Close',
+'Move topic'				=>	'Move topic',
+'Move topics'				=>	'Move topics',
+'Move legend'				=>	'Select destination of move',
+'Move to'					=>	'Move to',
+'Leave redirect'			=>	'Leave redirect topic(s)',
+'Move topic redirect'		=>	'Topic moved. Redirection ...',
+'Move topics redirect'		=>	'Topics moved. Redirection ...',
+'Confirm delete legend'		=>	'Please confirm deletion',
+'Delete topics'				=>	'Delete topics',
+'Delete topics comply'		=>	'Are you sure you want to delete the selected topics?',
+'Delete topics redirect'	=>	'Topics deleted. Redirection ...',
+'Open topic redirect'		=>	'Topic opened. Redirection ...',
+'Open topics redirect'		=>	'Topics opened. Redirection ...',
+'Close topic redirect'		=>	'Topic closed. Redirection ...',
+'Close topics redirect'		=>	'Topics closed. Redirection ...',
+'No topics selected'		=>	'You must select at least one topic for move/delete/open/close.',
+'Stick topic redirect'		=>	'Topic sticked. Redirection ...',
+'Unstick topic redirect'	=>	'Topic unsticked. Redirection ...',
 
 // Delete multiple posts in topic
-'Delete posts'					=>	'Delete posts',
-'Cannot select first'			=>	'First post cannot be selected for split/delete.',
-'Delete posts comply'			=>	'Are you sure you want to delete the selected posts?',
-'Delete posts redirect'			=>	'Posts deleted. Redirecting âŠ',
-'No posts selected'				=>	'You must select at least one post for split/delete.',
-
-// Get host
-'Host info 1'					=>	'The IP address is: %s',
-'Host info 2'					=>	'The host name is: %s',
-'Show more users'				=>	'Show more users for this IP',
+'Delete posts'				=>	'Delete posts',
+'Delete posts comply'		=>	'Are you sure you want to delete the selected posts?',
+'Delete posts redirect'		=>	'Posts deleted. Redirection ...',
+'No posts selected'			=>	'You must select at least one post to be deleted.'
 
 );
Index: /trunk/web/punbb/lang/English/post.php
===================================================================
--- /trunk/web/punbb/lang/English/post.php	(revision 10)
+++ /trunk/web/punbb/lang/English/post.php	(revision 1)
@@ -5,35 +5,29 @@
 
 // Post validation stuff (many are similiar to those in edit.php)
-'No subject'		=>	'Topics must contain a subject.',
-'No subject after censoring'	=>	'Topics must contain a subject. After applying censoring filters, your subject was empty.',
-'Too long subject'	=>	'Subjects cannot be longer than 70 characters.',
-'No message'		=>	'You must enter a message.',
-'No message after censoring'	=>	'You must enter a message. After applying censoring filters, your message was empty.',
-'Too long message'	=>	'Posts cannot be longer that %s bytes.',
-'All caps subject'	=>	'Subjects cannot contain only capital letters.',
-'All caps message'	=>	'Posts cannot contain only capital letters.',
-'Empty after strip'	=>	'It seems your post consisted of empty BBCodes only. It is possible that this happened because e.g. the innermost quote was discarded because of the maximum quote depth level.',
+'No subject'			=>	'Topics must contain a subject.',
+'Too long subject'		=>	'Subjects cannot be longer than 70 characters.',
+'No message'			=>	'You must enter a message.',
+'Too long message'		=>	'Posts cannot be longer that 65535 characters (64 KB).',
 
 // Posting
-'Post errors'		=>	'Post errors',
-'Post errors info'	=>	'The following errors need to be corrected before the message can be posted:',
-'Post preview'		=>	'Post preview',
-'Guest name'		=>	'Name', // For guests (instead of Username)
-'Post redirect'		=>	'Post entered. Redirecting âŠ',
-'Post a reply'		=>	'Post a reply',
-'Post new topic'	=>	'Post new topic',
-'Hide smilies'		=>	'Never show smilies as icons for this post',
-'Subscribe'			=>	'Subscribe to this topic',
-'Stay subscribed'	=>	'Stay subscribed to this topic',
-'Topic review'		=>	'Topic review (newest first)',
-'Flood start'		=>	'At least',
-'flood end'			=>	'seconds have to pass between posts. Please wait a little while and try posting again.',
-'Preview'			=>	'Preview', // submit button to preview message
+'Post errors'			=>	'Post errors',
+'Post errors info'		=>	'The following errors need to be corrected before the message can be posted:',
+'Post preview'			=>	'Post preview',
+'Guest name'			=>	'Name',	// For guests (instead of Username)
+'Post redirect'			=>	'Post entered. Redirection ...',
+'Post a reply'			=>	'Post a reply',
+'Post new topic'		=>	'Post new topic',
+'Hide smilies'			=>	'Never show smilies as icons for this post',
+'Subscribe'				=>	'Subscribe to this topic',
+'Topic review'			=>	'Topic review (newest first)',
+'Flood start'			=>	'At least',
+'flood end'				=>	'seconds have to pass between posts. Please wait a little while and try posting again.',
+'Preview'				=>	'Preview',	// submit button to preview message
 
 // Edit post
-'Edit post legend'	=>	'Edit the post and submit changes',
-'Silent edit'		=>	'Silent edit (don\'t display "Edited by ..." in topic view)',
-'Edit post'			=>	'Edit post',
-'Edit redirect'		=>	'Post updated. Redirecting âŠ'
+'Edit post legend'		=>	'Edit the post and submit changes',
+'Silent edit'			=>	'Silent edit (don\'t display "Edited by ..." in topic view)',
+'Edit post'				=>	'Edit post',
+'Edit redirect'			=>	'Post updated. Redirection ...'
 
 );
Index: /trunk/web/punbb/lang/English/prof_reg.php
===================================================================
--- /trunk/web/punbb/lang/English/prof_reg.php	(revision 10)
+++ /trunk/web/punbb/lang/English/prof_reg.php	(revision 1)
@@ -4,76 +4,36 @@
 $lang_prof_reg = array(
 
-'Email legend'				=>	'Enter a valid email address',
-'Email legend 2'			=>	'Enter and confirm a valid email address',
+'E-mail legend'				=>	'Enter a valid e-mail address',
+'E-mail legend 2'			=>	'Enter and confirm a valid e-mail address',
 'Localisation legend'		=>	'Set your localisation options',
-'Time zone'					=>	'Time zone',
-'Time zone info'			=>	'For the forum to display times correctly you must select your local time zone. If Daylight Savings Time is in effect you should also check the option provided which will advance times by 1 hour.',
-'DST'						=>	'Daylight Savings Time is in effect (advance time by 1 hour).',
-'Time format'				=>	'Time format',
-'Date format'				=>	'Date format',
-'Default'					=>	'Default',
+'Timezone'					=>	'Timezone',
+'Timezone info'				=>	'For the forum to display times correctly you must select your local timezone.',
 'Language'					=>	'Language',
-'Email setting info'		=>	'Select whether you want your email address to be viewable to other users or not and if you want other users to be able to send you email via the forum (form email) or not.',
-'Email setting 1'			=>	'Display your email address.',
-'Email setting 2'			=>	'Hide your email address but allow form email.',
-'Email setting 3'			=>	'Hide your email address and disallow form email.',
+'Language info'				=>	'You can choose which language you wish to use to view the forum.',
+'E-mail setting info'		=>	'Select whether you want your e-mail address to be viewable to other users or not and if you want other users to be able to send you e-mail via the forum (form e-mail) or not.',
+'E-mail setting 1'			=>	'Display your e-mail address.',
+'E-mail setting 2'			=>	'Hide your e-mail address but allow form e-mail.',
+'E-mail setting 3'			=>	'Hide your e-mail address and disallow form e-mail.',
 'Privacy options legend'	=>	'Set your privacy options',
+'Save user/pass'			=>	'Save username and password between visits.',
+'Save user/pass info'		=>	'This option sets whether the forum should "remember" you between visits. If enabled, you will not have to login every time you visit the forum. You will be logged in automatically. Recommended.',
 'Confirm pass'				=>	'Confirm password',
 
 'Username too short'		=>	'Usernames must be at least 2 characters long. Please choose another (longer) username.',
-'Username too long'			=>	'Usernames must not be more than 25 characters long. Please choose another (shorter) username.',
 'Username guest'			=>	'The username guest is reserved. Please choose another username.',
 'Username IP'				=>	'Usernames may not be in the form of an IP address. Please choose another username.',
 'Username reserved chars'	=>	'Usernames may not contain all the characters \', " and [ or ] at once. Please choose another username.',
 'Username BBCode'			=>	'Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please choose another username.',
-'Banned username'			=>	'The username you entered is banned in this forum. Please choose another username.',
+'Dupe username'				=>	'Someone else has already registered with that username. Please choose another username.',
 'Pass too short'			=>	'Passwords must be at least 4 characters long. Please choose another (longer) password.',
-'Pass not match'			=>	'Passwords do not match.',
-'Banned email'				=>	'The email address you entered is banned in this forum. Please choose another email address.',
-'Dupe email'				=>	'Someone else is already registered with that email address. Please choose another email address.',
-'Sig too long'				=>	'Signatures cannot be longer than %1$s characters. Please reduce your signature by %2$s characters.',
-'Sig too many lines'		=>	'Signatures cannot have more than %s lines.',
-'Bad ICQ'					=>	'You entered an invalid ICQ UIN. Please go back and correct.',
-
-'UTC-12:00'					=>	'(UTC-12:00) International Date Line West',
-'UTC-11:00'					=>	'(UTC-11:00) Niue, Samoa',
-'UTC-10:00'					=>	'(UTC-10:00) Hawaii-Aleutian, Cook Island',
-'UTC-09:30'					=>	'(UTC-09:30) Marquesas Islands',
-'UTC-09:00'					=>	'(UTC-09:00) Alaska, Gambier Island',
-'UTC-08:30'					=>	'(UTC-08:30) Pitcairn Islands',
-'UTC-08:00'					=>	'(UTC-08:00) Pacific',
-'UTC-07:00'					=>	'(UTC-07:00) Mountain',
-'UTC-06:00'					=>	'(UTC-06:00) Central',
-'UTC-05:00'					=>	'(UTC-05:00) Eastern',
-'UTC-04:00'					=>	'(UTC-04:00) Atlantic',
-'UTC-03:30'					=>	'(UTC-03:30) Newfoundland',
-'UTC-03:00'					=>	'(UTC-03:00) Amazon, Central Greenland',
-'UTC-02:00'					=>	'(UTC-02:00) Mid-Atlantic',
-'UTC-01:00'					=>	'(UTC-01:00) Azores, Cape Verde, Eastern Greenland',
-'UTC'						=>	'(UTC) Western European, Greenwich',
-'UTC+01:00'					=>	'(UTC+01:00) Central European, West African',
-'UTC+02:00'					=>	'(UTC+02:00) Eastern European, Central African',
-'UTC+03:00'					=>	'(UTC+03:00) Moscow, Eastern African',
-'UTC+03:30'					=>	'(UTC+03:30) Iran',
-'UTC+04:00'					=>	'(UTC+04:00) Gulf, Samara',
-'UTC+04:30'					=>	'(UTC+04:30) Afghanistan',
-'UTC+05:00'					=>	'(UTC+05:00) Pakistan, Yekaterinburg',
-'UTC+05:30'					=>	'(UTC+05:30) India, Sri Lanka',
-'UTC+05:45'					=>	'(UTC+05:45) Nepal',
-'UTC+06:00'					=>	'(UTC+06:00) Bangladesh, Bhutan, Novosibirsk',
-'UTC+06:30'					=>	'(UTC+06:30) Cocos Islands, Myanmar',
-'UTC+07:00'					=>	'(UTC+07:00) Indochina, Krasnoyarsk',
-'UTC+08:00'					=>	'(UTC+08:00) Greater China, Australian Western, Irkutsk',
-'UTC+08:45'					=>	'(UTC+08:45) Southeastern Western Australia',
-'UTC+09:00'					=>	'(UTC+09:00) Japan, Korea, Chita',
-'UTC+09:30'					=>	'(UTC+09:30) Australian Central',
-'UTC+10:00'					=>	'(UTC+10:00) Australian Eastern, Vladivostok',
-'UTC+10:30'					=>	'(UTC+10:30) Lord Howe',
-'UTC+11:00'					=>	'(UTC+11:00) Solomon Island, Magadan',
-'UTC+11:30'					=>	'(UTC+11:30) Norfolk Island',
-'UTC+12:00'					=>	'(UTC+12:00) New Zealand, Fiji, Kamchatka',
-'UTC+12:45'					=>	'(UTC+12:45) Chatham Islands',
-'UTC+13:00'					=>	'(UTC+13:00) Tonga, Phoenix Islands',
-'UTC+14:00'					=>	'(UTC+14:00) Line Islands'
+'Pass not match'			=>	'Passwords do not match. Please go back and correct.',
+'Banned e-mail'				=>	'The e-mail address you entered is banned in this forum. Please choose another e-mail address.',
+'Dupe e-mail'				=>	'Someone else is already registered with that e-mail address. Please choose another e-mail address.',
+'Sig too long'				=>	'Signatures cannot be longer than',
+'characters'				=>	'characters',
+'Sig too many lines'		=>	'Signatures cannot have more than',
+'lines'						=>	'lines',
+'Signature quote/code'		=>	'The quote and code BBCodes are not allowed in signatures. Please go back and correct.',
+'Bad ICQ'					=>	'You entered an invalid ICQ UIN. Please go back and correct.'
 
 );
Index: /trunk/web/punbb/lang/English/profile.php
===================================================================
--- /trunk/web/punbb/lang/English/profile.php	(revision 10)
+++ /trunk/web/punbb/lang/English/profile.php	(revision 1)
@@ -5,137 +5,140 @@
 
 // Navigation and sections
-'Profile menu'					=>	'Profile menu',
-'Section essentials'			=>	'Essentials',
-'Section personal'				=>	'Personal',
-'Section messaging'				=>	'Messaging',
-'Section personality'			=>	'Personality',
-'Section display'				=>	'Display',
-'Section privacy'				=>	'Privacy',
-'Section admin'					=>	'Administration',
+'Profile menu'				=>	'Profile menu',
+'Section essentials'		=>	'Essentials',
+'Section personal'			=>	'Personal',
+'Section messaging'			=>	'Messaging',
+'Section personality'		=>	'Personality',
+'Section display'			=>	'Display',
+'Section privacy'			=>	'Privacy',
+'Section admin'				=>	'Administration',
 
 // Miscellaneous
-'Username and pass legend'		=>	'Enter your username and password',
-'Personal details legend'		=>	'Enter your personal details',
-'Contact details legend'		=>	'Enter your messaging details',
-'User activity'					=>	'User activity',
-'Paginate info'					=>	'Enter the number of topics and posts you wish to view on each page.',
+'Username and pass legend'	=>	'Enter your username and password',
+'Personal details legend'	=>	'Enter your personal details',
+'Contact details legend'	=>	'Enter your messaging details',
+'Options display'			=>	'Set your display options',
+'Options post'				=>	'Set your post viewing options',
+'User activity'				=>	'User activity',
+'Paginate info'				=>	'Enter the number of topics and posts you wish to view on each page.',
 
 // Password stuff
-'Pass key bad'					=>	'The specified password activation key was incorrect or has expired. Please re-request a new password. If that fails, contact the forum administrator at',
-'Pass updated'					=>	'Your password has been updated. You can now login with your new password.',
-'Pass updated redirect'			=>	'Password updated. Redirecting âŠ',
-'Wrong pass'					=>	'Wrong old password.',
-'Change pass'					=>	'Change password',
-'Change pass legend'			=>	'Enter and confirm your new password',
-'Old pass'						=>	'Old password',
-'New pass'						=>	'New password',
-'Confirm new pass'				=>	'Confirm new password',
-'Pass info'						=>	'Passwords must be at least 4 characters long. Passwords are case sensitive.',
+'Pass key bad'				=>	'The specified password activation key was incorrect or has expired. Please re-request a new password. If that fails, contact the forum administrator at',
+'Pass updated'				=>	'Your password has been updated. You can now login with your new password.',
+'Pass updated redirect'		=>	'Password updated. Redirection ...',
+'Wrong pass'				=>	'Wrong old password.',
+'Change pass'				=>	'Change password',
+'Change pass legend'		=>	'Enter and confirm your new password',
+'Old pass'					=>	'Old password',
+'New pass'					=>	'New password',
+'Confirm new pass'			=>	'Confirm new password',
 
-// Email stuff
-'Email key bad'					=>	'The specified email activation key was incorrect or has expired. Please re-request change of email address. If that fails, contact the forum administrator at',
-'Email updated'					=>	'Your email address has been updated.',
-'Activate email sent'			=>	'An email has been sent to the specified address with instructions on how to activate the new email address. If it doesn\'t arrive you can contact the forum administrator at',
-'Email legend'					=>	'Enter your new email address',
-'Email instructions'			=>	'An email will be sent to your new address with an activation link. You must click the link in the email you receive to activate the new address.',
-'Change email'					=>	'Change email address',
-'New email'						=>	'New email',
+// E-mail stuff
+'E-mail key bad'			=>	'The specified e-mail activation key was incorrect or has expired. Please re-request change of e-mail address. If that fails, contact the forum administrator at',
+'E-mail updated'			=>	'Your e-mail address has been updated.',
+'Activate e-mail sent'		=>	'An email has been sent to the specified address with instructions on how to activate the new e-mail address. If it doesn\'t arrive you can contact the forum administrator at',
+'E-mail legend'				=>	'Enter your new e-mail address',
+'E-mail instructions'		=>	'An e-mail will be sent to your new address with an activation link. You must click the link in the e-mail you receive to activate the new address.',
+'Change e-mail'				=>	'Change e-mail address',
+'New e-mail'				=>	'New e-mail',
 
 // Avatar upload stuff
-'Avatars disabled'				=>	'The administrator has disabled avatar support.',
-'Too large ini'					=>	'The selected file was too large to upload. The server didn\'t allow the upload.',
-'Partial upload'				=>	'The selected file was only partially uploaded. Please try again.',
-'No tmp directory'				=>	'PHP was unable to save the uploaded file to a temporary location.',
-'No file'						=>	'You did not select a file for upload.',
-'Bad type'						=>	'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.',
-'Too wide or high'				=>	'The file you tried to upload is wider and/or higher than the maximum allowed',
-'Too large'						=>	'The file you tried to upload is larger than the maximum allowed',
-'pixels'						=>	'pixels',
-'bytes'							=>	'bytes',
-'Move failed'					=>	'The server was unable to save the uploaded file. Please contact the forum administrator at',
-'Unknown failure'				=>	'An unknown error occurred. Please try again.',
-'Avatar upload redirect'		=>	'Avatar uploaded. Redirecting âŠ',
-'Avatar deleted redirect'		=>	'Avatar deleted. Redirecting âŠ',
-'Avatar desc'					=>	'An avatar is a small image that will be displayed under your username in your posts. It must not be any bigger than',
-'Upload avatar'					=>	'Upload avatar',
-'Upload avatar legend'			=>	'Enter an avatar file to upload',
-'Delete avatar'					=>	'Delete avatar', // only for admins
-'File'							=>	'File',
-'Upload'						=>	'Upload', // submit button
+'Avatars disabled'			=>	'The administrator has disabled avatar support.',
+'Too large ini'				=>	'The selected file was too large to upload. The server didn\'t allow the upload.',
+'Partial upload'			=>	'The selected file was only partially uploaded. Please try again.',
+'No tmp directory'			=>	'PHP was unable to save the uploaded file to a temporary location.',
+'No file'					=>	'You did not select a file for upload.',
+'Bad type'					=>	'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.',
+'Too wide or high'			=>	'The file you tried to upload is wider and/or higher than the maximum allowed',
+'Too large'					=>	'The file you tried to upload is larger than the maximum allowed',
+'pixels'					=>	'pixels',
+'bytes'						=>	'bytes',
+'Move failed'				=>	'The server was unable to save the uploaded file. Please contact the forum administrator at',
+'Unknown failure'			=>	'An unknown error occurred. Please try again.',
+'Avatar upload redirect'	=>	'Avatar uploaded. Redirection ...',
+'Avatar deleted redirect'	=>	'Avatar deleted. Redirection ...',
+'Avatar desc'				=>	'An avatar is a small image that will be displayed under your username in your posts. It must not be any bigger than',
+'Upload avatar'				=>	'Upload avatar',
+'Upload avatar legend'		=>	'Enter an avatar file to upload',
+'Delete avatar'				=>	'Delete avatar',	// only for admins
+'File'						=>	'File',
+'Upload'					=>	'Upload',	// submit button
 
 // Form validation stuff
-'Forbidden title'				=>	'The title you entered contains a forbidden word. You must choose a different title.',
-'Profile redirect'				=>	'Profile updated. Redirecting âŠ',
+'Dupe username'				=>	'Someone else has already registered with that username. Please go back and try a different username.',
+'Forbidden title'			=>	'The title you entered contains a forbidden word. You must choose a different title.',
+'Profile redirect'			=>	'Profile updated. Redirection ...',
 
 // Profile display stuff
-'Users profile'					=>	'%s\'s profile',
-'Username info'					=>	'Username: %s',
-'Email info'					=>	'Email: %s',
-'Posts info'					=>	'Posts: %s',
-'Registered info'				=>	'Registered: %s',
-'Last post info'				=>	'Last post: %s',
-'Last visit info'				=>	'Last visit: %s',
-'Show posts'					=>	'Show all posts',
-'Show topics'					=>	'Show all topics',
-'Show subscriptions'			=>	'Show all subscriptions',
-'Realname'						=>	'Real name',
-'Location'						=>	'Location',
-'Website'						=>	'Website',
-'Invalid website URL'					=>	'The website URL you entered is invalid.',
-'Jabber'						=>	'Jabber',
-'ICQ'							=>	'ICQ',
-'MSN'							=>	'MSN Messenger',
-'AOL IM'						=>	'AOL IM',
-'Yahoo'							=>	'Yahoo! Messenger',
-'Avatar'						=>	'Avatar',
-'Signature'						=>	'Signature',
-'Sig max size'					=>	'Max length: %s characters / Max lines: %s',
-'Avatar legend'					=>	'Set your avatar display options',
-'Avatar info'					=>	'An avatar is a small image that will be displayed with all your posts. You can upload an avatar by clicking the link below.',
-'Change avatar'					=>	'Change avatar',
-'Signature legend'				=>	'Compose your signature',
-'Signature info'				=>	'A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like. Perhaps you would like to enter your favourite quote or your star sign. It\'s up to you! In your signature you can use BBCode if it is allowed in this particular forum. You can see the features that are allowed/enabled listed below whenever you edit your signature.',
-'Sig preview'					=>	'Current signature preview:',
-'No sig'						=>	'No signature currently stored in profile.',
-'Signature quote/code/list/h'	=>	'The quote, code, list, and heading BBCodes are not allowed in signatures.',
-'Topics per page'				=>	'Topics',
-'Posts per page'				=>	'Posts',
-'Leave blank'					=>	'Leave blank to use forum default.',
-'Subscription legend'			=>	'Set your subscription options',
-'Notify full'					=>	'Include a plain text version of new posts in subscription notification emails.',
-'Auto notify full'				=>	'Automatically subscribe to every topic you post in.',
-'Show smilies'					=>	'Show smilies as graphic icons.',
-'Show images'					=>	'Show images in posts.',
-'Show images sigs'				=>	'Show images in user signatures.',
-'Show avatars'					=>	'Show user avatars in posts.',
-'Show sigs'						=>	'Show user signatures.',
-'Style legend'					=>	'Select your preferred style',
-'Styles'						=>	'Styles',
-'Admin note'					=>	'Admin note',
-'Pagination legend'				=>	'Enter your pagination options',
-'Post display legend'			=>	'Set your options for viewing posts',
-'Post display info'				=>	'If you are on a slow connection, disabling these options, particularly showing images in posts and signatures, will make pages load faster.',
-'Instructions'					=>	'When you update your profile, you will be redirected back to this page.',
+'Not activated'				=>	'This user hasn\'t activated his/her account yet. The account is activated when he/she logs in the first time.',
+'Unknown'					=>	'(Unknown)',	// This is displayed when a user hasn't filled out profile field (e.g. Location)
+'Private'					=>	'(Private)',	// This is displayed when a user does not want to receive e-mails
+'No avatar'					=>	'(No avatar)',
+'Show posts'				=>	'Show all posts',
+'Realname'					=>	'Real name',
+'Location'					=>	'Location',
+'Website'					=>	'Website',
+'Jabber'					=>	'Jabber',
+'ICQ'						=>	'ICQ',
+'MSN'						=>	'MSN Messenger',
+'AOL IM'					=>	'AOL IM',
+'Yahoo'						=>	'Yahoo! Messenger',
+'Avatar'					=>	'Avatar',
+'Signature'					=>	'Signature',
+'Sig max length'			=>	'Max length',
+'Sig max lines'				=>	'Max lines',
+'Avatar legend'				=>	'Set your avatar display options',
+'Avatar info'				=>	'An avatar is a small image that will be displayed with all your posts. You can upload an avatar by clicking the link below. The checkbox \'Use avatar\' below must be checked in order for the avatar to be visible in your posts.',
+'Change avatar'				=>	'Change avatar',
+'Use avatar'				=>	'Use avatar.',
+'Signature legend'			=>	'Compose your signature',
+'Signature info'			=>	'A signature is a small piece of text that is attached to your posts. In it, you can enter just about anything you like. Perhaps you would like to enter your favourite quote or your star sign. It\'s up to you! In your signature you can use BBCode if it is allowed in this particular forum. You can see the features that are allowed/enabled listed below whenever you edit your signature.',
+'Sig preview'				=>	'Current signature preview:',
+'No sig'					=>	'No signature currently stored in profile.',
+'Topics per page'			=>	'Topics',
+'Topics per page info'		=>	'This setting controls how many topics are displayed per page when you view a forum. If you are uncertain about what to use, you can just leave it blank and the forum default will be used.',
+'Posts per page'			=>	'Posts',
+'Posts per page info'		=>	'This setting controls how many posts are displayed per page when you view a topic. If you are uncertain about what to use, you can just leave it blank and the forum default will be used.',
+'Leave blank'				=>	'Leave blank to use forum default.',
+'Notify full'				=>	'Include post in subscription e-mails.',
+'Notify full info'			=>	'With this enabled, a plain text version of the new post will be included in subscription notification e-mails.',
+'Show smilies'				=>	'Show smilies as graphic icons',
+'Show smilies info'			=>	'If you enable this option, small images will be displayed instead of text smilies.',
+'Show images'				=>	'Show images in posts.',
+'Show images info'			=>	'Disable this if you don\'t want to see images in posts (i.e. images displayed with the [img]-tag).',
+'Show images sigs'			=>	'Show images in user signatures.',
+'Show images sigs info'		=>	'Disable this if you don\'t want to see images in signatures (i.e. images displayed with the [img]-tag).',
+'Show avatars'				=>	'Show user avatars in posts.',
+'Show avatars info'			=>	'This option toggles whether user avatar images will be displayed in posts or not.',
+'Show sigs'					=>	'Show user signatures.',
+'Show sigs info'			=>	'Enable if you would like to see user signatures.',
+'Style legend'				=>	'Select your preferred style',
+'Style info'				=>	'If you like you can use a different visual style for this forum.',
+'Admin note'				=>	'Admin note',
+'Pagination legend'			=>	'Enter your pagination options',
+'Post display legend'		=>	'Set your options for viewing posts',
+'Post display info'			=>	'If you are on a slow connection, disabling these options, particularly showing images in posts and signatures, will make pages load faster.',
+'Instructions'				=>	'When you update your profile, you will be redirected back to this page.',
 
 // Administration stuff
-'Group membership legend'		=>	'Choose user group',
-'Save'							=>	'Save',
-'Set mods legend'				=>	'Set moderator access',
-'Moderator in info'				=>	'Choose which forums this user should be allowed to moderate. Note: This only applies to moderators. Administrators always have full permissions in all forums.',
-'Update forums'					=>	'Update forums',
-'Delete ban legend'				=>	'Delete (administrators only) or ban user',
-'Delete user'					=>	'Delete user',
-'Ban user'						=>	'Ban user',
-'Confirm delete legend'			=>	'Important: read before deleting user',
-'Confirm delete user'			=>	'Confirm delete user',
-'Confirmation info'				=>	'Please confirm that you want to delete the user', // the username will be appended to this string
-'Delete warning'				=>	'Warning! Deleted users and/or posts cannot be restored. If you choose not to delete the posts made by this user, the posts can only be deleted manually at a later time.',
-'Delete posts'					=>	'Delete any posts and topics this user has made.',
-'Delete'						=>	'Delete', // submit button (confirm user delete)
-'User delete redirect'			=>	'User deleted. Redirecting âŠ',
-'Group membership redirect'		=>	'Group membership saved. Redirecting âŠ',
-'Update forums redirect'		=>	'Forum moderator rights updated. Redirecting âŠ',
-'Ban redirect'					=>	'Redirecting âŠ',
-'No delete admin message'		=>	'Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group.',
+'Group membership legend'	=>	'Choose user group',
+'Save'						=>	'Save',
+'Set mods legend'			=>	'Set moderator access',
+'Moderator in'				=>	'Moderator in',
+'Moderator in info'			=>	'Choose what forums this user should be allowed to moderate. Note: This only applies to moderators. Administrators always have full permissions in all forums.',
+'Update forums'				=>	'Update forums',
+'Delete ban legend'			=>	'Delete (administrators only) or ban user',
+'Delete user'				=>	'Delete user',
+'Ban user'					=>	'Ban user',
+'Confirm delete legend'		=>	'Important: read before deleting user',
+'Confirm delete user'		=>	'Confirm delete user',
+'Confirmation info'			=>	'Please confirm that you want to delete the user',	// the username will be appended to this string
+'Delete warning'			=>	'Warning! Deleted users and/or posts cannot be restored. If you choose not to delete the posts made by this user, the posts can only be deleted manually at a later time.',
+'Delete posts'				=>	'Delete any posts and topics this user has made.',
+'Delete'					=>	'Delete',		// submit button (confirm user delete)
+'User delete redirect'		=>	'User deleted. Redirection ...',
+'Group membership redirect'	=>	'Group membership saved. Redirection ...',
+'Update forums redirect'	=>	'Forum moderator rights updated. Redirection ...',
+'Ban redirect'				=>	'Redirection ...'
 
 );
Index: /trunk/web/punbb/lang/English/register.php
===================================================================
--- /trunk/web/punbb/lang/English/register.php	(revision 10)
+++ /trunk/web/punbb/lang/English/register.php	(revision 1)
@@ -6,8 +6,7 @@
 // Miscellaneous
 'No new regs'				=>	'This forum is not accepting new registrations.',
-'Reg cancel redirect'		=>	'Registration cancelled. Redirecting âŠ',
+'Reg cancel redirect'		=>	'Registration cancelled. Redirection ...',
 'Forum rules'				=>	'Forum rules',
 'Rules legend'				=>	'You must agree to the following in order to register',
-'Registration flood'		=>	'A new user was registered with the same IP address as you within the last hour. To prevent registration flooding, at least an hour has to pass between registrations from the same IP. Sorry for the inconvenience.',
 'Agree'						=>	'Agree',
 'Cancel'					=>	'Cancel',
@@ -15,14 +14,12 @@
 
 // Form validation stuff (some of these are also used in post.php)
-'Registration errors'		=>	'Registration errors',
-'Registration errors info'	=>	'The following errors need to be corrected before you can register:',
 'Username censor'			=>	'The username you entered contains one or more censored words. Please choose a different username.',
 'Username dupe 1'			=>	'Someone is already registered with the username',
 'Username dupe 2'			=>	'The username you entered is too similar. The username must differ from that by at least one alphanumerical character (a-z or 0-9). Please choose a different username.',
-'Email not match'			=>	'Email addresses do not match.',
+'E-mail not match'			=>	'E-mail addresses do not match. Please go back and correct.',
 
-// Registration email stuff
-'Reg email'					=>	'Thank you for registering. Your password has been sent to the specified address. If it doesn\'t arrive you can contact the forum administrator at',
-'Reg complete'				=>	'Registration complete. Logging in and redirecting âŠ',
+// Registration e-mail stuff
+'Reg e-mail'				=>	'Thank you for registering. Your password has been sent to the specified address. If it doesn\'t arrive you can contact the forum administrator at',
+'Reg complete'				=>	'Registration complete. Logging in and Redirection ...',
 
 // Register info
@@ -30,8 +27,9 @@
 'Desc 2'					=>	'Below is a form you must fill out in order to register. Once you are registered you should visit your profile and review the different settings you can change. The fields below only make up a small part of all the settings you can alter in your profile.',
 'Username legend'			=>	'Please enter a username between 2 and 25 characters long',
-'Pass legend'				=>	'Please enter and confirm your chosen password',
-'Pass info'					=>	'Passwords must be at least 4 characters long. Passwords are case sensitive.',
-'Email info'				=>	'You must enter a valid email address as your randomly generated password will be sent to that address.',
-'Confirm email'				=>	'Confirm email address',
+'Pass legend 1'				=>	'Please enter and confirm your chosen password',
+'Pass legend 2'				=>	'Please read the instructions below',
+'Pass info'					=>	'Passwords can be between 4 and 16 characters long. Passwords are case sensitive.',
+'E-mail info'				=>	'You must enter a valid e-mail address as your randomly generated password will be sent to that address.',
+'Confirm e-mail'			=>	'Confirm e-mail address',
 
 );
Index: /trunk/web/punbb/lang/English/search.php
===================================================================
--- /trunk/web/punbb/lang/English/search.php	(revision 10)
+++ /trunk/web/punbb/lang/English/search.php	(revision 1)
@@ -5,61 +5,43 @@
 
 // The search form
-'User search'						=>	'User search',
-'No search permission'				=>	'You do not have permission to use the search feature.',
-'Search flood'						=>	'At least %s seconds have to pass between searches. Please wait a while and try searching again.',
-'Search'							=>	'Search',
-'Search criteria legend'			=>	'Enter your search criteria',
-'Search info'						=>	'To search by keyword, enter a term or terms to search for. Separate terms with spaces. Use AND, OR and NOT to refine your search. To search by author enter the username of the author whose posts you wish to search for. Use wildcard character * for partial matches.',
-'Keyword search'					=>	'Keyword search',
-'Author search'						=>	'Author search',
-'Search in legend'					=>	'Select where to search',
-'Search in info'					=>	'Choose in which forum you would like to search and if you want to search in topic subjects, message text or both.',
-'Search multiple forums info'		=>	'If no forums are selected, all forums will be searched.',
-'Forum search'						=>	'Forum',
-'All forums'						=>	'All forums',
-'Search in'							=>	'Search in',
-'Message and subject'				=>	'Message text and topic subject',
-'Message only'						=>	'Message text only',
-'Topic only'						=>	'Topic subject only',
-'Sort by'							=>	'Sort by',
-'Sort order'						=>	'Sort order',
-'Search results legend'				=>	'Select how to view search results',
-'Search results info'				=>	'You can choose how you wish to sort and show your results.',
-'Sort by post time'					=>	'Post time',
-'Sort by author'					=>	'Author',
-'Sort by subject'					=>	'Subject',
-'Sort by forum'						=>	'Forum',
-'Ascending'							=>	'Ascending',
-'Descending'						=>	'Descending',
-'Show as'							=>	'Show results as',
-'Show as topics'					=>	'Topics',
-'Show as posts'						=>	'Posts',
+'User search'				=>	'User search',
+'No search permission'		=>	'You do not have permission to use the search feature.',
+'Search'					=>	'Search',
+'Search criteria legend'	=>	'Enter your search criteria',
+'Search info'				=>	'To search by keyword, enter a term or terms to search for. Separate terms with spaces. Use AND, OR and NOT to refine your search. To search by author enter the username of the author whose posts you wish to search for. Use wildcard character * for partial matches.',
+'Keyword search'			=>	'Keyword search',
+'Author search'				=>	'Author search',
+'Search in legend'			=>	'Select where to search',
+'Search in info'			=>	'Choose in which forum you would like to search and if you want to search in topic subjects, message text or both.',
+'Forum search'				=>	'Forum',
+'All forums'				=>	'All forums',
+'Search in'					=>	'Search in',
+'Message and subject'		=>	'Message text and topic subject',
+'Message only'				=>	'Message text only',
+'Topic only'				=>	'Topic subject only',
+'Sort by'					=>	'Sort by',
+'Sort order'				=>	'Sort order',
+'Search results legend'		=>	'Select how to view search results',
+'Search results info'		=>	'You can choose how you wish to sort and show your results.',
+'Sort by post time'			=>	'Post time',
+'Sort by author'			=>	'Author',
+'Sort by subject'			=>	'Subject',
+'Sort by forum'				=>	'Forum',
+'Ascending'					=>	'Ascending',
+'Descending'				=>	'Descending',
+'Show as'					=>	'Show results as',
+'Show as topics'			=>	'Topics',
+'Show as posts'				=>	'Posts',
 
 // Results
-'Search'							=>	'Search',
-'Search results'					=>	'Search results',
-'Quick search show_new'				=>	'New',
-'Quick search show_recent'			=>	'Active',
-'Quick search show_unanswered'		=>	'Unanswered',
-'Quick search show_replies'			=>	'Posted',
-'Quick search show_user_topics'		=>	'Topics by %s',
-'Quick search show_user_posts'		=>	'Posts by %s',
-'Quick search show_subscriptions'	=>	'Subscribed by %s',
-'By keywords show as topics'		=>	'Topics with posts containing \'%s\'',
-'By keywords show as posts'			=>	'Posts containing \'%s\'',
-'By user show as topics'			=>	'Topics with posts by %s',
-'By user show as posts'				=>	'Posts by %s',
-'By both show as topics'			=>	'Topics with posts containing \'%s\', by %s',
-'By both show as posts'				=>	'Posts containing \'%s\', by %s',
-'No terms'							=>	'You have to enter at least one keyword and/or an author to search for.',
-'No hits'							=>	'Your search returned no hits.',
-'No user posts'						=>	'There are no posts by this user in this forum.',
-'No user topics'					=>	'There are no topics by this user in this forum.',
-'No subscriptions'					=>	'This user is currently not subscribed to any topics.',
-'No new posts'						=>	'There are no topics with new posts since your last visit.',
-'No recent posts'					=>	'No new posts have been made within the last 24 hours.',
-'No unanswered'						=>	'There are no unanswered posts in this forum.',
-'Go to post'						=>	'Go to post',
-'Go to topic'						=>	'Go to topic'
+'Search results'			=>	'Search results',
+'No terms'					=>	'You have to enter at least one keyword and/or an author to search for.',
+'No hits'					=>	'Your search returned no hits.',
+'No user posts'				=>	'There are no posts by this user in this forum.',
+'No subscriptions'			=>	'You are currently not subscribed to any topics.',
+'No new posts'				=>	'There are no topics with new posts since your last visit.',
+'No recent posts'			=>	'No new posts have been made within the last 24 hours.',
+'No unanswered'				=>	'There are no unanswered posts in this forum.',
+'Go to post'				=>	'Go to post'
 
 );
Index: /trunk/web/punbb/lang/English/stopwords.txt
===================================================================
--- /trunk/web/punbb/lang/English/stopwords.txt	(revision 10)
+++ /trunk/web/punbb/lang/English/stopwords.txt	(revision 1)
@@ -11,5 +11,4 @@
 are
 arent
-aren't
 around
 ask
@@ -22,17 +21,12 @@
 can
 cant
-can't
 come
 could
 couldnt
-couldn't
 did
 didnt
-didn't
 does
 doesnt
-doesn't
 dont
-don't
 each
 either
@@ -53,5 +47,4 @@
 have
 havent
-haven't
 having
 her
@@ -62,15 +55,8 @@
 how
 ill
-i'll
-i'm
 into
 isnt
-isn't
-itll
-it'll
 its
-it's
 ive
-i've
 just
 know
@@ -97,5 +83,4 @@
 our
 ours
-our's
 out
 over
@@ -118,5 +103,4 @@
 that
 thats
-that's
 the
 their
@@ -164,12 +148,3 @@
 you
 your
-youre
-you're
 yours
-http
-https
-ftp
-www
-com
-net
-org
Index: /trunk/web/punbb/lang/English/topic.php
===================================================================
--- /trunk/web/punbb/lang/English/topic.php	(revision 10)
+++ /trunk/web/punbb/lang/English/topic.php	(revision 1)
@@ -6,10 +6,6 @@
 'Post reply'		=>	'Post reply',
 'Topic closed'		=>	'Topic closed',
-'From'				=>	'From:', // User location
-'IP address logged'	=>	'IP address logged',
-'Note'				=>	'Note:', // Admin note
-'Posts'				=>	'Posts:',
-'Registered'		=>	'Registered:',
-'Replies'			=>	'Replies:',
+'From'				=>	'From',				// User location
+'Note'				=>	'Note',				// Admin note
 'Website'			=>	'Website',
 'Guest'				=>	'Guest',
@@ -25,8 +21,7 @@
 'Subscribe'			=>	'Subscribe to this topic',
 'Quick post'		=>	'Quick post',
-'Mod controls'		=>	'Moderator controls',
-'New icon'			=>	'New post',
-'Re'				=>	'Re:',
-'Preview'			=>	'Preview'
+
+'Link separator'	=>	' | ',	// The text that separates links in posts (website, e-mail, report, edit etc.)
+'Mod controls'		=>	'Moderator controls'
 
 );
Index: unk/web/punbb/lang/English/update.php
===================================================================
--- /trunk/web/punbb/lang/English/update.php	(revision 10)
+++ 	(revision )
@@ -1,76 +1,0 @@
-<?php
-
-// Language definitions used in db_update.php
-
-$lang_update = array(
-
-'Update'						=>	'Update FluxBB',
-'Update message'				=>	'Your FluxBB database is out-of-date and must be upgraded in order to continue. If you are the board administrator, please follow the instructions below to complete the upgrade.',
-'Note'							=>	'Note:',
-'Members message'				=>	'This process is for board administators only. If you are a member there is nothing to worry about - the forums will be back shortly!',
-'Administrator only'			=>	'This step is for the board administrator only!',
-'Database password info'		=>	'To perform the database update please enter the database password with which FluxBB was installed. If you cannot remember, this is stored in your \'config.php\' file.',
-'Database password note'		=>	'If you are running SQLite (and hence have no database password) please use the database file name instead. This must exactly match the database file name given in your configuration file.',
-'Database password'				=>	'Database password',
-'Maintenance'					=>	'Maintenance',
-'Maintenance message info'		=>	'The message that will be displayed to users during the updating process. This text will not be parsed like regular posts and thus may contain HTML.',
-'Maintenance message'		    =>	'Maintenance message',
-'Next'							=>	'Next',
-
-'You are running error'			=>	'You are running %1$s version %2$s. FluxBB %3$s requires at least %1$s %4$s to run properly. You must upgrade your %1$s installation before you can continue.',
-'Version mismatch error'		=>	'Version mismatch. The database \'%s\' doesn\'t seem to be running a FluxBB database schema supported by this update script.',
-'Invalid file error'			=>	'Invalid database file name. When using SQLite the database file name must be entered exactly as it appears in your \'%s\'',
-'Invalid password error'		=>	'Invalid database password. To upgrade FluxBB you must enter your database password exactly as it appears in your \'%s\'',
-'No password error'				=>	'No database password provided',
-'Script runs error'				=>	'It appears the update script is already being ran by someone else. If this is not the case, please manually delete the file \'%s\' and try again',
-'No update error'				=>	'Your forum is already as up-to-date as this script can make it',
-
-'Intro 1'						=>	'This script will update your forum database. The update procedure might take anything from a second to hours depending on the speed of the server and the size of the forum database. Don\'t forget to make a backup of the database before continuing.',
-'Intro 2'						=>	'Did you read the update instructions in the documentation? If not, start there.',
-'No charset conversion'			=>	'<strong>IMPORTANT!</strong> FluxBB has detected that this PHP environment does not have support for the encoding mechanisms required to do UTF-8 conversion from character sets other than ISO-8859-1. What this means is that if the current character set is not ISO-8859-1, FluxBB won\'t be able to convert your forum database to UTF-8 and you will have to do it manually. Instructions for doing manual charset conversion can be found in the update instructions.',
-'Enable conversion'				=>	'<strong>Enable conversion:</strong> When enabled this update script will, after it has made the required structural changes to the database, convert all text in the database from the current character set to UTF-8. This conversion is required if you\'re upgrading from version 1.2.',
-'Current character set'			=>	'<strong>Current character set:</strong> If the primary language in your forum is English, you can leave this at the default value. However, if your forum is non-English, you should enter the character set of the primary language pack used in the forum. <em>Getting this wrong can corrupt your database so don\'t just guess!</em> Note: This is required even if the old database is UTF-8.',
-'Charset conversion'			=>	'Charset conversion',
-'Enable conversion label'		=>	'<strong>Enable conversion</strong> (perform database charset conversion).',
-'Current character set label'	=>	'Current character set',
-'Current character set info'	=>	'Accept default for English forums otherwise the character set of the primary language pack.',
-'Start update'					=>	'Start update',
-'Error converting users'		=>	'Error converting users',
-'Error info 1'					=>	'There was an error converting some users. This can occur when converting from FluxBB v1.2 if multiple users have registered with very similar usernames, for example "bob" and "bÃ¶b".',
-'Error info 2'					=>	'Below is a list of users who failed to convert. Please choose a new username for each user. Users who are renamed will automatically be sent an email alerting them of the change.',
-'New username'					=>	'New username',
-'Required'						=>	'(Required)',
-'Correct errors'				=>	'The following errors need to be corrected:',
-'Rename users'					=>	'Rename users',
-'Successfully updated'			=>	'Your forum database was successfully updated. You may now %s.',
-'go to index'					=>	'go to the forum index',
-
-'Unable to lock error'			=>	'Unable to write update lock. Please make sure PHP has write access to the directory \'%s\' and no-one else is currently running the update script.',
-
-'Converting'					=>	'Converting %s âŠ',
-'Converting item'				=>	'Converting %1$s %2$s âŠ',
-'Preparsing item'				=>	'Preparsing %1$s %2$s âŠ',
-'Rebuilding index item'			=>	'Rebuilding index for %1$s %2$s',
-
-'ban'							=>	'ban',
-'categories'					=>	'categories',
-'censor words'					=>	'censor words',
-'configuration'					=>	'configuration',
-'forums'						=>	'forums',
-'groups'						=>	'groups',
-'post'							=>	'post',
-'ranks'							=>	'ranks',
-'report'						=>	'report',
-'topic'							=>	'topic',
-'user'							=>	'user',
-'signature'						=>	'signature',
-
-'Username too short error'		=>	'Usernames must be at least 2 characters long. Please choose another (longer) username.',
-'Username too long error'		=>	'Usernames must not be more than 25 characters long. Please choose another (shorter) username.',
-'Username Guest reserved error'	=>	'The username guest is reserved. Please choose another username.',
-'Username IP format error'		=>	'Usernames may not be in the form of an IP address. Please choose another username.',
-'Username bad characters error'	=>	'Usernames may not contain all the characters \', " and [ or ] at once. Please choose another username.',
-'Username BBCode error'			=>	'Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please choose another username.',
-'Username duplicate error'		=>	'Someone is already registered with the username %s. The username you entered is too similar. The username must differ from that by at least one alphanumerical character (a-z or 0-9). Please choose a different username.',
-
-);
Index: /trunk/web/punbb/lang/English/userlist.php
===================================================================
--- /trunk/web/punbb/lang/English/userlist.php	(revision 10)
+++ /trunk/web/punbb/lang/English/userlist.php	(revision 1)
@@ -4,10 +4,9 @@
 $lang_ul = array(
 
-'User find legend'	=>	'Find and sort users',
-'User search info'	=>	'Enter a username to search for and/or a user group to filter by. The username field can be left blank. Use the wildcard character * for partial matches.',
-'User sort info'	=>	'Sort users by name, date registered or number of posts and in ascending/descending order.',
-'User group'		=>	'User group',
-'No of posts'		=>	'Number of posts',
-'All users'			=>	'All'
+'User find legend'		=>	'Find and sort users',
+'User search info'		=>	'Enter a username to search for and/or a user group to filter by. The username field can be left blank. Use the wildcard character * for partial matches. Sort users by name, date registered or number of posts and in ascending/descending order.',
+'User group'			=>	'User group',
+'No of posts'			=>	'No. of posts',
+'All users'				=>	'All'
 
 );
Index: unk/web/punbb/lang/French/admin_bans.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_bans.php	(revision 10)
+++ 	(revision )
@@ -1,67 +1,0 @@
-<?php
-
-// Language definitions used in admin_bans.php
-$lang_admin_bans = array(
-
-'No user message'			=>	'Aucun utilisateur enregistrÃ© sous ce nom d\'utilisateur. Si vous souhaitez ajouter un bannissement n\'Ã©tant pas associÃ© Ã  un nom d\'utilisateur veuillez laisser le champ du nom d\'utilisateur vide.',
-'No user ID message'			=>	'Aucun utilisateur inscrit avec cet ID.',
-'User is admin message'			=>	'L\'utilisateur %s est un administrateur et ne peut Ãªtre banni. Si vous souhaitez bannir un administrateur, vous devez d\'abord le destituer de ce rang.',
-'User is mod message'                   =>      'L\'utilisateur %s est un modÃ©rateur et ne peut Ãªtre banni. Si vous souhaitez bannir un modÃ©rateur, vous devez d\'abord le destituer de ce rang.',
-'Must enter message'			=>	'Vous devez indiquer, au minimum, soit un nom d\'utilisateur, soit une adresse IP, soit une adresse Ã©lectronique.',
-'Cannot ban guest message'		=>	'Un visiteur ne peut Ãªtre banni.',
-'Invalid IP message'			=>	'Vous avez indiquÃ© une IP/plage d\'IP invalide.',
-'Invalid e-mail message'		=>	'L\'adresse Ã©lectronique (ex. : utilisateur@domaine.com) ou le nom de domaine d\'adresse Ã©lectronique (ex. : domaine.com) que vous avez indiquÃ© est invalide.',
-'Invalid date message'			=>	'Vous avez indiquÃ© une date d\'expiration invalide.',
-'Invalid date reasons'			=>	'Le format devrait Ãªtre du type YYYY-MM-DD et la date doit Ãªtre ultÃ©rieure Ã  la date d\'aujourd\'hui.',
-'Ban added redirect'			=>	'Bannissement ajoutÃ©. Redirection&#160;âŠ' ,
-'Ban edited redirect'			=>	'Bannissement modifiÃ©. Redirection&#160;âŠ',
-'Ban removed redirect'			=>	'Bannissement supprimÃ©. Redirection&#160;âŠ',
-
-'New ban head'				=>	'Nouveau bannissement',
-'Add ban subhead'			=>	'Ajouter le bannissement',
-'Username label'			=>	'Nom d\'utilisateur',
-'Username help'				=>	'Le nom d\'utilisateur Ã  bannir (insensible Ã  la casse).',
-'Username advanced help'		=>	'Le nom d\'utilisateur Ã  bannir (insensible Ã  la casse). La page suivante vous permettra d\'indiquer une IP et un e-mail personnalisÃ©s. Si vous ne souhaitez bannir qu\'une IP/plage d\'IP ou un e-mail, veuillez laisser ce champ vide.',
-
-'Ban search head'			=>	'Recherche de bannissements',
-'Ban search subhead'			=>	'Indiquer les critÃšres de recherche',
-'Ban search info'			=>	'Recherche de bannissements dans la base de donnÃ©es. Vous pouvez indiquer un ou plusieurs termes Ã  retrouver. Les jokers sous formes d\'astÃ©risques (*) sont acceptÃ©s. Pour afficher tous les bannissements, laisser tous les champs vides.',
-'Date help'				=>	'(yyyy-mm-dd)',
-'Message label'				=>	'Message',
-'Expire after label'			=>	'Expire aprÃšs',
-'Expire before label'			=>	'Expire avant',
-'Order by label'			=>	'Trier par',
-'Order by username'			=>	'Nom d\'utilisateur',
-'Order by ip'			        =>	'IP',
-'Order by e-mail'			=>	'E-mail',
-'Order by expire'			=>	'Date d\'expiration',
-'Ascending'				=>	'Ascendant',
-'Descending'				=>	'Descendant',
-'Submit search'				=>	'Lancer la recherche',
-
-'E-mail label'				=>	'E-mail',
-'E-mail help'				=>	'L\'e-mail ou le domaine d\'e-mail que vous souhaitez bannir (ex. : utilisateur@domaine.com ou domaine.com). Rendez-vous Ã  Â«&#160;Autoriser les adresses Ã©lectroniques bannies&#160;Â» dans la rubrique Permissions pour davantage d\'informations.',
-'IP label'				=>	'Adresse IP/plages d\'adresses IP',
-'IP help'				=>	'L\'adresse IP ou la plage d\'adresses IP que vous souhaitez bannir (ex. : 150.11.110.1 ou 150.11.110). SÃ©parez les adresses par des espaces. Si une IP est dÃ©jÃ  indiquÃ©e, il s\'agit de la derniÃšre adresse IP connue de cet utilisateur enregistrÃ©e dans la base de donnÃ©es.',
-'IP help link'				=>	'Cliquez sur %s pour afficher les statistiques IP de cet utilisateur.',
-'Ban advanced head'			=>	'ParamÃštres de bannissement avancÃ©s',
-'Ban advanced subhead'			=>	'Ajouter IP et e-mail pour complÃ©ter le bannissement',
-'Ban message label'			=>	'Message de bannissement',
-'Ban message help'			=>	'Un message qui s\'affichera lors de la prochaine visite de l\'utilisateur banni.',
-'Message expiry subhead'		=>	'Message de bannissement et expiration',
-'Ban IP range info'			=>	'Vous devrez Ãªtre trÃšs prudent lors du bannissement d\'une plage d\'IP puisqu\'il est possible que plusieurs utilisateurs utilisent la mÃªme partie d\'adresse IP.',
-'Expire date label'			=>	'Date d\'expiration',
-'Expire date help'			=>	'La date Ã  laquelle ce bannissement devrait prendre automatiquement fin (format : YYYY-MM-DD). Laissez vide pour une suppression manuelle.',
-
-'Results head'				=>	'RÃ©sultats de la recherche',
-'Results username head'			=>	'Nom d\'utilisateur',
-'Results e-mail head'			=>	'E-mail',
-'Results IP address head'		=>	'IP/plage d\'IP',
-'Results expire head'	      		=>	'Expire',
-'Results message head'	        	=>	'Message',
-'Results banned by head'       		=>	'Banni par',
-'Results actions head'			=>	'Actions',
-'No match'				=>	'Pas de correspondance',
-'Unknown'				=>	'Inconnu',
-
-);
Index: unk/web/punbb/lang/French/admin_categories.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_categories.php	(revision 10)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-// Language definitions used in admin_categories.php
-$lang_admin_categories = array(
-
-'Must enter name message'		=>	'Vous devez indiquer un nom pour la catÃ©gorie',
-'Category added redirect'		=>	'CatÃ©gorie ajoutÃ©e. Redirection&#160;âŠ',
-'Category deleted redirect'		=>	'CatÃ©gorie supprimÃ©e. Redirection&#160;âŠ',
-'Delete category head'			=>	'Supprimer la catÃ©gorie (ainsi que les forums et les sujets qu\'elle contient)',
-'Confirm delete subhead'		=>	'Confirmer la suppression de la catÃ©gorie',
-'Confirm delete info'			=>	'Souhaitez-vous vraiment supprimer la catÃ©gorie Â«&#160;%s&#160;Â» ?',
-'Delete category warn'			=>	'<strong>ATTENTION&#160;!</strong> Supprimer une catÃ©gorie entraÃ®ne la suppression des forums et sujets Ã©ventuels qu\'elle contient !',
-'Must enter integer message'		=>	'La position doit Ãªtre indiquÃ©e sous la forme d\'un nombre entier positif',
-'Categories updated redirect'		=>	'CatÃ©gories mises Ã  jour. Redirection&#160;âŠ',
-'Add categories head'			=>	'Ajouter des catÃ©gories',
-'Add categories subhead'		=>	'Ajouter les catÃ©gories',
-'Add category label'			=>	'Ajouter une nouvelle catÃ©gorie',
-'Add new submit'			=>	'Ajouter',
-'Add category help'			=>	'Le nom de la nouvelle catÃ©gorie que vous souhaitez ajouter. Vous pouvez modifier ce nom plus tard (voir ci-dessous). Allez Ã  la rubrique %s pour ajouter des forums dans votre nouvelle catÃ©gorie.',
-'Delete categories head'		=>	'Supprimer des catÃ©gories',
-'Delete categories subhead'		=>	'Supprimer les catÃ©gories',
-'Delete category label'			=>	'Supprimer une catÃ©gorie',
-'Delete category help'			=>	'SÃ©lectionnez le nom de la catÃ©gorie que vous souhaitez supprimer. Une confirmation vous sera demandÃ©e avant que cette catÃ©gorie ne soit supprimÃ©e.',
-'Edit categories head'			=>	'Modifier des catÃ©gories',
-'Edit categories subhead'		=>	'Modifier les catÃ©gories',
-'Category position label'		=>	'Position',
-'Category name label'			=>	'Nom',
-
-);
Index: unk/web/punbb/lang/French/admin_censoring.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_censoring.php	(revision 10)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-// Language definitions used in admin_censoring.php
-$lang_admin_censoring = array(
-
-'Must enter word message'		=>	'Vous devez indiquer un mot Ã  censurer.',
-'Word updated redirect'			=>	'Mot censurÃ© mis Ã  jour. Redirection&#160;âŠ',
-'Word added redirect'			=>	'Mot censurÃ© ajoutÃ©. Redirection&#160;âŠ',
-'Word removed redirect'			=>	'Mot censurÃ© supprimÃ©. Redirection&#160;âŠ',
-'Censoring head'			=>	'Censure',
-'Add word subhead'			=>	'Ajouter le mot',
-'Add word info'				=>	'Indiquer un mot que vous souhaitez censurer et le texte de remplacement pour ce mot. Les jokers sont acceptÃ©s (ex. : *certain* correspond Ã  Â«&#160;incertain&#160;Â» et Ã  Â«&#160;certainement&#160;Â»). Les noms d\'utilisateurs sont Ã©galement concernÃ©s par la censure. Les nouveaux utilisateurs ne pourront pas s\'inscrire en utilisant des noms d\'utilisateurs contenant un mot censurÃ©. La recherche est insensible Ã  la casse.',
-'Censoring enabled'			=>	'<strong>La censure est activÃ©e dans %s.</strong>',
-'Censoring disabled'			=>	'<strong>La censure est dÃ©sactivÃ©e dans %s.</strong>',
-'Censored word label'			=>	'Mot censurÃ©',
-'Replacement label'			=>	'Mot(s) de remplacement',
-'Action label'				=>	'Action',
-'Edit remove subhead'			=>	'Modifier ou supprimer des mots',
-'No words in list'			=>	'Aucun mot censurÃ© pour le moment.',
-
-);
Index: unk/web/punbb/lang/French/admin_common.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_common.php	(revision 10)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?php
-
-// Language definitions used in admin_common
-$lang_admin_common = array(
-
-// The menu
-'Admin menu'					=>	'Menu d\'administration',
-'Plugins menu'					=>	'Menu des plugins',
-'Moderator menu'				=>	'Menu de modÃ©ration',
-'Index'						=>	'Accueil',
-'Categories'					=>	'CatÃ©gories',
-'Forums'					=>	'Forums',
-'Users'						=>	'Utilisateurs',
-'User groups'					=>	'Groupes d\'utilisateurs',
-'Options'					=>	'Options',
-'Permissions'					=>	'Permissions',
-'Censoring'					=>	'Censure',
-'Ranks'						=>	'Rangs',
-'Bans'						=>	'Bannissements',
-'Prune'						=>	'Ãlagage',
-'Maintenance'					=>	'Maintenance',
-'Reports'					=>	'Signalements',
-
-'Admin'						=>	'Admin',
-'Go back'					=>	'Retour',
-'Delete'					=>	'Supprimer',
-'Update'					=>	'Mettre Ã  jour',
-'Add'						=>	'Ajouter',
-'Edit'						=>	'Modifier',
-'Remove'					=>	'Supprimer',
-'Yes'						=>	'Oui',
-'No'						=>	'Non',
-'Save changes'					=>	'Enregistrer les modifications',
-'Save'						=>	'Enregistrer',
-'here'						=>	'ici',
-'Action'					=>	'Action',
-'None'						=>	'Aucune',
-'Maintenance mode'				=>	'Mode maintenance', // Used for link text in more than one file
-
-// Admin loader
-'No plugin message'				=>	'Il n\'y a aucun plugin nommÃ© %s dans le rÃ©pertoire plugin.',
-'Plugin failed message'				=>	'Ãchec du chargement du plugin <strong>%s</strong>',
-
-);
Index: unk/web/punbb/lang/French/admin_forums.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_forums.php	(revision 10)
+++ 	(revision )
@@ -1,53 +1,0 @@
-<?php
-
-// Language definitions used in admin_forums.php
-$lang_admin_forums = array(
-
-'Forum added redirect'		=>	'Forum ajoutÃ©. Redirection&#160;âŠ',
-'Forum deleted redirect'	=>	'Forum supprimÃ©. Redirection&#160;âŠ',
-'Forums updated redirect'	=>	'Forums mis Ã  jour. Redirection&#160;âŠ',
-'Forum updated redirect'	=>	'Forum mis Ã  jour. Redirection&#160;âŠ',
-'Perms reverted redirect'	=>	'RÃ©tablissement des permissions par dÃ©faut. Redirection&#160;âŠ',
-'Must enter name message'	=>	'Vous devez indiquer un nom de forum.',
-'Must be integer message'	=>	'La position doit Ãªtre indiquÃ©e sous forme de nombre entier positif.',
-'New forum'			=>	'Nouveau forum',
-
-// Entry page
-'Add forum head'		=>	'Ajouter un forum',
-'Create new subhead'		=>	'CrÃ©er un nouveau forum',
-'Add forum label'		=>	'Ajouter le forum Ã  une catÃ©gorie',
-'Add forum help'		=>	'Choisissez la catÃ©gorie Ã  laquelle vous souhaitez ajouter un nouveau forum.',
-'Add forum'			=>	'Ajouter le forum',
-'No categories exist'		=>	'Il n\'existe aucune catÃ©gorie pour le moment',
-'Edit forums head'		=>	'Modifier des forums',
-'Category subhead'		=>	'CatÃ©gorie&#160;:',
-'Forum label'			=>	'Forum',
-'Edit link'			=>	'Modifier',
-'Delete link'			=>	'Supprimer',
-'Position label'		=>	'Position',
-'Update positions'		=>	'Mettre Ã  jour les positions',
-'Confirm delete head'		=>	'Confirmation de suppression de forum',
-'Confirm delete subhead'	=>	'Important ! Lisez ceci avant de supprimer.',
-'Confirm delete info'		=>	'Souhaitez-vous vraiment supprimer le forum <strong>%s</strong>&#160;?',
-'Confirm delete warn'		=>	'ATTENTION ! La suppression d\'un forum entraÃ®nera la suppression des Ã©ventuels messages contenus dans ce forum&#160;!',
-
-// Detailed edit page
-'Edit forum head'		=>	'Modifier un forum',
-'Edit details subhead'		=>	'Modifier les informations sur le forum',
-'Forum name label'		=>	'Nom du forum',
-'Forum description label'	=>	'Description (HTML)',
-'Category label'		=>	'CatÃ©gorie',
-'Sort by label'			=>	'Trier les discussions par',
-'Last post'			=>	'Dernier message',
-'Topic start'			=>	'DÃ©but du sujet',
-'Subject'					=>	'Sujet',
-'Redirect label'		=>	'URL de redirection',
-'Redirect help'			=>	'Uniquement disponible pour les forums vides',
-'Group permissions subhead'	=>	'Modifier les permissions des groupes pour ce forum',
-'Group permissions info'	=>	'Dans ce forum, vous pouvez dÃ©finir les permissions spÃ©cifiques Ã  diffÃ©rents groupes d\'utilisateurs. Si vous n\'avez fait aucune modification aux permissions de groupe de ce forum, ce que vous voyez ci-dessous sont les paramÃštres par dÃ©faut basÃ©s sur ceux proposÃ©s dans %s. Les administrateurs ont toujours toutes les permissions et sont donc exclus de ce paramÃ©trage. Les paramÃštres de permission qui diffÃšrent des permissions par dÃ©faut pour le groupe d\'utilisateurs sont mis en Ã©vidence en rouge. La case Ã  cocher indiquant la permission de Â«&#160;lire le forum&#160;Â» sera dÃ©sactivÃ©e si le groupe en question ne possÃšde pas cette permission. Pour les forums redirigÃ©s, seule la permission de lecture de forum est modifiable.',
-'Read forum label'		=>	'Lire le forum',
-'Post replies label'		=>	'RÃ©pondre aux messages',
-'Post topics label'		=>	'CrÃ©er des discussions',
-'Revert to default'		=>	'RÃ©tablir les paramÃštres par dÃ©faut',
-
-);
Index: unk/web/punbb/lang/French/admin_groups.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_groups.php	(revision 10)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-// Language definitions used in admin_groups.php
-$lang_admin_groups = array(
-
-'Must enter title message'		=>	'Vous devez indiquer un nom au groupe.',
-'Title already exists message'		=>	'Il existe dÃ©jÃ  un groupe nommÃ© <strong>%s</strong>.',
-'Default group redirect'		=>	'Groupe par dÃ©faut dÃ©fini. Redirection&#160;âŠ',
-'Cannot remove default message'		=>	'Le groupe par dÃ©faut ne peut Ãªtre supprimÃ©. Pour pouvoir supprimer ce groupe, vous devez d\'abord configurer un autre groupe.',
-'Group removed redirect'		=>	'Groupe supprimÃ©. Redirection&#160;âŠ',
-'Group added redirect'			=>	'Groupe ajoutÃ©. Redirection&#160;âŠ',
-'Group edited redirect'			=>	'Groupe modifiÃ©. Redirection&#160;âŠ',
-
-'Add groups head'			=>	'Ajouter/configurer des groupes',
-'Add group subhead'			=>	'Ajouter un nouveau groupe',
-'New group label'			=>	'Baser le nouveau groupe sur',
-'New group help'			=>	'SÃ©lectionner un groupe d\'utilisateurs duquel le nouveau groupe va hÃ©riter les permissions. La page suivante vous permettra de rÃ©gler plus prÃ©cisÃ©ment les paramÃštres.',
-'Default group subhead'			=>	'DÃ©finir le groupe par dÃ©faut',
-'Default group label'			=>	'Groupe par dÃ©faut',
-'Default group help'			=>	'Ceci est le groupe par dÃ©faut, c\'est-Ã -dire le groupe dans lequel sont placÃ©s les utilisateurs lorsqu\'ils s\'inscrivent. Pour des raisons de sÃ©curitÃ©, les utilisateurs ne peuvent Ãªtre placÃ©s ni dans le groupe des modÃ©rateurs, ni dans le groupe des administrateurs par dÃ©faut.',
-'Existing groups head'			=>	'Groupes existants',
-'Edit groups subhead'			=>	'Modifier/supprimer des groupes',
-'Edit groups info'			=>	'Les groupes prÃ©dÃ©finis des invitÃ©s, administrateurs, modÃ©rateurs et membres ne peuvent Ãªtre supprimÃ©s. Cependant, ils peuvent Ãªtre modifiÃ©s. Veuillez prendre note que, dans certains groupes, certaines options ne sont pas disponibles (ex. : la permission de <em>modifier les messages</em> pour les invitÃ©s). Les administrateurs ont toujours toutes les permissions.',
-'Edit link'				=>	'Modifier',
-'Delete link'				=>	'Supprimer',
-'Group delete head'			=>	'Suppression de groupe',
-'Confirm delete subhead'		=>	'Confirmez la suppression du groupe',
-'Confirm delete info'			=>	'Souhaitez-vous vraiment supprimer le groupe <strong>%s</strong> ?',
-'Confirm delete warn'			=>	'ATTENTION&#160;! AprÃšs avoir supprimÃ© un groupe il n\'est plus possible de le rÃ©tablir.',
-'Delete group head'			=>	'Supprimer le groupe',
-'Move users subhead'			=>	'DÃ©placer les utilisateurs actuellement dans le groupe',
-'Move users info'			=>	'Le groupe <strong>%s</strong> comporte actuellement <strong>%s</strong> membres. Veuillez choisir un groupe auquel ses membres seront assignÃ©s aprÃšs la suppression.',
-'Move users label'			=>	'DÃ©placer les utilisateurs vers',
-'Delete group'				=>	'Supprimer le groupe',
-
-'Group settings head'			=>	'ParamÃštres du groupe',
-'Group settings subhead'		=>	'Configurer les options et les permissions du groupe',
-'Group settings info'			=>	'Les options et permissions ci-dessous sont les permissions par dÃ©faut de ce groupe d\'utilisateurs. Ces options sont appliquÃ©es si aucune permission spÃ©cifique au forum n\'est effective.',
-'Group title label'			=>	'Nom du groupe',
-'User title label'			=>	'Titre d\'utilisateur',
-'User title help'			=>	'Ce titre remplacera tout rang que les utilisateurs auront obtenus dans ce groupe. Laissez vide pour utiliser titre ou rang par dÃ©faut.',
-'Mod privileges label'			=>	'Appliquer des privilÃšges de modÃ©rateur aux utilisateurs',
-'Mod privileges help'			=>	'Pour qu\'un utilisateur de ce groupe puisse obtenir des privilÃšges de modÃ©rateur, il doit Ãªtre assignÃ© Ã  modÃ©rer un ou plusieurs forums. Ceci se fait via la page d\'administration d\'utilisateur du profil de l\'utilisateur.',
-'Edit profile label'			=>	'Autoriser les modÃ©rateurs Ã  Ã©diter les profils des utilisateurs',
-'Edit profile help'			=>	'Si les privilÃšges de modÃ©rateurs sont activÃ©s, autoriser les utilisateurs de ce groupe Ã  Ã©diter les profils des utilisateurs.',
-'Rename users label'			=>	'Autoriser les modÃ©rateurs Ã  renommer les utilisateurs',
-'Rename users help'			=>	'Si les privilÃšges de modÃ©rateurs sont activÃ©s, autoriser les utilisateurs de ce groupe Ã  renommer les utilisateurs.',
-'Change passwords label'		=>	'Autoriser les modÃ©rateurs Ã  modifier les mots de passe',
-'Change passwords help'			=>	'Si les privilÃšges de modÃ©rateurs sont activÃ©s, autoriser les utilisateurs de ce groupe Ã  modifier le mot de passe des utilisateurs.',
-'Ban users label'			=>	'Autoriser les modÃ©rateurs Ã  bannir les utilisateurs',
-'Ban users help'			=>	'Si les privilÃšges de modÃ©rateurs sont activÃ©s, autoriser les utilisateurs de ce groupe Ã  bannir les utilisateurs.',
-'Read board label'			=>	'Lire le forum',
-'Read board help'			=>	'Autoriser les utilisateurs de ce groupe Ã  afficher le forum. Ce paramÃštre s\'applique Ã  tous les aspects du forum et ne peut donc pas Ãªtre remplacÃ© par les paramÃštres spÃ©cifiques au forum. Si votre choix porte sur le Â«&#160;Non&#160;Â», les utilisateurs dans ce groupe ne pourront que se connecter/dÃ©connecter et s\'inscrire.',
-'View user info label'			=>	'Afficher les informations sur l\'utilisateur',
-'View user info help'			=>	'Autoriser les utilisateurs Ã  afficher la liste des utilisateurs et les profils.',
-'Post replies label'			=>	'RÃ©pondre aux messages',
-'Post replies help'			=>	'Autoriser les utilisateurs de ce groupe Ã  rÃ©pondre dans les discussions.',
-'Post topics label'			=>	'CrÃ©er des discussions',
-'Post topics help'			=>	'Autoriser les utilisateurs de ce groupe Ã  crÃ©er des discussions.',
-'Edit posts label'			=>	'Modifier les messages',
-'Edit posts help'			=>	'Autoriser les utilisateurs de ce groupe Ã  modifier leurs propres messages.',
-'Delete posts label'			=>	'Supprimer les messages',
-'Delete posts help'			=>	'Autoriser les utilisateurs de ce groupe Ã  supprimer leurs propres messages.',
-'Delete topics label'			=>	'Supprimer les discussions',
-'Delete topics help'			=>	'Autoriser les utilisateurs de ce groupe Ã  supprimer leurs propres discussions (ainsi que les Ã©ventuelles rÃ©ponses).',
-'Set own title label'			=>	'DÃ©finir leur propre titre d\'utilisateur',
-'Set own title help'			=>	'Autoriser les utilisateurs de ce groupe Ã  dÃ©finir leur propre titre d\'utilisateur.',
-'User search label'			=>	'Utiliser la recherche',
-'User search help'			=>	'Autoriser les utilisateurs de ce groupe Ã  utiliser la fonction de recherche.',
-'User list search label'		=>	'Rechercher dans la liste des utilisateurs',
-'User list search help'			=>	'Autoriser les utilisateurs de ce groupe Ã  rechercher Ã  partir d\'un texte libre des utilisateurs dans la liste d\'utilisateurs.',
-'Send e-mails label'			=>	'Envoyer des e-mails',
-'Send e-mails help'			=>	'Autoriser les utilisateurs de ce groupe Ã  envoyer des e-mails Ã  d\'autres utilisateurs.',
-'Post flood label'			=>	'Intervalle entre messages consÃ©cutifs',
-'Post flood help'			=>	'DÃ©lai en secondes Ã  respecter par les utilisateurs de ce groupe entre deux messages envoyÃ©s. DÃ©finir Ã  0 pour dÃ©sactiver.',
-'Search flood label'			=>	'Intervalle entre recherches consÃ©cutives',
-'Search flood help'			=>	'DÃ©lai en secondes Ã  respecter par les utilisateurs de ce groupe entre deux recherches. DÃ©finir Ã  0 pour dÃ©sactiver.',
-'E-mail flood label'			=>	'Intervalle entre e-mails consÃ©cutifs',
-'E-mail flood help'			=>	'DÃ©lai en secondes Ã  respecter par les utilisateurs de ce groupe entre deux e-mails envoyÃ©s. DÃ©finir Ã  0 pour dÃ©sactiver.',
-'Report flood label'      =>  'Intervalle entre signalements consÃ©cutifs',
-'Report flood help'        =>  'DÃ©lai en secondes Ã  respecter par les utilisateurs de ce groupe entre deux signalements envoyÃ©s. DÃ©finir Ã  0 pour dÃ©sactiver.',
-'Moderator info'			=>	'Veuillez prendre note que pour qu\'un utilisateur de ce groupe puisse obtenir des privilÃšges de modÃ©rateur, il doit Ãªtre assignÃ© Ã  modÃ©rer un ou plusieurs forums. Ceci se fait via la page d\'administration d\'utilisateur du profil de l\'utilisateur.',
-
-);
Index: unk/web/punbb/lang/French/admin_index.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_index.php	(revision 10)
+++ 	(revision )
@@ -1,51 +1,0 @@
-<?php
-
-// Language definitions used in admin_index.php
-$lang_admin_index = array(
-
-'fopen disabled message'		=>	'Impossible de vÃ©rifier la prÃ©sence de nouvelles mises Ã  jour puisque l\'option Â«&#160;allow_url_fopen&#160;Â» est dÃ©sactivÃ©e sur ce systÃšme.',
-'Upgrade check failed message'		=>	'La vÃ©rification de nouvelles mises Ã  jour a Ã©chouÃ© pour des raisons inconnues.',
-'Running latest version message'	=>	'Vous utilisez la version la plus rÃ©cente de FluxBB.',
-'New version available message'		=>	'Une nouvelle version de FluxBB est disponible. Vous pouvez tÃ©lÃ©charger cette version ici&#160;: %s.',
-'PHPinfo disabled message'		=>	'La fonction PHP phpinfo() a Ã©tÃ© dÃ©sactivÃ©e sur ce serveur.',
-'Not available'				=>	'Non disponible',
-'Forum admin head'			=>	'Administration du forum',
-'NA'					=>	'N/A',
-'Welcome to admin'			=>	'Bienvenue dans le panneau d\'administration de FluxBB. Ã partir d\'ici vous pouvez gÃ©rer les aspects vitaux du forum. Selon que vous Ãªtes administrateur ou modÃ©rateur, vous pouvez',
-'Welcome 1'				=>	'Organiser les catÃ©gories et forums.',
-'Welcome 2'				=>	'DÃ©finir les options et prÃ©fÃ©rences pour chaque forum.',
-'Welcome 3'				=>	'GÃ©rer les permissions pour les utilisateurs et les invitÃ©s.',
-'Welcome 4'				=>	'Afficher les statistiques IP des utilisateurs.',
-'Welcome 5'				=>	'Bannir des utilisateurs.',
-'Welcome 6'				=>	'Censurer des mots.',
-'Welcome 7'				=>	'ParamÃ©trer les rangs d\'utilisateurs.',
-'Welcome 8'				=>	'Supprimer d\'anciens messages.',
-'Welcome 9'				=>	'Traiter les signalements de messages.',
-'Statistics head'			=>	'Statistiques',
-'FluxBB version label'			=>	'Version de FluxBB',
-'Check for upgrade'			=>	'VÃ©rification pour mise Ã  niveau',
-'FluxBB version data'			=>	'v%s - %s',
-'Server load label'			=>	'Charge du serveur',
-'Server load data'			=>	'%s - %s utilisateur(s) en ligne',
-'Environment label'			=>	'Environnement',
-'Environment data OS'			=>	'SystÃšme d\'exploitation&#160;: %s',
-'Show info'				=>	'Afficher les infos',
-'Environment data version'		=>	'PHP : %s - %s',
-'Environment data acc'			=>	'AccÃ©lÃ©rateur&#160;: %s',
-'Turck MMCache'				=>	'Turck MMCache',
-'Turck MMCache link'			=>	'turck-mmcache.sourceforge.net/',
-'ionCube PHP Accelerator'		=>	'AccÃ©lÃ©rateur PHP ionCube PHP',
-'ionCube PHP Accelerator link'		=>	'www.php-accelerator.co.uk/',
-'Alternative PHP Cache (APC)'		=>	'Cache alternatif PHP (APC)',
-'Alternative PHP Cache (APC) link'	=>	'www.php.net/apc/',
-'Zend Optimizer'			=>	'Optimiseur Zend',
-'Zend Optimizer link'			=>	'www.zend.com/products/guard/zend-optimizer/',
-'eAccelerator'				=>	'eAccelerator',
-'eAccelerator link'			=>	'www.eaccelerator.net/',
-'XCache'				=>	'XCache',
-'XCache link'				=>	'xcache.lighttpd.net/',
-'Database label'			=>	'Base de donnÃ©es',
-'Database data rows'			=>	'Lignes&#160;: %s',
-'Database data size'			=>	'Taille&#160;: %s',
-
-);
Index: unk/web/punbb/lang/French/admin_maintenance.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_maintenance.php	(revision 10)
+++ 	(revision )
@@ -1,39 +1,0 @@
-<?php
-
-// Language definitions used in admin_maintenance.php
-$lang_admin_maintenance = array(
-
-'Maintenance head'			=>	'Maintenance du forum',
-'Rebuild index subhead'			=>	'Reconstruire l\'index de recherche',
-'Rebuild index info'			=>	'Si vous avez ajoutÃ©, modifiÃ© ou supprimÃ© des messages manuellement dans la base de donnÃ©es ou si vous rencontrez des problÃšmes lors des recherches, vous devriez reconstruire l\'index de recherche. Pour une performance optimale vous devriez placer le forum en %s lors de la reconstruction. <strong>La reconstruction de l\'index de recherche peut prendre du temps et provoquer une montÃ©e en charge du serveur durant le processus&#160;!</strong>',
-'Posts per cycle label'			=>	'Messages par cycle',
-'Posts per cycle help'			=>	'Le nombre de messages Ã  afficher pour chaque page. Ex. : si vous indiquez 300, trois cents messages seront traitÃ©s, ensuite la page sera rÃ©actualisÃ©e. Ceci Ã©vite que le script ne s\'interrompe durant le processus de reconstruction.',
-'Starting post label'			=>	'ID du message de dÃ©part',
-'Starting post help'			=>	'L\'ID du message de dÃ©part pour la reconstruction. La valeur pas dÃ©faut est le premier ID disponible dans la base de donnÃ©es. En principe, vous ne devriez pas avoir Ã  changer cela.',
-'Empty index label'			=>	'Effacer l\'index',
-'Empty index help'			=>	'Choisissez cela si vous souhaitez que l\'index soit vidÃ© avant de dÃ©buter la reconstruction (voir ci-dessous).',
-'Rebuild completed info'		=>	'Une fois que le processus s\'est achevÃ© vous serez redirigÃ© vers cette page. L\'activation de Javascript dans votre navigateur est fortement recommandÃ©e durant la reconstruction (pour redirection automatique au terme d\'un cycle). Si vous Ãªtes contraint(e) d\'interrompre le processus de reconstruction, notez l\'ID du message traitÃ© en dernier et indiquez la valeur ID+1 dans Â«&#160;ID du message de dÃ©part&#160;Â» lorsque/si vous souhaitez continuer (Â«&#160;Effacer l\'index&#160;Â» ne doit pas Ãªtre sÃ©lectionnÃ©).',
-'Rebuild index'				=>	'Reconstruire l\'index',
-'Rebuilding search index'		=>	'Reconstruction de l\'index de recherche',
-'Rebuilding index info'			=>	'Reconstruction de l\'index. Il serait bon de se servir un cafÃ© en attendant :-)',
-'Processing post'			=>	'Traitement du message <strong>%s</strong>&#160;âŠ',
-'Click here'				=>	'Cliquez ici',
-'Javascript redirect failed'		=>	'Ãchec de la redirection JavaScript. %s pour continuer&#160;âŠ',
-'Posts must be integer message'		=>	'Le nombre de messages par cycle doit Ãªtre une valeur entiÃšre positive.',
-'Days must be integer message'          =>      'Le nombre de jours Ã  prendre en compte pour Ã©laguer doit Ãªtre indiquÃ© sous forme de nombre entier positif.',
-'No old topics message'		        =>	'Aucune discussion ne date de plus de %s jours. Veuillez rÃ©duire la valeur de Â«&#160;AnciennetÃ© en jours&#160;Â» et essayer Ã  nouveau.',
-'Posts pruned redirect'		        =>	'Messages Ã©laguÃ©s. Redirection&#160;âŠ',
-'Prune head'			        =>	'Ãlaguer',
-'Prune subhead'			        =>	'Supprimer d\'anciens messages',
-'Days old label'		        =>	'AnciennetÃ© en jours',
-'Days old help'			        =>	'L\'anciennetÃ© d\'une discussion pour qu\'elle puisse Ãªtre supprimÃ©e. Ex.&#160;: si vous indiquez le nombre 30, toute discussion qui ne contient pas de message datant de moins de 30 jours sera supprimÃ©e.',
-'Prune sticky label'		        =>	'Supprimer les discussions Ã©pinglÃ©es',
-'Prune sticky help'		        =>	'Si activÃ©, les discussions Ã©pinglÃ©es seront Ã©galement prises en compte lors de l\'Ã©lagage.',
-'Prune from label'		        =>	'Ãlaguer dans le forum',
-'All forums'			        =>	'Tous les forums',
-'Prune from help'		        =>	'Le forum dans lequel vous souhaitez Ã©laguer les messages.',
-'Prune info'			        =>	'Utilisez cette fonctionnalitÃ© avec prudence. <strong>Les messages supprimÃ©s ne peuvent plus Ãªtre rÃ©cupÃ©rÃ©s.</strong> Pour une performance optimale, vous devriez passer le forum en %s.',
-'Confirm prune subhead'		        =>	'Confirmer l\'Ã©lagage des messages',
-'Confirm prune info'		        =>	'Souhaitez-vous vraiment supprimer toutes les discussions datant de plus de %s jours de %s (%s discussions).',
-'Confirm prune warn'		        =>	'ATTENTION&#160;! La suppression des messages est irrÃ©versible lors de l\'Ã©lagage.',
-);
Index: unk/web/punbb/lang/French/admin_options.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_options.php	(revision 10)
+++ 	(revision )
@@ -1,228 +1,0 @@
-<?php
-
-// Language definitions used in admin-options.php
-$lang_admin_options = array(
-
-'Bad HTTP Referer message'			=>	'Mauvais HTTP_REFERER. Si vous avez dÃ©placÃ© ces forums d\'un endroit Ã  un autre ou si vous avez changÃ© de domaine, vous devez mettre Ã  jour l\'URL de base manuellement dans la base de donnÃ©es (recherchez o_base_url dans la table config) et nettoyer le cache en supprimant tous les fichiers *.php dans le rÃ©pertoire /cache.',
-'Must enter title message'			=>	'Vous devez spÃ©cifier un nom pour le forum.',
-'Invalid e-mail message'			=>	'L\'adresse Ã©lectronique d\'administrateur que vous avez indiquÃ©e est invalide.',
-'Invalid webmaster e-mail message'		=>	'L\'adresse Ã©lectronique de Webmestre que vous avez indiquÃ©e est invalide.',
-'SMTP passwords did not match'		        =>	'Vous devez indiquer le mot de passe SMTP deux fois exactement de la mÃªme maniÃšre pour le modifier.',
-'Enter announcement here'			=>	'Veuillez saisir votre annonce ici.',
-'Enter rules here'				=>	'Veuillez saisir vos rÃšgles ici.',
-'Default maintenance message'			=>	'Les forums sont temporairement fermÃ©s pour maintenance. Veuillez essayer Ã  nouveau dans quelques minutes.',
-'Timeout error message'				=>	'La valeur pour Â«&#160;DÃ©lai avant dÃ©connexion&#160;Â» doit Ãªtre infÃ©rieure Ã  celle du champ Â«&#160;DÃ©lai de fin de visite&#160;Â».',
-'Options updated redirect'			=>	'Options mises Ã  jour. Redirection&#160;âŠ',
-'Options head'					=>	'Options',
-
-// Essentials section
-'Essentials subhead'				=>	'Principal',
-'Board title label'				=>	'Titre du forum',
-'Board title help'				=>	'Le titre de ce forum (affichÃ© en haut de chaque page). Ce champ <strong>ne</strong> doit <strong>pas</strong> contenir de code HTML.',
-'Board desc label'				=>	'Description du forum',
-'Board desc help'				=>	'Une courte description de ce forum (affichÃ©e en haut de chaque page). Ce champ peut contenir du code HTML.',
-'Base URL label'				=>	'URL de base',
-'Base URL help'					=>	'L\'URL complÃšte du forum sans barre oblique finale (ex. : http://www.mondomaine.com/forums). Ceci <strong>doit</strong> Ãªtre correct pour que les fonctionnalitÃ©s dÃ©diÃ©es aux administrateurs et aux modÃ©rateurs puissent Ãªtre conservÃ©es. Si vous obtenez des erreurs Â«&#160;Bad referer&#160;Â», elle est sÃ»rement incorrecte.',
-'Timezone label'				=>	'Fuseau horaire par dÃ©faut',
-'Timezone help'					=>	'Le fuseau horaire par dÃ©faut pour les invitÃ©s et les utilisateurs qui s\'inscrivent sur le forum.',
-'DST label'					=>	'Ajustement pour l\'heure d\'Ã©tÃ©',
-'DST help'					=>	'Pour activer l\'heure d\'Ã©tÃ© (avance d\'une heure).',
-'Language label'				=>	'Langue par dÃ©faut',
-'Language help'					=>	'Ceci est la langue par dÃ©faut utilisÃ©e si le visiteur est un invitÃ© ou si un utilisateur n\'a pas modifiÃ© ce paramÃštre dans son pofil. Si vous supprimez un paquetage de langue, ceci devra Ãªtre mis Ã  jour.',
-'Default style label'				=>	'Style par dÃ©faut',
-'Default style help'				=>	'Ceci est le style par dÃ©faut utilisÃ© si le visiteur est un invitÃ© ou si un utilisateur n\'a pas modifiÃ© ce paramÃštre dans son profil.',
-
-// Essentials section timezone options
-'UTC-12:00'					=>	'(UTC-12:00) Ligne de changement de date OUEST',
-'UTC-11:00'					=>	'(UTC-11:00) Niue, Samoa',
-'UTC-10:00'					=>	'(UTC-10:00) Hawaii et des Ã®les AlÃ©outiennes, Ãles Cook',
-'UTC-09:30'					=>	'(UTC-09:30) Ãles Marquises',
-'UTC-09:00'					=>	'(UTC-09:00) Alaska, Ãles Gambier',
-'UTC-08:30'					=>	'(UTC-08:30) Ãles Pitcairn',
-'UTC-08:00'					=>	'(UTC-08:00) Pacifique',
-'UTC-07:00'					=>	'(UTC-07:00) Montagnes, les Rocheuses',
-'UTC-06:00'					=>	'(UTC-06:00) Centre',
-'UTC-05:00'					=>	'(UTC-05:00) Est',
-'UTC-04:00'					=>	'(UTC-04:00) Atlantique',
-'UTC-03:30'					=>	'(UTC-03:30) Terre-Neuve',
-'UTC-03:00'					=>	'(UTC-03:00) Amazone, Centre du Groenland',
-'UTC-02:00'					=>	'(UTC-02:00) Milieu de l\'Atlantique',
-'UTC-01:00'					=>	'(UTC-01:00) AÃ§ores, Cap Vert, Groenland de l\'Est',
-'UTC'						=>	'(UTC) Europe Occidentale, Greenwich',
-'UTC+01:00'					=>	'(UTC+01:00) Europe Centrale, Afrique Occidentale',
-'UTC+02:00'					=>	'(UTC+02:00) Europe de l\'Est, Afrique Centrale',
-'UTC+03:00'					=>	'(UTC+03:00) Moscou, Afrique Orientale',
-'UTC+03:30'					=>	'(UTC+03:30) Iran',
-'UTC+04:00'					=>	'(UTC+04:00) Golf, Samara',
-'UTC+04:30'					=>	'(UTC+04:30) Afghanistan',
-'UTC+05:00'					=>	'(UTC+05:00) Pakistan, Iekaterinbourg',
-'UTC+05:30'					=>	'(UTC+05:30) Inde, Sri Lanka',
-'UTC+05:45'					=>	'(UTC+05:45) NÃ©pal',
-'UTC+06:00'					=>	'(UTC+06:00) Bangladesh, Bhutan, Novosibirsk',
-'UTC+06:30'					=>	'(UTC+06:30) Ãles Cocos, Myanmar',
-'UTC+07:00'					=>	'(UTC+07:00) Indochine, Krasnoyarsk',
-'UTC+08:00'					=>	'(UTC+08:00) Grande Chin, Australie occidentale, Irkutsk',
-'UTC+08:45'					=>	'(UTC+08:45) Australie occidentale',
-'UTC+09:00'					=>	'(UTC+09:00) Japon, CorÃ©e, Chine',
-'UTC+09:30'					=>	'(UTC+09:30) Australie MÃ©ridionale',
-'UTC+10:00'					=>	'(UTC+10:00) Australie Orientale, Vladivostok',
-'UTC+10:30'					=>	'(UTC+10:30) Ãle Lord Howe',
-'UTC+11:00'					=>	'(UTC+11:00) Ãle Salomon, Magadan',
-'UTC+11:30'					=>	'(UTC+11:30) Ãle Norfolk',
-'UTC+12:00'					=>	'(UTC+12:00) Nouvelle ZÃ©lande, Fiji, Kamchatka',
-'UTC+12:45'					=>	'(UTC+12:45) Ãles Chatham',
-'UTC+13:00'					=>	'(UTC+13:00) Tonga, Ãles Phoenix',
-'UTC+14:00'					=>	'(UTC+14:00) Ãles de la Ligne',
-
-// Timeout Section
-'Timeouts subhead'				=>	'Horaire et dÃ©lais avant interruption',
-'Time format label'				=>	'Format de l\'horaire',
-'PHP manual'					=>	'manuel PHP',
-'Time format help'				=>	'[Format actuel&#160;: %s]. Rendez-vous au %s pour des options de formatage.',
-'Date format label'				=>	'Format de la date',
-'Date format help'				=>	'[Format actuel&#160;: %s]. Rendez-vous au %s pour des options de formatage.',
-'Visit timeout label'				=>	'DÃ©lai d\'interruption de visite',
-'Visit timeout help'				=>	'DÃ©lai en secondes d\'inactivitÃ© d\'un utilisateur avant de mettre Ã  jour ses donnÃ©es de derniÃšre visite (touche principalement les indicateurs de nouveau message).',
-'Online timeout label'				=>	'DÃ©lai de dÃ©connexion',
-'Online timeout help'				=>	'DÃ©lai en secondes d\'inactivitÃ© d\'un utilisateur avant d\'Ãªtre retirÃ© de la liste des utilisateurs en ligne.',
-'Redirect time label'				=>	'DÃ©lai de redirection',
-'Redirect time help'				=>	'DÃ©lai en secondes avant redirection. Si dÃ©fini Ã  0, la page de redirection ne sera pas affichÃ©e (non recommandÃ©).',
-
-// Display Section
-'Display subhead'				=>	'Affichage',
-'Version number label'				=>	'NumÃ©ro de version',
-'Version number help'				=>	'Afficher la version de FluxBB dans le pied de page.',
-'Info in posts label'				=>	'Infos sur l\'utilisateur dans les messages',
-'Info in posts help'				=>	'Afficher les informations Ã  propos de l\'utilisateur ayant crÃ©Ã© le  message sous son nom d\'utilisateur dans la discussion. Les informations donnÃ©es sont&#160;: le lieu, la date d\'inscription, le nombre de messages publiÃ©s et les liens de contact (e-mail et URL).',
-'Post count label'				=>	'Nombre de messages',
-'Post count help'				=>	'Affiche le nombre de messages publiÃ©s par un utilisateur (indiquÃ© dans les discussions, le profil et la liste d\'utilisateurs).',
-'Smilies label'					=>	'ÃmoticÃŽnes dans les messages',
-'Smilies help'					=>	'Convertit les Ã©moticÃŽnes en petites icÃŽnes graphiques.',
-'Smilies sigs label'				=>	'ÃmoticÃŽnes dans les signatures',
-'Smilies sigs help'				=>	'Convertit les Ã©moticÃŽnes en petites icÃŽnes graphiques dans les signatures d\'utilisateurs.',
-'Clickable links label'				=>	'Rendre les liens cliquables',
-'Clickable links help'				=>	'Si activÃ©e, FluxBB dÃ©tectera automatiquement les URL dans les messages et les convertira en hyperliens cliquables.',
-'Topic review label'				=>	'RÃ©sumÃ© de discussion',
-'Topic review help'				=>	'Nombre maximal de sujets Ã  afficher lors de la composition de message (le plus rÃ©cent en premier). 0 pour dÃ©sactiver.',
-'Topics per page label'				=>	'Discussions par page',
-'Topics per page help'				=>	'Le nombre de discussions Ã  afficher par dÃ©faut par page dans un forum. Les utilisateurs peuvent personnaliser ce paramÃštre.',
-'Posts per page label'				=>	'Messages par page',
-'Posts per page help'				=>	'Le nombre de messages Ã  afficher par dÃ©faut par page dans une discussion. Les utilisateurs peuvent personnaliser ce paramÃštre.',
-'Indent label'					=>	'Tabulation',
-'Indent help'					=>	'Si dÃ©finie Ã  8, une indentation normale sera utilisÃ©e lors de l\'affichage du texte contenu dans une balise [code][/code]. Sinon, le nombre d\'espaces indiquÃ© sera utilisÃ© pour l\'indentation du texte.',
-'Quote depth label'				=>	'Niveau maximum de citations imbriquÃ©es',
-'Quote depth help'				=>	'Le nombre de fois qu\'une balise [quote] peut apparaÃ®re Ã  l\'intÃ©rieure d\'une autre balise [quote], toute balise de niveau supÃ©rieur sera ignorÃ©e.',
-
-// Features section
-'Features subhead'				=>	'FonctionnalitÃ©s',
-'Quick post label'				=>	'RÃ©ponse rapide',
-'Quick post help'				=>	'Si activÃ©e, FluxBB ajoutera un formulaire de rÃ©ponse rapide au bas des sujets. Ainsi, les utilisateurs pourront rÃ©pondre directement Ã  partir du sujet.',
-'Users online label'				=>	'Utilisateurs en ligne',
-'Users online help'				=>	'Affiche des informations sur la page d\'accueil indiquant le nombre d\'invitÃ©s et d\'inscrits visitant actuellement les forums.',
-'Censor words label'				=>	'Mots censurÃ©s',
-'Censor words help'				=>	'Activez ceci pour censurer des mots spÃ©cifiques dans le forum. Rendez-vous Ã  la rubrique %s pour davantage d\'informations.',
-'Signatures label'				=>	'Signatures',
-'Signatures help'				=>	'Autoriser les utilisateurs Ã  ajouter une signature en bas de message.',
-'User ranks label'				=>	'Rangs des utilisateurs',
-'User ranks help'				=>	'Activer cela pour utiliser les rangs d\'utilisateurs. Rendez-vous Ã  la rubrique %s pour davantage d\'informations.',
-'User has posted label'				=>	'Indication de message antÃ©rieur',
-'User has posted help'				=>	'Cette fonctionnalitÃ© affiche un point devant les sujets dans viewforum.php si l\'utilisateur actuellement connectÃ© a dÃ©jÃ  Ã©crit un message dans le sujet. DÃ©sactivez cette fonction si vous constatez des problÃšmes de surcharge du serveur.',
-'Topic views label'				=>	'Affichages de sujet',
-'Topic views help'				=>	'Conserver le nombre de fois qu\'un sujet a Ã©tÃ© visionnÃ©. DÃ©sactivez cette option si vous constatez une surcharge du serveur dans un forum trÃšs frÃ©quentÃ©.',
-'Quick jump label'				=>	'Basculement rapide',
-'Quick jump help'				=>	'Activer la liste dÃ©roulante de basculement rapide (basculer vers un forum).',
-'GZip label'					=>	'Compression GZip',
-'GZip help'					=>	'Si activÃ©e, FluxBB compressera au format gzip ce qui sera envoyÃ© au navigateur. Cela rÃ©duira l\'utilisation de la bande passante mais utilisera davantage les ressources du processeur. Cette fonctionnalitÃ© demande une configuration de PHP avec zlib (--with-zlib). Remarque : si vous avez d\'ores et dÃ©jÃ  configurÃ© un des modules Apache mod_gzip ou mod_deflate pour compresser les scripts PHP, vous devriez dÃ©sactiver cette fonctionnalitÃ©.',
-'Search all label'				=>	'Rechercher dans tous les forums',
-'Search all help'				=>	'Si dÃ©sactivÃ©e, les recherches ne pourront Ãªtre effectuÃ©es que dans un forum Ã  la fois. DÃ©sactivez ceci si la charge du serveur est trop Ã©levÃ©e Ã  cause d\'un nombre de recherches trop important.',
-'Menu items label'				=>	'ÃlÃ©ments de menu supplÃ©mentaires',
-'Menu items help'				=>	'En ajoutant des hyperliens HTML dans cette boÃ®te, un nombre illimitÃ© d\'Ã©lÃ©ments peuvent Ãªtre ajoutÃ©s au menu de navigation situÃ© en haut de chaque page. Le format pour ajouter de nouveaux liens est le suivant&#160;: X = &lt;a href="URL"&gt;INTITULE DU LIEN&lt;/a&gt; oÃ¹ X est la position Ã  laquelle le lien devra Ãªtre insÃ©rÃ© (ex. : 0 pour insÃ©rer au dÃ©but et 2 pour insÃ©rer aprÃšs l\'Ã©lÃ©ment Â«&#160;Liste d\'utilisateurs&#160;Â»). Chaque Ã©lÃ©ment devra se trouver dans une nouvelle ligne.',
-
-// Feeds section
-'Feed subhead'                                  =>      'Syndication',
-'Default feed label'				=>	'Type de flux par dÃ©faut',
-'Default feed help'				=>	'Type d\'abonnement de flux devant Ãªtre affichÃ©. Remarque&#160;: le choix Â«&#160;Aucun&#160;Â» ne dÃ©sactive pas le flux mais le masque simplement par dÃ©faut.',
-'None'						=>	'Aucun',
-'RSS'						=>	'RSS',
-'Atom'						=>	'Atom',
-'Feed TTL label'                                =>      'Temps de mise en cache des flux',
-'Feed TTL help'                                 =>      'Les flux peuvent Ãªtre placÃ©s dans le cache afin de rÃ©duire l\'utilisation des ressources.',
-'No cache'                                      =>      'Ne pas placer dans le cache',
-'Minutes'                                       =>      '%d minutes',
-
-// Reports section
-'Reports subhead'				=>	'Signalements',
-'Reporting method label'			=>	'MÃ©thode de signalement',
-'Internal'					=>	'Interne',
-'By e-mail'					=>	'E-mail',
-'Both'						=>	'Les deux',
-'Reporting method help'				=>	'Choisissez la mÃ©thode pour traiter les signalements de discussion/message. Vous pouvez opter pour le systÃšme de signalement interne, l\'envoi d\'un e-mail Ã  la liste de diffusion (voir ci-dessous) ou effectuer les deux opÃ©rations.',
-'Mailing list label'				=>	'Liste de diffusion',
-'Mailing list help'				=>	'Une liste d\'abonnÃ©s sÃ©parÃ©s par une virgule. Les personnes dans cette liste sont les destinataires des signalements.',
-
-// Avatars section
-'Avatars subhead'				=>	'Avatars',
-'Use avatars label'				=>	'Utiliser des avatars',
-'Use avatars help'				=>	'Si activÃ©e, les utilisateurs pourront envoyer vers le serveur un avatar qui sera affichÃ© sous leur titre/rang.',
-'Upload directory label'			=>	'RÃ©pertoire d\'envoi',
-'Upload directory help'				=>	'Le rÃ©pertoire vers lequel les avatars seront envoyÃ©s (relatif au rÃ©pertoire racine de FluxBB). PHP doit avoir les permissions d\'Ã©criture dans ce rÃ©pertoire.',
-'Max width label'				=>	'Largeur max',
-'Max width help'				=>	'La largeur maximale autorisÃ©e pour les avatars en pixels (60 recommandÃ©s).',
-'Max height label'				=>	'Hauteur max',
-'Max height help'				=>	'La hauteur maximale autorisÃ©e pour les avatars en pixels (60 recommandÃ©s).',
-'Max size label'				=>	'Taille max',
-'Max size help'					=>	'La taille maximale autorisÃ©e pour les avatars en octets (10240 recommandÃ©s).',
-
-// E-mail section
-'E-mail subhead'				=>	'E-mail',
-'Admin e-mail label'				=>	'E-mail de l\'administrateur',
-'Admin e-mail help'				=>	'L\'adresse Ã©lectronique de l\'administrateur du forum.',
-'Webmaster e-mail label'			=>	'E-mail du webmaster',
-'Webmaster e-mail help'				=>	'Ceci est l\'adresse indiquÃ©e comme adresse de provenance dans les e-mails envoyÃ©s par le forum.',
-'Forum subscriptions label'			=>	'Suivi de forum',
-'Forum subscriptions help'			=>	'Autorise les utilisateurs Ã  suivre des forums (reÃ§oivent un e-mail lorsque quelqu\'un crÃ©Ã© une nouvelle discussion).',
-'Topic subscriptions label'			=>	'Suivi de discussion',
-'Topic subscriptions help'			=>	'Autorise les utilisateurs Ã  suivre des discussions (reÃ§oivent un e-mail lorsque quelqu\'un rÃ©pond).',
-'SMTP address label'				=>	'Adresse du serveur SMTP',
-'SMTP address help'				=>	'L\'adresse d\'un serveur SMTP externe Ã  utiliser pour envoyer les e-mails. Vous pouvez spÃ©cifier un numÃ©ro de port personnalisÃ© si le serveur SMTP n\'utilise pas le port par dÃ©faut 25 (exemple : mail.monhÃŽte.com:3580). Laisser vide pour utiliser le programme d\'envoi d\'e-mail local.',
-'SMTP username label'				=>	'Nom d\'utilisateur SMTP',
-'SMTP username help'				=>	'Nom d\'utilisateur pour serveur SMTP. Indiquez un nom d\'utilisateur uniquement si cela est demandÃ© par le serveur SMTP (la plupart des serveurs <strong>ne</strong> nÃ©cessitent <strong>pas</strong> d\'authentification).',
-'SMTP password label'				=>	'Mot de passe SMTP',
-'SMTP change password help'			=>	'Cocher ceci si vous souhaitez modifier ou supprimer le mot de passe stockÃ© actuellement.',
-'SMTP password help'				=>	'Mot de passe pour serveur SMTP. Indiquez un mot de passe uniquement si cela est demandÃ© par le serveur SMTP (la plupart des serveurs <strong>ne</strong> nÃ©cessitent <strong>pas</strong> d\'authentification). Veuillez indiquer deux fois votre mot de passe pour confirmation.',
-'SMTP SSL label'				=>	'Chiffrage du SMTP par SSL',
-'SMTP SSL help'					=>	'Chiffre la connexion vers le serveur SMTP en utilisant SSL. Ne devrait Ãªtre utilisÃ© que si votre serveur SMTP le demande et que votre version de PHP prend en charge SSL.',
-
-// Registration Section
-'Registration subhead'				=>	'Inscription',
-'Allow new label'				=>	'Autoriser de nouvelles inscriptions',
-'Allow new help'				=>	'Indique si ce forum accepte de nouvelles inscriptions. Ne dÃ©sactiver que sous certaines conditions.',
-'Verify label'					=>	'VÃ©rifier les inscriptions',
-'Verify help'					=>	'Si activÃ©e, les utilisateurs obtiendront par e-mail un mot de passe alÃ©atoire lors de leur inscription. Ils pourront alors se connecter et modifier leur mot de passe dans leur profil s\'ils le souhaitent. Cette fonctionnalitÃ© demande Ã©galement une vÃ©rification de leur adresse Ã©lectronique s\'ils choisissent d\'en changer. Ceci est un moyen efficace d\'Ã©viter l\'inscription abusive et de vÃ©rifier que les utilisateurs ont une adresse Ã©lectronique correcte associÃ©e Ã  leur profil.',
-'Report new label'				=>	'Signaler les nouvelles inscriptions',
-'Report new help'				=>	'Si activÃ©e, FluxBB notifiera les utilisateurs dans la liste de diffusion (voir ci-dessus) lorsqu\'un nouvel utilisateur s\'inscrit sur les forums.',
-'Use rules label'				=>	'RÃšgles du forum pour les utilisateurs',
-'Use rules help'				=>	'Si activÃ©e, les utilisateurs devront accepter les rÃšgles lorsqu\'ils s\'inscriront (indiquez le texte ci-dessous). Ces rÃšgles seront toujours disponibles sous forme de lien dans le menu de navigation en haut de chaque page.',
-'Rules label'					=>	'Indiquez vos rÃšgles d\'utilisation ici',
-'Rules help'					=>	'Ici vous pouvez indiquer toute rÃšgle ou autre information que l\'utilisateur doit considÃ©rer et accepter avant de s\'inscrire. Si vous avez activÃ© les rÃšgles ci-dessus vous devez saisir quelque chose ici, sinon, elles seront dÃ©sactivÃ©es. Ce texte ne sera pas traitÃ© comme les messages ordinaires et peut contenir du code HTML.',
-'E-mail default label'				=>	'ParamÃštre e-mail par dÃ©faut',
-'E-mail default help'				=>	'Choisissez le paramÃštre de vie privÃ©e pour les nouvelles inscriptions d\'utilisateurs.',
-'Display e-mail label'				=>	'Divulguer l\'adresse Ã©lectronique aux autres utilisateurs.',
-'Hide allow form label'				=>	'Masquer l\'adresse Ã©lectronique mais autoriser l\'utilisation du formulaire d\'envoi d\'e-mail.',
-'Hide both label'				=>	'Masquer l\'adresse Ã©lectronique et ne pas autoriser l\'utilisation du formulaire d\'envoi d\'e-mail.',
-
-// Announcement Section
-'Announcement subhead'				=>	'Annonces',
-'Display announcement label'			=>	'Afficher l\'annonce',
-'Display announcement help'			=>	'Activez ceci pour afficher le message ci-dessous sur chaque page des forums.',
-'Announcement message label'			=>	'Message d\'annonce',
-'Announcement message help'			=>	'Ce texte ne sera pas traitÃ© comme les messages ordinaires et peut contenir du code HTML.',
-
-// Maintenance Section
-'Maintenance subhead'				=>	'Maintenance',
-'Maintenance mode label'			=>	'Mode maintenance',
-'Maintenance mode help'				=>	'Si activÃ©, le forum ne sera disponible qu\'aux administrateurs. Ceci devra Ãªtre utilisÃ© si le forum doit Ãªtre indisponible temporairement pour maintenance. ATTENTION&#160;! Ne vous dÃ©connectez pas lorsque le forum est en mode maintenance. Vous ne seriez plus en mesure de vous connecter.',
-'Maintenance message label'			=>	'Message de maintenance',
-'Maintenance message help'			=>	'Le message qui s\'affichera pour les utilisateurs lorsque le forum sera en mode maintenance. Si laissÃ© vide, un message par dÃ©faut sera utilisÃ©. Ce texte ne sera pas traitÃ© comme les messages ordinaires et peut contenir du code HTML.',
-
-);
Index: unk/web/punbb/lang/French/admin_permissions.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_permissions.php	(revision 10)
+++ 	(revision )
@@ -1,36 +1,0 @@
-<?php
-
-// Language definitions used in admin-permissions.php
-$lang_admin_permissions = array(
-
-'Perms updated redirect'	=>	'Permissions mises Ã  jour. Redirection&#160;âŠ',
-'Permissions head'		=>	'Permissions',
-'Posting subhead'		=>	'Messages',
-'BBCode label'			=>	'BBCode',
-'BBCode help'			=>	'Autoriser les balises BBCode dans les messages (recommandÃ©).',
-'Image tag label'		=>	'Balise image',
-'Image tag help'		=>	'Autoriser la balise BBCode [img][/img] dans les messages.',
-'All caps message label'	=>	'Message uniquement en capitales',
-'All caps message help'		=>	'Accepter qu\'un message soit complÃštement Ã©crit en lettres capitales.',
-'All caps subject label'	=>	'Sujet uniquement en capitales',
-'All caps subject help'		=>	'Accepter qu\'un sujet soit complÃštement Ã©crit en lettres capitales.',
-'Require e-mail label'		=>	'E-mail de l\'invitÃ© obligatoire',
-'Require e-mail help'		=>	'Demander Ã  l\'invitÃ© d\'indiquer son adresse Ã©lectronique pour publier un message.',
-'Signatures subhead'		=>	'Signatures',
-'BBCode sigs label'		=>	'BBCodes dans les signatures',
-'BBCode sigs help'		=>	'Autoriser les balises BBCode dans les signatures des utilisateurs.',
-'Image tag sigs label'		=>	'Balise image dans les signatures',
-'Image tag sigs help'		=>	'Autoriser la balise BBCode [img][/img] dans les signatures d\'utilisateurs (non recommandÃ©).',
-'All caps sigs label'		=>	'Signature uniquement en capitales',
-'All caps sigs help'		=>	'Accepter qu\'une signature soit complÃštement Ã©crite en lettres capitales.',
-'Max sig length label'		=>	'Longueur maximale de la signature',
-'Max sig length help'		=>	'Nombre maximal de caractÃšres contenus dans une signature d\'utilisateur.',
-'Max sig lines label'		=>	'Lignes maximales de la signature',
-'Max sig lines help'		=>	'Nombre maximal de lignes acceptÃ© dans une signature d\'utilisateur.',
-'Registration subhead'		=>	'Inscription',
-'Banned e-mail label'		=>	'Autoriser les adresses Ã©lectroniques bannies',
-'Banned e-mail help'		=>	'Autoriser l\'utilisation d\'adresse Ã©lectroniques ou de domaines d\'adresse Ã©lectronique bannis lors de l\'inscription ou la modification d\'e-mail d\'utilisateurs. Si laissÃ© au paramÃštre par dÃ©faut (oui), cette action sera autorisÃ©e, mais un avertissement par e-mail sera envoyÃ© Ã  la liste de diffusion (moyen efficace pour dÃ©tecter les inscriptions multiples).',
-'Duplicate e-mail label'	=>	'Autoriser des adresses Ã©lectroniques en double',
-'Duplicate e-mail help'		=>	'Indique si les utilisateurs sont autorisÃ©s Ã  s\'inscrire avec une adresse Ã©lectronique dÃ©jÃ  utilisÃ©e par un autre utilisateur enregistrÃ©. Si autorisÃ©, un e-mail d\'avertissement sera envoyÃ© Ã  la liste de diffusion si un doublon est dÃ©tectÃ©.',
-
-);
Index: unk/web/punbb/lang/French/admin_ranks.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_ranks.php	(revision 10)
+++ 	(revision )
@@ -1,23 +1,0 @@
-<?php
-
-// Language definitions used in admin_ranks.php
-$lang_admin_ranks = array(
-
-'Must be integer message'	=>	'Le nombre minimum de messages doit Ãªtre indiquÃ© sous forme de nombre entier positif.',
-'Dupe min posts message'	=>	'Il existe dÃ©jÃ  un rang avec un nombre minimum de messages fixÃ© Ã  %s.',
-'Must enter title message'	=>	'Vous devez indiquer un intitulÃ© pour le rang.',
-'Rank added redirect'		=>	'Rang ajoutÃ©. Redirection&#160;âŠ',
-'Rank updated redirect'		=>	'Rang mis Ã  jour. Redirection&#160;âŠ',
-'Rank removed redirect'		=>	'Rang supprimÃ©. Redirection&#160;âŠ',
-'Ranks head'			=>	'Rangs',
-'Add rank subhead'		=>	'Ajouter le rang',
-'Add rank info'			=>	'Indiquez un rang et le nombre minimum de messages publiÃ©s pour qu\'un utilisateur puisse obtenir ce rang. DiffÃ©rents rangs ne peuvent dÃ©pendre du mÃªme nombre minimum de messages. Si une identitÃ© est dÃ©finie pour un utilisateur, cette identitÃ© sera affichÃ©e Ã  la place du rang.',
-'Ranks enabled'			=>	'<strong>Les rangs d\'utilisateur sont activÃ©s dans %s.</strong>',
-'Ranks disabled'		=>	'<strong>Les rangs d\'utilisateur sont dÃ©sactivÃ©s dans %s.</strong>',
-'Rank title label'		=>	'IntitulÃ© de rang',
-'Minimum posts label'		=>	'Nombre de messages minimum',
-'Actions label'			=>	'Actions',
-'Edit remove subhead'		=>	'Modifier/supprimer des rangs',
-'No ranks in list'		=>	'Pas de rangs dÃ©finis pour le moment.',
-
-);
Index: unk/web/punbb/lang/French/admin_reports.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_reports.php	(revision 10)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-// Language definitions used in admin_reports.php
-$lang_admin_reports = array(
-
-'Report zapped redirect'		=>	'Signalement traitÃ©. Redirection&#160;âŠ',
-'New reports head'			=>	'Nouveaux signalements',
-'Deleted user'				=>	'Utilisateur supprimÃ©',
-'Deleted'				=>	'SupprimÃ©',
-'Post ID'                               =>      'Message nÂ°%s',
-'Report subhead'			=>	'SignalÃ©&#160;: %s',
-'Reported by'				=>	'SignalÃ© par %s',
-'Reason'				=>	'Motif',
-'Zap'					=>	'Marquer comme traitÃ©',
-'No new reports'			=>	'Aucun nouveau signalement pour l\'instant.',
-'Last 10 head'				=>	'10 derniers signalements traitÃ©s',
-'NA'					=>	'N/A',
-'Zapped subhead'			=>	'TraitÃ© le %s par %s',
-'No zapped reports'			=>	'Aucun signalement traitÃ© pour le moment.',
-
-);
Index: unk/web/punbb/lang/French/admin_users.php
===================================================================
--- /trunk/web/punbb/lang/French/admin_users.php	(revision 10)
+++ 	(revision )
@@ -1,110 +1,0 @@
-<?php
-
-// Language definitions used in admin-users.php
-$lang_admin_users = array(
-
-'Non numeric message'			=>	'Vous avez indiquÃ© une valeur non numÃ©rique dans une colonne n\'acceptant que des valeurs numÃ©riques.',
-'Invalid date time message'		=>	'Vous avez indiquÃ© une date, un horaire invalide.',
-'Not verified'				=>	'Non vÃ©rifiÃ©',
-
-// Actions: mass delete/ban etc.
-'No users selected'                     =>      'Aucun utilisateur sÃ©lectionnÃ©.',
-'No move admins message'                =>      'Pour des raisons de sÃ©curitÃ©, vous n\'Ãªtes pas autorisÃ©(e) Ã  dÃ©placer plusieurs administrateurs vers un autre groupe. Si vous souhaitez dÃ©placer ces administrateurs, vous pouvez le faire dans leurs profils respectifs.',
-'No delete admins message'              =>      'Les administrateurs ne peuvent Ãªtre supprimÃ©s. Pour supprimer des administrateurs, vous devez d\'abord les dÃ©placer vers un autre groupe d\'utilisateurs.',
-'No ban admins message'                 =>      'Les administrateurs ne peuvent Ãªtre bannis. Pour bannir des administrateurs, vous devez d\'abord les dÃ©placer vers un autre groupe d\'utilisateurs.',
-'No ban mods message'                   =>      'Les modÃ©rateurs ne peuvent Ãªtre bannis. Pour bannir des modÃ©rateurs, vous devez d\'abord les dÃ©placer vers un autre groupe d\'utilisateurs.',
-'Move users'                            =>      'Changer le groupe d\'utilisateurs',
-'Move users subhead'                    =>      'Choisir un nouveau groupe d\'utilisateurs',
-'New group label'                       =>      'Nouveau groupe',
-'New group help'                        =>      'Choisissez le groupe vers lequel l\'(les) utilisateur(s) sÃ©lectionnÃ©(s) sera(seront) dÃ©placÃ©(s). Pour des raisons de sÃ©curitÃ©, il n\'est pas possible de dÃ©placer plusieurs utilisateurs vers le groupe des administrateurs.',
-'Invalid group message'                 =>      'ID de groupe invalide.',
-'Users move redirect'                   =>      'Groupe d\'utilisateur modifiÃ©. Redirection&#160;âŠ',
-'Delete users'                          =>      'Supprimer des utilisateurs',
-'Confirm delete legend'                 =>      'Important : lisez avant de supprimer des utilisateurs',
-'Confirm delete info'                   =>      'Veuillez confirmer que vous souhaitez supprimer ces utilisateurs.',
-'Delete posts'                          =>      'Supprimer tous les messages et discussions que ces utilisateurs ont publiÃ©s.',
-'Delete warning'                        =>      'Avertissement ! Des utilisateurs et/ou messages supprimÃ©s ne peuvent Ãªtre rÃ©cupÃ©rÃ©s. Si vous choisissez de ne pas supprimer les messages crÃ©Ã©s par ces utilisateurs, ils ne pourront Ãªtre supprimÃ©s plus tard que manuellement.',      
-'Users delete redirect'                 =>      'Utilisateurs supprimÃ©s. Redirection&#160;âŠ',
-'Ban users'                             =>      'Bannir des utilisateurs',
-'Message expiry subhead'                =>      'Message de bannissement et expiration',
-'Ban message label'                     =>      'Message de bannissement',
-'Ban message help'                      =>      'Un message qui s\'affichera pour les utilisateurs bannis lorsqu\'ils consulteront les forums.',
-'Expire date label'                     =>      'Date d\'expiration',
-'Expire date help'                      =>      'La date Ã  laquelle ces bannissements devront Ãªtre automatiquement supprimÃ©s (format : yyyy-mm-dd). Laisser vide pour une suppression manuelle.',
-'Ban IP label'                          =>      'Bannissement d\'adresse IP',
-'Ban IP help'                           =>      'Bannir Ã©galement les adresses IP des utilisateurs bannis pour leur rendre une nouvelle crÃ©ation de compte plus difficile.',
-'Invalid date message'                  =>      'Vous avez indiquÃ© une date d\'expiration invalide.',
-'Invalid date reasons'                  =>      'Le format devrait correspondre Ã  YYYY-MM-DD et la date doit Ãªtre dÃ©finie Ã  au moins un jour plus tard.',
-'Users banned redirect'                 =>      'Utilisateurs bannis. Redirection&#160;âŠ',
-
-'User search head'			=>	'Recherche d\'utilisateur',
-'User search subhead'			=>	'Indiquer les critÃšres de recherche',
-'User search info'			=>	'Rechercher des utilisateurs dans la base de donnÃ©es. Vous pouvez indiquer un ou plusieurs termes Ã  rechercher. Les jokers sous forme d\'astÃ©risques (*) sont acceptÃ©s.',
-'Username label'			=>	'Nom d\'utilisateur',
-'E-mail address label'			=>	'Adresse Ã©lectronique',
-'Title label'				=>	'Titre',
-'Real name label'			=>	'Nom rÃ©el',
-'Website label'				=>	'Site Web',
-'Jabber label'				=>	'Jabber',
-'ICQ label'				=>	'ICQ',
-'MSN label'				=>	'MSN Messenger',
-'AOL label'				=>	'AOL IM',
-'Yahoo label'				=>	'Yahoo Messenger',
-'Location label'			=>	'Lieu',
-'Signature label'			=>	'Signature',
-'Admin note label'			=>	'Note d\'administrateur',
-'Posts more than label'			=>	'Nombre de messages supÃ©rieur Ã ',
-'Posts less than label'			=>	'Nombre de messages infÃ©rieur Ã ',
-'Last post after label'			=>	'Dernier message publiÃ© aprÃšs',
-'Date help'				=>	'(dd-mm-yyyy hh:mm:ss)',
-'Last post before label'		=>	'Dernier message publiÃ© avant',
-'Last visit after label'  =>  'DerniÃšre visite aprÃšs',
-'Last visit before label'  =>  'DerniÃšre visite avant',
-'Registered after label'		=>	'Inscrit aprÃšs',
-'Registered before label'		=>	'Inscrit avant',
-'Order by label'			=>	'CritÃšre de tri&160;:',
-'Order by username'			=>	'nom d\'utilisateur',
-'Order by e-mail'			=>	'e-mail',
-'Order by posts'			=>	'nombre de messages',
-'Order by last post'			=>	'dernier message',
-'Order by last visit'    =>  'derniÃšre visite',
-'Order by registered'			=>	'inscrit',
-'Ascending'				=>	'ascendant',
-'Descending'				=>	'descendant',
-'User group label'			=>	'Groupe d\'utilisateurs',
-'All groups'				=>	'Tous les groupes',
-'Unverified users'			=>	'Utilisateurs non vÃ©rifiÃ©s',
-'Submit search'				=>	'Lancer la recherche',
-'IP search head'			=>	'Recherche d\'IP',
-'IP search subhead'			=>	'Indiquer l\'IP Ã  rechercher',
-'IP address label'			=>	'Adresse IP',
-'IP address help'			=>	'L\'adresse IP Ã  rechercher dans la base de donnÃ©es des messages.',
-'Find IP address'			=>	'Rechercher l\'adresse IP',
-
-'Results head'				=>	'Utilisateurs',
-'Results username head'			=>	'Nom d\'utilisateur',
-'Results e-mail head'			=>	'E-mail',
-'Results title head'			=>	'IdentitÃ©/Ã©tat',
-'Results posts head'			=>	'Messages',
-'Results admin note head'		=>	'Note d\'administrateur',
-'Results actions head'			=>	'Actions',
-'Results IP address head'		=>	'Adresse IP',
-'Results last used head'		=>	'RÃ©cemment utilisÃ©e',
-'Results times found head'		=>	'Nombre de fois trouvÃ©',
-'Results action head'			=>	'Action',
-'Results find more link'		=>	'Trouver davantage d\'utilisateurs pour cette IP',
-'Results no posts found'		=>	'Aucun message n\'a Ã©tÃ© publiÃ© par cet utilisateur dans ce forum pour le moment.',
-'Select'                                =>      'SÃ©lectionner',
-'Select all'                            =>      'Tout sÃ©lectionner',
-'Unselect all'                          =>      'Tout dÃ©sÃ©lectionner',
-'Ban'                                   =>      'Bannir',
-'Delete'                                =>      'Supprimer',
-'Change group'                          =>      'Changer de groupe',
-'Bad IP message'			=>	'L\'adresse IP indiquÃ©e n\'est pas correctement formatÃ©e.',
-'Results view IP link'			=>	'Afficher les stats IP',
-'Results show posts link'		=>	'Afficher les messages',
-'Results guest'				=>	'InvitÃ©',
-'Results no IP found'			=>	'L\'adresse IP indiquÃ©e est introuvable dans la base de donnÃ©es.',
-'No match'				=>	'Aucune correspondance'
-
-);
Index: /trunk/web/punbb/lang/French/common.php
===================================================================
--- /trunk/web/punbb/lang/French/common.php	(revision 10)
+++ /trunk/web/punbb/lang/French/common.php	(revision 1)
@@ -1,163 +1,154 @@
 <?php
 
+/*
+// Determine what locale to use
+switch (PHP_OS)
+{
+	case 'WINNT':
+	case 'WIN32':
+		$locale = 'french';
+		break;
+
+	case 'FreeBSD':
+	case 'NetBSD':
+	case 'OpenBSD':
+		$locale = 'fr_FR.ISO8859-1';
+		break;
+
+	default:
+		$locale = 'fr_FR';
+		break;
+}
+
+// Attempt to set the locale
+setlocale(LC_CTYPE, $locale);
+*/
+
+
 // Language definitions for frequently used strings
+ 
 $lang_common = array(
-
 // Text orientation and encoding
 'lang_direction'		=>	'ltr',	// ltr (Left-To-Right) or rtl (Right-To-Left)
-'lang_identifier'		=>	'fr', //iso code 639-1 value (see http://www.loc.gov/standards/iso639-2/php/code_list.php)
-
-// Number formatting
-'lang_decimal_point'            =>        ',',
-'lang_thousands_sep'            =>        ' ',
-
+'lang_encoding'			=>	'utf-8',
+'lang_multibyte'		=>	false,
+ 
 // Notices
 'Bad request'			=>	'Erreur. Le lien que vous avez suivi est incorrect ou pÃ©rimÃ©.',
-'No view'			=>	'Vous n\'Ãªtes pas autorisÃ©(e) Ã  visiter ces forums.',
-'No permission'			=>	'Vous n\'Ãªtes pas autorisÃ©(e) Ã  afficher cette page.',
-'Bad referrer'			=>	'Mauvais HTTP_REFERER. Vous avez Ã©tÃ© renvoyÃ©(e) vers cette page par une source inconnue ou interdite. Si le problÃšme persiste, assurez-vous que le champ Â«&#160;URL de base&#160;Â» de la page Administration&#160;Â» Options est correctement renseignÃ© et que vous vous rendez sur ces forums en utilisant cette URL. Vous pourrez trouver davantage d\'informations dans la documentation de FluxBB.',
-'No cookie'			=>	'Vous semblez avoir Ã©tÃ© identifiÃ©(e), cependant aucun cookie n\'a Ã©tÃ© envoyÃ©. Veuillez vÃ©rifier vos paramÃštres et, si possible, activer les cookies pour ce site.',
-'Pun include error'		=>	'Impossible de procÃ©der Ã  l\'inclusion utilisateur %s Ã  partir du gabarit %s. Ce fichier ne se trouve ni dans le dossier des gabarits, ni dans le dossier d\'inclusion d\'utilisateur.',
-
+'No view'				=>	'Vous n\'Ãªtes pas autorisÃ© Ã  visiter ces forums.',
+'No permission'			=>	'Vous n\'Ãªtes pas autorisÃ© Ã  afficher cette page.',
+'Bad referrer'			=>	'Mauvais HTTP_REFERER. Vous avez Ã©tÃ© renvoyÃ© sur cette page par une source inconnue ou interdite. Si le problÃšme persiste, assurez-vous que le champ \'URL de base\' de la page Admin/Options est correctement renseignÃ© et que vous visitez ces forums en utilisant cette URL. Plus d\'informations pourront-Ãªtres trouvÃ©es dans la documentation de PunBB.',
+ 
+// Topic/forum indicators
+'New icon'				=>	'Il y a des nouveaux messages',
+'Normal icon'			=>	'<!-- -->',
+'Closed icon'			=>	'Cette discussion est fermÃ©e',
+'Redirect icon'			=>	'Forum de redirection',
+ 
 // Miscellaneous
 'Announcement'			=>	'Annonce',
-'Options'			=>	'Options',
-'Submit'			=>	'Valider',	// "name" of submit buttons
-'Ban message'			=>	'Vous Ãªtes banni(e) de ce forum.',
-'Ban message 2'			=>	'Votre bannissement expire le',
-'Ban message 3'			=>	'L\'administrateur ou le modÃ©rateur qui vous a banni envoie le message suivant :',
+'Options'				=>	'Options',
+'Actions'				=>	'Actions',
+'Submit'				=>	'Envoyer',	// "name" of submit buttons
+'Ban message'			=>	'Vous Ãªtes exclu de ce forum.',
+'Ban message 2'			=>	'Votre exclusion expire le',
+'Ban message 3'			=>	'L\'administrateur ou le modÃ©rateur qui vous a exclu envoit le message suivant&#160;:',
 'Ban message 4'			=>	'Pour toute question, contactez l\'administrateur',
-'Never'				=>	'Jamais',
-'Today'				=>	'Aujourd\'hui',
-'Yesterday'			=>	'Hier',
-'Info'				=>	'Info',		// a common table header
-'Go back'			=>	'Retour',
+'Never'					=>	'Jamais',
+'Today'					=>	'Aujourd\'hui',
+'Yesterday'				=>	'Hier',
+'Info'					=>	'Info',		// a common table header
+'Go back'				=>	'Retour',
 'Maintenance'			=>	'Maintenance',
 'Redirecting'			=>	'Redirection',
-'Click redirect'		=>	'Cliquez ici si vous ne voulez pas attendre (ou si votre navigateur ne vous redirige pas automatiquement).',
-'on'				=>	'activÃ©',		// as in "BBCode is on"
-'off'				=>	'dÃ©sactivÃ©',
-'Invalid email'			=>	'L\'adresse Ã©lectronique que vous avez saisie est invalide.',
-'Required'			=>	'(obligatoire)',
-'required field'		=>	'est un champ obligatoire pour ce formulaire.',	// for javascript form validation
-'Last post'			=>	'Dernier message',
-'by'				=>	'par',	// as in last post by someuser
-'New posts'			=>	'Nouveaux messages',
-'New posts info'		=>	'Atteindre le premier nouveau message de cette discussion.',	// the popup text for new posts links
-'Username'			=>	'Nom d\'utilisateur',
-'Password'			=>	'Mot de passe',
-'Email'				=>	'E-mail',
-'Send email'			=>	'Envoyer un e-mail',
+'Click redirect'		=>	'Cliquez ici si vous ne voulez pas attendre (ou si votre navigateur ne vous redirige pas).',
+'on'					=>	'actif',		// as in "BBCode is on"
+'off'					=>	'inactif',
+'Invalid e-mail'		=>	'L\'adresse e-mail que vous avez saisie est invalide.',
+'required field'		=>	'est un champ requis pour ce formulaire.',	// for javascript form validation
+'Last post'				=>	'Dernier message',
+'by'					=>	'par',	// as in last post by someuser
+'New posts'				=>	'Nouveaux&#160;messages',	// the link that leads to the first new post (use &#160; for spaces)
+'New posts info'		=>	'Allez au premier nouveau message de cette discussion.',	// the popup text for new posts links
+'Username'				=>	'Nom d\'utilisateur',
+'Password'				=>	'Mot de passe',
+'E-mail'				=>	'e-mail',
+'Send e-mail'			=>	'Envoyer un e-mail',
 'Moderated by'			=>	'ModÃ©rÃ© par',
 'Registered'			=>	'Date d\'inscription',
-'Subject'			=>	'Sujet',
-'Message'			=>	'Message',
-'Topic'				=>	'Discussion',
-'Forum'				=>	'Forum',
-'Posts'				=>	'Messages',
-'Replies'			=>	'RÃ©ponses',
-'Pages'				=>	'Pages&#160;:',
-'Page'				=>	'Page %s',
-'BBCode'			=>	'BBCode&#160;:',	// You probably shouldn't change this
-'img tag'			=>	'Balise [img]&#160;:',
-'Smilies'			=>	'ÃmoticÃŽnes&#160;:',
-'and'				=>	'et',
+'Subject'				=>	'Sujet',
+'Message'				=>	'Message',
+'Topic'					=>	'Discussion',
+'Forum'					=>	'Forum',
+'Posts'					=>	'Messages',
+'Replies'				=>	'RÃ©ponses',
+'Author'				=>	'Auteur',
+'Pages'					=>	'Pages',
+'BBCode'				=>	'BBCode',	// You probably shouldn't change this
+'img tag'				=>	'Balise [img]',
+'Smilies'				=>	'ÃmoticÃŽnes',
+'and'					=>	'et',
 'Image link'			=>	'image',	// This is displayed (i.e. <image>) instead of images when "Show images" is disabled in the profile
-'wrote'				=>	'a Ã©crit&#160;:',	// For [quote]'s
-'Mailer'			=>	'E-mail automatique',	// As in "MyForums Mailer" in the signature of outgoing e-mails
-'Important information'		=>	'Information importante',
-'Write message legend'		=>	'Veuillez composer votre message et l\'envoyer',
-'Previous'                      =>      'PrÃ©cÃ©dent',
-'Next'                          =>      'Suivant',
-'Spacer'                        =>      'âŠ', // Ellipsis for paginate
-
+'wrote'					=>	'a Ã©crit',	// For [quote]'s
+'Code'					=>	'Code',		// For [code]'s
+'Mailer'				=>	'E-mail automatique',	// As in "MyForums Mailer" in the signature of outgoing e-mails
+'Important information'	=>	'Information importante',
+'Write message legend'	=>	'Veuillez Ã©crire votre message et l\'envoyer',
+ 
 // Title
-'Title'				=>	'Titre de l\'utilisateur',
-'Member'			=>	'Membre',	// Default title
-'Moderator'			=>	'ModÃ©rateur',
+'Title'					=>	'Titre',
+'Member'				=>	'Membre',	// Default title
+'Moderator'				=>	'ModÃ©rateur',
 'Administrator'			=>	'Administrateur',
-'Banned'			=>	'Banni(e)',
-'Guest'				=>	'InvitÃ©',
+'Banned'				=>	'Banni',
+'Guest'					=>	'InvitÃ©',
  
 // Stuff for include/parser.php
-'BBCode error no opening tag'		=>	'La balise [/%1$s] a Ã©tÃ© trouvÃ©e sans balise [%1$s] correspondante',
-'BBCode error invalid nesting'		=>	'La balise [%1$s] a Ã©tÃ© ouverte dans la balise [%2$s], ceci n\'est pas autorisÃ©',
-'BBCode error invalid self-nesting'	=>	'La balise [%s] a Ã©tÃ© ouverte dans cette mÃªme balise, ceci n\'est pas autorisÃ©',
-'BBCode error no closing tag'		=>	'La balise [%1$s] a Ã©tÃ© trouvÃ©e sans balise [/%1$s] correspondante',
-'BBCode error empty attribute'		=>	'La balise [%s] comporte un attribut non dÃ©fini',
-'BBCode code problem'			=>	'Il y a un problÃšme avec vos balises [code]',
-'BBCode list size error'		=>	'Votre liste Ã©tant trop longue pour Ãªtre analysÃ©e, veuillez la rÃ©duire s\'il vous plaÃ®t&#160;!',
-
+'BBCode error'			=>	'La syntaxe BBCode est incorrecte.',
+'BBCode error 1'		=>	'Il manque la balise d\'ouverture pour [/quote].',
+'BBCode error 2'		=>	'Il manque la balise de fermeture pour [code].',
+'BBCode error 3'		=>	'Il manque la balise d\'ouverture pour [/code].',
+'BBCode error 4'		=>	'Il manque une ou plusieurs balises de fermeture pour [quote].',
+'BBCode error 5'		=>	'Il manque une ou plusieurs balises d\'ouverture manquantes pour [/quote].',
+ 
 // Stuff for the navigator (top of every page)
-'Index'				=>	'Accueil',
-'User list'			=>	'Liste des membres',
-'Rules'				=>  	'RÃšgles',
-'Search'			=>  	'Recherche',
-'Register'			=>  	'Inscription',
-'Login'				=>  	'Identification',
-'Not logged in'			=>  	'Vous n\'Ãªtes pas identifiÃ©(e).',
-'Profile'			=>	'Profil',
-'Logout'			=>	'DÃ©connexion',
-'Logged in as'			=>	'ConnectÃ©(e) sous l\'identitÃ©&#160;',
-'Admin'				=>	'Administration',
-'Last visit'			=>	'DerniÃšre visite&#160;: %s',
-'Topic searches'		=>	'Contributions&#160;:',
-'New posts header'		=>	'Nouvelles',
-'Active topics'			=>	'RÃ©centes',
-'Unanswered topics'		=>      'Sans rÃ©ponse',
-'Posted topics'			=>	'Personnelles',
-'Show new posts'		=>	'Trouver les discussions avec de nouveaux messages depuis votre derniÃšre visite.',
-'Show active topics'		=>	'Trouver les discussions comportant des messages rÃ©cents.',
-'Show unanswered topics'	=>	'Trouver les discussions sans rÃ©ponse.',
-'Show posted topics'		=>	'Trouver les discussions auxquelles vous avez participÃ©.',
+'Index'					=>	'Index',
+'User list'				=>	'Liste des membres',
+'Rules'					=>  'RÃšgles',
+'Search'				=>  'Recherche',
+'Register'				=>  'Inscription',
+'Login'					=>  'S\'identifier',
+'Not logged in'			=>  'Vous n\'Ãªtes pas identifiÃ©.',
+'Profile'				=>	'Profil',
+'Logout'				=>	'DÃ©connexion',
+'Logged in as'			=>	'ConnectÃ© en tant que',
+'Admin'					=>	'Administration',
+'Last visit'			=>	'DerniÃšre visite',
+'Show new posts'		=>	'Afficher les nouveaux messages depuis la derniÃšre visite',
 'Mark all as read'		=>	'Marquer toutes les discussions comme lues',
-'Mark forum read'               =>      'Marquer ce forum comme lu',
-'Title separator'		=>	' / ',
-
+'Link separator'		=>	'',	// The text that separates links in the navigator
+ 
 // Stuff for the page footer
 'Board footer'			=>	'Pied de page des forums',
-'Jump to'			=>	'Atteindre',
-'Go'				=>	'Aller',		// submit button in forum jump
-'Moderate topic'                =>      'ModÃ©rer la discussion',
-'Move topic'			=>  	'DÃ©placer la discussion',
-'Open topic'			=>  	'Ouvrir la discussion',
-'Close topic'			=>  	'Fermer la discussion',
-'Unstick topic'			=>  	'DÃ©tacher la discussion',
-'Stick topic'			=>  	'Ãpingler la discussion',
+'Search links'			=>	'Liens de recherche',
+'Show recent posts'		=>	'Afficher les messages rÃ©cents',
+'Show unanswered posts'	=>	'Afficher les messages sans rÃ©ponse',
+'Show your posts'		=>	'Afficher vos messages',
+'Show subscriptions'	=>	'Afficher les discussions auxquelles vous Ãªtes abonnÃ©s',
+'Jump to'				=>	'Aller Ã ',
+'Go'					=>	' Aller ',		// submit button in forum jump
+'Move topic'			=>  'DÃ©placer la discussion',
+'Open topic'			=>  'Ouvrir la discussion',
+'Close topic'			=>  'Fermer la discussion',
+'Unstick topic'			=>  'DÃ©tacher la discussion',
+'Stick topic'			=>  'Ãpingler la discussion',
 'Moderate forum'		=>	'ModÃ©rer le forum',
-'Powered by'                    =>      'PropulsÃ© par %s',
+'Delete posts'			=>	'Supprimer plusieurs messages',
+'Debug table'			=>	'Informations de dÃ©bogue',
  
-// Debug information
-'Debug table'                   =>        'Informations de dÃ©bogage',
-'Querytime'                     =>        'GÃ©nÃ©rÃ©es en %1$s secondes, %2$s requÃªtes exÃ©cutÃ©es',
-'Memory usage'			=>	  'Utilisation de la mÃ©moire : %1$s',
-'Peak usage'			=>	  '(pic d\'utilisation : %1$s)',
-'Query times'                   =>        'Temps (s)',
-'Query'                         =>        'RequÃªte',
-'Total query time'              =>        'Temps total d\'exÃ©cution de la requÃªte&#160;: %s',
-
 // For extern.php RSS feed
-'RSS description'                                 =>        'Les sujets les plus rÃ©cents sur %s.',
-'RSS description topic'                           =>        'Les sujets les plus rÃ©cents dans %s.',
-'RSS reply'                                       =>        'RÃ©ponse Ã &#160;:  ', // The topic subject will be appended to this string (to signify a reply)
-'RSS active topics feed'			  =>	    'Flux RSS des discussions actives',
-'Atom active topics feed'			  =>	    'Flux Atom des discussions actives',
-'RSS forum feed'				  =>	    'Flux RSS du forum',
-'Atom forum feed'				  =>	    'Flux Atom du forum',
-'RSS topic feed'				  =>	    'Flux RSS de la discussion',
-'Atom topic feed'				  =>	    'Flux Atom de la discussion',
-
-// Admin related stuff in the header
-'New reports'					  =>	    'De nouveaux signalements ont Ã©tÃ© envoyÃ©s&#160;!',
-'Maintenance mode enabled'			  =>	    'Le mode maintenance est activÃ©&#160;!',
-
-// Units for file sizes
-'Size unit B'            =>  '%s O',
-'Size unit KiB'            =>  '%s Kio',
-'Size unit MiB'            =>  '%s Mio',
-'Size unit GiB'            =>  '%s Gio',
-'Size unit TiB'            =>  '%s Tio',
-'Size unit PiB'            =>  '%s Pio',
-'Size unit EiB'            =>  '%s Eio',
-
-); 
+'RSS Desc Active'		=>	'Les discussions rÃ©cemment actives de',	// board_title will be appended to this string
+'RSS Desc New'			=>	'Les derniÃšres discussions de',					// board_title will be appended to this string
+'Posted'				=>	'Ãcrit le'	// The date/time a topic was started
+);
+ 
Index: /trunk/web/punbb/lang/French/delete.php
===================================================================
--- /trunk/web/punbb/lang/French/delete.php	(revision 10)
+++ /trunk/web/punbb/lang/French/delete.php	(revision 1)
@@ -5,12 +5,8 @@
  
 'Delete post'			=>	'Supprimer le message',
-'Warning'			=>	'Vous Ãªtes sur le point de supprimer dÃ©finitivement ce message&#160;!',
-'Topic warning'			=>	'Attention&#160;! Ceci est le premier message de cette discussion, toute la discussion sera dÃ©finitivement supprimÃ©e.',
-'Delete info'			=>	'Le message que vous souhaitez supprimer vous est prÃ©sentÃ© ci-dessous afin que vous puissiez le revoir avant de continuer.',
-'Reply by'			=>	'RÃ©ponse de %s - %s',
-'Topic by'			=>	'Discussion dÃ©marrÃ©e par %s - %s',
-'Delete'			=>	'Supprimer',	// The submit button
-'Post del redirect'		=>	'Message supprimÃ©. Redirection&#160;âŠ',
-'Topic del redirect'		=>	'Discussion supprimÃ©e. Redirection&#160;âŠ'
+'Warning'				=>	'Attention&#160;: S\'il s\'agit du premier message de la discussion, celle-ci sera entiÃšrement supprimÃ©e&#160;!',
+'Delete'				=>	'Supprimer',	// The submit button
+'Post del redirect'		=>	'Message supprimÃ©. Redirection ...',
+'Topic del redirect'	=>	'Discussion supprimÃ©e. Redirection ...'
  
 );
Index: /trunk/web/punbb/lang/French/forum.php
===================================================================
--- /trunk/web/punbb/lang/French/forum.php	(revision 10)
+++ /trunk/web/punbb/lang/French/forum.php	(revision 1)
@@ -3,14 +3,10 @@
 // Language definitions used in viewforum.php
 $lang_forum = array(
-
+ 
 'Post topic'	=>	'Nouvelle discussion',
-'Views'		=>	'Vues',
-'Moved'		=>	'DÃ©placÃ©e&#160;:',
-'Sticky'	=>	'ÃpinglÃ©e&#160;:',
-'Closed'	=>	'FermÃ©e&#160;:',
-'Empty forum'	=>	'Le forum ne contient aucune discussion.',
-'Mod controls'	=>	'Interventions pour modÃ©rateurs',
-'Is subscribed'	=>	'Vous suivez ce forum',
-'Unsubscribe'	=>	'Ne plus suivre',
-'Subscribe'	=>	'Suivre ce forum'
+'Views'			=>	'Vues',
+'Moved'			=>	'DÃ©placÃ©',
+'Sticky'		=>	'ÃpinglÃ©',
+'Empty forum'	=>	'Le forum est vide.'
+ 
 );
Index: /trunk/web/punbb/lang/French/help.php
===================================================================
--- /trunk/web/punbb/lang/French/help.php	(revision 10)
+++ /trunk/web/punbb/lang/French/help.php	(revision 1)
@@ -4,63 +4,39 @@
 $lang_help = array(
  
-'Help'				=>	'Aide',
-'produces'			=>	'gÃ©nÃšre',
-
-'BBCode'			=>	'BBCode',
-'BBCode info 1'			=>	'Le BBCode est une collection de balises de formatage utilisÃ©es pour modifier l\'apparence du texte ou ajouter des Ã©lÃ©ments graphiques sur ces forums. BBCode est basÃ© sur le mÃªme principe que le HTML, et y ressemble donc beaucoup. Il suffit d\'encadrer les parties que l\'on souhaite modifier/ajouter par des balises ([nom_de_balise]partie Ã  modifier[/nom_de_balise]). Ci-dessous la liste de toutes les balises BBCodes disponibles et les instructions d\'utilisation.',
-'BBCode info 2'			=>	'Les administrateurs ont la possibilitÃ© d\'activer ou de dÃ©sactiver le systÃšme BBCode. Vous pouvez vÃ©rifier si le BBCode est activÃ© lors de la composition d\'un message ou la modification de votre signature.',
+'Help'					=>	'Aide',
+'produces'				=>	'produit',
+ 
+'BBCode info 1'			=>	'Le BBCode est une collection de balises de formatage utilisÃ©es pour modifier l\'apparence du texte sur ces forums. BBCode est basÃ© sur le mÃªme principe -&#160;et y ressemble beaucoup&#160;- que le HTML. Ci-dessous la liste de tous les BBCodes disponibles et les instructions d\'utilisation.',
+'BBCode info 2'			=>	'Les administrateurs ont la possibilitÃ© d\'activer ou de dÃ©sactiver le systÃšme de BBCode. Vous pouvez vÃ©rifier si le BBCode est activÃ© ou non lorsque vous Ã©crivez un message ou lorsque vous modifiez votre signature.',
  
 'Text style'			=>	'Style du texte',
 'Text style info'		=>	'Les balises suivantes changent l\'apparence du texte&#160;:',
-'Bold text'			=>	'Texte en gras',
+'Bold text'				=>	'Texte en gras',
 'Underlined text'		=>	'Texte soulignÃ©',
 'Italic text'			=>	'Texte en italique',
-'Strike-through text'		=>	'Texte barrÃ©',
-'Red text'			=>	'Texte rouge',
-'Blue text'			=>	'Texte bleu',
-'Heading text'			=>	'Titre',
-'Deleted text'			=>	'Texte supprimÃ©',
-'Inserted text'			=>	'Texte insÃ©rÃ©',
-'Emphasised text'		=>	'Texte en emphase',
-
+'Red text'				=>	'Texte rouge',
+'Blue text'				=>	'Texte bleu',
+ 
 'Links and images'		=>	'Liens et images',
-'This help page'    =>  'Cette page d\'aide',
-'Links info'			=>	'Vous pouvez crÃ©er des liens vers d\'autres documents ou vers des adresses Ã©lectroniques en utilisant les balises suivantes&#160;:',
-'My email address'		=>	'Mon adresse Ã©lectronique',
-'Images info'			=>	'Si vous souhaitez afficher une image, vous pouvez utiliser la balise Â«&#160;<strong>img</strong>&#160;Â». Le texte aprÃšs le signe Â«&#160;=&#160;Â» dans la balise ouvrante est utilisÃ© pour l\'attribut alt (texte alternatif en cas de non affichage de l\'image) et devrait Ãªtre ajoutÃ© Ã  chaque fois que cela est possible',
-'FluxBB bbcode test'	        =>	'Test du bbcode FluxBB',
-
-'Test topic'      =>  'Discussion de test',
-'Test post'        =>  'Message de test',
-'Test forum'      =>  'Forum de test',
-'Test user'        =>  'Utilisateur de test',
-
-'Quotes'			=>	'Citations',
-'Quotes info'			=>	'Si vous souhaitez inclure une citation de quelqu\'un, vous devriez utiliser la balise Â«&#160;<strong>quote</strong>&#160;Â».',
-'Quotes info 2'			=>	'Si vous ne souhaitez pas citer quelqu\'un en particulier, vous pouvez utiliser la balise Â«&#160;<strong>quote</strong>&#160;Â» sans spÃ©cifier de nom.',
+'Links info'			=>	'Vous pouvez crÃ©er des liens vers d\'autres documents ou vers des adresses e-mail en utilisant les balises suivantes&#160;:',
+'My e-mail address'		=>	'Mon adresse e-mail',
+'Images info'			=>	'Si vous souhaitez afficher une image, vous pouvez utiliser la balise <em>img</em> comme ceci&#160;:',
+ 
+'Quotes'				=>	'Citations',
+'Quotes info'			=>	'Si vous souhaitez rÃ©aliser une citation de quelqu\'un, vous devriez utiliser la balise <em>quote</em>.',
+'Quotes info 2'			=>	'Si vous ne souhaitez pas citer quelqu\'un en particulier, vous pouvez utiliser la balise <em>quote</em> sans spÃ©cifier de nom.',
 'Quote text'			=>	'Voici le texte que je veux citer.',
-'produces quote box'		=>	'gÃ©nÃšre une boÃ®te de citation comme ceci&#160;:',
-'quote note'			=>	'Remarque&#160;: si un nom d\'utilisateur contient les caractÃšres [ ou ] vous pouvez les dÃ©limiter par des guillemets.',
+'produces quote box'	=>	'produit une boite de citation comme ceci&#160;:',
  
-'Code'				=>	'Code',
-'Code info'			=>	'Lorsque vous affichez du code source vous devriez vous assurer que vous utilisez la balise Â«&#160;<strong>code</strong>&#160;Â». Le texte affichÃ© entre les balises <em>code</em> utilise une police de caractÃšres Ã  chasse fixe et n\'est pas affectÃ© par les autres balises.',
-'Code text'			=>	'Voici un peu de code.',
-'produces code box'		=>	'gÃ©nÃšre une boÃ®te de code comme ceci&#160;:',
+'Code'					=>	'Code',
+'Code info'				=>	'Lorsque vous affichez du code source vous devriez vous assurer que vous utilisez la balise <em>code</em>. Le texte affichÃ© entre les balises <em>code</em> utilise une police de caractÃšre Ã  chasse fixe et n\'est pas affectÃ© par les autres balises.',
+'Code text'				=>	'Voici un peu de code.',
+'produces code box'		=>	'produit une boite de code comme ceci&#160;:',
  
 'Nested tags'			=>	'Balises imbriquÃ©es',
 'Nested tags info'		=>	'Les balises BBCode peuvent s\'imbriquer afin de rÃ©aliser un formatage avancÃ©. Par exemple&#160;:',
-'Bold, underlined text'		=>	'Texte gras et soulignÃ©',
+'Bold, underlined text'	=>	'Texte gras et soulignÃ©',
  
-'Lists'                    	=>    	'Listes',
-'List info'               	=>    	'Pour crÃ©er une liste vous pouvez utiliser la balise Â«&#160;<strong>list</strong>&#160;Â». Trois types de listes sont Ã  votre disposition.',
-'List text 1'             	=>    	'Exemple de premier Ã©lÃ©ment de liste.',
-'List text 2'             	=>    	'Exemple de deuxiÃšme Ã©lÃ©ment de liste.',
-'List text 3'             	=>    	'Exemple de troisiÃšme Ã©lÃ©ment de liste.',
-'produces list'           	=>    	'gÃ©nÃšre une liste Ã  puces.',
-'produces decimal list'   	=>    	'gÃ©nÃšre une liste numÃ©rotÃ©e.',
-'produces alpha list'     	=>    	'gÃ©nÃšre une liste alphabÃ©tique.',
-
-'Smilies'			=>	'ÃmoticÃŽnes',
-'Smilies info'			=>	'Si vous le souhaitez (et si cette fonctionnalitÃ© est activÃ©e), les forums peuvent convertir une sÃ©rie d\'Ã©moticÃŽnes en images correspondantes. Ces forums reconnaissent les Ã©moticÃŽnes suivantes et les remplacent par des images&#160;:'
+'Smilies info'			=>	'Si vous le souhaitez (et si c\'est activÃ©), les forums peuvent convertir une sÃ©rie d\'Ã©moticÃŽnes en reprÃ©sentation graphique de ceux-ci. Les forums reconnaissent et remplacent les Ã©moticÃŽnes par des images comme ci-dessous&#160;:'
  
 );
Index: /trunk/web/punbb/lang/French/index.html
===================================================================
--- /trunk/web/punbb/lang/French/index.html	(revision 10)
+++ /trunk/web/punbb/lang/French/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/lang/French/index.php
===================================================================
--- /trunk/web/punbb/lang/French/index.php	(revision 10)
+++ /trunk/web/punbb/lang/French/index.php	(revision 1)
@@ -4,17 +4,18 @@
 $lang_index = array(
  
-'Topics'			=>  	'Discussions',
-'Link to'			=>	'Lien vers&#160;:',	// As in "Link to: http://www.punbb.org/"
-'Empty board'			=>	'Les forums ne contiennent rien pour le moment.',
-'Newest user'			=>	'Dernier utilisateur inscrit&#160;: %s',
-'Users online'			=>	'Membres en ligne&#160;: %s',
-'Guests online'			=>	'InvitÃ©s en ligne&#160;: %s',
-'No of users'			=>	'Nombre total de membres&#160;: %s',
-'No of topics'			=>	'Nombre total de discussions&#160;: %s',
-'No of posts'			=>	'Nombre total de messages&#160;: %s',
-'Online'			=>	'Actuellement en ligne&#160;: ',	// As in "Online: User A, User B etc."
-'Board info'			=>	'Informations sur les forums',
-'Board stats'			=>	'Statistiques des forums',
-'User info'			=>	'Informations sur l\'utilisateur'
+'Topics'				=>  'Discussions',
+'Moderators'			=>  'ModÃ©rateurs',
+'Link to'				=>	'Lien vers',	// As in "Link to http://www.punbb.org/"
+'Empty board'			=>	'Les forums sont vides.',
+'Newest user'			=>	'Dernier utilisateur inscrit',
+'Users online'			=>	'Membres en ligne',
+'Guests online'			=>	'InvitÃ©s en ligne',
+'No of users'			=>	'Nombre total de membres',
+'No of topics'			=>	'Nombre total de discussions',
+'No of posts'			=>	'Nombre total de messages',
+'Online'				=>	'Actuellement en ligne',	// As in "Online: User A, User B etc."
+'Board info'			=>	'Informations Forums',
+'Board stats'			=>	'Statistiques Forums',
+'User info'				=>	'Informations utilisateurs'
  
 );
Index: unk/web/punbb/lang/French/install.php
===================================================================
--- /trunk/web/punbb/lang/French/install.php	(revision 10)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?php
-
-// Language definitions used in install.php, localized by adaur
-
-$lang_install = array(
-
-'Install message'			=>	'Le fichier \'config.php\' n\'existe pas ou est corrompu. Cela veut dire que FluxBB n\'a pas encore Ã©tÃ© installÃ©. Pour l\'installer, veuillez suivre les instructions ci-dessous.',
-'Choose install language'		=>	'Choisir la langue du script d\'installation',
-'Choose install language info'	        =>	'La langue utilisÃ©e pour ce script d\'installation. La langue par dÃ©faut utilisÃ©e pour les forums peut Ãªtre dÃ©finie ci-dessous.',
-'Install language'			=>	'Installer la langue',
-'Change language'                       =>      'Changer de langue',
-'Next'					=>	'Suivante',
-'Already installed'			=>	'Il semble que FluxBB soit dÃ©jÃ  installÃ©. Veuillez vous rendre <a href="index.php">ici</a> plutÃŽt.',
-'You are running error'			=>	'Vous utilisez la version %2$s de %1$s. FluxBB %3$s nÃ©cessite au moins %1$s %4$s pour fonctionner correctement. Vous devez mettre Ã  niveau votre installation %1$s avant de poursuivre.',
-'My FluxBB Forum'			=>	'Mon Forum FluxBB',
-'Description'				=>	'Malheureusement, on ne peut pas vous expliquer ce qu\'est FluxBB - vous devrez vous en rendre compte par vous-mÃªme.',
-'Username 1'				=>	'Les noms d\'utilisateurs doivent comporter au moins 2 caractÃšres.',
-'Username 2'				=>	'Les noms d\'utilisateurs ne doivent pas comporter plus de 25 caractÃšres.',
-'Username 3'				=>	'Le nom d\'utilisateur Â« guest Â» est rÃ©servÃ©.',
-'Username 4'				=>	'Les noms d\'utilisateurs ne doivent pas ressembler Ã  une adresse IP.',
-'Username 5'				=>	'Les noms d\'utilisateurs ne doivent pas comporter tous les caractÃšres \', " et [ ou ] en mÃªme temps.',
-'Username 6'				=>	'Les noms d\'utilisateurs ne doivent pas comporter de balises de formatage de texte (BBCode) utilisÃ©s par les forums.',
-'Short password'			=>	'Les mots de passe doivent comporter au moins 4 caractÃšres.',
-'Passwords not match'			=>	'Les mots de passe ne coÃ¯ncident pas.',
-'Wrong email'				=>	'L\'e-mail d\'administrateur que vous avez indiquÃ© est invalide.',
-'No board title'			=>	'Vous devez indiquer un titre pour les forums.',
-'Error default language'		=>	'La langue par dÃ©faut choisie semble ne pas exister.',
-'Error default style'			=>	'Le style par dÃ©faut choisi semble ne pas exister.',
-'No DB extensions'			=>	'Cet environnement PHP n\'est compatible avec aucune des bases de donnÃ©es prises en charge par FluxBB. PHP doit prendre en charge MySQL, PostgreSQL ou SQLite pour pouvoir installer FluxBB.',
-'Administrator username'		=>	'Nom d\'utilisateur de l\'administrateur',
-'Administrator password 1'		=>	'Mot de passe de l\'administarteur',
-'Administrator password 2'		=>	'Confirmation du mot de passe de l\'administrateur',
-'Administrator email'			=>	'E-mail de l\'administrateur',
-'Board title'				=>	'Titre des forums',
-'Base URL'				=>	'URL de base',
-'Required field'			=>	'est un champ obligatoire dans ce formulaire.',
-'FluxBB Installation'			=>	'Installation de FluxBB',
-'Welcome'				=>	'Vous allez installer FluxBB. Pour ce faire, vous devez remplir le formulaire ci-dessous. Si vous rencontrez des difficultÃ©s concernant cette installation, veuillez vous rÃ©fÃ©rer Ã  la documentation.',
-'Install'				=>	'Installer FluxBB 1.4',
-'Errors'				=>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es :',
-'Database setup'			=>	'ParamÃ©trage de la base de donnÃ©es',
-'Info 1'				=>	'Veuillez renseigner les informations demandÃ©es pour paramÃ©trer votre base de donnÃ©es FluxBB. Vous devez connaÃ®tre toutes les informations demandÃ©es avant de procÃ©der Ã  l\'installation.',
-'Select database'			=>	'Choisir votre type de base de donnÃ©es',
-'Info 2'				=>	'FluxBB prend actuellement en charge MySQL, PostgreSQL et SQLite. Si la base de donnÃ©es que vous avez choisie ne figure pas dans le menu dÃ©roulant ci-dessous, cela signifie que votre environnement PHP n\'est pas compatible avec cette base de donnÃ©es-ci. Vous pourrez trouver davantage d\'informations concernant la prise en charge de base de donnÃ©es particuliÃšres dans la FAQ.',
-'Dual MySQL'				=>	'FluxBB a dÃ©tectÃ© que votre environnement PHP prend en charge 2 moyens diffÃ©rents de communication avec MySQL. Les deux options sont nommÃ©es Â« standard Â» et Â« improved Â». Si vous ne savez pas trop lequel utiliser, commencez par essayer avec Â« improved Â» et si cela ne fonctionne pas, essayez Â« standard Â».',
-'InnoDB'				=>	'FluxBB a dÃ©tectÃ© que votre serveur devrait prendre en charge <a href="http://dev.mysql.com/doc/refman/5.0/en/innodb.html">InnoDB</a>. Cela serait un bon choix si vous avez l\'intention de mettre Ã  disposition une grande plate-forme de discussion. Si vous n\'Ãªtes pas sÃ»r de vous, il est recommandÃ© de ne pas utiliser InnoDB.',
-'Database type'				=>	'Type de base de donnÃ©es',
-'Required'				=>	'(Obligatoire)',
-'Database hostname'			=>	'Indiquer le nom d\'hÃŽte de votre serveur de base de donnÃ©es',
-'Info 3'				=>	'L\'adresse du serveur de base de donnÃ©es (exemple : localhost, db.monhote.com ou 192.168.0.15). Vous pouvez spÃ©cifier un numÃ©ro de port si votre base de donnÃ©es n\'utilise pas le port par dÃ©faut (exemple : localhost:3580). Pour la prise en charge de SQLite, indiquer n\'importe quoi ou laisser \'localhost\'.',
-'Database server hostname'		=>      'Nom d\'hÃŽte du serveur de base de donnÃ©es',
-'Database enter name'			=>	'Indiquer le nom de votre base de donnÃ©es',
-'Info 4'				=>	'Le nom de la base de donnÃ©es dans laquelle FluxBB sera installÃ©. La base de donnÃ©e doit exister. Pour SQLite, indiquer le chemin relatif vers le fichier de base de donnÃ©es. Pour des raisons de sÃ©curitÃ©, il est fortement recommandÃ© de placer la base de donnÃ©es SQLite dans un dossier privÃ© (non accessible par le Web) tant que possible. Si le fichier de base de donnÃ©es SQLite n\'existe pas, FluxBB tentera de le crÃ©er.',
-'Database name'				=>	'Nom de la base de donnÃ©es',
-'Database enter informations'	        =>	'Indiquer le nom d\'utilisateur et le mot de passe de votre base de donnÃ©es',
-'Database username'			=>	'Nom d\'utilisateur de base de donnÃ©es',
-'Info 5'				=>	'Indiquer le nom d\'utilisateur et le mot de passe avec lesquels vous vous connectez Ã  la base de donnÃ©es. Ã ignorer pour SQLite.',
-'Database password'			=>	'Mot de passe de base de donnÃ©es',
-'Database enter prefix'			=>	'Indiquer le prÃ©fixe de table de la base de donnÃ©es',
-'Info 6'				=>	'Si vous le souhaitez, vous pouvez spÃ©cifier un prÃ©fixe de table. Ainsi vous pourrez faire fonctionner plusieurs copies de FluxBB dans la mÃªme base de donnÃ©es (exemple : foo_).',
-'Table prefix'				=>	'PrÃ©fixe de table',
-'Administration setup'			=>	'ParamÃ©trage de l\'administration',
-'Info 7'				=>	'Veuillez renseigner les informations demandÃ©es afin de paramÃ©trer un administrateur pour votre installation FluxBB.',
-'Admin enter username'			=>	'Indiquer le nom d\'utilisateur de l\'administrateur',
-'Info 8'				=>	'Le nom d\'utilisateur de l\'administrateur des forums. Vous pourrez crÃ©er davantage d\'administrateurs et de modÃ©rateurs plus tard. Les noms d\'utilisateur peuvent comporter de 2 Ã  25 caractÃšres.',
-'Admin enter password'			=>	'Indiquer et confirmer le mot de passe administrateur',
-'Info 9'				=>	'Les mots de passe doivent comporter au moins 4 caractÃšres. Ils sont sensibles Ã  la casse.',
-'Password'				=>	'Mot de passe',
-'Confirm password'			=>	'Confirmation du mot de passe',
-'Admin enter email'			=>	'Indiquer l\'e-mail de l\'administrateur',
-'Info 10'				=>	'L\'e-mail de l\'administrateur des forums.',
-'Board setup'				=>	'ParamÃ©trage des forums',
-'Info 11'				=>	'Veuillez renseigner les informations demandÃ©es afin de paramÃ©trer vos forums FluxBB.',
-'Enter board title'			=>	'Indiquer le titre des forums',
-'Info 12'				=>	'Le titre de cette plate-forme de discussion (AffichÃ© en haut de chaque page).',
-'Enter board description'		=>	'Indiquer la description des forums',
-'Info 13'				=>	'Une brÃšve description de cette plate-forme de discussion (AffichÃ© en haut de chaque page). Ce champ peut contenir des balises HTML.',
-'Board description'			=>	'Description des forums',
-'Enter base URL'			=>	'Indiquer l\'URL de base de votre installation FluxBB',
-'Info 14'				=>	'L\'URL (sans barre oblique Ã  la fin) de vos forums FluxBB (exemple : http://forum.mondomaine.com ou http://mondomaine.com/~monutilisateur). Ceci <strong>doit</strong> Ãªtre juste, sinon, les administrateurs et les modÃ©rateurs ne pourront pas soumettre de formulaires. Veuillez prendre note que la valeur prÃ©dÃ©finie ci-dessous n\'est qu\'une suggestion de FluxBB.',
-'Choose the default language'	        =>	'Choisir la langue par dÃ©faut',
-'Info 15'				=>	'La langue par dÃ©faut utilisÃ©e pour les invitÃ©s et les utilisateurs qui n\'ont pas optÃ© pour une autre langue dans leur profil.',
-'Default language'			=>	'Langue par dÃ©faut',
-'Choose the default style'		=>	'Choisir le style par dÃ©faut',
-'Info 16'				=>	'Le style par dÃ©faut utilisÃ© pour les invitÃ©s et les utilisateurs qui n\'ont pas optÃ© pour un autre style dans leur profil.',
-'Default style'				=>	'Style par dÃ©faut',
-'Start install'				=>	'DÃ©marrage de l\'installation',
-'DB type not valid'			=>	'Â«&#160;%s&#160;Â» n\'est pas un type de base de donnÃ©es valide',
-'Table prefix error'			=>	'Le prÃ©fixe de table Â«&#160;%s&#160;Â» comporte des cacactÃšres interdits ou est trop long. Le prÃ©fixe peut contenir les lettres de a Ã  z, tout nombre et le caractÃšre de soulignement (underscore). Mais il ne doit pas commencer par un nombre. La taille maximale est de 40 caractÃšres. Veuillez choisir un autre prÃ©fixe.',
-'Prefix reserved'			=>	'Le prÃ©fixe de table Â«&#160;sqlite_&#160;Â» est rÃ©servÃ© pour Ãªtre utilisÃ© par le moteur SQLite. Veuillez choisir un autre prÃ©fixe.',
-'Existing table error'			=>	'Une table nommÃ©e Â«&#160;%susers&#160;Â» est dÃ©jÃ  prÃ©sente dans la base de donnÃ©es Â«&#160;%s&#160;Â». Cela pourrait signifier que FluxBB est dÃ©jÃ  installÃ© ou qu\'une autre application utilise le nom d\'une ou plusieures tables nÃ©cessaires Ã  FluxBB. Si vous souhaitez installer plusieurs copies de FluxBB dans la mÃªme base de donnÃ©es, vous devez choisir un prÃ©fixe de table diffÃ©rent.',
-'InnoDB off'				=>	'InnoDB semble ne pas Ãªtre activÃ©. Veuillez choisir une base de donnÃ©es qui ne prend pas en charge InnoDB ou activez InnoDB sur votre serveur MySQL.',
-'Administrators'			=>	'Administrateurs',
-'Administrator'				=>	'Administrateur',
-'Moderators'				=>	'ModÃ©rateurs',
-'Moderator'				=>	'ModÃ©rateur',
-'Guests'                                =>      'InvitÃ©s',
-'Guest'					=>	'InvitÃ©',
-'New member'				=>	'Nouveau membre',
-'Members'                               =>      'Membres',
-'Member'				=>	'Membre',
-'Announcement'				=>	'Indiquer votre annonce ici.',
-'Rules'					=>	'Indiquer vos rÃšgles ici',
-'Maintenance message'			=>	'Les forums sont temporairement inaccessibles pour maintenance. Veuillez essayer Ã  nouveau dans quelques minutes.',
-'Test post'				=>	'Message de test',
-'Message'				=>	'Si vous lisez ceci (ce que vous faites probablement), l\'installation de FluxBB semble avoir fonctionnÃ© ! A prÃ©sent, identifiez-vous et rendez-vous au panneau d\'administration pour paramÃ©trer vos forums.',
-'Test category'				=>	'CatÃ©gorie de test',
-'Test forum'				=>	'Forum de test',
-'This is just a test forum'		=>	'Ceci n\'est qu\'un forum de test.',
-'Alert cache'				=>	'<strong>Le rÃ©pertoire cache n\'est pas modifiable actuellement !</strong> Pour que FluxBB fonctionne correctement, le rÃ©pertoire nommÃ© <em>%s</em> doit Ãªtre modifiable par PHP. Utilisez chmod pour spÃ©cifier les permissions appropriÃ©es au rÃ©pertoire. Si vous avez un doute, passez le chmod Ã  0777.',
-'Alert avatar'				=>	'<strong>Le rÃ©pertoire avatar n\'est pas modifiable actuellement !</strong> Si vous souhaitez que les utilisateurs puissent envoyer vers le serveur leur propre image avatar, vous devez vÃ©rifier que le rÃ©pertoire nommÃ© <em>%s</em> soit modifiable par PHP. Vous pourrez plus tard choisir d\'enregistrer les images avatar dans un autre rÃ©pertoire (rendez-vous Ã  Admin/Options). Utilisez chmod pour spÃ©cifier les permissions appropriÃ©es au rÃ©pertoire. Si vous avez un doute, passez le chmod Ã  0777.',
-'Alert upload'				=>	'<strong>L\'envoi de fichier semble Ãªtre interdit sur ce serveur !</strong> Si vous souhaitez que les utilisateurs puissent envoyer leur propre image avatar vous devez activer le paramÃštre de configuration file_uploads dans PHP. Une fois que l\'envoi (upload) de fichiers a Ã©tÃ© activÃ©, l\'envoi d\'avatars peut Ãªtre activÃ© dans Administration/Options/FonctionnalitÃ©s.',
-'FluxBB has been installed'		=>	'FluxBB a Ã©tÃ© installÃ©. Pour finaliser l\'installation veuillez suivre les instructions ci-dessous.',
-'Final instructions'			=>	'Instructions finales',
-'Info 17'				=>	'Pour finaliser l\'installation, vous devez cliquer sur le bouton ci-dessous afin de tÃ©lÃ©charger un fichier nommÃ© config.php. Vous devrez ensuite envoyer ce fichier vers le rÃ©pertoire racine de votre installation FluxBB.',
-'Info 18'				=>	'Une fois que vous aurez envoyÃ© config.php vers le serveur, FluxBB sera complÃštement installÃ© ! A ce moment-lÃ  vous pourrez <a href="index.php">vous rendre Ã  la page d\'accueil des forums</a>.',
-'Download config.php file'		=>	'TÃ©lÃ©charger le fichier config.php',
-'FluxBB fully installed'		=>	'FluxBB a Ã©tÃ© complÃštement installÃ© ! Vous pouvez Ã  prÃ©sent <a href="index.php">vous rendre Ã  la page d\'accueil des forums</a>.',
-
-);
Index: /trunk/web/punbb/lang/French/login.php
===================================================================
--- /trunk/web/punbb/lang/French/login.php	(revision 10)
+++ /trunk/web/punbb/lang/French/login.php	(revision 1)
@@ -5,22 +5,18 @@
  
 // Miscellaneous
-'Wrong user/pass'		=>	'Nom d\'utilisateur et/ou mot de passe incorrect.',
+'Wrong user/pass'		=>	'Identifiant et/ou mot de passe incorrect.',
 'Forgotten pass'		=>	'Mot de passe oubliÃ©&#160;?',
-'Login redirect'		=>	'Vous Ãªtes Ã  prÃ©sent identifiÃ©(e). Redirection&#160;âŠ',
-'Logout redirect'		=>	'Vous Ãªtes Ã  prÃ©sent dÃ©connectÃ©(e). Redirection&#160;âŠ',
-'No email match'		=>	'Aucun utilisateur inscrit n\'utilise cette adresse Ã©lectronique',
+'Login redirect'		=>	'Vous Ãªtes maintenant identifiÃ©. Redirection ...',
+'Logout redirect'		=>	'Vous Ãªtes maintenant dÃ©connectÃ©. Redirection ...',
+'No e-mail match'		=>	'Il n`y a pas d\'utilisateur inscrit avec l\'adresse e-mail',
 'Request pass'			=>	'Demande de mot de passe',
-'Request pass legend'		=>	'Indiquez l\'adresse Ã©lectronique utilisÃ©e lors de l\'inscription',
-'Request pass info'		=>	'Un nouveau mot de passe ainsi que le lien pour activer ce nouveau mot de passe vont Ãªtre envoyÃ©s Ã  cette adresse.',
-'Not registered'		=>	'Pas encore inscrit&#160;?',
-'Login legend'			=>	'Indiquez ci-dessous votre nom d\'utilisateur et votre mot de passe',
-'Remember me'			=>	'Me connecter automatiquement lors de mes prochaines visites.',
-'Login info'			=>	'Si vous n\'Ãªtes pas encore inscrit(e) ou si vous avez oubliÃ© votre mot de passe, veuillez cliquer sur le lien appropriÃ© ci-dessous.',
-'New password errors'		=>	'Erreur pour demande de mot de passe',
-'New passworderrors info'	=>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es avant qu\'un nouveau mot de passe puisse Ãªtre envoyÃ©&#160;:',
-
+'Request pass legend'	=>	'Saisissez l\'adresse e-mail avec laquelle vous vous Ãªtes inscrits',
+'Request pass info'		=>	'Un nouveau mot de passe ainsi que le lien pour activer ce nouveau mot de passe vont Ãªtre envoyÃ©s Ã  cette adresse e-mail.',
+'Not registered'		=>	'Toujours pas inscrit&#160;?',
+'Login legend'			=>	'Saisissez ci-dessous votre nom d\'utilisateur et votre mot de passe',
+'Login info'			=>	'Si vous ne vous Ãªtes jamais inscrits  ou si vous avez oubliÃ© votre mot de passe, veuillez cliquer ci-dessous sur le lien appropriÃ©.',
+ 
 // Forget password mail stuff
-'Forget mail'			=>	'Un e-mail contenant des instructions pour modifier votre mot de passe vient d\'Ãªtre envoyÃ© Ã  l\'adresse indiquÃ©e. Si vous ne le recevez pas, vous pouvez contacter l\'administrateur des forums&#160;: ',
-'Email flood'			=>	'Une rÃ©initialisation du mot de passe de ce compte a Ã©tÃ© effectuÃ©e il y a moins d\'une heure. Veuillez patienter un moment avant de rÃ©clamer un nouveau mot de passe.'
-
+'Forget mail'			=>	'Un e-mail avec les instructions pour changer de mot de passe vient d\'Ãªtre envoyÃ© Ã  l\'adresse indiquÃ©e. Si vous ne le recevez pas, vous pouvez contacter l\'administrateur des forums Ã '
+ 
 );
Index: /trunk/web/punbb/lang/French/mail_templates/activate_email.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/activate_email.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/activate_email.tpl	(revision 1)
@@ -1,12 +1,12 @@
-Subject: Demande de changement d'adresse Ã©lectronique
+Subject: Demande de changement d'adresse e-mail
 
 Bonjour <username>,
 
-Vous avez demandÃ© un changement d'adresse Ã©lectronique associÃ©e Ã  votre compte sur les forums de <base_url>. Si vous n'en avez pas fait la demande ou ne souhaitez finalement pas la modifier, veuillez ignorer ce message. Elle ne sera changÃ© que si vous vous rendez Ã  la page d'activation ci-dessous. Pour que cette activation soit effective, vous devez Ãªtre identifiÃ© sur les forums.
+Vous avez fait la demande d'avoir une nouvelle adresse e-mail assignÃ©e Ã  votre compte sur le forum de <base_url>. Si vous n'en avez pas fait la demande ou ne voulez pas en changer, veuillez ignorer ce message. Votre e-mail ne sera changÃ© que si vous visitez la page d'activation ci-dessous. Pour que la page d'activation fonctionne, vous devez Ãªtre identifiÃ© sur le forum.
 
-Afin de changer votre adresse Ã©lectronique, merci de vous rendre Ã  la page suivante :
+Pour changer votre adresse e-mail, merci de visiter la page suivante:
 <activation_url>
 
 -- 
 <board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
+(Ne pas rÃ©pondre a ce message)
Index: /trunk/web/punbb/lang/French/mail_templates/activate_password.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/activate_password.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/activate_password.tpl	(revision 1)
@@ -3,13 +3,12 @@
 Bonjour <username>,
 
-Vous avez demandÃ© un nouveau mot de passe associÃ© Ã  votre compte sur les forums de <base_url>. Si vous n'en avez pas fait la demande ou ne souhaitez finalement pas le modifier, veuillez ignorer ce message. Il ne sera changÃ© que si vous vous rendez Ã  la page d'activation ci-dessous. 
-=======================================================================
+Vous avez fait la demande d'avoir un nouveau mot de passe assignÃ© Ã  votre compte sur le forum de <base_url>. Si vous n'en avez pas fait la demande ou ne voulez pas en changer, veuillez ignorer ce message. Votre mot de passe ne sera changÃ© qui si vous visitez la page d'activation ci-dessous. 
+
 Votre nouveau mot de passe est : <new_password>
-=======================================================================
 
-Afin de modifier votre mot de passe, merci de vous rendre Ã  la page suivante :
+Pour changer votre mot de passe, merci de visiter la page suivante:
 <activation_url>
 
 -- 
 <board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
+(Ne pas rÃ©pondre a ce message)
Index: unk/web/punbb/lang/French/mail_templates/banned_email_change.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/banned_email_change.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - e-mail bannie dÃ©tectÃ©e
-
-L'utilisateur Â« <username> Â» a modifiÃ© son e-mail pour l'adresse e-mail bannie suivante : <email>
-
-Profil utilisateur : <profile_url>
-
--- 
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/banned_email_post.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/banned_email_post.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - e-mail bannie dÃ©tectÃ©e
-
-L'utilisateur Â« <username> Â» a publiÃ© un messsage en utilisant l'adresse e-mail bannie suivante : <email>
-
-URL du message : <post_url>
-
--- 
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/banned_email_register.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/banned_email_register.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - e-mail bannie dÃ©tectÃ©e
-
-L'utilisateur Â« <username> Â» s'est inscrit avec l'adresse e-mail bannie suivante : <email>
-
-Profil utilisateur : <profile_url>
-
--- 
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/dupe_email_change.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/dupe_email_change.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - e-mail en doublon dÃ©tectÃ©e
-
-L'utilisateur Â« <username> Â» a modifiÃ© son e-mail pour l'adresse e-mail appartenant Ã©galement Ã  : <dupe_list>
-
-Profil utilisateur : <profile_url>
-
--- 
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/dupe_email_register.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/dupe_email_register.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - e-mail en doublon dÃ©tectÃ©e
-
-L'utilisateur Â« <username> Â» s'est inscrit avec l'adresse e-mail appartenant Ã©galement Ã  : <dupe_list>
-
-Profil utilisateur : <profile_url>
-
--- 
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: /trunk/web/punbb/lang/French/mail_templates/form_email.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/form_email.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/form_email.tpl	(revision 1)
@@ -1,12 +1,12 @@
 Subject: <mail_subject>
 
-<sender> vous a envoyÃ© un message Ã  partir de <board_title>. Vous pouvez rÃ©pondre Ã  <sender> en rÃ©pondant Ã  cet e-mail.
+<sender> de <board_title> vous a envoyÃ© un message. Vous pouvez rÃ©pondre Ã  <sender> en rÃ©pondant Ã  cet e-mail.
 
-Contenu du message :
-=======================================================================
+Contenu du message:
+-----------------------------------------------------------------------
 
 <mail_message>
 
-=======================================================================
+-----------------------------------------------------------------------
 
 -- 
Index: /trunk/web/punbb/lang/French/mail_templates/index.html
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/index.html	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/lang/French/mail_templates/new_reply.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_reply.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/new_reply.tpl	(revision 1)
@@ -1,11 +1,11 @@
-Subject: RÃ©ponse Ã  la discussion Â« <topic_subject> Â»
+Subject: RÃ©ponse Ã  la discussion : <topic_subject>
 
-<replier> a rÃ©pondu Ã  la discussion Â« <topic_subject> Â» que vous suivez. Il se peut qu'il y ait davantage de nouvelles rÃ©ponses, mais ce sera la seule notification tant que vous ne vous serez pas rendu(e) Ã  nouveau aux forums.
+<replier> a rÃ©pondu Ã  la discussion <topic_subject> Ã  laquelle vous avez souscrit. Il se peut qu'il y ait plus de nouvelles rÃ©ponses, mais ce sera la seule notification d'ici Ã  ce que vous vous reconnectiez sur le forum.
 
-Le message est situÃ© ici : <post_url>
+Le message est situÃ© <post_url>
 
-Vous pouvez interrompre le suivi de cette discussion en cliquant ici : <unsubscribe_url>
+Vous pouvez vous dÃ©sabonner ici <unsubscribe_url>
 
 -- 
 <board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
+(Ne pas rÃ©pondre a ce message)
Index: /trunk/web/punbb/lang/French/mail_templates/new_reply_full.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_reply_full.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/new_reply_full.tpl	(revision 1)
@@ -1,18 +1,18 @@
-Subject: RÃ©ponse Ã  la discussion Â« <topic_subject> Â»
+Subject: RÃ©ponse Ã  la discussion: <topic_subject>
 
-<replier> a rÃ©pondu Ã  la discussion Â« <topic_subject> Â» que vous suivez. Il se peut qu'il y ait davantage de nouvelles rÃ©ponses, mais ce sera la seule notification tant que vous ne vous serez pas rendu(e) Ã  nouveau aux forums.
+<replier> a rÃ©pondu Ã  la discussion <topic_subject> Ã  laquelle vous avez souscrit. Il se peut qu'il y ait plus de nouvelles rÃ©ponses, mais ce sera la seule notification d'ici Ã  ce que vous vous reconnectiez sur le forum.
 
-Contenu du message :
-=======================================================================
+Contenu du message:
+-----------------------------------------------------------------------
 
 <message>
 
-=======================================================================
+-----------------------------------------------------------------------
 
-Le message est situÃ© ici : <post_url>
+Le message est situÃ© <post_url>
 
-Vous pouvez interrompre le suivi de cette discussion en cliquant ici : <unsubscribe_url>
+Vous pouvez vous dÃ©sabonner ici <unsubscribe_url>
 
 -- 
 <board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
+(Ne pas rÃ©pondre a ce message)
Index: unk/web/punbb/lang/French/mail_templates/new_report.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_report.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Signalement(<forum_id>) - Â« <topic_subject> Â»
-
-L'utilisateur Â« <username> Â» a signalÃ© le message suivant : <post_url>
-
-Motif : <reason>
-
---
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/new_topic.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_topic.tpl	(revision 10)
+++ 	(revision )
@@ -1,11 +1,0 @@
-Subject: Nouvelle discussion dans le forum Â« <forum_name> Â»
-
-<poster> a lancÃ© une nouvelle discussion intitulÃ©e Â« <topic_subject> Â» dans le forum Â« <forum_name> Â» que vous suivez.
-
-La discussion se trouve ici : <topic_url>
-
-Vous pouvez interrompre le suivi en cliquant ici : <unsubscribe_url>
-
---
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/new_topic_full.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_topic_full.tpl	(revision 10)
+++ 	(revision )
@@ -1,18 +1,0 @@
-Subject: Nouvelle discussion dans le forum Â« <forum_name> Â»
-
-<poster> a lancÃ© une nouvelle discussion intitulÃ©e Â« <topic_subject> Â» dans le forum Â« <forum_name> Â» que vous suivez.
-
-Contenu du message :
-=======================================================================
-
-<message>
-
-=======================================================================
-
-La discussion se trouve ici : <topic_url>
-
-Vous pouvez interrompre le suivi en cliquant ici : <unsubscribe_url>
-
---
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/new_user.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/new_user.tpl	(revision 10)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Subject: Avertissement - nouvelle inscription
-
-L'utilisateur Â« <username> Â» s'est inscrit dans les forums de <base_url>
-
-Profil utilisateur : <profile_url>
-
---
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: unk/web/punbb/lang/French/mail_templates/rename.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/rename.tpl	(revision 10)
+++ 	(revision )
@@ -1,12 +1,0 @@
-Subject: Compte utilisateur renommÃ©
-
-Lors d'une mise Ã  jour des forums sur <base_url> il a Ã©tÃ© dÃ©terminÃ© que votre nom d'utilisateur est trop proche d'un autre existant dÃ©jÃ . Il a donc Ã©tÃ© modifiÃ© de la maniÃšre suivante.
-
-Ancien nom d'utilisateur : <old_username>
-Nouveau nom d'utilisateur : <new_username>
-
-Nous vous prions de nous excuser pour les dÃ©sagrÃ©ments causÃ©s.
-
---
-<board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
Index: /trunk/web/punbb/lang/French/mail_templates/welcome.tpl
===================================================================
--- /trunk/web/punbb/lang/French/mail_templates/welcome.tpl	(revision 10)
+++ /trunk/web/punbb/lang/French/mail_templates/welcome.tpl	(revision 1)
@@ -1,13 +1,12 @@
 Subject: Bienvenue sur <board_title> !
 
-Merci de vous Ãªtre inscrit(e) sur <base_url>. Voici les informations concernant votre compte :
-=======================================================================
+Merci de vous Ãªtre inscrit sur les forums <base_url>. Les dÃ©tails de votre compte sont :
+
 Nom d'utilisateur : <username>
 Mot de passe      : <password>
-=======================================================================
 
-Veuillez vous rendre Ã  <login_url> pour activer votre compte.
+Allez Ã  <login_url> pour activer votre compte.
 
 -- 
 <board_mailer>
-(Veuillez ne pas rÃ©pondre Ã  ce message. Merci !)
+(Ne pas rÃ©pondre a ce message)
Index: /trunk/web/punbb/lang/French/misc.php
===================================================================
--- /trunk/web/punbb/lang/French/misc.php	(revision 10)
+++ /trunk/web/punbb/lang/French/misc.php	(revision 1)
@@ -4,90 +4,64 @@
 $lang_misc = array(
  
-'Mark read redirect'    	=>	'Toutes les discussions et forums ont Ã©tÃ© marquÃ©s comme lus. Redirection&#160;âŠ',
-'Mark forum read redirect'	=>	'Toutes les discussions du forum spÃ©cifiÃ© ont Ã©tÃ© marquÃ©es comme lues. Redirection&#160;âŠ',
-
+'Mark read redirect'    	=>	'Tous les messages et forums ont Ã©tÃ© marquÃ©s comme lus. Redirection ...',
+ 
 // Send e-mail
-'Form email disabled'		=>	'L\'utilisateur Ã  qui vous essayez d\'envoyer un e-mail a dÃ©sactivÃ© le formulaire e-mail.',
-'No email subject'		=>	'Vous devez indiquer un sujet.',
-'No email message'		=>	'Vous devez saisir un message.',
-'Too long email message'	=>	'Les messages ne peuvent contenir plus de 65535 caractÃšres (64 Kio).',
-'Email flood'			=>	'L\'intervalle d\'envoi consÃ©cutif d\'e-mails est de %s secondes. Veuillez patienter un moment avant de tenter d\'envoyer Ã  nouveau.',
-'Email sent redirect'		=>	'E-mail envoyÃ©. Redirection&#160;âŠ',
-'Send email to'			=>	'Envoyer un e-mail Ã ',
-'Email subject'			=>	'Sujet',
-'Email message'			=>	'Message',
-'Email disclosure note'		=>	'Veuillez prendre note qu\'en utilisant ce formulaire, vous divulguerez votre adresse Ã©lectronique au destinataire.',
-'Write email'			=>	'Composez et envoyez votre e-mail',
+'Form e-mail disabled'		=>	'L\'utilisateur Ã  qui vous essayez d\'envoyer un e-mail a dÃ©sactivÃ© le formulaire e-mail.',
+'No e-mail subject'			=>	'Vous devez saisir un sujet.',
+'No e-mail message'			=>	'Vous devez saisir un message.',
+'Too long e-mail message'	=>	'Les messages ne peuvent excÃ©der 65535 caractÃšres de long (64 ko).',
+'E-mail sent redirect'		=>	'E-mail envoyÃ©. Redirection ...',
+'Send e-mail to'			=>	'Envoyer un e-mail Ã ',
+'E-mail subject'			=>	'Sujet',
+'E-mail message'			=>	'Message',
+'E-mail disclosure note'	=>	'Veuillez noter qu\'en utilisant ce formulaire, votre adresse e-mail sera rÃ©vÃ©lÃ©e au destinataire.',
+'Write e-mail'				=>	'Ãcrivez et envoyez votre e-mail',
  
 // Report
-'No reason'			=>	'Vous devez indiquer un motif.',
-'Reason too long'		=>	'Votre message ne doit pas dÃ©passer 65535 octets (~64 Kio).',
-'Report flood'			=>	'L\'intervalle d\'envoi consÃ©cutif de signalements est de %s secondes. Veuillez patienter un moment avant de tenter d\'envoyer Ã  nouveau.',
-'Report redirect'		=>	'Message signalÃ©. RedirectionâŠ',
-'Report post'			=>	'Signaler un message',
-'Reason'			=>	'Motif',
-'Reason desc'			=>	'Indiquez la raison pour laquelle vous signalez ce message.',
+'No reason'					=>	'Vous devez saisir un motif.',
+'Report redirect'			=>	'Signalement envoyÃ©. Redirection ...',
+'Report post'				=>	'Signaler un message',
+'Reason'					=>	'Motif',
+'Reason desc'				=>	'Saisissez le motif du signalement de ce message.',
  
 // Subscriptions
-'Already subscribed topic'      =>      'Vous suivez dÃ©jÃ  cette discussion.',
-'Already subscribed forum'      =>      'Vous suivez dÃ©jÃ  ce forum.',
-'Subscribe redirect'		=>	'Votre demande de suivi a Ã©tÃ© prise en compte. Redirection&#160;âŠ',
-'Not subscribed topic'		=>	'Vous ne suivez pas cette discussion.',
-'Not subscribed forum'		=>	'Vous ne suivez pas ce forum.',
-'Unsubscribe redirect'		=>	'Vous ne suivez plus cette discussion. Redirection&#160;âŠ',
+'Already subscribed'		=>	'Vous Ãªtes dÃ©jÃ  abonnÃ© Ã  cette discussion.',
+'Subscribe redirect'		=>	'Votre abonnement a Ã©tÃ© pris en compte. Redirection ...',
+'Not subscribed'			=>	'Vous n\'Ãªtes pas abonnÃ© Ã  cette discussion.',
+'Unsubscribe redirect'		=>	'Votre abonnement a Ã©tÃ© annulÃ©. Redirection ...',
  
 // General forum and topic moderation
-'Moderate'			=>	'ModÃ©rer',
-'Select'			=>	'SÃ©lectionner',  // the header of a column of checkboxes
-'Move'				=>	'DÃ©placer',
-'Split'				=>	'Scinder',
-'Delete'			=>	'Supprimer',
-'Merge'				=>	'Fusionner',
-
+'Moderate'					=>	'ModÃ©rer',
+'Select'					=>	'SÃ©lectionner',  // the header of a column of checkboxes
+'Move'						=>	'DÃ©placer',
+'Delete'					=>	'Supprimer',
+ 
 // Moderate forum
-'Open'				=>	'Ouvrir',
-'Close'				=>	'Fermer',
-'Move topic'			=>	'DÃ©placer la discussion',
-'Move topics'			=>	'DÃ©placer les discussions',
-'Move legend'			=>	'Choisissez une destination',
-'Move to'			=>	'DÃ©placer vers',
-'Nowhere to move'		=>	'Aucun forum n\'est disponible pour y dÃ©placer des discussions.',
-'Leave redirect'		=>	'Laisser un lien de redirection',
-'Move topic redirect'		=>	'Discussion dÃ©placÃ©e. Redirection&#160;âŠ',
-'Move topics redirect'		=>	'Discussions dÃ©placÃ©es. Redirection&#160;âŠ',
+'Open'						=>	'Ouvrir',
+'Close'						=>	'Fermer',
+'Move topic'				=>	'DÃ©placer la discussion',
+'Move topics'				=>	'DÃ©placer les discussions',
+'Move legend'				=>	'Choisissez une destination',
+'Move to'					=>	'DÃ©placer vers',
+'Leave redirect'			=>	'Laisser un lien de redirection',
+'Move topic redirect'		=>	'Discussion dÃ©placÃ©e. Redirection ...',
+'Move topics redirect'		=>	'Discussions dÃ©placÃ©es. Redirection ...',
 'Confirm delete legend'		=>	'Veuillez confirmer la suppression',
-'Delete topics'			=>	'Supprimer des discussions',
-'Delete topics comply'		=>	'Souhaitez-vous vraiment supprimer les discussions sÃ©lectionnÃ©es&#160;?',
-'Delete topics redirect'	=>	'Discussions supprimÃ©es. Redirection&#160;âŠ',
-'Open topic redirect'       	=>  	'Discussion ouverte. Redirection&#160;âŠ',
-'Open topics redirect'     	=>  	'Discussions ouvertes. Redirection&#160;âŠ',
-'Close topic redirect'		=>	'Discussion fermÃ©e. Redirection&#160;âŠ',
-'Close topics redirect'		=>	'Discussions fermÃ©es. Redirection&#160;âŠ',
-'No topics selected'		=>	'Vous devez choisir au moins une discussion Ã  dÃ©placer/supprimer/ouvrir/fermer.',
-'Not enough topics selected'	=>	'Vous devez sÃ©lectionner au moins 2 discussions pour une fusion.',
-'Stick topic redirect'		=>	'Discussion Ã©pinglÃ©e. Redirection&#160;âŠ',
-'Unstick topic redirect'	=>	'Discussion dÃ©tachÃ©e. Redirection&#160;âŠ',
-'Merge topics'			=>	'Fusionner les discussions',
-'Merge topics redirect'		=>	'Discussions fusionnÃ©es. Redirection&#160;âŠ',
-'Confirm merge legend'		=>	'Veuillez confirmer la fusion',
-'New subject'			=>	'Nouveau sujet',
-
-// Split multiple posts in topic
-'Confirm split legend'		=>	'Veuillez confirmer la scission des messages sÃ©lectionnÃ©s et choisir leur destination pour dÃ©placement.',
-'Split posts'			=>	'Scinder les messages',
-'Split posts comply'		=>	'Souhaitez-vous vraiment scinder les messages sÃ©lectionnÃ©s&#160;?',
-'Split posts redirect'		=>	'Les messages ont Ã©tÃ© scindÃ©s. Redirection&#160;âŠ',
-
+'Delete topics'				=>	'Supprimer des discussions',
+'Delete topics comply'		=>	'Ãtes-vous sÃ»r de vouloir supprimer les discussions sÃ©lectionnÃ©es&#160;?',
+'Delete topics redirect'	=>	'Discussions supprimÃ©es. Redirection ...',
+'Open topic redirect'       =>  'Discussion ouverte. Redirection ...',
+'Open topics redirect'      =>  'Discussions ouvertes. Redirection ...',
+'Close topic redirect'		=>	'Discussion fermÃ©e. Redirection ...',
+'Close topics redirect'		=>	'Discussions fermÃ©es. Redirection ...',
+'No topics selected'		=>	'Vous devez choisir au moins une discussion Ã  DÃ©placer/Supprimer/Ouvrir/Fermer.',
+'Stick topic redirect'		=>	'Discussion Ã©pinglÃ©e. Redirection ...',
+'Unstick topic redirect'	=>	'Discussion dÃ©tachÃ©e. Redirection ...',
+ 
 // Delete multiple posts in topic
-'Delete posts'			=>	'Supprimer les messages',
-'Cannot select first'		=>	'Le premier message ne peut pas Ãªtre sÃ©lectionnÃ© pour Ãªtre scindÃ©/supprimÃ©.',
-'Delete posts comply'		=>	'Souhaitez-vous vraiment supprimer les messages sÃ©lectionnÃ©s&#160;?',
-'Delete posts redirect'		=>	'Messages supprimÃ©s. Redirection&#160;âŠ',
-'No posts selected'		=>	'Vous devez choisir au moins un message Ã  scinder/supprimer.',
-
-// Get host
-'Host info 1'			=>	'L\'adresse IP est&#160;: %s',
-'Host info 2'			=>	'Le nom d\'hÃŽte est&#160;: %s',
-'Show more users'		=>	'Afficher davantage d\'utilisateurs pour cette IP',
+'Delete posts'				=>	'Supprimer les messages',
+'Delete posts comply'		=>	'Ãtes vous sÃ»r de vouloir supprimer les messages sÃ©lectionnÃ©s&#160;?',
+'Delete posts redirect'		=>	'Messages supprimÃ©s. Redirection ...',
+'No posts selected'			=>	'Vous devez choisir au moins un message Ã  supprimer.'
  
 );
Index: /trunk/web/punbb/lang/French/post.php
===================================================================
--- /trunk/web/punbb/lang/French/post.php	(revision 10)
+++ /trunk/web/punbb/lang/French/post.php	(revision 1)
@@ -5,35 +5,29 @@
  
 // Post validation stuff (many are similiar to those in edit.php)
-'No subject'			=>	'Vous devez indiquer un sujet.',
-'No subject after censoring'    =>      'Les discussions doivent comporter un sujet. AprÃšs application des filtres de censure, le sujet n\'est pas indiquÃ©.',
+'No subject'			=>	'Vous devez saisir un sujet.',
 'Too long subject'		=>	'Le sujet ne peut contenir plus de 70 caractÃšres.',
 'No message'			=>	'Vous devez saisir un message.',
-'No message after censoring'    =>      'Vous devez saisir un message. AprÃšs application des filtres de censure, votre message est vide.',
-'Too long message'		=>	'Les messages ne peuvent contenir plus de %s octets.',
-'All caps subject'  		=>  	'Il n\'est pas autorisÃ© d\'Ã©crire un sujet entiÃšrement en lettres capitales.',
-'All caps message'  		=>  	'Il n\'est pas autorisÃ© d\'Ã©crire un message entiÃšrement en lettres capitales.',
-'Empty after strip'	        =>	'Il semblerait que votre message ne comporte que des balises BBCode vides. Il est possible que cela se soit passÃ© par exemple parce que la citation imbriquÃ©e la plus ancienne a Ã©tÃ© supprimÃ© pour cause de niveau d\'imbrication de citations supÃ©rieur Ã  celui autorisÃ©.',
-
+'Too long message'		=>	'Les messages ne peuvent excÃ©der 65535 caractÃšres de long (64 ko).',
+ 
 // Posting
-'Post errors'			=>	'Erreurs dans le message',
+'Post errors'			=>	'Erreurs',
 'Post errors info'		=>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es pour que le message puisse Ãªtre envoyÃ©&#160;:',
 'Post preview'			=>	'PrÃ©visualisation du message',
 'Guest name'			=>	'Nom',	// For guests (instead of Username)
-'Post redirect'			=>	'Message envoyÃ©. Redirection&#160;âŠ',
-'Post a reply'			=>	'RÃ©pondre',
-'Post new topic'		=>	'Nouvelle discussion',
-'Hide smilies'			=>	'Ne pas convertir les Ã©moticÃŽnes dans ce message',
-'Subscribe'			=>	'Suivre cette discussion',
-'Stay subscribed'   		=>  	'Continuer Ã  suivre cette discussion',
+'Post redirect'			=>	'Message envoyÃ©. Redirection ...',
+'Post a reply'			=>	'Ãcrire une rÃ©ponse',
+'Post new topic'		=>	'Lancer une nouvelle discussion',
+'Hide smilies'			=>	'Ne pas convertir les Ã©moticÃŽnes sur ce message',
+'Subscribe'				=>	'S\'abonner Ã  cette discussion',
 'Topic review'			=>	'RÃ©sumÃ© de la discussion (messages les plus rÃ©cents en premier)',
 'Flood start'			=>	'Au moins',
-'flood end'			=>	'secondes doivent s\'Ã©couler entre deux messages. Veuillez patienter quelques instants avant d\'essayer Ã  nouveau.',
-'Preview'			=>	'PrÃ©visualisation',	// submit button to preview message
+'flood end'				=>	'secondes doivent s\'Ã©couler entre deux messages. Merci de patienter quelques instants et essayer Ã  nouveau.',
+'Preview'				=>	'PrÃ©visualisation',	// submit button to preview message
  
 // Edit post
-'Edit post legend'		=>	'Modifier le message et valider les modifications',
-'Silent edit'			=>	'Modification anonyme (la mention Â«&#160;DerniÃšre modification parâŠ&#160;Â» ne s\'affichera pas)',
-'Edit post'			=>	'Modifier le message',
-'Edit redirect'			=>	'Message mis Ã  jour. Redirection&#160;âŠ'
+'Edit post legend'		=>	'Modifier le message et valider les changements',
+'Silent edit'			=>	'Modification invisible (la mention "DerniÃšre modification par ..." ne s\'affichera pas)',
+'Edit post'				=>	'Modifier le message',
+'Edit redirect'			=>	'Message mis Ã  jour. Redirection ...'
  
 );
Index: /trunk/web/punbb/lang/French/prof_reg.php
===================================================================
--- /trunk/web/punbb/lang/French/prof_reg.php	(revision 10)
+++ /trunk/web/punbb/lang/French/prof_reg.php	(revision 1)
@@ -4,76 +4,36 @@
 $lang_prof_reg = array(
  
-'Email legend'			=>	'Indiquez une adresse Ã©lectronique valide',
-'Email legend 2'		=>	'Saisissez et confirmez une adresse Ã©lectronique valide',
-'Localisation legend'		=>	'DÃ©finissez vos options gÃ©ographiques',
-'Time zone'			=>	'Fuseau horaire&#160;',
-'Time zone info'		=>	'Afin que le forum affiche correctement l\'heure, vous devez sÃ©lectionner votre fuseau horaire.',
-'DST'				=>	'Ajustement pour l\'heure d\'Ã©tÃ©&#160;: cochez cette case si nÃ©cessaire pour que les forums affichent correctement l\'heure.',
-'Time format'			=>	'Format de l\'heure',
-'Date format'			=>	'Format de la date',
-'Default'			=>	'Par dÃ©faut',
-'Language'			=>	'Langue&#160;',
-'Email setting info'		=>	'Indiquez si vous souhaitez que votre adresse Ã©lectronique soit visible par les autres utilisateurs ou non et si vous voulez que les autres utilisateurs puissent vous envoyer des e-mails via ces forums (formulaire d\'envoi d\'e-mail) ou non.',
-'Email setting 1'		=>	'Divulguer votre adresse Ã©lectronique.',
-'Email setting 2'		=>	'Masquer votre adresse Ã©lectronique mais autoriser l\'envoi via le formulaire d\'envoi d\'e-mail.',
-'Email setting 3'		=>	'Masquer votre adresse Ã©lectronique et interdire l\'utilisation du formulaire d\'envoi d\'e-mail.',
-'Privacy options legend'	=>	'DÃ©finissez vos options de vie privÃ©e',
-'Confirm pass'			=>	'Confirmez votre mot de passe',
+'E-mail legend'				=>	'Saisissez une adresse e-mail valide',
+'E-mail legend 2'			=>	'Saisissez et confirmez une adresse e-mail valide',
+'Localisation legend'		=>	'RÃ©glez vos options gÃ©ographiques',
+'Timezone'					=>	'Fuseau horaire&#160;',
+'Timezone info'				=>	'Afin que le forum affiche correctement l\'heure, vous devez sÃ©lectionner votre fuseau horaire.',
+'Language'					=>	'Langue&#160;',
+'Language info'				=>	'Vous pouvez choisir la langue dans laquelle vous souhaitez lire les forums.',
+'E-mail setting info'		=>	'Choisissez si vous voulez que votre adresse e-mail soit visible par les autres utilisateurs ou non et si vous voulez que les autres utilisateurs puissent vous envoyer des e-mails via ces forums (formulaire e-mail) ou non.',
+'E-mail setting 1'			=>	'Afficher votre adresse e-mail.',
+'E-mail setting 2'			=>	'Cacher votre adresse e-mail mais autoriser le formulaire e-mail.',
+'E-mail setting 3'			=>	'Cacher votre adresse e-mail et interdisez le formulaire e-mail.',
+'Privacy options legend'	=>	'RÃ©glez vos options de vie privÃ©e',
+'Save user/pass'			=>	'MÃ©moriser le nom d\'utilisateur et le mot de passe entre les visites.',
+'Save user/pass info'		=>	'Cette option dÃ©finit si le forum doit vous "mÃ©moriser" entre deux visites. Si vous l\'activez, vous n\'aurez pas Ã  vous identifier Ã  chaque fois que vous visitez les forums. Vous serez automatiquement connectÃ©s. RecommandÃ©.',
+'Confirm pass'				=>	'Confirmez votre mot de passe',
  
-'Username too short'		=>	'Les noms d\'utilisateur doivent comporter au moins 2 caractÃšres. Veuillez choisir un autre nom d\'utilisateur.',
-'Username too long'		=>	'Les noms d\'utilisateur ne doivent pas comporter plus de 25 caractÃšres. Veuillez choisir un autre nom d\'utilisateur.',
-'Username guest'		=>	'Le nom d\'utilisateur Â«&#160;invitÃ©&#160;Â» est rÃ©servÃ©. Veuillez choisir un autre nom d\'utilisateur.',
-'Username IP'			=>	'Les noms d\'utilisateur ne peuvent pas Ãªtre au format d\'une adresse IP. Veuillez choisir un autre nom d\'utilisateur.',
+'Username too short'		=>	'Les noms d\'utilisateur doivent Ãªtres constituÃ©s d\'au moins 2 caractÃšres. Veuillez choisir un autre nom d\'utilisateur.',
+'Username guest'			=>	'Le nom d\'utilisateur \'invitÃ©\' est rÃ©servÃ©. Veuillez choisir un autre nom d\'utilisateur.',
+'Username IP'				=>	'Les noms d\'utilisateur ne peuvent pas Ãªtres au format d\'une adresse IP. Veuillez choisir un autre nom d\'utilisateur.',
 'Username reserved chars'	=>	'Les noms d\'utilisateurs ne peuvent pas contenir les caractÃšres \', " et [ ou ]. Veuillez choisir un autre nom d\'utilisateur.',
-'Username BBCode'		=>	'Les noms d\'utilisateur ne peuvent pas contenir de balises (BBCode). Veuillez choisir un autre nom d\'utilisateur.',
-'Banned username'		=>	'Le nom d\'utilisateur que vous avez indiquÃ© est banni. Veuillez choisir un autre nom d\'utilisateur.',
-'Pass too short'		=>	'Les mots de passe doivent comporter au moins 4 caractÃšres. Veuillez choisir un autre mot de passe.',
-'Pass not match'		=>	'Les mots de passe ne coÃ¯ncident pas. Veuillez recommencer.',
-'Banned email'			=>	'L\'adresse Ã©lectronique saisie est bannie de ces forums. Veuillez en choisir une autre.',
-'Dupe email'			=>	'Cette adresse Ã©lectronique est dÃ©jÃ  utilisÃ©e. Veuillez en choisir une autre.',
-'Sig too long'			=>	'Les signatures ne peuvent pas contenir plus de %1$s caractÃšres. Veuillez raccourcir votre signature de %2$s caractÃšres.',
-'Sig too many lines'		=>	'Les signatures ne peuvent pas comporter plus de %s lignes.',
-'Bad ICQ'			=>	'Vous avez saisi un UIN ICQ invalide. Merci de corriger.',
-
-'UTC-12:00'			=>	'(UTC-12:00) Ligne de changement de date OUEST',
-'UTC-11:00'			=>	'(UTC-11:00) Niue, Samoa',
-'UTC-10:00'			=>	'(UTC-10:00) Hawaii et des Ã®les AlÃ©outiennes, Ãles Cook',
-'UTC-09:30'			=>	'(UTC-09:30) Ãles Marquises',
-'UTC-09:00'			=>	'(UTC-09:00) Alaska, Ãles Gambier',
-'UTC-08:30'			=>	'(UTC-08:30) Ãles Pitcairn',
-'UTC-08:00'			=>	'(UTC-08:00) Pacifique',
-'UTC-07:00'			=>	'(UTC-07:00) Montagnes, les Rocheuses',
-'UTC-06:00'			=>	'(UTC-06:00) Centre',
-'UTC-05:00'			=>	'(UTC-05:00) Est',
-'UTC-04:00'			=>	'(UTC-04:00) Atlantique',
-'UTC-03:30'			=>	'(UTC-03:30) Terre-Neuve',
-'UTC-03:00'			=>	'(UTC-03:00) Amazone, Centre du Groenland',
-'UTC-02:00'			=>	'(UTC-02:00) Milieu de l\'Atlantique',
-'UTC-01:00'			=>	'(UTC-01:00) AÃ§ores, Cap Vert, Groenland de l\'Est',
-'UTC'				=>	'(UTC) Europe Occidentale, Greenwich',
-'UTC+01:00'			=>	'(UTC+01:00) Europe Centrale, Afrique Occidentale',
-'UTC+02:00'			=>	'(UTC+02:00) Europe de l\'Est, Afrique Centrale',
-'UTC+03:00'			=>	'(UTC+03:00) Moscou, Afrique Orientale',
-'UTC+03:30'			=>	'(UTC+03:30) Iran',
-'UTC+04:00'			=>	'(UTC+04:00) Golf, Samara',
-'UTC+04:30'			=>	'(UTC+04:30) Afghanistan',
-'UTC+05:00'			=>	'(UTC+05:00) Pakistan, Iekaterinbourg',
-'UTC+05:30'			=>	'(UTC+05:30) Inde, Sri Lanka',
-'UTC+05:45'			=>	'(UTC+05:45) NÃ©pal',
-'UTC+06:00'			=>	'(UTC+06:00) Bangladesh, Bhutan, Novosibirsk',
-'UTC+06:30'			=>	'(UTC+06:30) Ãles Cocos, Myanmar',
-'UTC+07:00'			=>	'(UTC+07:00) Indochine, Krasnoyarsk',
-'UTC+08:00'			=>	'(UTC+08:00) Grande Chin, Australie occidentale, Irkutsk',
-'UTC+08:45'			=>	'(UTC+08:45) Australie occidentale',
-'UTC+09:00'			=>	'(UTC+09:00) Japon, CorÃ©e, Chine',
-'UTC+09:30'			=>	'(UTC+09:30) Australie MÃ©ridionale',
-'UTC+10:00'			=>	'(UTC+10:00) Australie Orientale, Vladivostok',
-'UTC+10:30'			=>	'(UTC+10:30) Ãle Lord Howe',
-'UTC+11:00'			=>	'(UTC+11:00) Ãle Salomon, Magadan',
-'UTC+11:30'			=>	'(UTC+11:30) Ãle Norfolk',
-'UTC+12:00'			=>	'(UTC+12:00) Nouvelle ZÃ©lande, Fiji, Kamchatka',
-'UTC+12:45'			=>	'(UTC+12:45) Ãles Chatham',
-'UTC+13:00'			=>	'(UTC+13:00) Tonga, Ãles Phoenix',
-'UTC+14:00'			=>	'(UTC+14:00) Ãles de la Ligne',
-
+'Username BBCode'			=>	'Les noms d\'utilisateur ne peuvent pas contenir de balises (BBCode). Veuillez choisir un autre nom d\'utilisateur.',
+'Dupe username'				=>	'Ce nom d\'utilisateur est dÃ©jÃ  utilisÃ©. Veuillez choisir un autre nom d\'utilisateur.',
+'Pass too short'			=>	'Les mots de passe doivent Ãªtres constituÃ©s d\'au moins 4 caractÃšres. Veuillez choisir un autre mot de passe.',
+'Pass not match'			=>	'Les mots de passe ne correspondent pas. Veuillez recommencer.',
+'Banned e-mail'				=>	'L\'adresse e-mail saisie est bannie de ces forums. Veuillez en choisir une autre.',
+'Dupe e-mail'				=>	'Cette adresse e-mail est dÃ©jÃ  utilisÃ©e. Veuillez en choisir une autre.',
+'Sig too long'				=>	'Les signatures ne peuvent pas contenir plus de',
+'characters'				=>	'caractÃšres',
+'Sig too many lines'		=>	'Les signatures ne peuvent pas faire plus de',
+'lines'						=>	'lignes',
+'Signature quote/code'		=>	'Les balises BBCode \'QUOTE\' et \'CODE\' ne sont pas autorisÃ©es dans les signatures. Veuillez corriger.',
+'Bad ICQ'					=>	'Vous avez saisi un UIN ICQ invalide. Merci de corriger.'
+ 
 );
Index: /trunk/web/punbb/lang/French/profile.php
===================================================================
--- /trunk/web/punbb/lang/French/profile.php	(revision 10)
+++ /trunk/web/punbb/lang/French/profile.php	(revision 1)
@@ -5,137 +5,140 @@
  
 // Navigation and sections
-'Profile menu'			=>	'Menu profil',
-'Section essentials'		=>	'Principal',
-'Section personal'		=>	'Personnel',
-'Section messaging'		=>	'Messagerie',
-'Section personality'		=>	'PersonnalitÃ©',
-'Section display'		=>	'Affichage',
-'Section privacy'		=>	'Vie privÃ©e',
-'Section admin'			=>	'Administration',
+'Profile menu'				=>	'Menu profil',
+'Section essentials'		=>	'GÃ©nÃ©ral',
+'Section personal'			=>	'Personnel',
+'Section messaging'			=>	'Messagerie',
+'Section personality'		=>	'Personnalisation',
+'Section display'			=>	'Affichage',
+'Section privacy'			=>	'Vie privÃ©e',
+'Section admin'				=>	'Administration',
  
 // Miscellaneous
 'Username and pass legend'	=>	'Nom d\'utilisateur et mot de passe',
 'Personal details legend'	=>	'Informations personnelles',
-'Contact details legend'	=>	'Informations sur les messageries instantanÃ©es',
-'User activity'			=>	'ActivitÃ© de l\'utilisateur',
-'Paginate info'			=>	'Nombres de discussions et de messages Ã  afficher par page.',
+'Contact details legend'	=>	'Informations de messageries instantanÃ©es',
+'Options display'			=>	'Options d\'affichage',
+'Options post'				=>	'Options de visualisation des messages',
+'User activity'				=>	'ActivitÃ© de l\'utilisateur',
+'Paginate info'				=>	'Nombres de discussions et de messages a afficher par page.',
  
 // Password stuff
-'Pass key bad'			=>	'La clef d\'activation du mot de passe est incorrecte ou a expirÃ©. Veuillez demander un nouveau mot de passe. Si cela ne marche pas, contactez l\'administrateur.',
-'Pass updated'			=>	'Votre mot de passe a Ã©tÃ© mis Ã  jour. Vous pouvez Ã  prÃ©sent vous identifier avec votre nouveau mot de passe.',
-'Pass updated redirect'		=>	'Mot de passe mis Ã  jour. Redirection&#160;âŠ',
-'Wrong pass'			=>	'Ancien mot de passe incorrect.',
-'Change pass'			=>	'Changer de mot de passe',
+'Pass key bad'				=>	'La clef d\'activation du mot de passe est incorrecte ou a expirÃ©. Veuillez demander Ã  nouveau un mot de passe. Si cela Ã©choue, contactez l\'administrateur',
+'Pass updated'				=>	'Votre mot de passe a Ã©tÃ© mis Ã  jour. Vous pouvez vous identifier avec votre nouveau mot de passe.',
+'Pass updated redirect'		=>	'Mot de passe mis Ã  jour. Redirection ...',
+'Wrong pass'				=>	'Ancien mot de passe incorrect.',
+'Change pass'				=>	'Changer de mot de passe',
 'Change pass legend'		=>	'Saisissez et confirmez votre mot de passe',
-'Old pass'			=>	'Ancien mot de passe',
-'New pass'			=>	'Nouveau mot de passe',
-'Confirm new pass'		=>	'Confirmez le nouveau mot de passe',
-'Pass info'			=>	'Les mots de passe doivent comporter au moins 4 caractÃšres. Ils sont sensibles Ã  la casse.',
+'Old pass'					=>	'Ancien mot de passe',
+'New pass'					=>	'Nouveau mot de passe',
+'Confirm new pass'			=>	'Confirmez le nouveau mot de passe',
  
 // E-mail stuff
-'Email key bad'			=>	'La clef d\'activation d\'adresse Ã©lectronique est incorrecte ou a expirÃ©. Veuillez demander Ã  nouveau un changement d\'adresse Ã©lectronique. Si cela Ã©choue, contactez l\'administrateur',
-'Email updated'			=>	'Votre adresse Ã©lectronique a Ã©tÃ© mise Ã  jour.',
-'Activate email sent'		=>	'Un e-mail comportant les instructions pour activer la nouvelle adresse Ã©lectronique a Ã©tÃ© envoyÃ©. S\'il n\'arrive pas, contactez l\'administrateur&#160;: ',
-'Email legend'			=>	'Saisissez la nouvelle adresse Ã©lectronique',
-'Email instructions'		=>	'Indiquez la nouvelle adresse Ã©lectronique. Un e-mail comportant un lien d\'activation y sera envoyÃ©. Vous devrez cliquer sur ce lien pour activer l\'adresse.',
-'Change email'			=>	'Changer l\'adresse Ã©lectronique',
-'New email'			=>	'Nouvelle adresse Ã©lectronique',
+'E-mail key bad'			=>	'La clef d\'activation d\'adresse e-mail est incorrecte ou a expir&eacute. Veuillez demander Ã  nouveau un changement d\'adresse e-mail. Si cela Ã©choue, contactez l\'administrateur',
+'E-mail updated'			=>	'Votre adresse e-mail a Ã©tÃ© mise Ã  jour.',
+'Activate e-mail sent'		=>	'Un e-mail a Ã©tÃ© envoyÃ© avec les instructions pour activer la nouvelle adresse e-mail. S\'il n\'arrive pas, contactez l\'administrateur Ã ',
+'E-mail legend'				=>	'Saisissez la nouvelle adresse e-mail',
+'E-mail instructions'		=>	'Entrez la nouvelle adresse e-mail. Un e-mail y sera envoyÃ© avec un lien d\'activation. Vous devrez cliquer sur ce lien pour activer l\'adresse.',
+'Change e-mail'				=>	'Changer l\'adresse e-mail',
+'New e-mail'				=>	'Nouvelle adresse e-mail',
  
 // Avatar upload stuff
-'Avatars disabled'		=>	'La prise en charge des avatars est dÃ©sactivÃ©e.',
-'Too large ini'			=>	'Fichier trop volumineux. Le serveur refuse son envoi.',
-'Partial upload'		=>	'Fichier partiellement envoyÃ©. Merci de rÃ©essayer.',
-'No tmp directory'		=>	'Le serveur n\'a pas pu enregistrer temporairement le fichier envoyÃ©.',
-'No file'			=>	'Vous n\'avez pas sÃ©lectionnÃ© de fichier Ã  envoyer.',
-'Bad type'			=>	'Ce type de fichier n\'est pas autorisÃ©. Voici les formats pris en charge&#160;:  *.gif, *.jpeg et *.png.',
-'Too wide or high'		=>	'L\'image est plus large et/ou plus haute que le maximum autorisÃ©',
-'Too large'			=>	'La taille du fichier dÃ©passe le maximum autorisÃ©',
-'pixels'			=>	'pixels',
-'bytes'				=>	'octets',
-'Move failed'			=>	'Le serveur n\'a pas pu enregistrer le fichier envoyÃ©. Contactez l\'administrateur',
-'Unknown failure'		=>	'Erreur inconnue. Merci de rÃ©essayer.',
-'Avatar upload redirect'	=>	'Avatar envoyÃ©. Redirection&#160;âŠ',
-'Avatar deleted redirect'	=>	'Avatar effacÃ©. Redirection&#160;âŠ',
-'Avatar desc'			=>	'Un avatar est une petite image qui sera affichÃ©e sous votre nom d\'utilisateur dans vos messages. Il ne doit pas faire plus de',
-'Upload avatar'			=>	'Envoyer un avatar',
-'Upload avatar legend'		=>	'SÃ©lectionnez un fichier avatar Ã  envoyer',
-'Delete avatar'			=>	'Effacer l\'avatar',	// only for admins
-'File'				=>	'Fichier',
-'Upload'			=>	'Envoyer',	// submit button
+'Avatars disabled'			=>	'Le support des avatars est dÃ©sactivÃ©.',
+'Too large ini'				=>	'Fichier trop gros. Le serveur refuse son tÃ©lÃ©chargement.',
+'Partial upload'			=>	'Fichier partiellement tÃ©lÃ©charg&eacute. Merci de reacute;essayer.',
+'No tmp directory'			=>	'Le serveur n\'a pas pu enregistrer le fichier envoyÃ© dans un rÃ©pertoire temporaire.',
+'No file'					=>	'Vous n\'avez pas sÃ©lectionnÃ© de fichier Ã  tÃ©lÃ©charger.',
+'Bad type'					=>	'Le type du fichier n\'est pas autorisÃ©. Les types autorisÃ©s sont le GIF, le JPG et le PNG.',
+'Too wide or high'			=>	'L\'image est plus large et/ou plus haute que le maximum autorisÃ©',
+'Too large'					=>	'La taille du fichier dÃ©passe le maximum autorisÃ©',
+'pixels'					=>	'pixels',
+'bytes'						=>	'octets',
+'Move failed'				=>	'Le serveur n\'a pas pu enregistrer le fichier tÃ©lÃ©charg&acute;. Contactez l\'administrateur',
+'Unknown failure'			=>	'Erreur inconnue. Merci de rÃ©essayer.',
+'Avatar upload redirect'	=>	'Avatar tÃ©lÃ©chargÃ©. Redirection ...',
+'Avatar deleted redirect'	=>	'Avatar effacÃ©. Redirection ...',
+'Avatar desc'				=>	'Un avatar est une petite image qui sera affichÃ©e sous votre nom d\'utilisateur dans vos messages. Il ne doit pas faire plus de',
+'Upload avatar'				=>	'TÃ©lÃ©charger un avatar',
+'Upload avatar legend'		=>	'SÃ©lectionnez un fichier avatar Ã  tÃ©lÃ©charger',
+'Delete avatar'				=>	'Effacer l\'avatar',	// only for admins
+'File'						=>	'Fichier',
+'Upload'					=>	'TÃ©lÃ©charger',	// submit button
  
 // Form validation stuff
-'Forbidden title'		=>	'Votre titre contient un mot interdit. Choisissez un autre titre.',
-'Profile redirect'		=>	'Profil mis Ã  jour. Redirection&#160;âŠ',
+'Dupe username'				=>	'Ce nom d\'utilisateur est dÃ©jÃ  utilisÃ©. Essayez un autre nom d\'utilisateur.',
+'Forbidden title'			=>	'Votre titre contient un mot interdit. Choisissez un autre titre.',
+'Profile redirect'			=>	'Profil mis Ã  jour. Redirection ...',
  
 // Profile display stuff
-'Users profile'			=>	'Profil de %s',
-'Username info'			=>	'Nom d\'utilisateur&#160;: %s',
-'Email info'			=>	'E-mail&#160;: %s',
-'Posts info'			=>	'Messages&#160;: %s',
-'Registered info'		=>	'Inscription&#160;: %s',
-'Last post info'		=>	'Dernier message&#160;: %s',
-'Last visit info'               =>      'DerniÃšre visite&#160;: %s',
-'Show posts'			=>	'Voir les messages de cet utilisateur',
-'Show topics'			=>	'Afficher toutes les discussions',
-'Show subscriptions'		=>	'Afficher toutes les discussions suivies',
-'Realname'			=>	'Nom',
-'Location'			=>	'Lieu',
-'Website'			=>	'Site Web',
-'Invalid website URL'          =>  'L\'URL de site Web saisie est invalide.',
-'Jabber'			=>	'Jabber',
-'ICQ'				=>	'ICQ',
-'MSN'				=>	'MSN Messenger',
-'AOL IM'			=>	'AOL IM',
-'Yahoo'				=>	'Yahoo! Messenger',
-'Avatar'			=>	'Avatar',
-'Signature'			=>	'Signature',
-'Sig max size'			=>	'%s caractÃšres et %s lignes autorisÃ©s',
-'Avatar legend'			=>	'DÃ©finissez vos options d\'affichage d\'avatar',
-'Avatar info'			=>	'Un avatar est une petite image qui sera affichÃ©e avec chacun de vos messages. Vous pouvez envoyer un avatar en cliquant sur le lien ci-dessous.',
-'Change avatar'			=>	'Changer d\'avatar',
-'Signature legend'		=>	'RÃ©digez votre signature',
-'Signature info'		=>	'Une signature est un petit texte ajoutÃ© Ã  la suite de vos messages. Vous pouvez y inclure ce que vous voulez et y utiliser des balises BBCode, selon la configuration du forum. Les fonctionnalitÃ©s actives apparaissent dans la marge lors de l\'Ã©dition de votre signature.',
-'Sig preview'			=>	'AperÃ§u de la signature actuelle&#160;:',
-'No sig'			=>	'Pas de signature dans le profil.',
-'Signature quote/code/list/h'	=>	'L\'utilisation des balises BBCode [quote], [code], [list] et [h] n\'est pas autorisÃ©e dans les signatures.',
-'Topics per page'		=>	'Discussions par page',
-'Posts per page'		=>	'Messages par page',
-'Leave blank'			=>	'Laisser vide pour utiliser la valeur par dÃ©faut du forum.',
-'Subscription legend'	        =>	'DÃ©finit vos options de suivi de discussion',
-'Notify full'			=>	'Inclure le message dans les e-mails de notification de rÃ©ponse.',
-'Auto notify full'		=>	'Suivre automatiquement les sujets auxquels on a rÃ©pondu.',
-'Show smilies'			=>	'Afficher les Ã©moticÃŽnes sous forme d\'icÃŽnes',
-'Show images'			=>	'Afficher les images.',
-'Show images sigs'		=>	'Afficher les images dans les signatures des utilisateurs.',
-'Show avatars'			=>	'Afficher les avatars des utilisateurs.',
-'Show sigs'			=>	'Afficher les signatures.',
-'Style legend'			=>	'Choisissez votre style favori',
-'Styles'			=>	'Styles',
-'Admin note'			=>	'Note de l\'administrateur',
-'Pagination legend'		=>	'DÃ©finissez vos options de pagination',
+'Not activated'				=>	'Cet utilisateur n\'a pas activÃ© son compte. Le compte est activÃ© lors de la premiÃšre identification de l\'utilisateur.',
+'Unknown'					=>	'(Information inconnue)',	// This is displayed when a user hasn't filled out profile field (e.g. Location)
+'Private'					=>	'(Information privÃ©e)',	// This is displayed when a user does not want to receive e-mails
+'No avatar'					=>	'(Aucun avatar)',
+'Show posts'				=>	'Voir les messages de cet utilisateur',
+'Realname'					=>	'Nom',
+'Location'					=>	'Lieu',
+'Website'					=>	'Site web',
+'Jabber'					=>	'Jabber',
+'ICQ'						=>	'ICQ',
+'MSN'						=>	'MSN Messenger',
+'AOL IM'					=>	'AOL IM',
+'Yahoo'						=>	'Yahoo! Messenger',
+'Avatar'					=>	'Avatar',
+'Signature'					=>	'Signature',
+'Sig max length'			=>	'Longueur maximale',
+'Sig max lines'				=>	'Maximum de lignes',
+'Avatar legend'				=>	'DÃ©finissez vos options d\'affichage d\'avatar',
+'Avatar info'				=>	'Un avatar est une petite image qui sera affichÃ©e avec chacun de vos messages. Vous pouvez tÃ©lÃ©charger un avatar en cliquant sur le lien ci-dessous. La case \'Utiliser l\'avatar\' doit Ãªtre cochÃ©e pour que l\'avatar soit visible dans vos messages.',
+'Change avatar'				=>	'Modifier avatar',
+'Use avatar'				=>	'Utiliser l\'avatar.',
+'Signature legend'			=>	'RÃ©digez votre signature',
+'Signature info'			=>	'Une signature est un petit texte ajoutÃ© Ã  la suite de vos messages. Vous pouvez y mettre ce que vous voulez. Vous pouvez y utiliser des balises BBCode, selon la configuration du forum. Les fonctionnalitÃ©s actives apparaissent dans la marge lors de l\'Ã©dition de votre signature.',
+'Sig preview'				=>	'Apercu de la signature actuelle:',
+'No sig'					=>	'Pas de signature dans le profil.',
+'Topics per page'			=>	'Discussions par page',
+'Topics per page info'		=>	'ContrÃŽle le nombre de discussions affichÃ©es par page dans chaque forum. Vous pouvez laisser blanc et la valeur par dÃ©faut sera employÃ©e.',
+'Posts per page'			=>	'Messages par page',
+'Posts per page info'		=>	'ContrÃŽle le nombre de messages affichÃ©s par page dans chaque forum. Vous pouvez laisser blanc et la valeur par dÃ©faut sera employÃ©e.',
+'Leave blank'				=>	'Laisser blanc pour utiliser la valeur par dÃ©faut du forum.',
+'Notify full'				=>	'Inclure le message dans les e-mails d\'abonnement.',
+'Notify full info'			=>	'En activant cette option, une version en texte brut du nouveau message sera incluse dans l\'avis d\'abonnement par e-mail.',
+'Show smilies'				=>	'Afficher les smileys sous forme d\'icÃŽnes',
+'Show smilies info'			=>	'En activant cette option, de petites images seront affichÃ©es Ã  la place du texte.',
+'Show images'				=>	'Afficher les images.',
+'Show images info'			=>	'En dÃ©sactivant cette option, vous ne verez pas les images dans les message (c\'est-Ã -dire les images affichÃ©es avec la balise [img]).',
+'Show images sigs'			=>	'Afficher les images dans les signatures des utilisateurs.',
+'Show images sigs info'		=>	'DÃ©sactivez ceci si vous ne voulez pas voir les images dans les signatures (c\'est-Ã -dire les images affichÃ©es avec la balise [img]).',
+'Show avatars'				=>	'Afficher les avatars des utilisateurs.',
+'Show avatars info'			=>	'Cette option vous permet de dÃ©cider si les images des avatars des utilisateurs doivent Ãªtre affichÃ©es dans les messages ou non.',
+'Show sigs'					=>	'Afficher les signatures.',
+'Show sigs info'			=>	'Activez ceci si vous voulez voir les signatures ou non.',
+'Style legend'				=>	'SÃ©lectionnez votre style favori',
+'Style info'				=>	'Vous pouvez utiliser un style diffÃ©rent pour ce forum.',
+'Admin note'				=>	'Note de l\'administrateur',
+'Pagination legend'			=>	'DÃ©finissez vos options de pagination',
 'Post display legend'		=>	'DÃ©finissez vos options de visualisation des messages',
-'Post display info'		=>	'En dÃ©sactivant toutes les options d\'affichage des images et des signatures dans les messages, vous augmenterez la vitesse de chargement des pages.',
-'Instructions'			=>	'AprÃšs avoir mis Ã  jour le profil vous serez redirigÃ©(e) vers cette page.',
+'Post display info'			=>	'En dÃ©sactivant toutes les options d\'affichage des images dans les messages et les signatures vous augmenterez le temps de chargement des pages.',
+'Instructions'				=>	'AprÃšs avoir mis Ã  jour le profil vous serez redirigÃ©s sur cette page.',
  
 // Administration stuff
 'Group membership legend'	=>	'Choisissez un groupe d\'utilisateurs',
-'Save'				=>	'Enregistrer',
-'Set mods legend'		=>	'DÃ©finir l\'accÃšs modÃ©rateur',
-'Moderator in info'		=>	'Veuillez choisir les forums que cet utilisateur peut modÃ©rer. Remarque&#160;:  Ceci s\'applique seulement aux modÃ©rateurs. Les administrateurs ont toujours toutes les permissions pour tous les forums.',
-'Update forums'			=>	'Mettre Ã  jour',
-'Delete ban legend'		=>	'Supprimer (administrateurs seulement) ou bannir un utilisateur',
-'Delete user'			=>	'Supprimer l\'utilisateur',
-'Ban user'			=>	'Bannir l\'utilisateur',
+'Save'						=>	'Enregistrer',
+'Set mods legend'			=>	'DÃ©finir l\'accÃšs modÃ©rateur',
+'Moderator in'				=>	'ModÃšre',
+'Moderator in info'			=>	'Veuillez choisir quels forums cet utilisateur peut modÃ©rer. Note: Ceci s\'applique seulement aux modÃ©rateurs. Les administrateurs ont toujours toutes les permissions pour tous les forums.',
+'Update forums'				=>	'Mettre Ã  jour',
+'Delete ban legend'			=>	'Supprimer (administrateurs seulement) ou exclure un utilisateur',
+'Delete user'				=>	'Supprimer l\'utilisateur',
+'Ban user'					=>	'Exclure l\'utilisateur',
 'Confirm delete legend'		=>	'Important&#160;: lisez avant de supprimer un utilisateur',
 'Confirm delete user'		=>	'Confirmer la suppression de l\'utilisateur',
-'Confirmation info'		=>	'Veuillez confirmer la suppression de l\'utilisateur',	// the username will be appended to this string
-'Delete warning'		=>	'Attention&#160;! Les utilisateurs et/ou messages supprimÃ©s ne peuvent Ãªtre rÃ©cupÃ©rÃ©s. Si vous choisissez de ne pas supprimer les messages d\'un utilisateur, les messages pourront uniquement Ãªtre supprimÃ©s manuellement plus tard.',
-'Delete posts'			=>	'Supprimer tous les messages ou discussions de cet utilisateur.',
-'Delete'			=>	'Supprimer',		// submit button (confirm user delete)
-'User delete redirect'		=>	'Utilisateur supprimÃ©. Redirection&#160;âŠ',
-'Group membership redirect'	=>	'Appartenance Ã  un groupe enregistrÃ©e. Redirection&#160;âŠ',
-'Update forums redirect'	=>	'Droits du modÃ©rateur mis Ã  jour. Redirection&#160;âŠ',
-'Ban redirect'			=>	'Redirection&#160;âŠ',
-'No delete admin message'	=>	'Les administrateurs ne peuvent Ãªtre supprimÃ©s. Pour supprimer cet utilisateur, vous devez d\'abord le/la dÃ©placer vers un groupe d\'utilisateurs diffÃ©rent.',
+'Confirmation info'			=>	'Veuillez confirmer la suppression de l\'utilisateur',	// the username will be appended to this string
+'Delete warning'			=>	'Attention&#160;! Les utilisateurs et/ou messages supprimÃ©s ne peuvent Ãªtre restaurÃ©s. Si vous choisissez de ne pas supprimer les messages d\'un utilisateur, les messages ne pourront Ãªtre uniquement supprimÃ©s manuellement plus tard.',
+'Delete posts'				=>	'Supprimer tous les messages ou discussions de cet utilisateur.',
+'Delete'					=>	'Supprimer',		// submit button (confirm user delete)
+'User delete redirect'		=>	'Utilisateur supprimÃ©. Redirection ...',
+'Group membership redirect'	=>	'Appartenance Ã  un groupe enregistrÃ©e. Redirection ...',
+'Update forums redirect'	=>	'Droits du modÃ©rateur mis Ã  jour. Redirection ...',
+'Ban redirect'				=>	'Redirection ...'
  
 );
Index: /trunk/web/punbb/lang/French/register.php
===================================================================
--- /trunk/web/punbb/lang/French/register.php	(revision 10)
+++ /trunk/web/punbb/lang/French/register.php	(revision 1)
@@ -5,33 +5,31 @@
  
 // Miscellaneous
-'No new regs'			=>	'Ces forums n\'acceptent pas de nouveaux utilisateurs.',
-'Reg cancel redirect'		=>	'Inscription annulÃ©e. Redirection&#160;âŠ',
-'Forum rules'			=>	'Conditions d\'utilisation des forums',
-'Rules legend'			=>	'Vous devez accepter les conditions d\'utilisation suivantes pour vous inscrire sur ces forums.',
-'Registration flood'		=>	'Un nouvel utilisateur ayant la mÃªme adresse IP que vous a Ã©tÃ© inscrit dans la derniÃšre heure. Pour Ã©viter les inscriptions multiples, il n\'est pas possible de s\'inscrire Ã  partir de la mÃªme IP dans un intervalle infÃ©rieur Ã  1 heure. DÃ©solÃ© pour la gÃªne occasionnÃ©e.',
-'Agree'				=>	'J\'accepte',
-'Cancel'			=>	'Je refuse',
-'Register'			=>	'S\'inscrire',
+'No new regs'				=>	'Ce forum n\'accepte pas de nouveaux utilisateurs.',
+'Reg cancel redirect'		=>	'Inscription annulÃ©e. Redirection ...',
+'Forum rules'				=>	'Conditions d\'utilisation du forum',
+'Rules legend'				=>	'Vous devez accepter les conditions d\'utilisation suivantes pour vous inscrire sur ce forum.',
+'Agree'						=>	'J\'accepte',
+'Cancel'					=>	'Je refuse',
+'Register'					=>	'S\'inscrire',
  
 // Form validation stuff (some of these are also used in post.php)
-'Registration errors'		=>	'Erreurs d\'inscription',
-'Registration errors info'	=>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es avant que vous puissiez vous inscrire&#160;:',
-'Username censor'		=>	'Le nom d\'utilisateur que vous avez saisi contient des mots interdits. Veuillez choisir un autre nom d\'utilisateur.',
-'Username dupe 1'		=>	'Il existe dÃ©jÃ  une personne inscrite avec ce nom d\'utilisateur.',
-'Username dupe 2'		=>	'Ce nom d\'utilisateur est trop ressemblant. Il doit diffÃ©rer par au moins un caractÃšre alpha-numÃ©rique (a-z ou 0-9). Veuillez essayer un autre nom d\'utilisateur.',
-'Email not match'		=>	'Les adresses Ã©lectroniques ne coÃ¯ncident pas. Veuillez revenir en arriÃšre et corriger cela.',
+'Username censor'			=>	'Le nom d\'utilisateur que vous avez saisi contient des mots interdits. Veuillez choisir un autre nom d\'utilisateur.',
+'Username dupe 1'			=>	'Quelqu\'un est dÃ©jÃ  inscrit avec ce nom d\'utilisateur',
+'Username dupe 2'			=>	'Ce nom d\'utilisateur est trop ressemblant. Il doit diffÃ©rer par au moins un caractÃšre alpha-numÃ©rique (a-z ou 0-9). Veuillez essayer un autre nom d\'utilisateur.',
+'E-mail not match'			=>	'Les adresses e-mail ne correspondent pas. Veuiller retourner en arriÃšre et corriger cela.',
  
 // Registration e-mail stuff
-'Reg email'			=>	'Merci de vous Ãªtre inscrit(e). Votre mot de passe a Ã©tÃ© envoyÃ© Ã  l\'adresse indiquÃ©e. Si vous ne l\'obtenez pas, merci de contacter l\'administrateur&#160;:',
-'Reg complete'			=>	'Inscription acceptÃ©e. Identification et redirection&#160;âŠ',
+'Reg e-mail'				=>	'Merci de vous Ãªtre inscrits. Votre mot de passe a Ã©tÃ© envoyÃ© Ã  l\'adresse indiquÃ©e. S\'il n\'arrive pas, merci de contacter l\'administrateur Ã ',
+'Reg complete'				=>	'Inscription acceptÃ©e. Identification et redirection ...',
  
 // Register info
-'Desc 1'			=>	'L\'inscription vous permettra d\'accÃ©der Ã  un certain nombre de fonctionnalitÃ©s autrement indisponibles. Cela inclut la possibilitÃ© de modifier et d\'effacer des messages, de crÃ©er vos propres signatures et bien davantage. Pour toute question, contactez l\'administrateur.',
-'Desc 2'			=>	'Ci-dessous le formulaire Ã  remplir afin de vous inscrire. AprÃšs vous Ãªtre inscrit(e), vous pourrez consulter votre profil et modifier vos prÃ©fÃ©rences. Les champs ci-dessous ne sont qu\'une toute petite partie de tout ce que vous pouvez changer dans votre profil.',
-'Username legend'		=>	'Veuillez saisir un nom d\'utilisateur comportant entre 2 et 25 caractÃšres.',
-'Pass legend'			=>	'Veuillez saisir et confirmer le mot de passe que vous avez choisi.',
-'Pass info'			=>	'Le mot de passe doit comporter au minimum 4 caractÃšres (sensible Ã  la casse).',
-'Email info'			=>	'Vous devez saisir une adresse Ã©lectronique valide. Vous pouvez choisir de ne pas divulguer votre adresse aux autres utilisateurs (voir ci-dessous).',
-'Confirm email'			=>	'Confirmez votre adresse Ã©lectronique',
+'Desc 1'					=>	'L\'inscription vous accordera l\'accÃšs Ã  un certain nombre de fonctionnalitÃ©s et de possibilitÃ©s autrement indisponibles. Cela inclue la possibilitÃ© de modifier et d\'effacer des messages, de crÃ©er vos propres signatures, et autres encore. Pour toute question, contactez l\'administrateur.',
+'Desc 2'					=>	'Ci-dessous le formulaire Ã  remplir afin de vous inscrire. AprÃšs vous Ãªtres inscrits, vous pourrez regarder votre profil et vos prÃ©fÃ©rences. Les champs ci-dessous ne sont qu\'une toute petite partie de tous ce que vous pouvez changer dans votre profil.',
+'Username legend'			=>	'Veuillez saisir un nom d\'utilisateur entre 2 et 25 caractÃšres de long.',
+'Pass legend 1'				=>	'Veuillez saisir et confirmer le mot de passe que vous avez choisi',
+'Pass legend 2'				=>	'Veuillez lire les instructions ci-dessous',
+'Pass info'					=>	'Le mots de passe doit faire entre 4 et 16 caractÃšres de long (sensible Ã  la casse).',
+'E-mail info'				=>	'Vous devez saisir une adresse e-mail valide,. Vous pouvez choisir de ne pas rÃ©veler votre adresse aux autres utilisateurs (voir ci-dessous).',
+'Confirm e-mail'			=>	'Confirmez votre adresse e-mail',
  
 );
Index: /trunk/web/punbb/lang/French/search.php
===================================================================
--- /trunk/web/punbb/lang/French/search.php	(revision 10)
+++ /trunk/web/punbb/lang/French/search.php	(revision 1)
@@ -5,61 +5,43 @@
  
 // The search form
-'User search'			=>	'Rechercher un utilisateur',
-'No search permission'		=>	'Vous ne pouvez pas effectuer de recherche, vous n\'avez pas les permissions requises',
-'Search flood'			=>	'Vous devez patienter au minimum %s secondes avant d\'effectuer une nouvelle recherche. Veuillez patienter un moment et essayer Ã  nouveau.',
-'Search'			=>	'Rechercher',
-'Search criteria legend'	=>	'Choisissez vos critÃšres de recherche',
-'Search info'			=>	'Pour effectuer une recherche par mots-clÃ©s, indiquez le ou les termes Ã  rechercher en les sÃ©parant par des espaces. Utilisez AND, OR, NOT pour affiner votre recherche. Pour rechercher par auteur, saisissez le nom d\'utilisateur auquel les messages appartiennent. Utilisez le joker * pour des recherches sur des fragments de mot.',
-'Keyword search'		=>	'Mots-clÃ©s',
-'Author search'			=>	'Rechercher un auteur',
-'Search in legend'		=>	'Indiquez oÃ¹ la recherche doit s\'effectuer',
-'Search in info'		=>	'Choisissez le forum dans lequel vous souhaitez lancer votre recherche et indiquez si vous souhaitez rechercher dans les sujets des discussions uniquement ou dans les textes des messages ou bien dans les deux Ã  la fois.',
-'Search multiple forums info'    =>  'Si aucun forum n\'est sÃ©lectionnÃ©, la recherche s\'effectuera dans tous les forums.',
-'Forum search'			=>	'Forum',
-'All forums'			=>	'Tous les forums',
-'Search in'			=>	'Rechercher dans&#160;âŠ',
-'Message and subject'		=>	'Le texte du message et du sujet',
-'Message only'			=>	'Le texte du message seulement',
-'Topic only'			=>	'Le texte du sujet seulement',
-'Sort by'			=>	'Trier par&#160;âŠ',
-'Sort order'			=>	'Ordre&#160;âŠ',
-'Search results legend'		=>	'SÃ©lectionnez le mode d\'affichage des rÃ©sultats',
-'Search results info'		=>	'Vous pouvez choisir le mode de classement et d\'affichage des rÃ©sultats.',
-'Sort by post time'		=>	'Date du message',
-'Sort by author'		=>	'Auteur',
-'Sort by subject'		=>	'Sujet',
-'Sort by forum'			=>	'Forum',
-'Ascending'			=>	'Croissant',
-'Descending'			=>	'DÃ©croissant',
-'Show as'			=>	'Afficher les&#160;âŠ',
-'Show as topics'		=>	'Discussions',
-'Show as posts'			=>	'Messages',
+'User search'				=>	'Rechercher un utilisateur',
+'No search permission'		=>	'Vous n\'avez pas accÃšs Ã  la fonctionnalitÃ© de recherche',
+'Search'					=>	'Rechercher',
+'Search criteria legend'	=>	'SÃ©lectionnez vos critÃšres de recherche',
+'Search info'				=>	'Pour effectuer une recherche par mots-clef, saisissez le ou les termes Ã  rechercher. SÃ©parez chaque terme avec des espaces. Utilisez AND, OR, NOT pour affiner votre recherche. Pour rechercher par auteur, saisissez le nom d\'utilisateur auquel les messages appartiennent. Utilisez le joker * pour des recherches sur des mots incomplets.',
+'Keyword search'			=>	'Mots-clef',
+'Author search'				=>	'Rechercher un auteur',
+'Search in legend'			=>	'SÃ©lectionnez oÃ¹ vous souhaitez chercher',
+'Search in info'			=>	'Choisissez dans quel forum vous souhaitez lancer votre recherche et si vous souhaitez rechercher dans les sujets des discussions ou les textes des messages ou bien les deux Ã  la fois.',
+'Forum search'				=>	'Forum',
+'All forums'				=>	'Tous les forums',
+'Search in'					=>	'Rechercher dans',
+'Message and subject'		=>	'Texte du message et du sujet',
+'Message only'				=>	'Texte du message seulement',
+'Topic only'				=>	'Texte du sujet seulement',
+'Sort by'					=>	'Trier par',
+'Sort order'				=>	'Ordre',
+'Search results legend'		=>	'Selectionnez le mode d\'affichage des rÃ©sultats',
+'Search results info'		=>	'Vous pouvez choisir comment vous voulez classer et afficher les rÃ©sultats.',
+'Sort by post time'			=>	'Date du message',
+'Sort by author'			=>	'Auteur',
+'Sort by subject'			=>	'Sujet',
+'Sort by forum'				=>	'Forum',
+'Ascending'					=>	'Croissant',
+'Descending'				=>	'DÃ©croissant',
+'Show as'					=>	'Voir les rÃ©sultats',
+'Show as topics'			=>	'Discussions',
+'Show as posts'				=>	'Messages',
  
 // Results
-'Search'              =>  'Recherche',
-'Search results'		=>	'RÃ©sultats de la recherche',
-'Quick search show_new'		=>	'Nouveaux',
-'Quick search show_recent'	=>	'RÃ©centes',
-'Quick search show_unanswered'	=>	'Sans rÃ©ponse',
-'Quick search show_replies'	=>	'PubliÃ©s',
-'Quick search show_user_topics'	=>	'Discussions de %s',
-'Quick search show_user_posts'	=>	'Messages de %s',
-'Quick search show_subscriptions'       =>	'Suivies par %s',
-'By keywords show as topics'    =>      'Discussions avec messages contenant Â«&#160;%s&#160;Â»',
-'By keywords show as posts'     =>      'Messages contenant Â«&#160;%s&#160;Â»',
-'By user show as topics'        =>      'Discussions contenant des messages de %s',
-'By user show as posts'         =>      'Messages de %s',
-'By both show as topics'        =>      'Discussions avec messages de %s contenant Â«&#160;%s&#160;Â»',
-'By both show as posts'         =>      'Messages de %s contenant Â«&#160;%s&#160;Â»',
-'No terms'			=>	'Vous devez saisir au moins un mot-clÃ© et/ou un auteur Ã  rechercher.',
-'No hits'			=>	'DÃ©solÃ©, aucun rÃ©sultat n\'a Ã©tÃ© trouvÃ© pour votre recherche.',
-'No user posts'			=>	'Il n\'y a pas de message de cet utilisateur dans ce forum.',
-'No user topics'		=>	'Il n\'y a pas de discussion de cet utilisateur dans ce forum.',
-'No subscriptions'		=>	'Cet utilisateur ne suit actuellement aucune discussion.',
-'No new posts'			=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis votre derniÃšre visite.',
-'No recent posts'		=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis les 24 derniÃšres heures.',
-'No unanswered'			=>	'Il n\'y a pas de message sans rÃ©ponse dans ce forum.',
-'Go to post'			=>	'Aller au message',
-'Go to topic'			=>	'Aller Ã  la discussion'
-
+'Search results'			=>	'RÃ©sultats de la recherche',
+'No terms'					=>	'Vous devez entrer au moins un mot-clef et/ou un auteur Ã  rechercher.',
+'No hits'					=>	'Votre recherche n\'a renvoyÃ© aucun rÃ©sultat.',
+'No user posts'				=>	'Il n\'y a pas de message de cet utilisateur dans ce forum.',
+'No subscriptions'			=>	'Vous n\'Ãªtes abonnÃ© Ã  aucune discussion.',
+'No new posts'				=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis votre derniÃšre visite.',
+'No recent posts'			=>	'Il n\'y a pas de discussion avec de nouveaux messages depuis les derniÃšres 24 heures.',
+'No unanswered'				=>	'Il n\'y a pas de message sans rÃ©ponse dans ce forum.',
+'Go to post'				=>	'Aller au message'
+ 
 );
Index: /trunk/web/punbb/lang/French/topic.php
===================================================================
--- /trunk/web/punbb/lang/French/topic.php	(revision 10)
+++ /trunk/web/punbb/lang/French/topic.php	(revision 1)
@@ -3,30 +3,24 @@
 // Language definitions used in viewtopic.php
 $lang_topic = array(
-
-'Post reply'		=>	'RÃ©pondre',
+ 
+'Post reply'		=>	'Ãcrire une rÃ©ponse',
 'Topic closed'		=>	'Discussion fermÃ©e',
-'From'			=>	'Lieu&#160;:',	// User location
-'IP address logged'	=>	'IP de connexion',
-'Note'			=>	'Note&#160;:',	// Admin note
-'Posts'			=>	'Messages&#160;:',
-'Replies'		=>	'RÃ©ponses&#160;:',
-'Registered'		=>	'Inscription&#160;:',
-'Website'		=>	'Site Web',
-'Guest'			=>	'InvitÃ©',
-'Online'		=>	'En ligne',
-'Offline'		=>	'Hors ligne',
-'Last edit'		=>	'DerniÃšre modification par',
-'Report'		=>	'Signaler',
-'Delete'		=>	'Supprimer',
-'Edit'			=>	'Modifier',
-'Quote'			=>	'Citer',
-'Is subscribed'		=>	'Vous suivez cette discussion',
-'Unsubscribe'		=>	'Ne plus suivre',
-'Subscribe'		=>	'Suivre cette discussion',
+'From'				=>	'Lieu',				// User location
+'Note'				=>	'Note',				// Admin note
+'Website'			=>	'Site web',
+'Guest'				=>	'InvitÃ©',
+'Online'			=>	'En ligne',
+'Offline'			=>	'Hors ligne',
+'Last edit'			=>	'DerniÃšre modification par',
+'Report'			=>	'Signaler',
+'Delete'			=>	'Supprimer',
+'Edit'				=>	'Modifier',
+'Quote'				=>	'Citer',
+'Is subscribed'		=>	'Vous Ãªtes abonnÃ© Ã  cette discussion',
+'Unsubscribe'		=>	'DÃ©sabonner',
+'Subscribe'			=>	'S\'abonner Ã  cette discussion',
 'Quick post'		=>	'RÃ©ponse rapide',
-'Mod controls'		=>	'ModÃ©ration',
-'New icon'		=>	'Nouveau message',
-'Re'			=>	'Re&#160;:',
-'Preview'		=>	'PrÃ©visualisation'
-
+'Link separator'	=>	' | ',	// The text that separates links in posts (website, e-mail, report, edit etc.)
+'Mod controls'		=>	'ModÃ©ration'
+ 
 );
Index: unk/web/punbb/lang/French/update.php
===================================================================
--- /trunk/web/punbb/lang/French/update.php	(revision 10)
+++ 	(revision )
@@ -1,76 +1,0 @@
-<?php
-
-// Language definitions used in db_update.php
-
-$lang_update = array(
-
-'Update'			     =>	'Mise Ã  jour de FluxBB',
-'Update message'		     =>	'Votre base de donnÃ©es FluxBB est dÃ©passÃ©e et doit Ãªtre mise Ã  niveau afin de poursuivre. Si vous Ãªtes l\'administrateur de ces forums, veuillez suivre les instructions ci-desssous afin d\'achever la mise Ã  niveau.',
-'Note'				     =>	'Remarque :',
-'Members message'		     =>	'Cette procÃ©dure n\'est destinÃ©e qu\'aux administrateurs des forums. Si vous Ãªtes un membre ce n\'est pas la peine de vous prÃ©occuper de cela - les forums seront trÃšs rapidement fonctionnels !',
-'Administrator only'		     =>	'Cette Ã©tape ne concerne que l\'administrateur des forums !',
-'Database password info'	     =>	'Pour lancer la mise Ã  jour de la base de donnÃ©es veuillez indiquer le mot de passe de base de donnÃ©es avec lequel FluxBB a Ã©tÃ© installÃ©. Si vous ne vous en souvenez plus, il est stockÃ© dans le fichier \'config.php\'.',
-'Database password note'	     =>	'Si vous utilisez SQLite (et donc n\'avez dÃ©fini aucun mot de passe), veuillez utiliser le nom du fichier de base de donnÃ©es Ã  la place. Cela doit correspondre exactement au nom de base de donnÃ©es indiquÃ© dans votre fichier de configuration.',
-'Database password'		     =>	'Mot de passe de base de donnÃ©es',
-'Maintenance'          =>  'Maintenance',
-'Maintenance message info'    =>  'Le message qui s\'affichera pour les utilisateurs lors de l\'opÃ©ration de mise Ã  jour. Ce texte ne sera pas analysÃ© comme les messages habituels et peut donc contenir du code HTML.',
-'Maintenance message'        =>  'Message de maintenance',
-'Next'				     =>	'Suivante',
-
-'You are running error'		     =>	'Vous utilez la version %2$s de %1$s. FluxBB %3$s nÃ©cessite au moins %1$s %4$s pour fonctionner correctement. Vous devez mettre Ã  niveau votre installation avant de poursuivre.',
-'Version mismatch error'	     =>	'Version non correspondante. La base de donnÃ©es \'%s\' ne semble pas utiliser un schÃ©ma de base de donnÃ©es FluxBB pris en charge par ce script de mise Ã  jour.',
-'Invalid file error'		     =>	'Nom de base de donnÃ©es invalide. Lorsque vous utilisez SQLite le nom de la base de donnÃ©es indiquÃ© doit Ãªtre exactement identique Ã  celui de votre \'%s\'',
-'Invalid password error'	     =>	'Mot de passe de base de donnÃ©es invalide. Pour mettre Ã  niveau FluxBB vous devez indiquer votre mot de passe de base de donnÃ©es, il doit Ãªtre exactement identique Ã  celui de votre \'%s\'',
-'No password error'		     =>	'Aucun mot de passe de base de donnÃ©es fourni',
-'Script runs error'		     =>	'Il semblerait que le script de mise Ã  jour ait dÃ©jÃ  Ã©tÃ© lancÃ© par une autre personne. Si cela ne s\'averrait pas Ãªtre vrai, veuillez supprimer manuellement le fichier \'%s\' et essayer Ã  nouveau',
-'No update error'		     =>	'Votre forum a dÃ©jÃ  atteint le niveau de mis Ã  jour le plus Ã©levÃ© pour ce script',
-
-'Intro 1'			     =>	'Ce script va se charger de mettre votre base de donnÃ©es Ã  jour. La procÃ©dure de mise Ã  jour pourra prendre quelques secondes Ã  plusieures heures, cette durÃ©e dÃ©pendant de la vitesse du serveur et de la taille de la base de donnÃ©es. N\'oubliez pas de faire une sauvegarde de la base de donnÃ©es avant de poursuivre.',
-'Intro 2'			     =>	'Avez-vous lu les instructions de mise Ã  jour dans la documentation ? Si non, allez voir.',
-'No charset conversion'		     =>	'<strong>IMPORTANT !</strong> FluxBB a dÃ©tectÃ© que cet environnement PHP ne prend pas en charge les mÃ©canismes d\'encodage nÃ©cessaires pour effectuer une conversion UTF-8 Ã  partir de jeux de caractÃšres autres que ISO-8859-1. Cela signifie que si le jeu de caractÃšres actuel n\'est pas ISO-8859-1, FluxBB ne pourra pas convertir votre base de donnÃ©es du forum en UTF-8 et vous devrez le faire manuellement. Des informations concernant la conversion manuelle peuvent Ãªtre trouvÃ©es dans les instructions de mise Ã  jour.',
-'Enable conversion'		     =>	'<strong>Activer la conversion :</strong> si activÃ©, ce script de mise Ã  jour procÃšdera, aprÃšs avoir fait les modifications structurelles nÃ©cessaires Ã  la base de donnÃ©es, Ã  la conversion de tout le texte dans la base de donnÃ©es de l\'actuel jeu de caractÃšres vers UTF-8. Cette conversion est nÃ©cessaire si vous mettez Ã  niveau une version 1.2.',
-'Current character set'		     =>	'<strong>Jeu de caractÃšre actuel :</strong> Si la langue principale de votre forum est l\'anglais, vous pouvez laisser cela Ã  la valeur par dÃ©faut. En revanche, si votre forum utilise une autre langue, vous devrez indiquer le jeu de caractÃšres du paquetage de la langue principale utilisÃ© par le forum. <em>Si cette donnÃ©e est fausse, cela pourra corrompre votre base de donnÃ©es, donc n\'essayez pas de deviner !</em> Remarque : ceci est nÃ©cessaire mÃªme si votre ancienne base de donnÃ©es est en UTF-8.',
-'Charset conversion'		     =>	'Conversion de jeu de caractÃšres',
-'Enable conversion label'	     =>	'<strong>Activer la conversion</strong> (effectuer la conversion du jeu de caractÃšres de la base de donnÃ©es).',
-'Current character set label'	     =>	'Jeu de caractÃšres actuel',
-'Current character set info'	     =>	'Accepter la valeur par dÃ©faut pour des forums en anglais sinon, le jeu de caractÃšres du paquetage de la langue principale.',
-'Start update'			     =>	'DÃ©marrer la mise Ã  jour',
-'Error converting users'	     =>	'Erreur lors de la conversion de noms d\'utilisateurs',
-'Error info 1'			     =>	'Une erreur est survenue lors de la conversion de certains noms d\'utilisateurs. Cela peut arriver lors d\'une conversion Ã  partir de FluxBB v1.2 si plusieurs utilisateurs se sont inscrits en indiquant des noms trÃšs similaires, par exemple Â« bob Â» et Â« bÃ¶b Â».',
-'Error info 2'			     =>	'Ci-dessous une liste d\'utilisateurs dont la conversion du nom a Ã©chouÃ©. Veuillez choisir un nouveau nom pour chaque utilisateur. Les utilisateurs dont le nom aura Ã©tÃ© modifiÃ© seront automatiquement avertis par l\'envoi d\'un e-mail.',
-'New username'			     =>	'Nouvel utilisateur',
-'Required'			     =>	'(Obligatoire)',
-'Correct errors'		     =>	'Les erreurs suivantes doivent Ãªtre corrigÃ©es :',
-'Rename users'			     =>	'Renommer les utilisateurs',
-'Successfully updated'		     =>	'Votre base de donnÃ©es a Ã©tÃ© mise Ã  jour avec succÃšs. Vous devrez Ã  prÃ©sent %s.',
-'go to index'			     =>	'vous rendre Ã  la page d\'accueil des forums',
-
-'Unable to lock error'		     =>	'Impossible de dÃ©verrouiller pour mise Ã  jour. Veuillez vÃ©rifier que PHP puisse modifier le rÃ©pertoire \'%s\' et qu\'actuellement personne d\'autre n\'a lancÃ© le script de mise Ã  jour.',
-
-'Converting'			     =>	'Conversion de %s âŠ',
-'Converting item'		     =>	'Conversion de %1$s %2$s âŠ',
-'Preparsing item'		     =>	'Analyse prÃ©liminaire de %1$s %2$s âŠ',
-'Rebuilding index item'		     =>	'Reconstruction de l\'index pour %1$s %2$s',
-
-'ban'				     =>	'bannissement',
-'categories'			     =>	'catÃ©gories',
-'censor words'			     =>	'mots censurÃ©s',
-'configuration'			     =>	'configuration',
-'forums'			     =>	'forums',
-'groups'			     =>	'groupes',
-'post'				     =>	'message',
-'ranks'				     =>	'rangs',
-'report'			     =>	'signalement',
-'topic'				     =>	'discussion',
-'user'				     =>	'utilisateur',
-'signature'			     =>	'signature',
-
-'Username too short error'	     =>	'Les noms d\'utilisateurs doivent comporter au moins 2 caractÃšres. Veuillez choisir un autre nom d\'utilisateur (plus long).',
-'Username too long error'	     =>	'Les noms d\'utilisateurs ne doivent pas comporter plus de 25 caractÃšres. Veuillez choisir un autre nom d\'utilisateur (plus court).',
-'Username Guest reserved error'	     =>	'Le nom d\'utilisateur Â« guest Â» est rÃ©servÃ©. Veuillez choisir un autre nom.',
-'Username IP format error'	     =>	'Les noms d\'utilisateurs ne doivent pas ressembler Ã  une adresse IP. Veuillez choisir un autre nom d\'utilisateur.',
-'Username bad characters error'	     =>	'Les noms d\'utilisateurs ne doivent pas comporter tous les caractÃšres \', " et [ ou ] en mÃªme temps. Veuillez choisir un autre nom d\'utilisateur.',
-'Username BBCode error'		     =>	'Les noms d\'utilisateurs ne doivent pas comporter de balises de formatage de texte (BBCode) utilisÃ©s par le forum. Veuillez choisir un autre nom d\'utilisateur.',
-'Username duplicate error'	     =>	'Quelqu\'un a dÃ©jÃ  utilisÃ© le nom d\'utilisateur Â« %s Â». Le nom d\'utilisateur que vous avez indiquÃ© est trop semblable. Le nom doit comporter au moins un caractÃšre alphanumÃ©rique (a-z ou 0-9) diffÃ©rent. Veuillez choisir un autre nom d\'utilisateur.',
-
-);
Index: /trunk/web/punbb/lang/French/userlist.php
===================================================================
--- /trunk/web/punbb/lang/French/userlist.php	(revision 10)
+++ /trunk/web/punbb/lang/French/userlist.php	(revision 1)
@@ -5,9 +5,8 @@
  
 'User find legend'		=>	'Chercher et trier les utilisateurs',
-'User search info'		=>	'Saisissez un nom d\'utilisateur pour le rechercher et/ou un groupe d\'utilisateurs pour filtrer les rÃ©sultats. Le champ Â«&#160;Nom d\'utilisateur&#160;Â» peut rester vide. Utilisez le joker * pour des recherches sur une partie du nom.',
-'User sort info'		=>	'Triez les utilisateurs par nom, date d\'inscription ou nombre de messages et dans l\'ordre croissant ou dÃ©croissant.',
+'User search info'		=>	'Saisissez un nom d\'utilisateur pour rechercher un utilisateur et le trier par groupe d\'utilisateurs. Le champ nom d\'utilisateur peut rester vide. Utilisez le joker * pour des recherches partielles. Triez les utilisateurs par nom, date d\'inscription ou nombre de messages et en ordre croissant ou dÃ©croissant.',
 'User group'			=>	'Groupe d\'utilisateurs',
 'No of posts'			=>	'Nombre de messages',
-'All users'			=>	'Tous les utilisateurs'
+'All users'				=>	'Tous les utilisateurs'
  
 );
Index: /trunk/web/punbb/lang/index.html
===================================================================
--- /trunk/web/punbb/lang/index.html	(revision 10)
+++ /trunk/web/punbb/lang/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/login.php
===================================================================
--- /trunk/web/punbb/login.php	(revision 10)
+++ /trunk/web/punbb/login.php	(revision 1)
@@ -1,14 +1,31 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 if (isset($_GET['action']))
 	define('PUN_QUIET_VISIT', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -21,42 +38,30 @@
 if (isset($_POST['form_sent']) && $action == 'in')
 {
-	$form_username = pun_trim($_POST['req_username']);
-	$form_password = pun_trim($_POST['req_password']);
-	$save_pass = isset($_POST['save_pass']);
-
-	$username_sql = ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
-
-	$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-	$cur_user = $db->fetch_assoc($result);
+	$form_username = trim($_POST['req_username']);
+	$form_password = trim($_POST['req_password']);
+
+	$username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
+
+	$result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+	list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
 
 	$authorized = false;
 
-	if (!empty($cur_user['password']))
+	if (!empty($db_password_hash))
 	{
-		$form_password_hash = pun_hash($form_password); // Will result in a SHA-1 hash
-
-		// If there is a salt in the database we have upgraded from 1.3-legacy though havent yet logged in
-		if (!empty($cur_user['salt']))
+		$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+		$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
+
+		$form_password_hash = pun_hash($form_password);	// This could result in either an SHA-1 or an MD5 hash (depends on $sha1_available)
+
+		if ($sha1_in_db && $sha1_available && $db_password_hash == $form_password_hash)
+			$authorized = true;
+		else if (!$sha1_in_db && $db_password_hash == md5($form_password))
 		{
-			if (sha1($cur_user['salt'].sha1($form_password)) == $cur_user['password']) // 1.3 used sha1(salt.sha1(pass))
-			{
-				$authorized = true;
-
-				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\', salt=NULL WHERE id='.$cur_user['id']) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
-			}
+			$authorized = true;
+
+			if ($sha1_available)	// There's an MD5 hash in the database, but SHA1 hashing is available, so we update the DB
+				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\' WHERE id='.$user_id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
 		}
-		// If the length isn't 40 then the password isn't using sha1, so it must be md5 from 1.2
-		else if (strlen($cur_user['password']) != 40)
-		{
-			if (md5($form_password) == $cur_user['password'])
-			{
-				$authorized = true;
-
-				$db->query('UPDATE '.$db->prefix.'users SET password=\''.$form_password_hash.'\' WHERE id='.$cur_user['id']) or error('Unable to update user password', __FILE__, __LINE__, $db->error());
-			}
-		}
-		// Otherwise we should have a normal sha1 password
-		else
-			$authorized = ($cur_user['password'] == $form_password_hash);
 	}
 
@@ -65,25 +70,14 @@
 
 	// Update the status if this is the first time the user logged in
-	if ($cur_user['group_id'] == PUN_UNVERIFIED)
-	{
-		$db->query('UPDATE '.$db->prefix.'users SET group_id='.$pun_config['o_default_user_group'].' WHERE id='.$cur_user['id']) or error('Unable to update user status', __FILE__, __LINE__, $db->error());
-
-		// Regenerate the users info cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
-	}
+	if ($group_id == PUN_UNVERIFIED)
+		$db->query('UPDATE '.$db->prefix.'users SET group_id='.$pun_config['o_default_user_group'].' WHERE id='.$user_id) or error('Uimpossible de modifier le statut utilisateur', __FILE__, __LINE__, $db->error());
 
 	// Remove this users guest entry from the online list
-	$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
-
-	$expire = ($save_pass == '1') ? time() + 1209600 : time() + $pun_config['o_timeout_visit'];
-	pun_setcookie($cur_user['id'], $form_password_hash, $expire);
-
-	// Reset tracked topics
-	set_tracked_topics(null);
-
-	redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
+	$db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
+
+	$expire = ($save_pass == '1') ? time() + 31536000 : 0;
+	pun_setcookie($user_id, $form_password_hash, $expire);
+
+	redirect($_POST['redirect_url'], $lang_login['Login redirect']);
 }
 
@@ -91,5 +85,5 @@
 else if ($action == 'out')
 {
-	if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id'] || !isset($_GET['csrf_token']) || $_GET['csrf_token'] != pun_hash($pun_user['id'].pun_hash(get_remote_address())))
+	if ($pun_user['is_guest'] || !isset($_GET['id']) || $_GET['id'] != $pun_user['id'])
 	{
 		header('Location: index.php');
@@ -97,12 +91,12 @@
 	}
 
-	// Remove user from "users online" list
-	$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
+	// Remove user from "users online" list.
+	$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Impossible de supprimer de la liste des utilisateur en ligne', __FILE__, __LINE__, $db->error());
 
 	// Update last_visit (make sure there's something to update it with)
 	if (isset($pun_user['logged']))
-		$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
-
-	pun_setcookie(1, pun_hash(uniqid(rand(), true)), time() + 31536000);
+		$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de modifier les donnÃ©es de visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
+
+	pun_setcookie(1, random_pass(8), time() + 31536000);
 
 	redirect('index.php', $lang_login['Logout redirect']);
@@ -117,90 +111,56 @@
 	if (isset($_POST['form_sent']))
 	{
-		// Start with a clean slate
-		$errors = array();
-
 		require PUN_ROOT.'include/email.php';
 
-		// Validate the email address
+		// Validate the email-address
 		$email = strtolower(trim($_POST['req_email']));
 		if (!is_valid_email($email))
-			$errors[] = $lang_common['Invalid email'];
-
-		// Did everything go according to plan?
-		if (empty($errors))
+			message($lang_common['Invalid e-mail']);
+
+		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+
+		if ($db->num_rows($result))
 		{
-			$result = $db->query('SELECT id, username, last_email_sent FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-
-			if ($db->num_rows($result))
+			// Load the "activate password" template
+			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_password.tpl'));
+
+			// The first row contains the subject
+			$first_crlf = strpos($mail_tpl, "\n");
+			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+			$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+			// Do the generic replacements first (they apply to all e-mails sent out here)
+			$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+			// Loop through users we found
+			while ($cur_hit = $db->fetch_assoc($result))
 			{
-				// Load the "activate password" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_password.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				// Do the generic replacements first (they apply to all emails sent out here)
-				$mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-				// Loop through users we found
-				while ($cur_hit = $db->fetch_assoc($result))
-				{
-					if ($cur_hit['last_email_sent'] != '' && (time() - $cur_hit['last_email_sent']) < 3600 && (time() - $cur_hit['last_email_sent']) >= 0)
-						message($lang_login['Email flood'], true);
-
-					// Generate a new password and a new password activation code
-					$new_password = random_pass(8);
-					$new_password_key = random_pass(8);
-
-					$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.pun_hash($new_password).'\', activate_key=\''.$new_password_key.'\', last_email_sent = '.time().' WHERE id='.$cur_hit['id']) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
-
-					// Do the user specific replacements to the template
-					$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
-					$cur_mail_message = str_replace('<activation_url>', get_base_url().'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
-					$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
-
-					pun_mail($email, $mail_subject, $cur_mail_message);
-				}
-
-				message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+				// Generate a new password and a new password activation code
+				$new_password = random_pass(8);
+				$new_password_key = random_pass(8);
+
+				$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.pun_hash($new_password).'\', activate_key=\''.$new_password_key.'\' WHERE id='.$cur_hit['id']) or error('Impossible de modifier les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
+
+				// Do the user specific replacements to the template
+				$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
+				$cur_mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
+				$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
+
+				pun_mail($email, $mail_subject, $cur_mail_message);
 			}
-			else
-				$errors[] = $lang_login['No email match'].' '.htmlspecialchars($email).'.';
-			}
+
+			message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 		}
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_login['Request pass']);
-	$required_fields = array('req_email' => $lang_common['Email']);
+		else
+			message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
+	}
+
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_login['Request pass'];
+	$required_fields = array('req_email' => $lang_common['E-mail']);
 	$focus_element = array('request_pass', 'req_email');
-	define ('PUN_ACTIVE_PAGE', 'login');
 	require PUN_ROOT.'header.php';
 
-// If there are errors, we display them
-if (!empty($errors))
-{
-
-?>
-<div id="posterror" class="block">
-	<h2><span><?php echo $lang_login['New password errors'] ?></span></h2>
-	<div class="box">
-		<div class="inbox error-info">
-			<p><?php echo $lang_login['New passworderrors info'] ?></p>
-			<ul class="error-list">
-<?php
-
-	foreach ($errors as $cur_error)
-		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
-?>
-			</ul>
-		</div>
-	</div>
-</div>
-
-<?php
-
-}
 ?>
 <div class="blockform">
@@ -213,10 +173,10 @@
 					<div class="infldset">
 						<input type="hidden" name="form_sent" value="1" />
-						<label class="required"><strong><?php echo $lang_common['Email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input id="req_email" type="text" name="req_email" size="50" maxlength="80" /><br /></label>
+						<input id="req_email" type="text" name="req_email" size="50" maxlength="50" />
 						<p><?php echo $lang_login['Request pass info'] ?></p>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="request_pass" value="<?php echo $lang_common['Submit'] ?>" /><?php if (empty($errors)): ?> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a><?php endif; ?></p>
+			<p><input type="submit" name="request_pass" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -232,35 +192,9 @@
 
 // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
-if (!empty($_SERVER['HTTP_REFERER']))
-{
-	$referrer = parse_url($_SERVER['HTTP_REFERER']);
-	// Remove www subdomain if it exists
-	if (strpos($referrer['host'], 'www.') === 0)
-		$referrer['host'] = substr($referrer['host'], 4);
-
-	// Make sure the path component exists
-	if (!isset($referrer['path']))
-		$referrer['path'] = '';
-
-	$valid = parse_url(get_base_url());
-	// Remove www subdomain if it exists
-	if (strpos($valid['host'], 'www.') === 0)
-		$valid['host'] = substr($valid['host'], 4);
-
-	// Make sure the path component exists
-	if (!isset($valid['path']))
-		$valid['path'] = '';
-
-	if ($referrer['host'] == $valid['host'] && preg_match('%^'.preg_quote($valid['path'], '%').'/(.*?)\.php%i', $referrer['path']))
-		$redirect_url = $_SERVER['HTTP_REFERER'];
-}
-
-if (!isset($redirect_url))
-	$redirect_url = 'index.php';
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Login']);
+$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];
 $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);
 $focus_element = array('login', 'req_username');
-define('PUN_ACTIVE_PAGE', 'login');
 require PUN_ROOT.'header.php';
 
@@ -273,20 +207,16 @@
 				<fieldset>
 					<legend><?php echo $lang_login['Login legend'] ?></legend>
-					<div class="infldset">
-						<input type="hidden" name="form_sent" value="1" />
-						<input type="hidden" name="redirect_url" value="<?php echo pun_htmlspecialchars($redirect_url) ?>" />
-						<label class="conl required"><strong><?php echo $lang_common['Username'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
-						<label class="conl required"><strong><?php echo $lang_common['Password'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password" size="25" tabindex="2" /><br /></label>
-
-						<div class="rbox clearb">
-							<label><input type="checkbox" name="save_pass" value="1" tabindex="3" /><?php echo $lang_login['Remember me'] ?><br /></label>
+						<div class="infldset">
+							<input type="hidden" name="form_sent" value="1" />
+							<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
+							<label class="conl"><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" tabindex="1" /><br /></label>
+							<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" tabindex="2" /><br /></label>
+							<p class="clearb"><?php echo $lang_login['Login info'] ?></p>
+							<p><a href="register.php" tabindex="4"><?php echo $lang_login['Not registered'] ?></a>&#160;&#160;
+							<a href="login.php?action=forget" tabindex="5"><?php echo $lang_login['Forgotten pass'] ?></a></p>
 						</div>
-
-						<p class="clearb"><?php echo $lang_login['Login info'] ?></p>
-						<p class="actions"><span><a href="register.php" tabindex="5"><?php echo $lang_login['Not registered'] ?></a></span> <span><a href="login.php?action=forget" tabindex="6"><?php echo $lang_login['Forgotten pass'] ?></a></span></p>
-					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" tabindex="4" /></p>
+			<p><input type="submit" name="login" value="<?php echo $lang_common['Login'] ?>" tabindex="3" /></p>
 		</form>
 	</div>
Index: /trunk/web/punbb/misc.php
===================================================================
--- /trunk/web/punbb/misc.php	(revision 10)
+++ /trunk/web/punbb/misc.php	(revision 1)
@@ -1,14 +1,31 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 if (isset($_GET['action']))
 	define('PUN_QUIET_VISIT', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -22,20 +39,16 @@
 if ($action == 'rules')
 {
-	if ($pun_config['o_rules'] == '0' || ($pun_user['is_guest'] && $pun_user['g_read_board'] == '0' && $pun_config['o_regs_allow'] == '0'))
-		message($lang_common['Bad request']);
-
 	// Load the register.php language file
 	require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Forum rules']);
-	define('PUN_ACTIVE_PAGE', 'rules');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Forum rules'];
 	require PUN_ROOT.'header.php';
 
 ?>
-<div id="rules" class="block">
-	<div class="hd"><h2><span><?php echo $lang_register['Forum rules'] ?></span></h2></div>
+<div class="block">
+	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
 	<div class="box">
-		<div id="rules-block" class="inbox">
-			<div class="usercontent"><?php echo $pun_config['o_rules_message'] ?></div>
+		<div class="inbox">
+			<p><?php echo $pun_config['o_rules_message'] ?></p>
 		</div>
 	</div>
@@ -52,8 +65,5 @@
 		message($lang_common['No permission']);
 
-	$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user last visit data', __FILE__, __LINE__, $db->error());
-
-	// Reset tracked topics
-	set_tracked_topics(null);
+	$db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Impossible de modifier les donnÃ©es de derniÃšre visite de l\'utilisateur', __FILE__, __LINE__, $db->error());
 
 	redirect('index.php', $lang_misc['Mark read redirect']);
@@ -61,25 +71,7 @@
 
 
-// Mark the topics/posts in a forum as read?
-else if ($action == 'markforumread')
+else if (isset($_GET['email']))
 {
 	if ($pun_user['is_guest'])
-		message($lang_common['No permission']);
-
-	$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
-	if ($fid < 1)
-		message($lang_common['Bad request']);
-
-	$tracked_topics = get_tracked_topics();
-	$tracked_topics['forums'][$fid] = time();
-	set_tracked_topics($tracked_topics);
-
-	redirect('viewforum.php?id='.$fid, $lang_misc['Mark forum read redirect']);
-}
-
-
-else if (isset($_GET['email']))
-{
-	if ($pun_user['is_guest'] || $pun_user['g_send_email'] == '0')
 		message($lang_common['No permission']);
 
@@ -88,5 +80,5 @@
 		message($lang_common['Bad request']);
 
-	$result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
 		message($lang_common['Bad request']);
@@ -94,6 +86,6 @@
 	list($recipient, $recipient_email, $email_setting) = $db->fetch_row($result);
 
-	if ($email_setting == 2 && !$pun_user['is_admmod'])
-		message($lang_misc['Form email disabled']);
+	if ($email_setting == 2 && $pun_user['g_id'] > PUN_MOD)
+		message($lang_misc['Form e-mail disabled']);
 
 
@@ -105,20 +97,17 @@
 
 		if ($subject == '')
-			message($lang_misc['No email subject']);
+			message($lang_misc['No e-mail subject']);
 		else if ($message == '')
-			message($lang_misc['No email message']);
-		else if (pun_strlen($message) > PUN_MAX_POSTSIZE)
-			message($lang_misc['Too long email message']);
-
-		if ($pun_user['last_email_sent'] != '' && (time() - $pun_user['last_email_sent']) < $pun_user['g_email_flood'] && (time() - $pun_user['last_email_sent']) >= 0)
-			message(sprintf($lang_misc['Email flood'], $pun_user['g_email_flood']));
-
-		// Load the "form email" template
+			message($lang_misc['No e-mail message']);
+		else if (strlen($message) > 65535)
+			message($lang_misc['Too long e-mail message']);
+
+		// Load the "form e-mail" template
 		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/form_email.tpl'));
 
 		// The first row contains the subject
 		$first_crlf = strpos($mail_tpl, "\n");
-		$mail_subject = pun_trim(substr($mail_tpl, 8, $first_crlf-8));
-		$mail_message = pun_trim(substr($mail_tpl, $first_crlf));
+		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+		$mail_message = trim(substr($mail_tpl, $first_crlf));
 
 		$mail_subject = str_replace('<mail_subject>', $subject, $mail_subject);
@@ -126,62 +115,42 @@
 		$mail_message = str_replace('<board_title>', $pun_config['o_board_title'], $mail_message);
 		$mail_message = str_replace('<mail_message>', $message, $mail_message);
-		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
 
 		require_once PUN_ROOT.'include/email.php';
 
-		pun_mail($recipient_email, $mail_subject, $mail_message, $pun_user['email'], $pun_user['username']);
-
-		$db->query('UPDATE '.$db->prefix.'users SET last_email_sent='.time().' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-
-		redirect(htmlspecialchars($_POST['redirect_url']), $lang_misc['Email sent redirect']);
+		pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');
+
+		redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);
 	}
 
 
-	// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to the users profile after the email is sent)
-	if (!empty($_SERVER['HTTP_REFERER']))
-	{
-		$referrer = parse_url($_SERVER['HTTP_REFERER']);
-		// Remove www subdomain if it exists
-		if (strpos($referrer['host'], 'www.') === 0)
-			$referrer['host'] = substr($referrer['host'], 4);
-
-		$valid = parse_url(get_base_url());
-		// Remove www subdomain if it exists
-		if (strpos($valid['host'], 'www.') === 0)
-			$valid['host'] = substr($valid['host'], 4);
-
-		if ($referrer['host'] == $valid['host'] && preg_match('%^'.preg_quote($valid['path'], '%').'/(.*?)\.php%i', $referrer['path']))
-			$redirect_url = $_SERVER['HTTP_REFERER'];
-	}
-
-	if (!isset($redirect_url))
-		$redirect_url = 'profile.php?id='.$recipient_id;
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Send email to'].' '.pun_htmlspecialchars($recipient));
-	$required_fields = array('req_subject' => $lang_misc['Email subject'], 'req_message' => $lang_misc['Email message']);
+	// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to the users profile after the e-mail is sent)
+	$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php';
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Send e-mail to'].' '.pun_htmlspecialchars($recipient);
+	$required_fields = array('req_subject' => $lang_misc['E-mail subject'], 'req_message' => $lang_misc['E-mail message']);
 	$focus_element = array('email', 'req_subject');
-	define('PUN_ACTIVE_PAGE', 'index');
 	require PUN_ROOT.'header.php';
 
 ?>
-<div id="emailform" class="blockform">
-	<h2><span><?php echo $lang_misc['Send email to'] ?> <?php echo pun_htmlspecialchars($recipient) ?></span></h2>
+<div class="blockform">
+	<h2><span><?php echo $lang_misc['Send e-mail to'] ?> <?php echo pun_htmlspecialchars($recipient) ?></span></h2>
 	<div class="box">
 		<form id="email" method="post" action="misc.php?email=<?php echo $recipient_id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_misc['Write email'] ?></legend>
+					<legend><?php echo $lang_misc['Write e-mail'] ?></legend>
 					<div class="infldset txtarea">
 						<input type="hidden" name="form_sent" value="1" />
-						<input type="hidden" name="redirect_url" value="<?php echo pun_htmlspecialchars($redirect_url) ?>" />
-						<label class="required"><strong><?php echo $lang_misc['Email subject'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
+						<input type="hidden" name="redirect_url" value="<?php echo $redirect_url ?>" />
+						<label><strong><?php echo $lang_misc['E-mail subject'] ?></strong><br />
 						<input class="longinput" type="text" name="req_subject" size="75" maxlength="70" tabindex="1" /><br /></label>
-						<label class="required"><strong><?php echo $lang_misc['Email message'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
+						<label><strong><?php echo $lang_misc['E-mail message'] ?></strong><br />
 						<textarea name="req_message" rows="10" cols="75" tabindex="2"></textarea><br /></label>
-						<p><?php echo $lang_misc['Email disclosure note'] ?></p>
+						<p><?php echo $lang_misc['E-mail disclosure note'] ?></p>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="3" accesskey="s" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="3" accesskey="s" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -208,9 +177,4 @@
 		if ($reason == '')
 			message($lang_misc['No reason']);
-		else if (strlen($reason) > 65535) // TEXT field can only hold 65535 bytes
-			message($lang_misc['Reason too long']);
-
-		if ($pun_user['last_report_sent'] != '' && (time() - $pun_user['last_report_sent']) < $pun_user['g_report_flood'] && (time() - $pun_user['last_report_sent']) >= 0)
-			message(sprintf($lang_misc['Report flood'], $pun_user['g_report_flood']));
 
 		// Get the topic ID
@@ -222,5 +186,5 @@
 
 		// Get the subject and forum ID
-		$result = $db->query('SELECT subject, forum_id FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT subject, forum_id FROM '.$db->prefix.'topics WHERE id='.$topic_id) or error('Impossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
 		if (!$db->num_rows($result))
 			message($lang_common['Bad request']);
@@ -229,27 +193,15 @@
 
 		// Should we use the internal report handling?
-		if ($pun_config['o_report_method'] == '0' || $pun_config['o_report_method'] == '2')
+		if ($pun_config['o_report_method'] == 0 || $pun_config['o_report_method'] == 2)
 			$db->query('INSERT INTO '.$db->prefix.'reports (post_id, topic_id, forum_id, reported_by, created, message) VALUES('.$post_id.', '.$topic_id.', '.$forum_id.', '.$pun_user['id'].', '.time().', \''.$db->escape($reason).'\')' ) or error('Unable to create report', __FILE__, __LINE__, $db->error());
 
-		// Should we email the report?
-		if ($pun_config['o_report_method'] == '1' || $pun_config['o_report_method'] == '2')
+		// Should we e-mail the report?
+		if ($pun_config['o_report_method'] == 1 || $pun_config['o_report_method'] == 2)
 		{
 			// We send it to the complete mailing-list in one swoop
 			if ($pun_config['o_mailing_list'] != '')
 			{
-				// Load the "new report" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/new_report.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_subject = str_replace('<forum_id>', $forum_id, $mail_subject);
-				$mail_subject = str_replace('<topic_subject>', $subject, $mail_subject);
-				$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
-				$mail_message = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$post_id.'#p'.$post_id, $mail_message);
-				$mail_message = str_replace('<reason>', $reason, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
+				$mail_subject = 'Report('.$forum_id.') - \''.$subject.'\'';
+				$mail_message = 'User \''.$pun_user['username'].'\' has reported the following message:'."\n".$pun_config['o_base_url'].'/viewtopic.php?pid='.$post_id.'#p'.$post_id."\n\n".'Reason:'."\n".$reason;
 
 				require PUN_ROOT.'include/email.php';
@@ -259,38 +211,15 @@
 		}
 
-		$db->query('UPDATE '.$db->prefix.'users SET last_report_sent='.time().' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-
 		redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_misc['Report redirect']);
 	}
 
-	// Fetch some info about the post, the topic and the forum
-	$result = $db->query('SELECT f.id AS fid, f.forum_name, t.id AS tid, t.subject FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$post_id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-	if (!$db->num_rows($result))
-		message($lang_common['Bad request']);
-
-	$cur_post = $db->fetch_assoc($result);
-
-	if ($pun_config['o_censoring'] == '1')
-		$cur_post['subject'] = censor_words($cur_post['subject']);
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Report post']);
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Report post'];
 	$required_fields = array('req_reason' => $lang_misc['Reason']);
 	$focus_element = array('report', 'req_reason');
-	define('PUN_ACTIVE_PAGE', 'index');
 	require PUN_ROOT.'header.php';
 
 ?>
-<div class="linkst">
-	<div class="inbox">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?pid=<?php echo $post_id ?>#p<?php echo $post_id ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_misc['Report post'] ?></strong></li>
-		</ul>
-	</div>
-</div>
-
-<div id="reportform" class="blockform">
+<div class="blockform">
 	<h2><span><?php echo $lang_misc['Report post'] ?></span></h2>
 	<div class="box">
@@ -301,9 +230,9 @@
 					<div class="infldset txtarea">
 						<input type="hidden" name="form_sent" value="1" />
-						<label class="required"><strong><?php echo $lang_misc['Reason'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><textarea name="req_reason" rows="5" cols="60"></textarea><br /></label>
+						<label><strong><?php echo $lang_misc['Reason'] ?></strong><br /><textarea name="req_reason" rows="5" cols="60"></textarea><br /></label>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -315,91 +244,39 @@
 
 
-else if ($action == 'subscribe')
-{
-	if ($pun_user['is_guest'])
-		message($lang_common['No permission']);
-
-	$topic_id = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
-	$forum_id = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
-	if ($topic_id < 1 && $forum_id < 1)
-		message($lang_common['Bad request']);
-
-	if ($topic_id)
-	{
-		if ($pun_config['o_topic_subscriptions'] != '1')
-			message($lang_common['No permission']);
-
-		// Make sure the user can view the topic
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$topic_id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			message($lang_common['Bad request']);
-
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'topic_subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
-		if ($db->num_rows($result))
-			message($lang_misc['Already subscribed topic']);
-
-		$db->query('INSERT INTO '.$db->prefix.'topic_subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$topic_id.')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
-
-		redirect('viewtopic.php?id='.$topic_id, $lang_misc['Subscribe redirect']);
-	}
-
-	if ($forum_id)
-	{
-		if ($pun_config['o_forum_subscriptions'] != '1')
-			message($lang_common['No permission']);
-
-		// Make sure the user can view the forum
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			message($lang_common['Bad request']);
-
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'forum_subscriptions WHERE user_id='.$pun_user['id'].' AND forum_id='.$forum_id) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
-		if ($db->num_rows($result))
-			message($lang_misc['Already subscribed forum']);
-
-		$db->query('INSERT INTO '.$db->prefix.'forum_subscriptions (user_id, forum_id) VALUES('.$pun_user['id'].' ,'.$forum_id.')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
-
-		redirect('viewforum.php?id='.$forum_id, $lang_misc['Subscribe redirect']);
-	}
-}
-
-
-else if ($action == 'unsubscribe')
-{
-	if ($pun_user['is_guest'])
-		message($lang_common['No permission']);
-
-	$topic_id = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
-	$forum_id = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
-	if ($topic_id < 1 && $forum_id < 1)
-		message($lang_common['Bad request']);
-
-	if ($topic_id)
-	{
-		if ($pun_config['o_topic_subscriptions'] != '1')
-			message($lang_common['No permission']);
-
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'topic_subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			message($lang_misc['Not subscribed topic']);
-
-		$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Unable to remove subscription', __FILE__, __LINE__, $db->error());
-
-		redirect('viewtopic.php?id='.$topic_id, $lang_misc['Unsubscribe redirect']);
-	}
-
-	if ($forum_id)
-	{
-		if ($pun_config['o_forum_subscriptions'] != '1')
-			message($lang_common['No permission']);
-
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'forum_subscriptions WHERE user_id='.$pun_user['id'].' AND forum_id='.$forum_id) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			message($lang_misc['Not subscribed forum']);
-
-		$db->query('DELETE FROM '.$db->prefix.'forum_subscriptions WHERE user_id='.$pun_user['id'].' AND forum_id='.$forum_id) or error('Unable to remove subscription', __FILE__, __LINE__, $db->error());
-
-		redirect('viewforum.php?id='.$forum_id, $lang_misc['Unsubscribe redirect']);
-	}
+else if (isset($_GET['subscribe']))
+{
+	if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
+		message($lang_common['No permission']);
+
+	$topic_id = intval($_GET['subscribe']);
+	if ($topic_id < 1)
+		message($lang_common['Bad request']);
+
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+	if ($db->num_rows($result))
+		message($lang_misc['Already subscribed']);
+
+	$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$topic_id.')') or error('UImpossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$topic_id, $lang_misc['Subscribe redirect']);
+}
+
+
+else if (isset($_GET['unsubscribe']))
+{
+	if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
+		message($lang_common['No permission']);
+
+	$topic_id = intval($_GET['unsubscribe']);
+	if ($topic_id < 1)
+		message($lang_common['Bad request']);
+
+	$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+	if (!$db->num_rows($result))
+		message($lang_misc['Not subscribed']);
+
+	$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$topic_id) or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
+
+	redirect('viewtopic.php?id='.$topic_id, $lang_misc['Unsubscribe redirect']);
 }
 
Index: /trunk/web/punbb/moderate.php
===================================================================
--- /trunk/web/punbb/moderate.php	(revision 10)
+++ /trunk/web/punbb/moderate.php	(revision 1)
@@ -1,23 +1,40 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
 
 // This particular function doesn't require forum-based moderator access. It can be used
-// by all moderators and admins
+// by all moderators and admins.
 if (isset($_GET['get_host']))
 {
-	if (!$pun_user['is_admmod'])
+	if ($pun_user['g_id'] > PUN_MOD)
 		message($lang_common['No permission']);
 
 	// Is get_host an IP address or a post ID?
-	if (@preg_match('%^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$%', $_GET['get_host']) || @preg_match('%^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$%', $_GET['get_host']))
+	if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_GET['get_host']))
 		$ip = $_GET['get_host'];
 	else
@@ -27,5 +44,5 @@
 			message($lang_common['Bad request']);
 
-		$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE id='.$get_host) or error('Impossible de retrouver l\'adresse IP', __FILE__, __LINE__, $db->error());
 		if (!$db->num_rows($result))
 			message($lang_common['Bad request']);
@@ -34,8 +51,5 @@
 	}
 
-	// Load the misc.php language file
-	require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';
-
-	message(sprintf($lang_misc['Host info 1'], $ip).'<br />'.sprintf($lang_misc['Host info 2'], @gethostbyaddr($ip)).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">'.$lang_misc['Show more users'].'</a>');
+	message('L\'adresse IP est : '.$ip.'<br />Le nom de l\'hÃŽte est : '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Voir plus d\'utilisateurs pour cette IP</a>');
 }
 
@@ -46,15 +60,12 @@
 	message($lang_common['Bad request']);
 
-$result = $db->query('SELECT moderators FROM '.$db->prefix.'forums WHERE id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT moderators FROM '.$db->prefix.'forums WHERE id='.$fid) or error('UImpossible de retrouver les informations des forums', __FILE__, __LINE__, $db->error());
 
 $moderators = $db->result($result);
 $mods_array = ($moderators != '') ? unserialize($moderators) : array();
 
-if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] == '0' || !array_key_exists($pun_user['username'], $mods_array)))
+if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_id'] != PUN_MOD || !array_key_exists($pun_user['username'], $mods_array)))
 	message($lang_common['No permission']);
 
-// Get topic/forum tracking data
-if (!$pun_user['is_guest'])
-	$tracked_topics = get_tracked_topics();
 
 // Load the misc.php language file
@@ -62,5 +73,5 @@
 
 
-// All other topic moderation features require a topic ID in GET
+// All other topic moderation features require a topic id in GET
 if (isset($_GET['tid']))
 {
@@ -70,5 +81,5 @@
 
 	// Fetch some info about the topic
-	$result = $db->query('SELECT t.subject, t.num_replies, t.first_post_id, f.id AS forum_id, forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid.' AND t.id='.$tid.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT t.subject, t.num_replies, f.id AS forum_id, forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid.' AND t.id='.$tid.' AND t.moved_to IS NULL') or error('UImpossible de retrouver les informations des discussions', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
 		message($lang_common['Bad request']);
@@ -76,8 +87,9 @@
 	$cur_topic = $db->fetch_assoc($result);
 
+
 	// Delete one or more posts
 	if (isset($_POST['delete_posts']) || isset($_POST['delete_posts_comply']))
 	{
-		$posts = isset($_POST['posts']) ? $_POST['posts'] : array();
+		$posts = $_POST['posts'];
 		if (empty($posts))
 			message($lang_misc['No posts selected']);
@@ -87,15 +99,9 @@
 			confirm_referrer('moderate.php');
 
-			if (@preg_match('%[^0-9,]%', $posts))
+			if (preg_match('/[^0-9,]/', $posts))
 				message($lang_common['Bad request']);
 
-			// Verify that the post IDs are valid
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'posts WHERE id IN('.$posts.') AND topic_id='.$tid) or error('Unable to check posts', __FILE__, __LINE__, $db->error());
-
-			if ($db->num_rows($result) != substr_count($posts, ',') + 1)
-				message($lang_common['Bad request']);
-
 			// Delete the posts
-			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error());
+			$db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
 
 			require PUN_ROOT.'include/search_idx.php';
@@ -103,5 +109,5 @@
 
 			// Get last_post, last_post_id, and last_poster for the topic after deletion
-			$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
 			$last_post = $db->fetch_assoc($result);
 
@@ -110,5 +116,5 @@
 
 			// Update the topic
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$last_post['posted'].', last_post_id='.$last_post['id'].', last_poster=\''.$db->escape($last_post['poster']).'\', num_replies=num_replies-'.$num_posts_deleted.' WHERE id='.$tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$last_post['posted'].', last_post_id='.$last_post['id'].', last_poster=\''.$db->escape($last_post['poster']).'\', num_replies=num_replies-'.$num_posts_deleted.' WHERE id='.$tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
 
 			update_forum($fid);
@@ -118,6 +124,5 @@
 
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Moderate']);
-		define('PUN_ACTIVE_PAGE', 'index');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
 		require PUN_ROOT.'header.php';
 
@@ -131,10 +136,10 @@
 					<legend><?php echo $lang_misc['Confirm delete legend'] ?></legend>
 					<div class="infldset">
-						<input type="hidden" name="posts" value="<?php echo implode(',', array_map('intval', array_keys($posts))) ?>" />
+						<input type="hidden" name="posts" value="<?php echo implode(',', array_keys($posts)) ?>" />
 						<p><?php echo $lang_misc['Delete posts comply'] ?></p>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="delete_posts_comply" value="<?php echo $lang_misc['Delete'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="delete_posts_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -144,128 +149,7 @@
 		require PUN_ROOT.'footer.php';
 	}
-	else if (isset($_POST['split_posts']) || isset($_POST['split_posts_comply']))
-	{
-		$posts = isset($_POST['posts']) ? $_POST['posts'] : array();
-		if (empty($posts))
-			message($lang_misc['No posts selected']);
-
-		if (isset($_POST['split_posts_comply']))
-		{
-			confirm_referrer('moderate.php');
-
-			if (@preg_match('%[^0-9,]%', $posts))
-				message($lang_common['Bad request']);
-
-			$move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0;
-			if ($move_to_forum < 1)
-				message($lang_common['Bad request']);
-
-			// How many posts did we just split off?
-			$num_posts_splitted = substr_count($posts, ',') + 1;
-
-			// Verify that the post IDs are valid
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'posts WHERE id IN('.$posts.') AND topic_id='.$tid) or error('Unable to check posts', __FILE__, __LINE__, $db->error());
-			if ($db->num_rows($result) != $num_posts_splitted)
-				message($lang_common['Bad request']);
-
-			// Verify that the move to forum ID is valid
-			$result = $db->query('SELECT 1 FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.group_id='.$pun_user['g_id'].' AND fp.forum_id='.$move_to_forum.') WHERE f.redirect_url IS NULL AND (fp.post_topics IS NULL OR fp.post_topics=1)') or error('Unable to fetch forum permissions', __FILE__, __LINE__, $db->error());
-			if (!$db->num_rows($result))
-				message($lang_common['Bad request']);
-
-			// Load the post.php language file
-			require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
-
-			// Check subject
-			$new_subject = isset($_POST['new_subject']) ? pun_trim($_POST['new_subject']) : '';
-
-			if ($new_subject == '')
-				message($lang_post['No subject']);
-			else if (pun_strlen($new_subject) > 70)
-				message($lang_post['Too long subject']);
-
-			// Get data from the new first post
-			$result = $db->query('SELECT p.id, p.poster, p.posted FROM '.$db->prefix.'posts AS p WHERE id IN('.$posts.') ORDER BY p.id ASC LIMIT 1') or error('Unable to get first post', __FILE__, __LINE__, $db->error());
-			$first_post_data = $db->fetch_assoc($result);
-
-			// Create the new topic
-			$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, first_post_id, forum_id) VALUES (\''.$db->escape($first_post_data['poster']).'\', \''.$db->escape($new_subject).'\', '.$first_post_data['posted'].', '.$first_post_data['id'].', '.$move_to_forum.')') or error('Unable to create new topic', __FILE__, __LINE__, $db->error());
-			$new_tid = $db->insert_id();
-
-			// Move the posts to the new topic
-			$db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$new_tid.' WHERE id IN('.$posts.')') or error('Unable to move posts into new topic', __FILE__, __LINE__, $db->error());
-
-			// Get last_post, last_post_id, and last_poster from the topic and update it
-			$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-			$last_post_data = $db->fetch_assoc($result);
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$last_post_data['posted'].', last_post_id='.$last_post_data['id'].', last_poster=\''.$db->escape($last_post_data['poster']).'\', num_replies=num_replies-'.$num_posts_splitted.' WHERE id='.$tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
-
-			// Get last_post, last_post_id, and last_poster from the new topic and update it
-			$result = $db->query('SELECT id, poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$new_tid.' ORDER BY id DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
-			$last_post_data = $db->fetch_assoc($result);
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post='.$last_post_data['posted'].', last_post_id='.$last_post_data['id'].', last_poster=\''.$db->escape($last_post_data['poster']).'\', num_replies='.($num_posts_splitted-1).' WHERE id='.$new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
-
-			update_forum($fid);
-			update_forum($move_to_forum);
-
-			redirect('viewtopic.php?id='.$new_tid, $lang_misc['Split posts redirect']);
-		}
-
-		$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.post_topics IS NULL OR fp.post_topics=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Moderate']);
-		$focus_element = array('subject','new_subject');
-		define('PUN_ACTIVE_PAGE', 'index');
-		require PUN_ROOT.'header.php';
-
-?>
-<div class="blockform">
-	<h2><span><?php echo $lang_misc['Split posts'] ?></span></h2>
-	<div class="box">
-		<form id="subject" method="post" action="moderate.php?fid=<?php echo $fid ?>&amp;tid=<?php echo $tid ?>">
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_misc['Confirm split legend'] ?></legend>
-					<div class="infldset">
-						<input type="hidden" name="posts" value="<?php echo implode(',', array_map('intval', array_keys($posts))) ?>" />
-						<label class="required"><strong><?php echo $lang_misc['New subject'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="new_subject" size="80" maxlength="70" /><br /></label>
-						<label><?php echo $lang_misc['Move to'] ?>
-						<br /><select name="move_to_forum">
-<?php
-
-	$cur_category = 0;
-	while ($cur_forum = $db->fetch_assoc($result))
-	{
-		if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
-		{
-			if ($cur_category)
-				echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
-
-			echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
-			$cur_category = $cur_forum['cid'];
-		}
-
-		echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"'.($fid == $cur_forum['fid'] ? ' selected="selected"' : '').'>'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
-	}
-
-?>
-							</optgroup>
-						</select>
-						<br /></label>
-						<p><?php echo $lang_misc['Split posts comply'] ?></p>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="split_posts_comply" value="<?php echo $lang_misc['Split'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
-		</form>
-	</div>
-</div>
-<?php
-
-		require PUN_ROOT.'footer.php';
-	}
-
-
-	// Show the moderate posts view
+
+
+	// Show the delete multiple posts view
 
 	// Load the viewtopic.php language file
@@ -273,5 +157,5 @@
 
 	// Used to disable the Move and Delete buttons if there are no replies to this topic
-	$button_status = ($cur_topic['num_replies'] == 0) ? ' disabled="disabled"' : '';
+	$button_status = ($cur_topic['num_replies'] == 0) ? ' disabled' : '';
 
 
@@ -279,9 +163,9 @@
 	$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
 
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
+	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 	$start_from = $pun_user['disp_posts'] * ($p - 1);
 
 	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'moderate.php?fid='.$fid.'&amp;tid='.$tid);
+	$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'moderate.php?fid='.$fid.'&amp;tid='.$tid);
 
 
@@ -290,20 +174,12 @@
 
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), pun_htmlspecialchars($cur_topic['subject']));
-	define('PUN_ACTIVE_PAGE', 'index');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$cur_topic['subject'];
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_misc['Moderate'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-		</div>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
 		<div class="clearer"></div>
 	</div>
@@ -315,15 +191,9 @@
 	require PUN_ROOT.'include/parser.php';
 
-	$post_count = 0; // Keep track of post numbers
-
-	// Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
-	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id LIMIT '.$start_from.','.$pun_user['disp_posts']) or error('Unable to fetch post IDs', __FILE__, __LINE__, $db->error());
-
-	$post_ids = array();
-	for ($i = 0;$cur_post_id = $db->result($result, $i);$i++)
-		$post_ids[] = $cur_post_id;
+	$bg_switch = true;	// Used for switching background color in posts
+	$post_count = 0;	// Keep track of post numbers
 
 	// Retrieve the posts (and their respective poster)
-	$result = $db->query('SELECT u.title, u.num_posts, g.g_id, g.g_user_title, p.id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE p.id IN ('.implode(',', $post_ids).') ORDER BY p.id', true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT u.title, u.num_posts, g.g_id, g.g_user_title, p.id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE p.topic_id='.$tid.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
 
 	while ($cur_post = $db->fetch_assoc($result))
@@ -331,11 +201,8 @@
 		$post_count++;
 
-		// If the poster is a registered user
+		// If the poster is a registered user.
 		if ($cur_post['poster_id'] > 1)
 		{
-			if ($pun_user['g_view_users'] == '1')
-				$poster = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>';
-			else
-				$poster = pun_htmlspecialchars($cur_post['poster']);
+			$poster = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a>';
 
 			// get_title() requires that an element 'username' be present in the array
@@ -353,4 +220,8 @@
 		}
 
+		// Switch the background color for every message.
+		$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+		$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
+
 		// Perform the main parsing of the message (BBCode, smilies, censor words etc)
 		$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
@@ -358,50 +229,40 @@
 ?>
 
-<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php if($cur_post['id'] == $cur_topic['first_post_id']) echo ' firstpost' ?><?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?><?php if ($post_count == 1) echo ' blockpost1' ?>">
-	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
+<div class="blockpost<?php echo $vtbg ?>">
+	<a name="<?php echo $cur_post['id'] ?>"></a>
+	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&#160;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
 	<div class="box">
 		<div class="inbox">
-			<div class="postbody">
-				<div class="postleft">
-					<dl>
-						<dt><strong><?php echo $poster ?></strong></dt>
-						<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
-					</dl>
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo $poster ?></strong></dt>
+					<dd><strong><?php echo $user_title ?></strong></dd>
+				</dl>
+			</div>
+			<div class="postright">
+				<h3 class="nosize"><?php echo $lang_common['Message'] ?></h3>
+				<div class="postmsg">
+					<?php echo $cur_post['message']."\n" ?>
+<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
 				</div>
-				<div class="postright">
-					<h3 class="nosize"><?php echo $lang_common['Message'] ?></h3>
-					<div class="postmsg">
-						<?php echo $cur_post['message']."\n" ?>
-<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
-					</div>
-				</div>
+				<?php if ($start_from + $post_count > 1) echo '<p class="multidelete"><label><strong>'.$lang_misc['Select'].'</strong>&#160;&#160;<input type="checkbox" name="posts['.$cur_post['id'].']" value="1" /></label></p>'."\n" ?>
 			</div>
-		</div>
-		<div class="inbox">
-			<div class="postfoot clearb">
-				<div class="postfootright"><?php echo ($cur_post['id'] != $cur_topic['first_post_id']) ? '<p class="multidelete"><label><strong>'.$lang_misc['Select'].'</strong>&#160;<input type="checkbox" name="posts['.$cur_post['id'].']" value="1" /></label></p>' : '<p>'.$lang_misc['Cannot select first'].'</p>' ?></div>
-			</div>
-		</div>
-	</div>
-</div>
-
-<?php
-
-	}
-
-?>
-<div class="postlinksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-			<p class="conr modbuttons"><input type="submit" name="split_posts" value="<?php echo $lang_misc['Split'] ?>"<?php echo $button_status ?> /> <input type="submit" name="delete_posts" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> /></p>
 			<div class="clearer"></div>
 		</div>
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_misc['Moderate'] ?></strong></li>
-		</ul>
+	</div>
+</div>
+
+
+
+
+<?php
+
+	}
+
+?>
+<div class="postlinksb">
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="conr"><input type="submit" name="delete_posts" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> /></p>
 		<div class="clearer"></div>
 	</div>
@@ -421,5 +282,5 @@
 		confirm_referrer('moderate.php');
 
-		if (@preg_match('%[^0-9,]%', $_POST['topics']))
+		if (preg_match('/[^0-9,]/', $_POST['topics']))
 			message($lang_common['Bad request']);
 
@@ -429,37 +290,26 @@
 			message($lang_common['Bad request']);
 
-		// Verify that the topic IDs are valid
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'topics WHERE id IN('.implode(',',$topics).') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $db->error());
-
-		if ($db->num_rows($result) != count($topics))
-			message($lang_common['Bad request']);
-
-		// Verify that the move to forum ID is valid
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.group_id='.$pun_user['g_id'].' AND fp.forum_id='.$move_to_forum.') WHERE f.redirect_url IS NULL AND (fp.post_topics IS NULL OR fp.post_topics=1)') or error('Unable to fetch forum permissions', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			message($lang_common['Bad request']);
-
-		// Delete any redirect topics if there are any (only if we moved/copied the topic back to where it was once moved from)
-		$db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Unable to delete redirect topics', __FILE__, __LINE__, $db->error());
+		// Delete any redirect topics if there are any (only if we moved/copied the topic back to where it where it was once moved from)
+		$db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to IN('.implode(',',$topics).')') or error('Impossible de supprimer les redirections', __FILE__, __LINE__, $db->error());
 
 		// Move the topic(s)
-		$db->query('UPDATE '.$db->prefix.'topics SET forum_id='.$move_to_forum.' WHERE id IN('.implode(',',$topics).')') or error('Unable to move topics', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET forum_id='.$move_to_forum.' WHERE id IN('.implode(',',$topics).')') or error('Impossible de dÃ©placer la discussion', __FILE__, __LINE__, $db->error());
 
 		// Should we create redirect topics?
 		if (isset($_POST['with_redirect']))
 		{
-			foreach ($topics as $cur_topic)
+			while (list(, $cur_topic) = @each($topics))
 			{
 				// Fetch info for the redirect topic
-				$result = $db->query('SELECT poster, subject, posted, last_post FROM '.$db->prefix.'topics WHERE id='.$cur_topic) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT poster, subject, posted, last_post FROM '.$db->prefix.'topics WHERE id='.$cur_topic) or error('Impossible de retrouver les informations de la discussions', __FILE__, __LINE__, $db->error());
 				$moved_to = $db->fetch_assoc($result);
 
 				// Create the redirect topic
-				$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, moved_to, forum_id) VALUES(\''.$db->escape($moved_to['poster']).'\', \''.$db->escape($moved_to['subject']).'\', '.$moved_to['posted'].', '.$moved_to['last_post'].', '.$cur_topic.', '.$fid.')') or error('Unable to create redirect topic', __FILE__, __LINE__, $db->error());
+				$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, moved_to, forum_id) VALUES(\''.$db->escape($moved_to['poster']).'\', \''.$db->escape($moved_to['subject']).'\', '.$moved_to['posted'].', '.$moved_to['last_post'].', '.$cur_topic.', '.$fid.')') or error('Impossible de crÃ©er une redirection', __FILE__, __LINE__, $db->error());
 			}
 		}
 
-		update_forum($fid); // Update the forum FROM which the topic was moved
-		update_forum($move_to_forum); // Update the forum TO which the topic was moved
+		update_forum($fid);				// Update the forum FROM which the topic was moved
+		update_forum($move_to_forum);	// Update the forum TO which the topic was moved
 
 		$redirect_msg = (count($topics) > 1) ? $lang_misc['Move topics redirect'] : $lang_misc['Move topic redirect'];
@@ -473,5 +323,5 @@
 			message($lang_misc['No topics selected']);
 
-		$topics = implode(',', array_map('intval', array_keys($topics)));
+		$topics = implode(',', array_keys($topics));
 		$action = 'multi';
 	}
@@ -485,10 +335,5 @@
 	}
 
-	$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.post_topics IS NULL OR fp.post_topics=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result) < 2)
-		message($lang_misc['Nowhere to move']);
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Moderate']);
-	define('PUN_ACTIVE_PAGE', 'index');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
 	require PUN_ROOT.'header.php';
 
@@ -507,8 +352,10 @@
 <?php
 
+	$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+	
 	$cur_category = 0;
 	while ($cur_forum = $db->fetch_assoc($result))
 	{
-		if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
+		if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 		{
 			if ($cur_category)
@@ -533,5 +380,5 @@
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="move_topics_to" value="<?php echo $lang_misc['Move'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="move_topics_to" value="<?php echo $lang_misc['Move'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -542,96 +389,7 @@
 }
 
-// Merge two or more topics
-else if (isset($_POST['merge_topics']) || isset($_POST['merge_topics_comply']))
-{
-	if (isset($_POST['merge_topics_comply']))
-	{
-		confirm_referrer('moderate.php');
-
-		if (@preg_match('%[^0-9,]%', $_POST['topics']))
-			message($lang_common['Bad request']);
-
-		$topics = explode(',', $_POST['topics']);
-		if (count($topics) < 2)
-			message($lang_misc['Not enough topics selected']);
-
-		// Verify that the topic IDs are valid (redirect links will point to the merged topic after the merge)
-		$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topics).') AND forum_id='.$fid.' ORDER BY id ASC') or error('Unable to check topics', __FILE__, __LINE__, $db->error());
-		if ($db->num_rows($result) != count($topics))
-			message($lang_common['Bad request']);
-
-		// The topic that we are merging into is the one with the smallest ID
-		$merge_to_tid = $db->result($result);
-
-		// Make any redirect topics point to our new, merged topic
-		$query = 'UPDATE '.$db->prefix.'topics SET moved_to='.$merge_to_tid.' WHERE moved_to IN('.implode(',', $topics).')';
-
-		// Should we create redirect topics?
-		if (isset($_POST['with_redirect']))
-			$query .= ' OR (id IN('.implode(',', $topics).') AND id != '.$merge_to_tid.')';
-
-		$db->query($query) or error('Unable to make redirection topics', __FILE__, __LINE__, $db->error());
-
-		// Merge the posts into the topic
-		$db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$merge_to_tid.' WHERE topic_id IN('.implode(',', $topics).')') or error('Unable to merge the posts into the topic', __FILE__, __LINE__, $db->error());
-
-		// Delete any subscriptions
-		$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id IN('.implode(',', $topics).') AND topic_id != '.$merge_to_tid) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
-
-		// Without redirection the old topics are removed
-		if (!isset($_POST['with_redirect']))
-			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topics).') AND id != '.$merge_to_tid) or error('Unable to delete old topics', __FILE__, __LINE__, $db->error());
-
-		// Count number of replies in the topic
-		$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$merge_to_tid) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
-		$num_replies = $db->result($result, 0) - 1;
-
-		// Get last_post, last_post_id and last_poster
-		$result = $db->query('SELECT posted, id, poster FROM '.$db->prefix.'posts WHERE topic_id='.$merge_to_tid.' ORDER BY id DESC LIMIT 1') or error('Unable to get last post info', __FILE__, __LINE__, $db->error());
-		list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);
-
-		// Update topic
-		$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$merge_to_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
-
-		// Update the forum FROM which the topic was moved and redirect
-		update_forum($fid);
-		redirect('viewforum.php?id='.$fid, $lang_misc['Merge topics redirect']);
-	}
-
-	$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
-	if (count($topics) < 2)
-		message($lang_misc['Not enough topics selected']);
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Moderate']);
-	define('PUN_ACTIVE_PAGE', 'index');
-	require PUN_ROOT.'header.php';
-
-?>
-<div class="blockform">
-	<h2><span><?php echo $lang_misc['Merge topics'] ?></span></h2>
-	<div class="box">
-		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
-			<input type="hidden" name="topics" value="<?php echo implode(',', array_map('intval', array_keys($topics))) ?>" />
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_misc['Confirm merge legend'] ?></legend>
-					<div class="infldset">
-						<div class="rbox">
-							<label><input type="checkbox" name="with_redirect" value="1" /><?php echo $lang_misc['Leave redirect'] ?><br /></label>
-						</div>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="merge_topics_comply" value="<?php echo $lang_misc['Merge'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
-		</form>
-	</div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
 
 // Delete one or more topics
-else if (isset($_POST['delete_topics']) || isset($_POST['delete_topics_comply']))
+if (isset($_REQUEST['delete_topics']) || isset($_POST['delete_topics_comply']))
 {
 	$topics = isset($_POST['topics']) ? $_POST['topics'] : array();
@@ -643,23 +401,17 @@
 		confirm_referrer('moderate.php');
 
-		if (@preg_match('%[^0-9,]%', $topics))
+		if (preg_match('/[^0-9,]/', $topics))
 			message($lang_common['Bad request']);
 
 		require PUN_ROOT.'include/search_idx.php';
 
-		// Verify that the topic IDs are valid
-		$result = $db->query('SELECT 1 FROM '.$db->prefix.'topics WHERE id IN('.$topics.') AND forum_id='.$fid) or error('Unable to check topics', __FILE__, __LINE__, $db->error());
-
-		if ($db->num_rows($result) != substr_count($topics, ',') + 1)
-			message($lang_common['Bad request']);
-
 		// Delete the topics and any redirect topics
-		$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Unable to delete topic', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Impossible de supprimer la discussion', __FILE__, __LINE__, $db->error());
 
 		// Delete any subscriptions
-		$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id IN('.$topics.')') or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
-
-		// Create a list of the post IDs in this topic and then strip the search index
-		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE topic_id IN('.$topics.')') or error('Impossible de supprimer l\'abonnement', __FILE__, __LINE__, $db->error());
+
+		// Create a list of the post ID's in this topic and then strip the search index
+		$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
 
 		$post_ids = '';
@@ -667,10 +419,10 @@
 			$post_ids .= ($post_ids != '') ? ','.$row[0] : $row[0];
 
-		// We have to check that we actually have a list of post IDs since we could be deleting just a redirect topic
+		// We have to check that we actually have a list of post ID's since we could be deleting just a redirect topic
 		if ($post_ids != '')
 			strip_search_index($post_ids);
 
 		// Delete posts
-		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'posts WHERE topic_id IN('.$topics.')') or error('Impossible de supprimer les messages', __FILE__, __LINE__, $db->error());
 
 		update_forum($fid);
@@ -680,14 +432,13 @@
 
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_misc['Moderate']);
-	define('PUN_ACTIVE_PAGE', 'index');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="blockform">
-	<h2><span><?php echo $lang_misc['Delete topics'] ?></span></h2>
+	<h2><?php echo $lang_misc['Delete topics'] ?></h2>
 	<div class="box">
 		<form method="post" action="moderate.php?fid=<?php echo $fid ?>">
-			<input type="hidden" name="topics" value="<?php echo implode(',', array_map('intval', array_keys($topics))) ?>" />
+			<input type="hidden" name="topics" value="<?php echo implode(',', array_keys($topics)) ?>" />
 			<div class="inform">
 				<fieldset>
@@ -698,5 +449,5 @@
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="delete_topics_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="delete_topics_comply" value="<?php echo $lang_misc['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -713,5 +464,5 @@
 	$action = (isset($_REQUEST['open'])) ? 0 : 1;
 
-	// There could be an array of topic IDs in $_POST
+	// There could be an array of topic ID's in $_POST
 	if (isset($_POST['open']) || isset($_POST['close']))
 	{
@@ -722,5 +473,5 @@
 			message($lang_misc['No topics selected']);
 
-		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).') AND forum_id='.$fid) or error('Unable to close topics', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).')') or error('Impossible de fermer les discussions', __FILE__, __LINE__, $db->error());
 
 		$redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];
@@ -736,5 +487,5 @@
 			message($lang_common['Bad request']);
 
-		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id.' AND forum_id='.$fid) or error('Unable to close topic', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id='.$topic_id) or error('Impossible de fermer la discussion', __FILE__, __LINE__, $db->error());
 
 		$redirect_msg = ($action) ? $lang_misc['Close topic redirect'] : $lang_misc['Open topic redirect'];
@@ -753,5 +504,5 @@
 		message($lang_common['Bad request']);
 
-	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick.' AND forum_id='.$fid) or error('Unable to stick topic', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'1\' WHERE id='.$stick) or error('Impossible d\'Ã©pingler la discussion', __FILE__, __LINE__, $db->error());
 
 	redirect('viewtopic.php?id='.$stick, $lang_misc['Stick topic redirect']);
@@ -768,5 +519,5 @@
 		message($lang_common['Bad request']);
 
-	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick.' AND forum_id='.$fid) or error('Unable to unstick topic', __FILE__, __LINE__, $db->error());
+	$db->query('UPDATE '.$db->prefix.'topics SET sticky=\'0\' WHERE id='.$unstick) or error('Impossible de dÃ©tacher la discussion', __FILE__, __LINE__, $db->error());
 
 	redirect('viewtopic.php?id='.$unstick, $lang_misc['Unstick topic redirect']);
@@ -780,5 +531,5 @@
 
 // Fetch some info about the forum
-$result = $db->query('SELECT f.forum_name, f.redirect_url, f.num_topics, f.sort_by FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT f.forum_name, f.redirect_url, f.num_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Impossible de retrouver les informations de forums', __FILE__, __LINE__, $db->error());
 if (!$db->num_rows($result))
 	message($lang_common['Bad request']);
@@ -790,44 +541,21 @@
 	message($lang_common['Bad request']);
 
-switch ($cur_forum['sort_by'])
-{
-	case 0:
-		$sort_by = 'last_post DESC';
-		break;
-	case 1:
-		$sort_by = 'posted DESC';
-		break;
-	case 2:
-		$sort_by = 'subject ASC';
-		break;
-	default:
-		$sort_by = 'last_post DESC';
-		break;
-}
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.pun_htmlspecialchars($cur_forum['forum_name']);
+require PUN_ROOT.'header.php';
 
 // Determine the topic offset (based on $_GET['p'])
 $num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = $pun_user['disp_topics'] * ($p - 1);
 
 // Generate paging links
-$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'moderate.php?fid='.$fid);
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_forum['forum_name']));
-define('PUN_ACTIVE_PAGE', 'index');
-require PUN_ROOT.'header.php';
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'moderate.php?fid='.$fid)
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_misc['Moderate'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-		</div>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
 		<div class="clearer"></div>
 	</div>
@@ -844,6 +572,6 @@
 					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
 					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
-<?php if ($pun_config['o_topic_views'] == '1'): ?>					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
-<?php endif; ?>					<th class="tcr"><?php echo $lang_common['Last post'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
+					<th class="tcr"><?php echo $lang_common['Last post'] ?></th>
 					<th class="tcmod" scope="col"><?php echo $lang_misc['Select'] ?></th>
 				</tr>
@@ -852,36 +580,27 @@
 <?php
 
-
-// Retrieve a list of topic IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
-$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$fid.' ORDER BY sticky DESC, '.$sort_by.', id DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']) or error('Unable to fetch topic IDs', __FILE__, __LINE__, $db->error());
-
-// If there are topics in this forum
+// Select topics
+$result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$fid.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']) or error('Impossible de retrouver la liste des discussions du forum', __FILE__, __LINE__, $db->error());
+
+// If there are topics in this forum.
 if ($db->num_rows($result))
 {
-	$topic_ids = array();
-	for ($i = 0;$cur_topic_id = $db->result($result, $i);$i++)
-		$topic_ids[] = $cur_topic_id;
-
-	// Select topics
-	$result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topic_ids).') ORDER BY sticky DESC, '.$sort_by.', id DESC') or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error());
-
 	$button_status = '';
-	$topic_count = 0;
+
 	while ($cur_topic = $db->fetch_assoc($result))
 	{
 
-		++$topic_count;
-		$status_text = array();
-		$item_status = ($topic_count % 2 == 0) ? 'roweven' : 'rowodd';
+		$icon_text = $lang_common['Normal icon'];
+		$item_status = '';
 		$icon_type = 'icon';
 
 		if ($cur_topic['moved_to'] == null)
 		{
-			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
+			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']);
 			$ghost_topic = false;
 		}
 		else
 		{
-			$last_post = '- - -';
+			$last_post = '&#160;';
 			$ghost_topic = true;
 		}
@@ -890,42 +609,41 @@
 			$cur_topic['subject'] = censor_words($cur_topic['subject']);
 
-		if ($cur_topic['sticky'] == '1')
-		{
-			$item_status .= ' isticky';
-			$status_text[] = '<span class="stickytext">'.$lang_forum['Sticky'].'</span>';
-		}
-
 		if ($cur_topic['moved_to'] != 0)
-		{
-			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
-			$item_status .= ' imoved';
-		}
+			$subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
 		else if ($cur_topic['closed'] == '0')
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else
+		{
 			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-		else
-		{
-			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
-			$item_status .= ' iclosed';
-		}
-
-		if (!$ghost_topic && $cur_topic['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$fid]) || $tracked_topics['forums'][$fid] < $cur_topic['last_post']))
-		{
+			$icon_text = $lang_common['Closed icon'];
+			$item_status = 'iclosed';
+		}
+
+		if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic)
+		{
+			$icon_text .= ' '.$lang_common['New icon'];
 			$item_status .= ' inew';
-			$icon_type = 'icon icon-new';
+			$icon_type = 'icon inew';
 			$subject = '<strong>'.$subject.'</strong>';
-			$subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
+			$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
 		}
 		else
 			$subject_new_posts = null;
 
-		// Insert the status text before the subject
-		$subject = implode(' ', $status_text).' '.$subject;
+		// We won't display "the dot", but we add the spaces anyway
+		if ($pun_config['o_show_dot'] == '1')
+			$subject = '&#160;&#160;'.$subject;
+
+		if ($cur_topic['sticky'] == '1')
+		{
+			$subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
+			$item_status .= ' isticky';
+			$icon_text .= ' '.$lang_forum['Sticky'];
+		}
 
 		$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
 
 		if ($num_pages_topic > 1)
-			$subject_multipage = '<span class="pagestext">[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]</span>';
+			$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
 		else
 			$subject_multipage = null;
@@ -934,21 +652,19 @@
 		if (!empty($subject_new_posts) || !empty($subject_multipage))
 		{
-			$subject .= !empty($subject_new_posts) ? ' '.$subject_new_posts : '';
+			$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
 			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
 		}
 
 ?>
-				<tr class="<?php echo $item_status ?>">
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
 					<td class="tcl">
-						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($topic_count + $start_from) ?></div></div>
+						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
 						<div class="tclcon">
-							<div>
-								<?php echo $subject."\n" ?>
-							</div>
+							<?php echo $subject."\n" ?>
 						</div>
 					</td>
-					<td class="tc2"><?php echo (!$ghost_topic) ? forum_number_format($cur_topic['num_replies']) : '-' ?></td>
-<?php if ($pun_config['o_topic_views'] == '1'): ?>					<td class="tc3"><?php echo (!$ghost_topic) ? forum_number_format($cur_topic['num_views']) : '-' ?></td>
-<?php endif; ?>					<td class="tcr"><?php echo $last_post ?></td>
+					<td class="tc2"><?php echo (!$ghost_topic) ? $cur_topic['num_replies'] : '&#160;' ?></td>
+					<td class="tc3"><?php echo (!$ghost_topic) ? $cur_topic['num_views'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
 					<td class="tcmod"><input type="checkbox" name="topics[<?php echo $cur_topic['id'] ?>]" value="1" /></td>
 				</tr>
@@ -959,7 +675,6 @@
 else
 {
-	$colspan = ($pun_config['o_topic_views'] == '1') ? 5 : 4;
-	$button_status = ' disabled="disabled"';
-	echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="'.$colspan.'">'.$lang_forum['Empty forum'].'</td></tr>'."\n";
+	$button_status = ' disabled';
+	echo "\t\t\t\t\t".'<tr><td class="tcl" colspan="5">'.$lang_forum['Empty forum'].'</td></tr>'."\n";
 }
 
@@ -972,15 +687,7 @@
 
 <div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-			<p class="conr modbuttons"><input type="submit" name="move_topics" value="<?php echo $lang_misc['Move'] ?>"<?php echo $button_status ?> /> <input type="submit" name="delete_topics" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> /> <input type="submit" name="merge_topics" value="<?php echo $lang_misc['Merge'] ?>"<?php echo $button_status ?> /> <input type="submit" name="open" value="<?php echo $lang_misc['Open'] ?>"<?php echo $button_status ?> /> <input type="submit" name="close" value="<?php echo $lang_misc['Close'] ?>"<?php echo $button_status ?> /></p>
-			<div class="clearer"></div>
-		</div>
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $fid ?>"><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_misc['Moderate'] ?></strong></li>
-		</ul>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="conr"><input type="submit" name="move_topics" value="<?php echo $lang_misc['Move'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="delete_topics" value="<?php echo $lang_misc['Delete'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="open" value="<?php echo $lang_misc['Open'] ?>"<?php echo $button_status ?> />&#160;&#160;<input type="submit" name="close" value="<?php echo $lang_misc['Close'] ?>"<?php echo $button_status ?> /></p>
 		<div class="clearer"></div>
 	</div>
Index: /trunk/web/punbb/plugins/index.html
===================================================================
--- /trunk/web/punbb/plugins/index.html	(revision 10)
+++ /trunk/web/punbb/plugins/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/post.php
===================================================================
--- /trunk/web/punbb/post.php	(revision 10)
+++ /trunk/web/punbb/post.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -22,7 +39,7 @@
 // Fetch some info about the topic and/or the forum
 if ($tid)
-	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
 else
-	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
 
 if (!$db->num_rows($result))
@@ -30,5 +47,4 @@
 
 $cur_posting = $db->fetch_assoc($result);
-$is_subscribed = $tid && $cur_posting['is_subscribed'];
 
 // Is someone trying to post into a redirect forum?
@@ -38,8 +54,5 @@
 // Sort out who the moderators are and if we are currently a moderator (or an admin)
 $mods_array = ($cur_posting['moderators'] != '') ? unserialize($cur_posting['moderators']) : array();
-$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
-
-if ($tid && $pun_config['o_censoring'] == '1')
-	$cur_posting['subject'] = censor_words($cur_posting['subject']);
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
 
 // Do we have permission to post?
@@ -60,6 +73,10 @@
 if (isset($_POST['form_sent']))
 {
+	// Make sure form_user is correct
+	if (($pun_user['is_guest'] && $_POST['form_user'] != 'InvitÃ©') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))
+		message($lang_common['Bad request']);
+
 	// Flood protection
-	if (!isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
+	if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
 		$errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];
 
@@ -69,18 +86,13 @@
 		$subject = pun_trim($_POST['req_subject']);
 
-		if ($pun_config['o_censoring'] == '1')
-			$censored_subject = pun_trim(censor_words($subject));
-
 		if ($subject == '')
 			$errors[] = $lang_post['No subject'];
-		else if ($pun_config['o_censoring'] == '1' && $censored_subject == '')
-			$errors[] = $lang_post['No subject after censoring'];
 		else if (pun_strlen($subject) > 70)
 			$errors[] = $lang_post['Too long subject'];
-		else if ($pun_config['p_subject_all_caps'] == '0' && is_all_uppercase($subject) && !$pun_user['is_admmod'])
-			$errors[] = $lang_post['All caps subject'];
+		else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
+			$subject = ucwords(strtolower($subject));
 	}
 
-	// If the user is logged in we get the username and email from $pun_user
+	// If the user is logged in we get the username and e-mail from $pun_user
 	if (!$pun_user['is_guest'])
 	{
@@ -91,14 +103,36 @@
 	else
 	{
-		$username = pun_trim($_POST['req_username']);
+		$username = trim($_POST['req_username']);
 		$email = strtolower(trim(($pun_config['p_force_guest_email'] == '1') ? $_POST['req_email'] : $_POST['email']));
-		$banned_email = false;
-
-		// Load the register.php/prof_reg.php language files
+
+		// Load the register.php/profile.php language files
 		require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
 		require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
 
 		// It's a guest, so we have to validate the username
-		check_username($username);
+		if (strlen($username) < 2)
+			$errors[] = $lang_prof_reg['Username too short'];
+		else if (!strcasecmp($username, 'invitÃ©') || !strcasecmp($username, $lang_common['Guest']))
+			$errors[] = $lang_prof_reg['Username guest'];
+		else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+			$errors[] = $lang_prof_reg['Username IP'];
+
+		if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
+			$errors[] = $lang_prof_reg['Username reserved chars'];
+		if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+			$errors[] = $lang_prof_reg['Username BBCode'];
+
+		// Check username for any censored words
+		$temp = censor_words($username);
+		if ($temp != $username)
+			$errors[] = $lang_register['Username censor'];
+
+		// Check that the username (or a too similar username) is not already registered
+		$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE username=\''.$db->escape($username).'\' OR username=\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+		if ($db->num_rows($result))
+		{
+			$busy = $db->result($result);
+			$errors[] = $lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2'];
+		}
 
 		if ($pun_config['p_force_guest_email'] == '1' || $email != '')
@@ -106,29 +140,20 @@
 			require PUN_ROOT.'include/email.php';
 			if (!is_valid_email($email))
-				$errors[] = $lang_common['Invalid email'];
-
-			// Check if it's a banned email address
-			// we should only check guests because members addresses are already verified
-			if ($pun_user['is_guest'] && is_banned_email($email))
-			{
-				if ($pun_config['p_allow_banned_email'] == '0')
-					$errors[] = $lang_prof_reg['Banned email'];
-
-				$banned_email = true; // Used later when we send an alert email
-			}
+				$errors[] = $lang_common['Invalid e-mail'];
 		}
 	}
 
 	// Clean up message from POST
-	$orig_message = $message = pun_linebreaks(pun_trim($_POST['req_message']));
-
-	// Here we use strlen() not pun_strlen() as we want to limit the post to PUN_MAX_POSTSIZE bytes, not characters
-	if (strlen($message) > PUN_MAX_POSTSIZE)
-		$errors[] = sprintf($lang_post['Too long message'], forum_number_format(PUN_MAX_POSTSIZE));
-	else if ($pun_config['p_message_all_caps'] == '0' && is_all_uppercase($message) && !$pun_user['is_admmod'])
-		$errors[] = $lang_post['All caps message'];
+	$message = pun_linebreaks(pun_trim($_POST['req_message']));
+
+	if ($message == '')
+		$errors[] = $lang_post['No message'];
+	else if (strlen($message) > 65535)
+		$errors[] = $lang_post['Too long message'];
+	else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD)
+		$message = ucwords(strtolower($message));
 
 	// Validate BBCode syntax
-	if ($pun_config['p_message_bbcode'] == '1')
+	if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
 	{
 		require PUN_ROOT.'include/parser.php';
@@ -136,21 +161,9 @@
 	}
 
-	if (empty($errors))
-	{
-		if ($message == '')
-			$errors[] = $lang_post['No message'];
-		else if ($pun_config['o_censoring'] == '1')
-		{
-			// Censor message to see if that causes problems
-			$censored_message = pun_trim(censor_words($message));
-
-			if ($censored_message == '')
-				$errors[] = $lang_post['No message after censoring'];
-		}
-	}
-
-	$hide_smilies = isset($_POST['hide_smilies']) ? '1' : '0';
-	$subscribe = isset($_POST['subscribe']) ? '1' : '0';
-	$stick_topic = isset($_POST['stick_topic']) && $is_admmod ? '1' : '0';
+
+	require PUN_ROOT.'include/search_idx.php';
+
+	$hide_smilies = isset($_POST['hide_smilies']) ? 1 : 0;
+	$subscribe = isset($_POST['subscribe']) ? 1 : 0;
 
 	$now = time();
@@ -159,6 +172,4 @@
 	if (empty($errors) && !isset($_POST['preview']))
 	{
-		require PUN_ROOT.'include/search_idx.php';
-
 		// If it's a reply
 		if ($tid)
@@ -166,17 +177,14 @@
 			if (!$pun_user['is_guest'])
 			{
-				$new_tid = $tid;
-
 				// Insert the new post
-				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$hide_smilies.', '.$now.', '.$tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
 				$new_pid = $db->insert_id();
 
 				// To subscribe or not to subscribe, that ...
-				if ($pun_config['o_topic_subscriptions'] == '1')
+				if ($pun_config['o_subscriptions'] == '1' && $subscribe)
 				{
-					if ($subscribe && !$is_subscribed)
-						$db->query('INSERT INTO '.$db->prefix.'topic_subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$tid.')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
-					else if (!$subscribe && $is_subscribed)
-						$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$tid) or error('Unable to remove subscription', __FILE__, __LINE__, $db->error());
+					$result = $db->query('SELECT 1 FROM '.$db->prefix.'subscriptions WHERE user_id='.$pun_user['id'].' AND topic_id='.$tid) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
+					if (!$db->num_rows($result))
+						$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$tid.')') or error('Impossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
 				}
 			}
@@ -184,15 +192,15 @@
 			{
 				// It's a guest. Insert the new post
-				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$db->escape($email).'\'' : 'NULL';
-				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$hide_smilies.', '.$now.', '.$tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
+				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
 				$new_pid = $db->insert_id();
 			}
 
 			// Count number of replies in the topic
-			$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$tid) or error('Impossible de retrouver le total de messages de la discussion', __FILE__, __LINE__, $db->error());
 			$num_replies = $db->result($result, 0) - 1;
 
 			// Update topic
-			$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', last_post='.$now.', last_post_id='.$new_pid.', last_poster=\''.$db->escape($username).'\' WHERE id='.$tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', last_post='.$now.', last_post_id='.$new_pid.', last_poster=\''.$db->escape($username).'\' WHERE id='.$tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
 
 			update_search_index('post', $new_pid, $message);
@@ -201,12 +209,12 @@
 
 			// Should we send out notifications?
-			if ($pun_config['o_topic_subscriptions'] == '1')
+			if ($pun_config['o_subscriptions'] == '1')
 			{
 				// Get the post time for the previous post in this topic
-				$result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Impossible de retrouver les information de message', __FILE__, __LINE__, $db->error());
 				$previous_post_time = $db->result($result);
 
 				// Get any subscribed users that should be notified (banned users are excluded)
-				$result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'topic_subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.$pun_user['id']) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Impossible de retrouver les informations d\'abonnement', __FILE__, __LINE__, $db->error());
 				if ($db->num_rows($result))
 				{
@@ -215,13 +223,8 @@
 					$notification_emails = array();
 
-					if ($pun_config['o_censoring'] == '1')
-						$cleaned_message = bbcode2email($censored_message, -1);
-					else
-						$cleaned_message = bbcode2email($message, -1);
-
-					// Loop through subscribed users and send emails
+					// Loop through subscribed users and send e-mails
 					while ($cur_subscriber = $db->fetch_assoc($result))
 					{
-						// Is the subscription email for $cur_subscriber['language'] cached or not?
+						// Is the subscription e-mail for $cur_subscriber['language'] cached or not?
 						if (!isset($notification_emails[$cur_subscriber['language']]))
 						{
@@ -243,18 +246,18 @@
 								$mail_message_full = trim(substr($mail_tpl_full, $first_crlf));
 
-								$mail_subject = str_replace('<topic_subject>', $cur_posting['subject'], $mail_subject);
-								$mail_message = str_replace('<topic_subject>', $cur_posting['subject'], $mail_message);
+								$mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);
+								$mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);
 								$mail_message = str_replace('<replier>', $username, $mail_message);
-								$mail_message = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
-								$mail_message = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&tid='.$tid, $mail_message);
-								$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-								$mail_subject_full = str_replace('<topic_subject>', $cur_posting['subject'], $mail_subject_full);
-								$mail_message_full = str_replace('<topic_subject>', $cur_posting['subject'], $mail_message_full);
+								$mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
+								$mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message);
+								$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+								$mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);
+								$mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);
 								$mail_message_full = str_replace('<replier>', $username, $mail_message_full);
-								$mail_message_full = str_replace('<message>', $cleaned_message, $mail_message_full);
-								$mail_message_full = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
-								$mail_message_full = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&tid='.$tid, $mail_message_full);
-								$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message_full);
+								$mail_message_full = str_replace('<message>', $message, $mail_message_full);
+								$mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
+								$mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full);
+								$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
 
 								$notification_emails[$cur_subscriber['language']][0] = $mail_subject;
@@ -276,6 +279,4 @@
 						}
 					}
-
-					unset($cleaned_message);
 				}
 			}
@@ -285,5 +286,5 @@
 		{
 			// Create the topic
-			$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, sticky, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$stick_topic.', '.$fid.')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());
+			$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.')') or error('Impossible de crÃ©er la discussion', __FILE__, __LINE__, $db->error());
 			$new_tid = $db->insert_id();
 
@@ -291,122 +292,24 @@
 			{
 				// To subscribe or not to subscribe, that ...
-				if ($pun_config['o_topic_subscriptions'] == '1' && $subscribe)
-					$db->query('INSERT INTO '.$db->prefix.'topic_subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$new_tid.')') or error('Unable to add subscription', __FILE__, __LINE__, $db->error());
+				if ($pun_config['o_subscriptions'] == '1' && (isset($_POST['subscribe']) && $_POST['subscribe'] == '1'))
+					$db->query('INSERT INTO '.$db->prefix.'subscriptions (user_id, topic_id) VALUES('.$pun_user['id'].' ,'.$new_tid.')') or error('Impossible d\'ajouter l\'abonnement', __FILE__, __LINE__, $db->error());
 
 				// Create the post ("topic post")
-				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', '.$hide_smilies.', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
 			}
 			else
 			{
 				// Create the post ("topic post")
-				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$db->escape($email).'\'' : 'NULL';
-				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', '.$hide_smilies.', '.$now.', '.$new_tid.')') or error('Unable to create post', __FILE__, __LINE__, $db->error());
+				$email_sql = ($pun_config['p_force_guest_email'] == '1' || $email != '') ? '\''.$email.'\'' : 'NULL';
+				$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_ip, poster_email, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', \''.get_remote_address().'\', '.$email_sql.', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Impossible de crÃ©er le message', __FILE__, __LINE__, $db->error());
 			}
 			$new_pid = $db->insert_id();
 
 			// Update the topic with last_post_id
-			$db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.', first_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
 
 			update_search_index('post', $new_pid, $message, $subject);
 
 			update_forum($fid);
-
-			// Should we send out notifications?
-			if ($pun_config['o_forum_subscriptions'] == '1')
-			{
-				// Get any subscribed users that should be notified (banned users are excluded)
-				$result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'forum_subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.forum_id='.$cur_posting['id'].' AND u.id!='.$pun_user['id']) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
-				if ($db->num_rows($result))
-				{
-					require_once PUN_ROOT.'include/email.php';
-
-					$notification_emails = array();
-
-					if ($pun_config['o_censoring'] == '1')
-						$cleaned_message = bbcode2email($censored_message, -1);
-					else
-						$cleaned_message = bbcode2email($message, -1);
-
-					// Loop through subscribed users and send emails
-					while ($cur_subscriber = $db->fetch_assoc($result))
-					{
-						// Is the subscription email for $cur_subscriber['language'] cached or not?
-						if (!isset($notification_emails[$cur_subscriber['language']]))
-						{
-							if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_topic.tpl'))
-							{
-								// Load the "new topic" template
-								$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_topic.tpl'));
-
-								// Load the "new topic full" template (with post included)
-								$mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_topic_full.tpl'));
-
-								// The first row contains the subject (it also starts with "Subject:")
-								$first_crlf = strpos($mail_tpl, "\n");
-								$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-								$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-								$first_crlf = strpos($mail_tpl_full, "\n");
-								$mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));
-								$mail_message_full = trim(substr($mail_tpl_full, $first_crlf));
-
-								$mail_subject = str_replace('<forum_name>', $cur_posting['forum_name'], $mail_subject);
-								$mail_message = str_replace('<topic_subject>', $pun_config['o_censoring'] == '1' ? $censored_subject : $subject, $mail_message);
-								$mail_message = str_replace('<forum_name>', $cur_posting['forum_name'], $mail_message);
-								$mail_message = str_replace('<poster>', $username, $mail_message);
-								$mail_message = str_replace('<topic_url>', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message);
-								$mail_message = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message);
-								$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-								$mail_subject_full = str_replace('<forum_name>', $cur_posting['forum_name'], $mail_subject_full);
-								$mail_message_full = str_replace('<topic_subject>', $pun_config['o_censoring'] == '1' ? $censored_subject : $subject, $mail_message_full);
-								$mail_message_full = str_replace('<forum_name>', $cur_posting['forum_name'], $mail_message_full);
-								$mail_message_full = str_replace('<poster>', $username, $mail_message_full);
-								$mail_message_full = str_replace('<message>', $cleaned_message, $mail_message_full);
-								$mail_message_full = str_replace('<topic_url>', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message_full);
-								$mail_message_full = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message_full);
-								$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message_full);
-
-								$notification_emails[$cur_subscriber['language']][0] = $mail_subject;
-								$notification_emails[$cur_subscriber['language']][1] = $mail_message;
-								$notification_emails[$cur_subscriber['language']][2] = $mail_subject_full;
-								$notification_emails[$cur_subscriber['language']][3] = $mail_message_full;
-
-								$mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null;
-							}
-						}
-
-						// We have to double check here because the templates could be missing
-						if (isset($notification_emails[$cur_subscriber['language']]))
-						{
-							if ($cur_subscriber['notify_with_post'] == '0')
-								pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);
-							else
-								pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);
-						}
-					}
-
-					unset($cleaned_message);
-				}
-			}
-		}
-
-		// If we previously found out that the email was banned
-		if ($pun_user['is_guest'] && $banned_email && $pun_config['o_mailing_list'] != '')
-		{
-			// Load the "banned email post" template
-			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/banned_email_post.tpl'));
-
-			// The first row contains the subject
-			$first_crlf = strpos($mail_tpl, "\n");
-			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-			$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-			$mail_message = str_replace('<username>', $username, $mail_message);
-			$mail_message = str_replace('<email>', $email, $mail_message);
-			$mail_message = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
-			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-			pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
 		}
 
@@ -414,13 +317,6 @@
 		if (!$pun_user['is_guest'])
 		{
-			$db->query('UPDATE '.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-
-			$tracked_topics = get_tracked_topics();
-			$tracked_topics['topics'][$new_tid] = time();
-			set_tracked_topics($tracked_topics);
-		}
-		else
-		{
-			$db->query('UPDATE '.$db->prefix.'online SET last_post='.$now.' WHERE ident=\''.$db->escape(get_remote_address()).'\'' ) or error('Unable to update user', __FILE__, __LINE__, $db->error());
+			$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
+			$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Impossible de modifier l\'utilisateur', __FILE__, __LINE__, $db->error());
 		}
 
@@ -430,5 +326,5 @@
 
 
-// If a topic ID was specified in the url (it's a reply)
+// If a topic id was specified in the url (it's a reply).
 if ($tid)
 {
@@ -436,5 +332,5 @@
 	$form = '<form id="post" method="post" action="post.php?action=post&amp;tid='.$tid.'" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">';
 
-	// If a quote ID was specified in the url
+	// If a quote-id was specified in the url.
 	if (isset($_GET['qid']))
 	{
@@ -443,5 +339,5 @@
 			message($lang_common['Bad request']);
 
-		$result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Impossible de retrouver les informations de citation', __FILE__, __LINE__, $db->error());
 		if (!$db->num_rows($result))
 			message($lang_common['Bad request']);
@@ -449,38 +345,9 @@
 		list($q_poster, $q_message) = $db->fetch_row($result);
 
-		// If the message contains a code tag we have to split it up (text within [code][/code] shouldn't be touched)
-		if (strpos($q_message, '[code]') !== false && strpos($q_message, '[/code]') !== false)
-		{
-			$errors = array();
-			list($inside, $outside) = split_text($q_message, '[code]', '[/code]', $errors);
-			if (!empty($errors)) // Technically this shouldn't happen, since $q_message is an existing post it should only exist if it previously passed validation
-				message($errors[0]);
-
-			$q_message = implode("\1", $outside);
-		}
-
-		// Remove [img] tags from quoted message
-		$q_message = preg_replace('%\[img(?:=(?:[^\[]*?))?\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%U', '\1\3', $q_message);
-
-		// If we split up the message before we have to concatenate it together again (code tags)
-		if (isset($inside))
-		{
-			$outside = explode("\1", $q_message);
-			$q_message = '';
-
-			$num_tokens = count($outside);
-			for ($i = 0; $i < $num_tokens; ++$i)
-			{
-				$q_message .= $outside[$i];
-				if (isset($inside[$i]))
-					$q_message .= '[code]'.$inside[$i].'[/code]';
-			}
-
-			unset($inside);
-		}
-
-		if ($pun_config['o_censoring'] == '1')
-			$q_message = censor_words($q_message);
-
+		// Mod: Flash MP3 Player (1 nouvelle ligne suit)
+		$q_message = preg_replace("/\[mp3 url=([^ ]+)\]/", "[url]$1[/url]", $q_message);
+
+		$q_message = str_replace('[img]', '[url]', $q_message);
+		$q_message = str_replace('[/img]', '[/url]', $q_message);
 		$q_message = pun_htmlspecialchars($q_message);
 
@@ -510,12 +377,16 @@
 		}
 		else
-			$quote = '> '.$q_poster.' '.$lang_common['wrote']."\n\n".'> '.$q_message."\n";
+			$quote = '> '.$q_poster.' '.$lang_common['wrote'].':'."\n\n".'> '.$q_message."\n";
 	}
-}
-// If a forum ID was specified in the url (new topic)
+
+	$forum_name = '<a href="viewforum.php?id='.$cur_posting['id'].'">'.pun_htmlspecialchars($cur_posting['forum_name']).'</a>';
+}
+// If a forum_id was specified in the url (new topic).
 else if ($fid)
 {
 	$action = $lang_post['Post new topic'];
 	$form = '<form id="post" method="post" action="post.php?action=post&amp;fid='.$fid.'" onsubmit="return process_form(this)">';
+
+	$forum_name = pun_htmlspecialchars($cur_posting['forum_name']);
 }
 else
@@ -523,6 +394,6 @@
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $action);
-$required_fields = array('req_email' => $lang_common['Email'], 'req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$action;
+$required_fields = array('req_email' => $lang_common['E-mail'], 'req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
 $focus_element = array('post');
 
@@ -535,5 +406,4 @@
 }
 
-define('PUN_ACTIVE_PAGE', 'index');
 require PUN_ROOT.'header.php';
 
@@ -541,10 +411,5 @@
 <div class="linkst">
 	<div class="inbox">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_posting['id'] ?>"><?php echo pun_htmlspecialchars($cur_posting['forum_name']) ?></a></li>
-<?php if (isset($cur_posting['subject'])): ?>			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_posting['subject']) ?></a></li>
-<?php endif; ?>			<li><span>Â»&#160;</span><strong><?php echo $action ?></strong></li>
-		</ul>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<?php echo $forum_name ?><?php if (isset($cur_posting['subject'])) echo '</li><li>&#160;&raquo;&#160;'.pun_htmlspecialchars($cur_posting['subject']) ?></li></ul>
 	</div>
 </div>
@@ -560,10 +425,10 @@
 	<h2><span><?php echo $lang_post['Post errors'] ?></span></h2>
 	<div class="box">
-		<div class="inbox error-info">
+		<div class="inbox">
 			<p><?php echo $lang_post['Post errors info'] ?></p>
-			<ul class="error-list">
-<?php
-
-	foreach ($errors as $cur_error)
+			<ul>
+<?php
+
+	while (list(, $cur_error) = each($errors))
 		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
 ?>
@@ -586,9 +451,7 @@
 	<div class="box">
 		<div class="inbox">
-			<div class="postbody">
-				<div class="postright">
-					<div class="postmsg">
-						<?php echo $preview_message."\n" ?>
-					</div>
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $preview_message."\n" ?>
 				</div>
 			</div>
@@ -605,5 +468,5 @@
 
 ?>
-<div id="postform" class="blockform">
+<div class="blockform">
 	<h2><span><?php echo $action ?></span></h2>
 	<div class="box">
@@ -614,14 +477,14 @@
 					<div class="infldset txtarea">
 						<input type="hidden" name="form_sent" value="1" />
+						<input type="hidden" name="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'InvitÃ©'; ?>" />
 <?php
 
 if ($pun_user['is_guest'])
 {
-	$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['Email'].' <span>'.$lang_common['Required'].'</span></strong>' : $lang_common['Email'];
+	$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['E-mail'].'</strong>' : $lang_common['E-mail'];
 	$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
 
-?>
-						<label class="conl required"><strong><?php echo $lang_post['Guest name'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="25" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
-						<label class="conl<?php echo ($pun_config['p_force_guest_email'] == '1') ? ' required' : '' ?>"><?php echo $email_label ?><br /><input type="text" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="50" maxlength="80" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+?>						<label class="conl"><strong><?php echo $lang_post['Guest name'] ?></strong><br /><input type="text" name="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="25" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+						<label class="conl"><?php echo $email_label ?><br /><input type="text" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="50" maxlength="50" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
 						<div class="clearer"></div>
 <?php
@@ -630,11 +493,12 @@
 
 if ($fid): ?>
-						<label class="required"><strong><?php echo $lang_common['Subject'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
-<?php endif; ?>						<label class="required"><strong><?php echo $lang_common['Message'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($orig_message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>
+						<label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
+<?php endif; require PUN_ROOT.'mod_easy_bbcode.php'; ?>						<label><strong><?php echo $lang_common['Message'] ?></strong><br />
+
+						<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>
 						<ul class="bblinks">
-							<li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
 						</ul>
 					</div>
@@ -643,31 +507,14 @@
 
 $checkboxes = array();
-if ($is_admmod)
-	$checkboxes[] = '<label><input type="checkbox" name="stick_topic" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['stick_topic']) ? ' checked="checked"' : '').' />'.$lang_common['Stick topic'].'<br /></label>';
-
 if (!$pun_user['is_guest'])
 {
 	if ($pun_config['o_smilies'] == '1')
-		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'].'<br /></label>';
-
-	if ($pun_config['o_topic_subscriptions'] == '1')
-	{
-		$subscr_checked = false;
-
-		// If it's a preview
-		if (isset($_POST['preview']))
-			$subscr_checked = isset($_POST['subscribe']) ? true : false;
-		// If auto subscribed
-		else if ($pun_user['auto_notify'])
-			$subscr_checked = true;
-		// If already subscribed to the topic
-		else if ($is_subscribed)
-			$subscr_checked = true;
-
-		$checkboxes[] = '<label><input type="checkbox" name="subscribe" value="1" tabindex="'.($cur_index++).'"'.($subscr_checked ? ' checked="checked"' : '').' />'.($is_subscribed ? $lang_post['Stay subscribed'] : $lang_post['Subscribe']).'<br /></label>';
-	}
+		$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'];
+
+	if ($pun_config['o_subscriptions'] == '1')
+		$checkboxes[] = '<label><input type="checkbox" name="subscribe" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['subscribe']) ? ' checked="checked"' : '').' />'.$lang_post['Subscribe'];
 }
 else if ($pun_config['o_smilies'] == '1')
-	$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'].'<br /></label>';
+	$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(isset($_POST['hide_smilies']) ? ' checked="checked"' : '').' />'.$lang_post['Hide smilies'];
 
 if (!empty($checkboxes))
@@ -681,5 +528,5 @@
 					<div class="infldset">
 						<div class="rbox">
-							<?php echo implode("\n\t\t\t\t\t\t\t", $checkboxes)."\n" ?>
+							<?php echo implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
 						</div>
 					</div>
@@ -691,5 +538,5 @@
 ?>
 			</div>
-			<p class="buttons"><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /> <input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="submit" value="<?php echo $lang_common['Submit'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="s" /><input type="submit" name="preview" value="<?php echo $lang_post['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -698,22 +545,26 @@
 <?php
 
-// Check to see if the topic review is to be displayed
+// Check to see if the topic review is to be displayed.
 if ($tid && $pun_config['o_topic_review'] != '0')
 {
 	require_once PUN_ROOT.'include/parser.php';
 
-	$result = $db->query('SELECT poster, message, hide_smilies, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT '.$pun_config['o_topic_review']) or error('Unable to fetch topic review', __FILE__, __LINE__, $db->error());
-
-?>
-
-<div id="postreview">
+	$result = $db->query('SELECT poster, message, hide_smilies, posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT '.$pun_config['o_topic_review']) or error('Impossible de retrouver le rÃ©sumÃ© de la discussion', __FILE__, __LINE__, $db->error());
+
+?>
+
+<div id="postreview" class="blockpost">
 	<h2><span><?php echo $lang_post['Topic review'] ?></span></h2>
 <?php
 
-	// Set background switching on
+	//Set background switching on
+	$bg_switch = true;
 	$post_count = 0;
 
 	while ($cur_post = $db->fetch_assoc($result))
 	{
+		// Switch the background color for every message.
+		$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+		$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
 		$post_count++;
 
@@ -721,22 +572,18 @@
 
 ?>
-	<div class="blockpost">
-		<div class="box<?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?>">
-			<div class="inbox">
-				<div class="postbody">
-					<div class="postleft">
-						<dl>
-							<dt><strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></dt>
-							<dd><span><?php echo format_time($cur_post['posted']) ?></span></dd>
-						</dl>
-					</div>
-					<div class="postright">
-						<div class="postmsg">
-							<?php echo $cur_post['message']."\n" ?>
-						</div>
-					</div>
+	<div class="box<?php echo $vtbg ?>">
+		<div class="inbox">
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></dt>
+					<dd><?php echo format_time($cur_post['posted']) ?></dd>
+				</dl>
+			</div>
+			<div class="postright">
+				<div class="postmsg">
+					<?php echo $cur_post['message'] ?>
 				</div>
-				<div class="clearer"></div>
 			</div>
+			<div class="clearer"></div>
 		</div>
 	</div>
Index: /trunk/web/punbb/profile.php
===================================================================
--- /trunk/web/punbb/profile.php	(revision 10)
+++ /trunk/web/punbb/profile.php	(revision 1)
@@ -1,17 +1,30 @@
 <?php
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
-
-// Include UTF-8 function
-require PUN_ROOT.'include/utf8/substr_replace.php';
-require PUN_ROOT.'include/utf8/ucwords.php'; // utf8_ucwords needs utf8_substr_replace
-require PUN_ROOT.'include/utf8/strcasecmp.php';
 
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -21,11 +34,6 @@
 	message($lang_common['Bad request']);
 
-if ($action != 'change_pass' || !isset($_GET['key']))
-{
-	if ($pun_user['g_read_board'] == '0')
-		message($lang_common['No view']);
-	else if ($pun_user['g_view_users'] == '0' && ($pun_user['is_guest'] || $pun_user['id'] != $id))
-		message($lang_common['No permission']);
-}
+if ($pun_user['g_read_board'] == '0' && ($action != 'change_pass' || !isset($_GET['key'])))
+	message($lang_common['No view']);
 
 // Load the profile.php/register.php language file
@@ -49,12 +57,12 @@
 		$key = $_GET['key'];
 
-		$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error());
-		$cur_user = $db->fetch_assoc($result);
-
-		if ($key == '' || $key != $cur_user['activate_key'])
+		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver le nouveau mot de passe', __FILE__, __LINE__, $db->error());
+		list($new_password_hash, $new_password_key) = $db->fetch_row($result);
+
+		if ($key == '' || $key != $new_password_key)
 			message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 		else
 		{
-			$db->query('UPDATE '.$db->prefix.'users SET password=\''.$cur_user['activate_string'].'\', activate_string=NULL, activate_key=NULL'.(!empty($cur_user['salt']) ? ', salt=NULL' : '').' WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
 
 			message($lang_profile['Pass updated'], true);
@@ -65,15 +73,13 @@
 	if ($pun_user['id'] != $id)
 	{
-		if (!$pun_user['is_admmod']) // A regular user trying to change another users password?
+		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users password?
 			message($lang_common['No permission']);
-		else if ($pun_user['g_moderator'] == '1') // A moderator trying to change a users password?
-		{
-			$result = $db->query('SELECT u.group_id, g.g_moderator FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON (g.g_id=u.group_id) WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users password?
+		{
+			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 			if (!$db->num_rows($result))
 				message($lang_common['Bad request']);
 
-			list($group_id, $is_moderator) = $db->fetch_row($result);
-
-			if ($pun_user['g_mod_edit_users'] == '0' || $pun_user['g_mod_change_passwords'] == '0' || $group_id == PUN_ADMIN || $is_moderator == '1')
+			if ($pun_config['p_mod_edit_users'] == '0' || $pun_config['p_mod_change_passwords'] == '0' || $db->result($result) < PUN_GUEST)
 				message($lang_common['No permission']);
 		}
@@ -82,26 +88,28 @@
 	if (isset($_POST['form_sent']))
 	{
-		if ($pun_user['is_admmod'])
-			confirm_referrer('profile.php');
-
-		$old_password = isset($_POST['req_old_password']) ? pun_trim($_POST['req_old_password']) : '';
-		$new_password1 = pun_trim($_POST['req_new_password1']);
-		$new_password2 = pun_trim($_POST['req_new_password2']);
+		$old_password = isset($_POST['req_old_password']) ? trim($_POST['req_old_password']) : '';
+		$new_password1 = trim($_POST['req_new_password1']);
+		$new_password2 = trim($_POST['req_new_password2']);
 
 		if ($new_password1 != $new_password2)
 			message($lang_prof_reg['Pass not match']);
-		if (pun_strlen($new_password1) < 4)
+		if (strlen($new_password1) < 4)
 			message($lang_prof_reg['Pass too short']);
 
-		$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch password', __FILE__, __LINE__, $db->error());
-		$cur_user = $db->fetch_assoc($result);
+		$result = $db->query('SELECT password, save_pass FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver le mot de passe', __FILE__, __LINE__, $db->error());
+		list($db_password_hash, $save_pass) = $db->fetch_row($result);
 
 		$authorized = false;
 
-		if (!empty($cur_user['password']))
-		{
-			$old_password_hash = pun_hash($old_password);
-
-			if ($cur_user['password'] == $old_password_hash || $pun_user['is_admmod'])
+		if (!empty($db_password_hash))
+		{
+			$sha1_in_db = (strlen($db_password_hash) == 40) ? true : false;
+			$sha1_available = (function_exists('sha1') || function_exists('mhash')) ? true : false;
+
+			$old_password_hash = pun_hash($old_password);	// This could result in either an SHA-1 or an MD5 hash
+
+			if (($sha1_in_db && $sha1_available && $db_password_hash == $old_password_hash) ||
+				(!$sha1_in_db && $db_password_hash == md5($old_password)) ||
+				$pun_user['g_id'] < PUN_GUEST)
 				$authorized = true;
 		}
@@ -112,16 +120,18 @@
 		$new_password_hash = pun_hash($new_password1);
 
-		$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\''.(!empty($cur_user['salt']) ? ', salt=NULL' : '').' WHERE id='.$id) or error('Unable to update password', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'users SET password=\''.$new_password_hash.'\' WHERE id='.$id) or error('Impossible de modifier le mot de passe', __FILE__, __LINE__, $db->error());
 
 		if ($pun_user['id'] == $id)
-			pun_setcookie($pun_user['id'], $new_password_hash, time() + $pun_config['o_timeout_visit']);
+		{
+			$expire = ($save_pass == '1') ? time() + 31536000 : 0;
+			pun_setcookie($pun_user['id'], $new_password_hash, $expire);
+		}
 
 		redirect('profile.php?section=essentials&amp;id='.$id, $lang_profile['Pass updated redirect']);
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Change pass']);
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 	$required_fields = array('req_old_password' => $lang_profile['Old pass'], 'req_new_password1' => $lang_profile['New pass'], 'req_new_password2' => $lang_profile['Confirm new pass']);
-	$focus_element = array('change_pass', ((!$pun_user['is_admmod']) ? 'req_old_password' : 'req_new_password1'));
-	define('PUN_ACTIVE_PAGE', 'profile');
+	$focus_element = array('change_pass', (($pun_user['g_id'] > PUN_MOD) ? 'req_old_password' : 'req_new_password1'));
 	require PUN_ROOT.'header.php';
 
@@ -136,15 +146,15 @@
 					<legend><?php echo $lang_profile['Change pass legend'] ?></legend>
 					<div class="infldset">
-<?php if (!$pun_user['is_admmod']): ?>						<label class="required"><strong><?php echo $lang_profile['Old pass'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<input type="password" name="req_old_password" size="16" /><br /></label>
-<?php endif; ?>						<label class="conl required"><strong><?php echo $lang_profile['New pass'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<input type="password" name="req_new_password1" size="16" /><br /></label>
-						<label class="conl required"><strong><?php echo $lang_profile['Confirm new pass'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<input type="password" name="req_new_password2" size="16" /><br /></label>
-						<p class="clearb"><?php echo $lang_profile['Pass info'] ?></p>
+<?php if ($pun_user['g_id'] > PUN_MOD): ?>						<label><strong><?php echo $lang_profile['Old pass'] ?></strong><br />
+						<input type="password" name="req_old_password" size="16" maxlength="16" /><br /></label>
+<?php endif; ?>						<label class="conl"><strong><?php echo $lang_profile['New pass'] ?></strong><br />
+						<input type="password" name="req_new_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong><?php echo $lang_profile['Confirm new pass'] ?></strong><br />
+						<input type="password" name="req_new_password2" size="16" maxlength="16" /><br /></label>
+						<div class="clearb"></div>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -158,18 +168,16 @@
 else if ($action == 'change_email')
 {
-	// Make sure we are allowed to change this users email
+	// Make sure we are allowed to change this users e-mail
 	if ($pun_user['id'] != $id)
 	{
-		if (!$pun_user['is_admmod']) // A regular user trying to change another users email?
+		if ($pun_user['g_id'] > PUN_MOD)	// A regular user trying to change another users e-mail?
 			message($lang_common['No permission']);
-		else if ($pun_user['g_moderator'] == '1') // A moderator trying to change a users email?
-		{
-			$result = $db->query('SELECT u.group_id, g.g_moderator FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON (g.g_id=u.group_id) WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+		else if ($pun_user['g_id'] == PUN_MOD)	// A moderator trying to change a users e-mail?
+		{
+			$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 			if (!$db->num_rows($result))
 				message($lang_common['Bad request']);
 
-			list($group_id, $is_moderator) = $db->fetch_row($result);
-
-			if ($pun_user['g_mod_edit_users'] == '0' || $group_id == PUN_ADMIN || $is_moderator == '1')
+			if ($pun_config['p_mod_edit_users'] == '0' || $db->result($result) < PUN_GUEST)
 				message($lang_common['No permission']);
 		}
@@ -180,14 +188,14 @@
 		$key = $_GET['key'];
 
-		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch activation data', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
 		list($new_email, $new_email_key) = $db->fetch_row($result);
 
-		if ($key == '' || $key != $new_email_key)
-			message($lang_profile['Email key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
+		if ($key != $new_email_key)
+			message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 		else
 		{
-			$db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update email address', __FILE__, __LINE__, $db->error());
-
-			message($lang_profile['Email updated'], true);
+			$db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Impossible de modifier l\'adresse e-mail', __FILE__, __LINE__, $db->error());
+
+			message($lang_profile['E-mail updated'], true);
 		}
 	}
@@ -199,28 +207,18 @@
 		require PUN_ROOT.'include/email.php';
 
-		// Validate the email address
+		// Validate the email-address
 		$new_email = strtolower(trim($_POST['req_new_email']));
 		if (!is_valid_email($new_email))
-			message($lang_common['Invalid email']);
-
-		// Check if it's a banned email address
+			message($lang_common['Invalid e-mail']);
+
+		// Check it it's a banned e-mail address
 		if (is_banned_email($new_email))
 		{
 			if ($pun_config['p_allow_banned_email'] == '0')
-				message($lang_prof_reg['Banned email']);
+				message($lang_prof_reg['Banned e-mail']);
 			else if ($pun_config['o_mailing_list'] != '')
 			{
-				// Load the "banned email change" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/banned_email_change.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
-				$mail_message = str_replace('<email>', $new_email, $mail_message);
-				$mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$id, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
+				$mail_subject = 'Alerte - Adresse e-mail bannis dÃ©tectÃ©e';
+				$mail_message = 'L\'utilisateur \''.$pun_user['username'].'\' a changÃ© son e-mail en une adresse interdite : '.$new_email."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
 
 				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -228,10 +226,10 @@
 		}
 
-		// Check if someone else already has registered with that email address
-		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+		// Check if someone else already has registered with that e-mail address
+		$result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 		if ($db->num_rows($result))
 		{
 			if ($pun_config['p_allow_dupe_email'] == '0')
-				message($lang_prof_reg['Dupe email']);
+				message($lang_prof_reg['Dupe e-mail']);
 			else if ($pun_config['o_mailing_list'] != '')
 			{
@@ -239,16 +237,6 @@
 					$dupe_list[] = $cur_dupe['username'];
 
-				// Load the "dupe email change" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/dupe_email_change.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
-				$mail_message = str_replace('<dupe_list>', implode(', ', $dupe_list), $mail_message);
-				$mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$id, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
+				$mail_subject = 'Alerte - Adresse e-mail en doublon dÃ©tectÃ©e';
+				$mail_message = 'L\'utilisateur \''.$pun_user['username'].'\' a changÃ© son e-mail pour une adresse qui appartient dÃ©jÃ  Ã  : '.implode(', ', $dupe_list)."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$id."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
 
 				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -259,7 +247,7 @@
 		$new_email_key = random_pass(8);
 
-		$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
-
-		// Load the "activate email" template
+		$db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Impossible de modifier les donnÃ©es d\'activation', __FILE__, __LINE__, $db->error());
+
+		// Load the "activate e-mail" template
 		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));
 
@@ -270,36 +258,35 @@
 
 		$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
-		$mail_message = str_replace('<base_url>', get_base_url(), $mail_message);
-		$mail_message = str_replace('<activation_url>', get_base_url().'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
-		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
+		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'], $mail_message);
+		$mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
 
 		pun_mail($new_email, $mail_subject, $mail_message);
 
-		message($lang_profile['Activate email sent'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
-	}
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Change email']);
-	$required_fields = array('req_new_email' => $lang_profile['New email'], 'req_password' => $lang_common['Password']);
+		message($lang_profile['Activate e-mail sent'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+	}
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+	$required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
 	$focus_element = array('change_email', 'req_new_email');
-	define('PUN_ACTIVE_PAGE', 'profile');
 	require PUN_ROOT.'header.php';
 
 ?>
 <div class="blockform">
-	<h2><span><?php echo $lang_profile['Change email'] ?></span></h2>
+	<h2><span><?php echo $lang_profile['Change e-mail'] ?></span></h2>
 	<div class="box">
 		<form id="change_email" method="post" action="profile.php?action=change_email&amp;id=<?php echo $id ?>" id="change_email" onsubmit="return process_form(this)">
 			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_profile['Email legend'] ?></legend>
+					<legend><?php echo $lang_profile['E-mail legend'] ?></legend>
 					<div class="infldset">
 						<input type="hidden" name="form_sent" value="1" />
-						<label class="required"><strong><?php echo $lang_profile['New email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_new_email" size="50" maxlength="80" /><br /></label>
-						<label class="required"><strong><?php echo $lang_common['Password'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password" size="16" /><br /></label>
-						<p><?php echo $lang_profile['Email instructions'] ?></p>
+						<label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
+						<label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
+						<p><?php echo $lang_profile['E-mail instructions'] ?></p>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="new_email" value="<?php echo $lang_common['Submit'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="new_email" value="<?php echo $lang_common['Submit'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -316,5 +303,5 @@
 		message($lang_profile['Avatars disabled']);
 
-	if ($pun_user['id'] != $id && !$pun_user['is_admmod'])
+	if ($pun_user['id'] != $id && $pun_user['g_id'] > PUN_MOD)
 		message($lang_common['No permission']);
 
@@ -323,5 +310,5 @@
 		if (!isset($_FILES['req_file']))
 			message($lang_profile['No file']);
-
+			
 		$uploaded_file = $_FILES['req_file'];
 
@@ -331,18 +318,18 @@
 			switch ($uploaded_file['error'])
 			{
-				case 1: // UPLOAD_ERR_INI_SIZE
-				case 2: // UPLOAD_ERR_FORM_SIZE
+				case 1:	// UPLOAD_ERR_INI_SIZE
+				case 2:	// UPLOAD_ERR_FORM_SIZE
 					message($lang_profile['Too large ini']);
 					break;
 
-				case 3: // UPLOAD_ERR_PARTIAL
+				case 3:	// UPLOAD_ERR_PARTIAL
 					message($lang_profile['Partial upload']);
 					break;
 
-				case 4: // UPLOAD_ERR_NO_FILE
+				case 4:	// UPLOAD_ERR_NO_FILE
 					message($lang_profile['No file']);
 					break;
 
-				case 6: // UPLOAD_ERR_NO_TMP_DIR
+				case 6:	// UPLOAD_ERR_NO_TMP_DIR
 					message($lang_profile['No tmp directory']);
 					break;
@@ -358,5 +345,4 @@
 		if (is_uploaded_file($uploaded_file['tmp_name']))
 		{
-			// Preliminary file check, adequate in most cases
 			$allowed_types = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
 			if (!in_array($uploaded_file['type'], $allowed_types))
@@ -365,48 +351,51 @@
 			// Make sure the file isn't too big
 			if ($uploaded_file['size'] > $pun_config['o_avatars_size'])
-				message($lang_profile['Too large'].' '.forum_number_format($pun_config['o_avatars_size']).' '.$lang_profile['bytes'].'.');
-
-			// Move the file to the avatar directory. We do this before checking the width/height to circumvent open_basedir restrictions
-			if (!@move_uploaded_file($uploaded_file['tmp_name'], PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp'))
+				message($lang_profile['Too large'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].'.');
+
+			// Determine type
+			$extensions = null;
+			if ($uploaded_file['type'] == 'image/gif')
+				$extensions = array('.gif', '.jpg', '.png');
+			else if ($uploaded_file['type'] == 'image/jpeg' || $uploaded_file['type'] == 'image/pjpeg')
+				$extensions = array('.jpg', '.gif', '.png');
+			else
+				$extensions = array('.png', '.gif', '.jpg');
+
+			// Move the file to the avatar directory. We do this before checking the width/height to circumvent open_basedir restrictions.
+			if (!@move_uploaded_file($uploaded_file['tmp_name'], $pun_config['o_avatars_dir'].'/'.$id.'.tmp'))
 				message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 
-			list($width, $height, $type,) = @getimagesize(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp');
-
-			// Determine type
-			if ($type == IMAGETYPE_GIF)
-				$extension = '.gif';
-			else if ($type == IMAGETYPE_JPEG)
-				$extension = '.jpg';
-			else if ($type == IMAGETYPE_PNG)
-				$extension = '.png';
-			else
-			{
-				// Invalid type
-				@unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp');
-				message($lang_profile['Bad type']);
-			}
-
 			// Now check the width/height
+			list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
 			if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
 			{
-				@unlink(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+				@unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
 				message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
 			}
+			else if ($type == 1 && $uploaded_file['type'] != 'image/gif')	// Prevent dodgy uploads
+			{
+				@unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
+				message($lang_profile['Bad type']);
+			}			
 
 			// Delete any old avatars and put the new one in place
-			delete_avatar($id);
-			@rename(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.'.tmp', PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extension);
-			@chmod(PUN_ROOT.$pun_config['o_avatars_dir'].'/'.$id.$extension, 0644);
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[1]);
+			@unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[2]);
+			@rename($pun_config['o_avatars_dir'].'/'.$id.'.tmp', $pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
+			@chmod($pun_config['o_avatars_dir'].'/'.$id.$extensions[0], 0644);
 		}
 		else
 			message($lang_profile['Unknown failure']);
 
+		// Enable use_avatar (seems sane since the user just uploaded an avatar)
+		$db->query('UPDATE '.$db->prefix.'users SET use_avatar=1 WHERE id='.$id) or error('Impossible de modifier l\'Ã©tat de l\'avatar', __FILE__, __LINE__, $db->error());
+
 		redirect('profile.php?section=personality&amp;id='.$id, $lang_profile['Avatar upload redirect']);
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Upload avatar']);
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 	$required_fields = array('req_file' => $lang_profile['File']);
 	$focus_element = array('upload_avatar', 'req_file');
-	define('PUN_ACTIVE_PAGE', 'profile');
 	require PUN_ROOT.'header.php';
 
@@ -422,10 +411,10 @@
 						<input type="hidden" name="form_sent" value="1" />
 						<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" />
-						<label class="required"><strong><?php echo $lang_profile['File'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input name="req_file" type="file" size="40" /><br /></label>
-						<p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.forum_number_format($pun_config['o_avatars_size']).' '.$lang_profile['bytes'].' ('.file_size($pun_config['o_avatars_size']).').' ?></p>
+						<label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label>
+						<p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="upload" value="<?php echo $lang_profile['Upload'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="upload" value="<?php echo $lang_profile['Upload'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -439,10 +428,15 @@
 else if ($action == 'delete_avatar')
 {
-	if ($pun_user['id'] != $id && !$pun_user['is_admmod'])
+	if ($pun_user['id'] != $id && $pun_user['g_id'] > PUN_MOD)
 		message($lang_common['No permission']);
 
 	confirm_referrer('profile.php');
 
-	delete_avatar($id);
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.jpg');
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.png');
+	@unlink($pun_config['o_avatars_dir'].'/'.$id.'.gif');
+
+	// Disable use_avatar
+	$db->query('UPDATE '.$db->prefix.'users SET use_avatar=0 WHERE id='.$id) or error('Impossible de modifier l\'Ã©tat de l\'avatar', __FILE__, __LINE__, $db->error());
 
 	redirect('profile.php?section=personality&amp;id='.$id, $lang_profile['Avatar deleted redirect']);
@@ -459,19 +453,10 @@
 	$new_group_id = intval($_POST['group_id']);
 
-	$db->query('UPDATE '.$db->prefix.'users SET group_id='.$new_group_id.' WHERE id='.$id) or error('Unable to change user group', __FILE__, __LINE__, $db->error());
-
-	// Regenerate the users info cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
-	generate_users_info_cache();
-
-	$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$new_group_id) or error('Unable to fetch group', __FILE__, __LINE__, $db->error());
-	$new_group_mod = $db->result($result);
+	$db->query('UPDATE '.$db->prefix.'users SET group_id='.$new_group_id.' WHERE id='.$id) or error('Impossible de change de groupe', __FILE__, __LINE__, $db->error());
 
 	// If the user was a moderator or an administrator, we remove him/her from the moderator list in all forums as well
-	if ($new_group_id != PUN_ADMIN && $new_group_mod != '1')
-	{
-		$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
+	if ($new_group_id > PUN_MOD)
+	{
+		$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
 
 		while ($cur_forum = $db->fetch_assoc($result))
@@ -485,5 +470,5 @@
 				$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
 
-				$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+				$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier le forum', __FILE__, __LINE__, $db->error());
 			}
 		}
@@ -502,5 +487,5 @@
 
 	// Get the username of the user we are processing
-	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 	$username = $db->result($result);
 
@@ -508,5 +493,5 @@
 
 	// Loop through all forums
-	$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
 
 	while ($cur_forum = $db->fetch_assoc($result))
@@ -517,7 +502,7 @@
 		{
 			$cur_moderators[$username] = $id;
-			uksort($cur_moderators, 'utf8_strcasecmp');
-
-			$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+			ksort($cur_moderators);
+
+			$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
 		}
 		// If the user shouldn't have moderator access (and he/she already has it)
@@ -527,5 +512,5 @@
 			$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
 
-			$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
 		}
 	}
@@ -537,20 +522,8 @@
 else if (isset($_POST['ban']))
 {
-	if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] != '1' || $pun_user['g_mod_ban_users'] == '0'))
+	if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
 		message($lang_common['No permission']);
 
-	// Get the username of the user we are banning
-	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch username', __FILE__, __LINE__, $db->error());
-	$username = $db->result($result);
-
-	// Check whether user is already banned
-	$result = $db->query('SELECT id FROM '.$db->prefix.'bans WHERE username = \''.$db->escape($username).'\' ORDER BY expire IS NULL DESC, expire DESC LIMIT 1') or error('Unable to fetch ban ID', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result))
-	{
-		$ban_id = $db->result($result);
-		redirect('admin_bans.php?edit_ban='.$ban_id.'&amp;exists', $lang_profile['Ban redirect']);
-	}
-	else
-		redirect('admin_bans.php?add_ban='.$id, $lang_profile['Ban redirect']);
+	redirect('admin_bans.php?add_ban='.$id, $lang_profile['Ban redirect']);
 }
 
@@ -564,19 +537,16 @@
 
 	// Get the username and group of the user we are deleting
-	$result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 	list($group_id, $username) = $db->fetch_row($result);
-
-	if ($group_id == PUN_ADMIN)
-		message($lang_profile['No delete admin message']);
+	
+	if ($group_id == PUN_ADMIN)  
+		message('Les administrateurs ne peuvent Ãªtres supprimÃ©s. Afin de supprimer cet utilisateur vous devez d\'abord le dÃ©placer dans un autre groupe.');  
 
 	if (isset($_POST['delete_user_comply']))
 	{
 		// If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well
-		$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group', __FILE__, __LINE__, $db->error());
-		$group_mod = $db->result($result);
-
-		if ($group_id == PUN_ADMIN || $group_mod == '1')
-		{
-			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
+		if ($group_id < PUN_GUEST)
+		{
+			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
 
 			while ($cur_forum = $db->fetch_assoc($result))
@@ -589,5 +559,5 @@
 					$cur_moderators = (!empty($cur_moderators)) ? '\''.$db->escape(serialize($cur_moderators)).'\'' : 'NULL';
 
-					$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+					$db->query('UPDATE '.$db->prefix.'forums SET moderators='.$cur_moderators.' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
 				}
 			}
@@ -595,9 +565,8 @@
 
 		// Delete any subscriptions
-		$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE user_id='.$id) or error('Unable to delete topic subscriptions', __FILE__, __LINE__, $db->error());
-		$db->query('DELETE FROM '.$db->prefix.'forum_subscriptions WHERE user_id='.$id) or error('Unable to delete forum subscriptions', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'subscriptions WHERE user_id='.$id) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());
 
 		// Remove him/her from the online list (if they happen to be logged in)
-		$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$id) or error('Unable to remove user from online list', __FILE__, __LINE__, $db->error());
+		$db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$id) or error('Impossible de retirer l\'utilisateur de la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 		// Should we delete all posts made by this user?
@@ -608,5 +577,5 @@
 
 			// Find all posts made by this user
-			$result = $db->query('SELECT p.id, p.topic_id, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE p.poster_id='.$id) or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT p.id, p.topic_id, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE p.poster_id='.$id) or error('Impossible de retrouver les messages', __FILE__, __LINE__, $db->error());
 			if ($db->num_rows($result))
 			{
@@ -614,5 +583,5 @@
 				{
 					// Determine whether this post is the "topic post" or not
-					$result2 = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['topic_id'].' ORDER BY posted LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+					$result2 = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$cur_post['topic_id'].' ORDER BY posted LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 
 					if ($db->result($result2) == $cur_post['id'])
@@ -627,23 +596,13 @@
 		else
 			// Set all his/her posts to guest
-			$db->query('UPDATE '.$db->prefix.'posts SET poster_id=1 WHERE poster_id='.$id) or error('Unable to update posts', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'posts SET poster_id=1 WHERE poster_id='.$id) or error('Impossible de modifier les messages', __FILE__, __LINE__, $db->error());
 
 		// Delete the user
-		$db->query('DELETE FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to delete user', __FILE__, __LINE__, $db->error());
-
-		// Delete user avatar
-		delete_avatar($id);
-
-		// Regenerate the users info cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
+		$db->query('DELETE FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de supprimer l\'utilisateur', __FILE__, __LINE__, $db->error());
 
 		redirect('index.php', $lang_profile['User delete redirect']);
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Confirm delete user']);
-	define('PUN_ACTIVE_PAGE', 'profile');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 	require PUN_ROOT.'header.php';
 
@@ -657,5 +616,5 @@
 					<legend><?php echo $lang_profile['Confirm delete legend'] ?></legend>
 					<div class="infldset">
-						<p><?php echo $lang_profile['Confirmation info'].' <strong>'.pun_htmlspecialchars($username).'</strong>.' ?></p>
+						<p><?php echo $lang_profile['Confirmation info'].' '.pun_htmlspecialchars($username).'.' ?></p>
 						<div class="rbox">
 							<label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label>
@@ -665,5 +624,5 @@
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="delete_user_comply" value="<?php echo $lang_profile['Delete'] ?>" /> <a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
+			<p><input type="submit" name="delete_user_comply" value="<?php echo $lang_profile['Delete'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
 		</form>
 	</div>
@@ -678,20 +637,32 @@
 {
 	// Fetch the user group of the user we are editing
-	$result = $db->query('SELECT u.username, u.group_id, g.g_moderator FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON (g.g_id=u.group_id) WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
 		message($lang_common['Bad request']);
 
-	list($old_username, $group_id, $is_moderator) = $db->fetch_row($result);
-
-	if ($pun_user['id'] != $id &&																	// If we arent the user (i.e. editing your own profile)
-		(!$pun_user['is_admmod'] ||																	// and we are not an admin or mod
-		($pun_user['g_id'] != PUN_ADMIN &&															// or we aren't an admin and ...
-		($pun_user['g_mod_edit_users'] == '0' ||													// mods aren't allowed to edit users
-		$group_id == PUN_ADMIN ||																	// or the user is an admin
-		$is_moderator))))																			// or the user is another mod
+	$group_id = $db->result($result);
+
+	if ($pun_user['id'] != $id &&
+		($pun_user['g_id'] > PUN_MOD ||
+		($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') ||
+		($pun_user['g_id'] == PUN_MOD && $group_id < PUN_GUEST)))
 		message($lang_common['No permission']);
 
-	if ($pun_user['is_admmod'])
+	if ($pun_user['g_id'] < PUN_GUEST)
 		confirm_referrer('profile.php');
+
+	// Extract allowed elements from $_POST['form']
+	function extract_elements($allowed_elements)
+	{
+		$form = array();
+
+		while (list($key, $value) = @each($_POST['form']))
+		{
+		    if (in_array($key, $allowed_elements))
+		        $form[$key] = $value;
+		}
+
+		return $form;
+	}
 
 	$username_updated = false;
@@ -702,41 +673,34 @@
 		case 'essentials':
 		{
-			$form = array(
-				'timezone'		=> floatval($_POST['form']['timezone']),
-				'dst'			=> isset($_POST['form']['dst']) ? '1' : '0',
-				'time_format'	=> intval($_POST['form']['time_format']),
-				'date_format'	=> intval($_POST['form']['date_format']),
-			);
-
-			// Make sure we got a valid language string
-			if (isset($_POST['form']['language']))
+			$form = extract_elements(array('timezone', 'language'));
+
+			if ($pun_user['g_id'] < PUN_GUEST)
 			{
-				$languages = forum_list_langs();
-				$form['language'] = pun_trim($_POST['form']['language']);
-				if (!in_array($form['language'], $languages))
-					message($lang_common['Bad request']);
-			}
-
-			if ($pun_user['is_admmod'])
-			{
-				$form['admin_note'] = pun_trim($_POST['admin_note']);
+				$form['admin_note'] = trim($_POST['admin_note']);
 
 				// Are we allowed to change usernames?
-				if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && $pun_user['g_mod_rename_users'] == '1'))
+				if ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_rename_users'] == '1'))
 				{
-					$form['username'] = pun_trim($_POST['req_username']);
+					$form['username'] = trim($_POST['req_username']);
+					$old_username = trim($_POST['old_username']);
+
+					if (strlen($form['username']) < 2)
+						message($lang_prof_reg['Username too short']);
+					else if (pun_strlen($form['username']) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
+					    message($lang_common['Bad request']);
+					else if (!strcasecmp($form['username'], 'invitÃ©') || !strcasecmp($form['username'], $lang_common['Guest']))
+						message($lang_prof_reg['Username guest']);
+					else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $form['username']))
+						message($lang_prof_reg['Username IP']);
+					else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $form['username']))
+						message($lang_prof_reg['Username BBCode']);
+
+					// Check that the username is not already registered
+					$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE username=\''.$db->escape($form['username']).'\' AND id!='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+					if ($db->num_rows($result))
+						message($lang_profile['Dupe username']);
 
 					if ($form['username'] != $old_username)
-					{
-						// Check username
-						require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
-
-						$errors = array();
-						check_username($form['username'], $id);
-						if (!empty($errors))
-							message($errors[0]);
-
 						$username_updated = true;
-					}
 				}
 
@@ -746,14 +710,19 @@
 			}
 
-			if ($pun_config['o_regs_verify'] == '0' || $pun_user['is_admmod'])
+			if ($pun_config['o_regs_verify'] == '0' || $pun_user['g_id'] < PUN_GUEST)
 			{
 				require PUN_ROOT.'include/email.php';
 
-				// Validate the email address
+				// Validate the email-address
 				$form['email'] = strtolower(trim($_POST['req_email']));
 				if (!is_valid_email($form['email']))
-					message($lang_common['Invalid email']);
+					message($lang_common['Invalid e-mail']);
 			}
-
+			
+			// Make sure we got a valid language string
+			$form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']);
+			if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php'))
+				message($lang_common['Bad request']);
+			
 			break;
 		}
@@ -761,26 +730,11 @@
 		case 'personal':
 		{
-			$form = array(
-				'realname'		=> pun_trim($_POST['form']['realname']),
-				'url'			=> pun_trim($_POST['form']['url']),
-				'location'		=> pun_trim($_POST['form']['location']),
-			);
-
-			// Add http:// if the URL doesn't contain it already (while allowing https://, too)
-			if ($form['url'] != '')
-			{
-				$url = url_valid($form['url']);
-
-				if ($url === false)
-					message($lang_profile['Invalid website URL']);
-
-				$form['url'] = $url['url'];
-			}
+			$form = extract_elements(array('realname', 'url', 'location'));
 
 			if ($pun_user['g_id'] == PUN_ADMIN)
-				$form['title'] = pun_trim($_POST['title']);
+				$form['title'] = trim($_POST['title']);
 			else if ($pun_user['g_set_title'] == '1')
 			{
-				$form['title'] = pun_trim($_POST['title']);
+				$form['title'] = trim($_POST['title']);
 
 				if ($form['title'] != '')
@@ -788,11 +742,15 @@
 					// A list of words that the title may not contain
 					// If the language is English, there will be some duplicates, but it's not the end of the world
-					$forbidden = array('member', 'moderator', 'administrator', 'banned', 'guest', utf8_strtolower($lang_common['Member']), utf8_strtolower($lang_common['Moderator']), utf8_strtolower($lang_common['Administrator']), utf8_strtolower($lang_common['Banned']), utf8_strtolower($lang_common['Guest']));
-
-					if (in_array(utf8_strtolower($form['title']), $forbidden))
+					$forbidden = array('Member', 'Moderator', 'Administrator', 'Banned', 'Guest', $lang_common['Member'], $lang_common['Moderator'], $lang_common['Administrator'], $lang_common['Banned'], $lang_common['Guest']);
+
+					if (in_array($form['title'], $forbidden))
 						message($lang_profile['Forbidden title']);
 				}
 			}
 
+			// Add http:// if the URL doesn't contain it already
+			if ($form['url'] != '' && !stristr($form['url'], 'http://'))
+				$form['url'] = 'http://'.$form['url'];
+
 			break;
 		}
@@ -800,14 +758,8 @@
 		case 'messaging':
 		{
-			$form = array(
-				'jabber'		=> pun_trim($_POST['form']['jabber']),
-				'icq'			=> pun_trim($_POST['form']['icq']),
-				'msn'			=> pun_trim($_POST['form']['msn']),
-				'aim'			=> pun_trim($_POST['form']['aim']),
-				'yahoo'			=> pun_trim($_POST['form']['yahoo']),
-			);
+			$form = extract_elements(array('jabber', 'icq', 'msn', 'aim', 'yahoo'));
 
 			// If the ICQ UIN contains anything other than digits it's invalid
-			if (preg_match('%[^0-9]%', $form['icq']))
+			if ($form['icq'] != '' && preg_match('/[^0-9]/', $form['icq']))
 				message($lang_prof_reg['Bad ICQ']);
 
@@ -817,33 +769,26 @@
 		case 'personality':
 		{
-			$form = array();
+			$form = extract_elements(array('use_avatar'));
 
 			// Clean up signature from POST
-			if ($pun_config['o_signatures'] == '1')
+			$form['signature'] = pun_linebreaks(trim($_POST['signature']));
+
+			// Validate signature
+			if (pun_strlen($form['signature']) > $pun_config['p_sig_length'])
+				message($lang_prof_reg['Sig too long'].' '.$pun_config['p_sig_length'].' '.$lang_prof_reg['characters'].'.');
+			else if (substr_count($form['signature'], "\n") > ($pun_config['p_sig_lines']-1))
+				message($lang_prof_reg['Sig too many lines'].' '.$pun_config['p_sig_lines'].' '.$lang_prof_reg['lines'].'.');
+			else if ($form['signature'] && $pun_config['p_sig_all_caps'] == '0' && strtoupper($form['signature']) == $form['signature'] && $pun_user['g_id'] > PUN_MOD)
+				$form['signature'] = ucwords(strtolower($form['signature']));
+
+			// Validate BBCode syntax
+			if ($pun_config['p_sig_bbcode'] == '1' && strpos($form['signature'], '[') !== false && strpos($form['signature'], ']') !== false)
 			{
-				$form['signature'] = pun_linebreaks(pun_trim($_POST['signature']));
-
-				// Validate signature
-				if (pun_strlen($form['signature']) > $pun_config['p_sig_length'])
-					message(sprintf($lang_prof_reg['Sig too long'], $pun_config['p_sig_length'], pun_strlen($form['signature']) - $pun_config['p_sig_length']));
-				else if (substr_count($form['signature'], "\n") > ($pun_config['p_sig_lines']-1))
-					message(sprintf($lang_prof_reg['Sig too many lines'], $pun_config['p_sig_lines']));
-				else if ($form['signature'] && $pun_config['p_sig_all_caps'] == '0' && is_all_uppercase($form['signature']) && !$pun_user['is_admmod'])
-					$form['signature'] = utf8_ucwords(utf8_strtolower($form['signature']));
-
-				// Validate BBCode syntax
-				if ($pun_config['p_sig_bbcode'] == '1')
-				{
-					require PUN_ROOT.'include/parser.php';
-
-					$errors = array();
-
-					$form['signature'] = preparse_bbcode($form['signature'], $errors, true);
-
-					if(count($errors) > 0)
-						message('<ul><li>'.implode('</li><li>', $errors).'</li></ul>');
-				}
+				require PUN_ROOT.'include/parser.php';
+				$form['signature'] = preparse_bbcode($form['signature'], $foo, true);
 			}
 
+			if (!isset($form['use_avatar']) || $form['use_avatar'] != '1') $form['use_avatar'] = '0';
+
 			break;
 		}
@@ -851,54 +796,36 @@
 		case 'display':
 		{
-			$form = array(
-				'disp_topics'		=> pun_trim($_POST['form']['disp_topics']),
-				'disp_posts'		=> pun_trim($_POST['form']['disp_posts']),
-				'show_smilies'		=> isset($_POST['form']['show_smilies']) ? '1' : '0',
-				'show_img'			=> isset($_POST['form']['show_img']) ? '1' : '0',
-				'show_img_sig'		=> isset($_POST['form']['show_img_sig']) ? '1' : '0',
-				'show_avatars'		=> isset($_POST['form']['show_avatars']) ? '1' : '0',
-				'show_sig'			=> isset($_POST['form']['show_sig']) ? '1' : '0',
-			);
-
-			if ($form['disp_topics'] != '')
+			$form = extract_elements(array('disp_topics', 'disp_posts', 'show_smilies', 'show_img', 'show_img_sig', 'show_avatars', 'show_sig', 'style'));
+
+			if ($form['disp_topics'] != '' && intval($form['disp_topics']) < 3) $form['disp_topics'] = 3;
+			if ($form['disp_topics'] != '' && intval($form['disp_topics']) > 75) $form['disp_topics'] = 75;
+			if ($form['disp_posts'] != '' && intval($form['disp_posts']) < 3) $form['disp_posts'] = 3;
+			if ($form['disp_posts'] != '' && intval($form['disp_posts']) > 75) $form['disp_posts'] = 75;
+
+			if (!isset($form['show_smilies']) || $form['show_smilies'] != '1') $form['show_smilies'] = '0';
+			if (!isset($form['show_img']) || $form['show_img'] != '1') $form['show_img'] = '0';
+			if (!isset($form['show_img_sig']) || $form['show_img_sig'] != '1') $form['show_img_sig'] = '0';
+			if (!isset($form['show_avatars']) || $form['show_avatars'] != '1') $form['show_avatars'] = '0';
+			if (!isset($form['show_sig']) || $form['show_sig'] != '1') $form['show_sig'] = '0';
+
+			break;
+		}
+
+		case 'privacy':
+		{
+			$form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));
+
+			$form['email_setting'] = intval($form['email_setting']);
+			if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;
+
+			if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';
+			if (!isset($form['notify_with_post']) || $form['notify_with_post'] != '1') $form['notify_with_post'] = '0';
+
+			// If the save_pass setting has changed, we need to set a new cookie with the appropriate expire date
+			if ($pun_user['id'] == $id && $form['save_pass'] != $pun_user['save_pass'])
 			{
-				$form['disp_topics'] = intval($form['disp_topics']);
-				if ($form['disp_topics'] < 3)
-					$form['disp_topics'] = 3;
-				else if ($form['disp_topics'] > 75)
-					$form['disp_topics'] = 75;
+				$result = $db->query('SELECT password FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user password hash', __FILE__, __LINE__, $db->error());
+				pun_setcookie($id, $db->result($result), ($form['save_pass'] == '1') ? time() + 31536000 : 0);
 			}
-
-			if ($form['disp_posts'] != '')
-			{
-				$form['disp_posts'] = intval($form['disp_posts']);
-				if ($form['disp_posts'] < 3)
-					$form['disp_posts'] = 3;
-				else if ($form['disp_posts'] > 75)
-					$form['disp_posts'] = 75;
-			}
-
-			// Make sure we got a valid style string
-			if (isset($_POST['form']['style']))
-			{
-				$styles = forum_list_styles();
-				$form['style'] = pun_trim($_POST['form']['style']);
-				if (!in_array($form['style'], $styles))
-					message($lang_common['Bad request']);
-			}
-
-			break;
-		}
-
-		case 'privacy':
-		{
-			$form = array(
-				'email_setting'			=> intval($_POST['form']['email_setting']),
-				'notify_with_post'		=> isset($_POST['form']['notify_with_post']) ? '1' : '0',
-				'auto_notify'			=> isset($_POST['form']['auto_notify']) ? '1' : '0',
-			);
-
-			if ($form['email_setting'] < 0 || $form['email_setting'] > 2)
-				$form['email_setting'] = $pun_config['o_default_email_setting'];
 
 			break;
@@ -910,7 +837,7 @@
 
 
-	// Single quotes around non-empty values and NULL for empty values
+	// Singlequotes around non-empty values and NULL for empty values
 	$temp = array();
-	foreach ($form as $key => $input)
+	while (list($key, $input) = @each($form))
 	{
 		$value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL';
@@ -921,7 +848,6 @@
 	if (empty($temp))
 		message($lang_common['Bad request']);
-
-
-	$db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());
+	
+	$db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Impossible de modifier le profil utilisateur', __FILE__, __LINE__, $db->error());
 
 	// If we changed the username we have to update some stuff
@@ -929,9 +855,8 @@
 	{
 		$db->query('UPDATE '.$db->prefix.'posts SET poster=\''.$db->escape($form['username']).'\' WHERE poster_id='.$id) or error('Unable to update posts', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'posts SET edited_by=\''.$db->escape($form['username']).'\' WHERE edited_by=\''.$db->escape($old_username).'\'') or error('Unable to update posts', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'topics SET poster=\''.$db->escape($form['username']).'\' WHERE poster=\''.$db->escape($old_username).'\'') or error('Unable to update topics', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'topics SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Unable to update topics', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'forums SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Unable to update forums', __FILE__, __LINE__, $db->error());
-		$db->query('UPDATE '.$db->prefix.'online SET ident=\''.$db->escape($form['username']).'\' WHERE ident=\''.$db->escape($old_username).'\'') or error('Unable to update online list', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET poster=\''.$db->escape($form['username']).'\' WHERE poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les discussions', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'topics SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les discussions', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'forums SET last_poster=\''.$db->escape($form['username']).'\' WHERE last_poster=\''.$db->escape($old_username).'\'') or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'online SET ident=\''.$db->escape($form['username']).'\' WHERE ident=\''.$db->escape($old_username).'\'') or error('Impossible de modifier la liste des utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 		// If the user is a moderator or an administrator we have to update the moderator lists
@@ -939,10 +864,7 @@
 		$group_id = $db->result($result);
 
-		$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group', __FILE__, __LINE__, $db->error());
-		$group_mod = $db->result($result);
-
-		if ($group_id == PUN_ADMIN || $group_mod == '1')
-		{
-			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Unable to fetch forum list', __FILE__, __LINE__, $db->error());
+		if ($group_id < PUN_GUEST)
+		{
+			$result = $db->query('SELECT id, moderators FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
 
 			while ($cur_forum = $db->fetch_assoc($result))
@@ -954,16 +876,10 @@
 					unset($cur_moderators[$old_username]);
 					$cur_moderators[$form['username']] = $id;
-					uksort($cur_moderators, 'utf8_strcasecmp');
-
-					$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Unable to update forum', __FILE__, __LINE__, $db->error());
+					ksort($cur_moderators);
+
+					$db->query('UPDATE '.$db->prefix.'forums SET moderators=\''.$db->escape(serialize($cur_moderators)).'\' WHERE id='.$cur_forum['id']) or error('Impossible de modifier les forums', __FILE__, __LINE__, $db->error());
 				}
 			}
 		}
-
-		// Regenerate the users info cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
 	}
 
@@ -972,5 +888,6 @@
 
 
-$result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.notify_with_post, u.auto_notify, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.dst, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, u.date_format, u.time_format, u.last_visit, g.g_id, g.g_user_title, g.g_moderator FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+
+$result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 if (!$db->num_rows($result))
 	message($lang_common['Bad request']);
@@ -988,141 +905,55 @@
 
 // View or edit?
-if ($pun_user['id'] != $id &&																	// If we arent the user (i.e. editing your own profile)
-	(!$pun_user['is_admmod'] ||																	// and we are not an admin or mod
-	($pun_user['g_id'] != PUN_ADMIN &&															// or we aren't an admin and ...
-	($pun_user['g_mod_edit_users'] == '0' ||													// mods aren't allowed to edit users
-	$user['g_id'] == PUN_ADMIN ||																// or the user is an admin
-	$user['g_moderator'] == '1'))))																// or the user is another mod
+if ($pun_user['id'] != $id &&
+	($pun_user['g_id'] > PUN_MOD ||
+	($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_edit_users'] == '0') ||
+	($pun_user['g_id'] == PUN_MOD && $user['g_id'] < PUN_GUEST)))
 {
-	$user_personal = array();
-
-	$user_personal[] = '<dt>'.$lang_common['Username'].'</dt>';
-	$user_personal[] = '<dd>'.pun_htmlspecialchars($user['username']).'</dd>';
+	if ($user['email_setting'] == '0' && !$pun_user['is_guest'])
+		$email_field = '<a href="mailto:'.$user['email'].'">'.$user['email'].'</a>';
+	else if ($user['email_setting'] == '1' && !$pun_user['is_guest'])
+		$email_field = '<a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a>';
+	else
+		$email_field = $lang_profile['Private'];
 
 	$user_title_field = get_title($user);
-	$user_personal[] = '<dt>'.$lang_common['Title'].'</dt>';
-	$user_personal[] = '<dd>'.(($pun_config['o_censoring'] == '1') ? censor_words($user_title_field) : $user_title_field).'</dd>';
-
-	if ($user['realname'] != '')
-	{
-		$user_personal[] = '<dt>'.$lang_profile['Realname'].'</dt>';
-		$user_personal[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['realname']) : $user['realname']).'</dd>';
-	}
-
-	if ($user['location'] != '')
-	{
-		$user_personal[] = '<dt>'.$lang_profile['Location'].'</dt>';
-		$user_personal[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['location']) : $user['location']).'</dd>';
-	}
 
 	if ($user['url'] != '')
 	{
-		$user['url'] = pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['url']) : $user['url']);
-		$user_personal[] = '<dt>'.$lang_profile['Website'].'</dt>';
-		$user_personal[] = '<dd><span class="website"><a href="'.$user['url'].'">'.$user['url'].'</a></span></dd>';
-	}
-
-	if ($user['email_setting'] == '0' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
-		$email_field = '<a href="mailto:'.$user['email'].'">'.$user['email'].'</a>';
-	else if ($user['email_setting'] == '1' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
-		$email_field = '<a href="misc.php?email='.$id.'">'.$lang_common['Send email'].'</a>';
+		$user['url'] = pun_htmlspecialchars($user['url']);
+
+		if ($pun_config['o_censoring'] == '1')
+			$user['url'] = censor_words($user['url']);
+
+		$url = '<a href="'.$user['url'].'">'.$user['url'].'</a>';
+	}
 	else
-		$email_field = '';
-	if ($email_field != '')
-	{
-		$user_personal[] = '<dt>'.$lang_common['Email'].'</dt>';
-		$user_personal[] = '<dd><span class="email">'.$email_field.'</span></dd>';
-	}
-
-	$user_messaging = array();
-
-	if ($user['jabber'] != '')
-	{
-		$user_messaging[] = '<dt>'.$lang_profile['Jabber'].'</dt>';
-		$user_messaging[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['jabber']) : $user['jabber']).'</dd>';
-	}
-
-	if ($user['icq'] != '')
-	{
-		$user_messaging[] = '<dt>'.$lang_profile['ICQ'].'</dt>';
-		$user_messaging[] = '<dd>'.$user['icq'].'</dd>';
-	}
-
-	if ($user['msn'] != '')
-	{
-		$user_messaging[] = '<dt>'.$lang_profile['MSN'].'</dt>';
-		$user_messaging[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['msn']) : $user['msn']).'</dd>';
-	}
-
-	if ($user['aim'] != '')
-	{
-		$user_messaging[] = '<dt>'.$lang_profile['AOL IM'].'</dt>';
-		$user_messaging[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['aim']) : $user['aim']).'</dd>';
-	}
-
-	if ($user['yahoo'] != '')
-	{
-		$user_messaging[] = '<dt>'.$lang_profile['Yahoo'].'</dt>';
-		$user_messaging[] = '<dd>'.pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['yahoo']) : $user['yahoo']).'</dd>';
-	}
-
-	$user_personality = array();
+		$url = $lang_profile['Unknown'];
 
 	if ($pun_config['o_avatars'] == '1')
 	{
-		$avatar_field = generate_avatar_markup($id);
-		if ($avatar_field != '')
-		{
-			$user_personality[] = '<dt>'.$lang_profile['Avatar'].'</dt>';
-			$user_personality[] = '<dd>'.$avatar_field.'</dd>';
-		}
-	}
-
-	if ($pun_config['o_signatures'] == '1')
-	{
-		if (isset($parsed_signature))
-		{
-			$user_personality[] = '<dt>'.$lang_profile['Signature'].'</dt>';
-			$user_personality[] = '<dd><div class="postsignature postmsg">'.$parsed_signature.'</div></dd>';
-		}
-	}
-
-	$user_activity = array();
+		if ($user['use_avatar'] == '1')
+		{
+			if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.gif'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.gif" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.jpg'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.jpg" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.png'))
+				$avatar_field = '<img src="'.$pun_config['o_avatars_dir'].'/'.$id.'.png" '.$img_size[3].' alt="" />';
+			else
+				$avatar_field = $lang_profile['No avatar'];
+		}
+		else
+			$avatar_field = $lang_profile['No avatar'];
+	}
 
 	$posts_field = '';
-	if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod'])
-		$posts_field = forum_number_format($user['num_posts']);
+	if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+		$posts_field = $user['num_posts'];
 	if ($pun_user['g_search'] == '1')
-	{
-		$quick_searches = array();
-		if ($user['num_posts'] > 0)
-		{
-			$quick_searches[] = '<a href="search.php?action=show_user_topics&amp;user_id='.$id.'">'.$lang_profile['Show topics'].'</a>';
-			$quick_searches[] = '<a href="search.php?action=show_user_posts&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a>';
-		}
-		if ($pun_user['is_admmod'] && $pun_config['o_topic_subscriptions'] == '1')
-			$quick_searches[] = '<a href="search.php?action=show_subscriptions&amp;user_id='.$id.'">'.$lang_profile['Show subscriptions'].'</a>';
-
-		if (!empty($quick_searches))
-			$posts_field .= (($posts_field != '') ? ' - ' : '').implode(' - ', $quick_searches);
-	}
-	if ($posts_field != '')
-	{
-		$user_activity[] = '<dt>'.$lang_common['Posts'].'</dt>';
-		$user_activity[] = '<dd>'.$posts_field.'</dd>';
-	}
-
-	if ($user['num_posts'] > 0)
-	{
-		$user_activity[] = '<dt>'.$lang_common['Last post'].'</dt>';
-		$user_activity[] = '<dd>'.$last_post.'</dd>';
-	}
-
-	$user_activity[] = '<dt>'.$lang_common['Registered'].'</dt>';
-	$user_activity[] = '<dd>'.format_time($user['registered'], true).'</dd>';
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), sprintf($lang_profile['Users profile'], pun_htmlspecialchars($user['username'])));
+		$posts_field .= (($posts_field != '') ? ' - ' : '').'<a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a>';
+
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 	define('PUN_ALLOW_INDEX', 1);
-	define('PUN_ACTIVE_PAGE', 'index');
 	require PUN_ROOT.'header.php';
 
@@ -1137,5 +968,16 @@
 					<div class="infldset">
 						<dl>
-							<?php echo implode("\n\t\t\t\t\t\t\t", $user_personal)."\n" ?>
+							<dt><?php echo $lang_common['Username'] ?>: </dt>
+							<dd><?php echo pun_htmlspecialchars($user['username']) ?></dd>
+							<dt><?php echo $lang_common['Title'] ?>: </dt>
+							<dd><?php echo ($pun_config['o_censoring'] == '1') ? censor_words($user_title_field) : $user_title_field; ?></dd>
+							<dt><?php echo $lang_profile['Realname'] ?>: </dt>
+							<dd><?php echo ($user['realname'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['realname']) : $user['realname']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Location'] ?>: </dt>
+							<dd><?php echo ($user['location'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['location']) : $user['location']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Website'] ?>: </dt>
+							<dd><?php echo $url ?>&#160;</dd>
+							<dt><?php echo $lang_common['E-mail'] ?>: </dt>
+							<dd><?php echo $email_field ?></dd>
 						</dl>
 						<div class="clearer"></div>
@@ -1143,10 +985,19 @@
 				</fieldset>
 			</div>
-<?php if (!empty($user_messaging)): ?>			<div class="inform">
+			<div class="inform">
 				<fieldset>
 				<legend><?php echo $lang_profile['Section messaging'] ?></legend>
 					<div class="infldset">
 						<dl>
-							<?php echo implode("\n\t\t\t\t\t\t\t", $user_messaging)."\n" ?>
+							<dt><?php echo $lang_profile['Jabber'] ?>: </dt>
+							<dd><?php echo ($user['jabber'] !='') ? pun_htmlspecialchars($user['jabber']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['ICQ'] ?>: </dt>
+							<dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['MSN'] ?>: </dt>
+							<dd><?php echo ($user['msn'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['msn']) : $user['msn']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['AOL IM'] ?>: </dt>
+							<dd><?php echo ($user['aim'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['aim']) : $user['aim']) : $lang_profile['Unknown']; ?></dd>
+							<dt><?php echo $lang_profile['Yahoo'] ?>: </dt>
+							<dd><?php echo ($user['yahoo'] !='') ? pun_htmlspecialchars(($pun_config['o_censoring'] == '1') ? censor_words($user['yahoo']) : $user['yahoo']) : $lang_profile['Unknown']; ?></dd>
 						</dl>
 						<div class="clearer"></div>
@@ -1154,10 +1005,13 @@
 				</fieldset>
 			</div>
-<?php endif; if (!empty($user_personality)): ?>			<div class="inform">
+			<div class="inform">
 				<fieldset>
 				<legend><?php echo $lang_profile['Section personality'] ?></legend>
 					<div class="infldset">
 						<dl>
-							<?php echo implode("\n\t\t\t\t\t\t\t", $user_personality)."\n" ?>
+<?php if ($pun_config['o_avatars'] == '1'): ?>							<dt><?php echo $lang_profile['Avatar'] ?>: </dt>
+							<dd><?php echo $avatar_field ?></dd>
+<?php endif; ?>							<dt><?php echo $lang_profile['Signature'] ?>: </dt>
+							<dd><div><?php echo isset($parsed_signature) ? $parsed_signature : $lang_profile['No sig']; ?></div></dd>
 						</dl>
 						<div class="clearer"></div>
@@ -1165,10 +1019,15 @@
 				</fieldset>
 			</div>
-<?php endif; ?>			<div class="inform">
+			<div class="inform">
 				<fieldset>
 				<legend><?php echo $lang_profile['User activity'] ?></legend>
 					<div class="infldset">
 						<dl>
-							<?php echo implode("\n\t\t\t\t\t\t\t", $user_activity)."\n" ?>
+<?php if ($posts_field != ''): ?>							<dt><?php echo $lang_common['Posts'] ?>: </dt>
+							<dd><?php echo $posts_field ?></dd>
+<?php endif; ?>							<dt><?php echo $lang_common['Last post'] ?>: </dt>
+							<dd><?php echo $last_post ?></dd>
+							<dt><?php echo $lang_common['Registered'] ?>: </dt>
+							<dd><?php echo format_time($user['registered'], true) ?></dd>
 						</dl>
 						<div class="clearer"></div>
@@ -1188,12 +1047,12 @@
 	if (!$section || $section == 'essentials')
 	{
-		if ($pun_user['is_admmod'])
-		{
-			if ($pun_user['g_id'] == PUN_ADMIN || $pun_user['g_mod_rename_users'] == '1')
-				$username_field = '<label class="required"><strong>'.$lang_common['Username'].' <span>'.$lang_common['Required'].'</span></strong><br /><input type="text" name="req_username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25" /><br /></label>'."\n";
+		if ($pun_user['g_id'] < PUN_GUEST)
+		{
+			if ($pun_user['g_id'] == PUN_ADMIN || $pun_config['p_mod_rename_users'] == '1')
+				$username_field = '<input type="hidden" name="old_username" value="'.pun_htmlspecialchars($user['username']).'" /><label><strong>'.$lang_common['Username'].'</strong><br /><input type="text" name="req_username" value="'.pun_htmlspecialchars($user['username']).'" size="25" maxlength="25" /><br /></label>'."\n";
 			else
-				$username_field = '<p>'.sprintf($lang_profile['Username info'], pun_htmlspecialchars($user['username'])).'</p>'."\n";
-
-			$email_field = '<label class="required"><strong>'.$lang_common['Email'].' <span>'.$lang_common['Required'].'</span></strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="80" /><br /></label><p><span class="email"><a href="misc.php?email='.$id.'">'.$lang_common['Send email'].'</a></span></p>'."\n";
+				$username_field = '<p>'.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'</p>'."\n";
+
+			$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label><p><a href="misc.php?email='.$id.'">'.$lang_common['Send e-mail'].'</a></p>'."\n";
 		}
 		else
@@ -1202,32 +1061,18 @@
 
 			if ($pun_config['o_regs_verify'] == '1')
-				$email_field = '<p>'.sprintf($lang_profile['Email info'], $user['email'].' - <a href="profile.php?action=change_email&amp;id='.$id.'">'.$lang_profile['Change email'].'</a>').'</p>'."\n";
+				$email_field = '<p>'.$lang_common['E-mail'].': '.$user['email'].'&#160;-&#160;<a href="profile.php?action=change_email&amp;id='.$id.'">'.$lang_profile['Change e-mail'].'</a></p>'."\n";
 			else
-				$email_field = '<label class="required"><strong>'.$lang_common['Email'].' <span>'.$lang_common['Required'].'</span></strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="80" /><br /></label>'."\n";
-		}
-
-		$posts_field = '';
-		$posts_actions = array();
+				$email_field = '<label><strong>'.$lang_common['E-mail'].'</strong><br /><input type="text" name="req_email" value="'.$user['email'].'" size="40" maxlength="50" /><br /></label>'."\n";
+		}
 
 		if ($pun_user['g_id'] == PUN_ADMIN)
-			$posts_field .= '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label>';
-		else if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod'])
-			$posts_actions[] = sprintf($lang_profile['Posts info'], forum_number_format($user['num_posts']));
-
-		if ($pun_user['g_search'] == '1' || $pun_user['g_id'] == PUN_ADMIN)
-		{
-			$posts_actions[] = '<a href="search.php?action=show_user_topics&amp;user_id='.$id.'">'.$lang_profile['Show topics'].'</a>';
-			$posts_actions[] = '<a href="search.php?action=show_user_posts&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a>';
-
-			if ($pun_config['o_topic_subscriptions'] == '1')
-				$posts_actions[] = '<a href="search.php?action=show_subscriptions&amp;user_id='.$id.'">'.$lang_profile['Show subscriptions'].'</a>';
-		}
-
-		$posts_field .= (!empty($posts_actions) ? '<p class="actions">'.implode(' - ', $posts_actions).'</p>' : '')."\n";
-
-
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section essentials']);
-		$required_fields = array('req_username' => $lang_common['Username'], 'req_email' => $lang_common['Email']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+			$posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+		else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+			$posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+		else
+			$posts_field = '<p><a href="search.php?action=show_user&amp;user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
+		$required_fields = array('req_username' => $lang_common['Username'], 'req_email' => $lang_common['E-mail']);
 		require PUN_ROOT.'header.php';
 
@@ -1245,11 +1090,11 @@
 							<input type="hidden" name="form_sent" value="1" />
 							<?php echo $username_field ?>
-<?php if ($pun_user['id'] == $id || $pun_user['g_id'] == PUN_ADMIN || ($user['g_moderator'] == '0' && $pun_user['g_mod_change_passwords'] == '1')): ?>							<p class="actions"><span><a href="profile.php?action=change_pass&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Change pass'] ?></a></span></p>
-<?php endif; ?>						</div>
+<?php if ($pun_user['id'] == $id || $pun_user['g_id'] == PUN_ADMIN || ($user['g_id'] > PUN_MOD && $pun_config['p_mod_change_passwords'] == '1')): ?><p><a href="profile.php?action=change_pass&amp;id=<?php echo $id ?>"><?php echo $lang_profile['Change pass'] ?></a></p>
+<?php endif; ?>					</div>
 					</fieldset>
 				</div>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_prof_reg['Email legend'] ?></legend>
+						<legend><?php echo $lang_prof_reg['E-mail legend'] ?></legend>
 						<div class="infldset">
 							<?php echo $email_field ?>
@@ -1261,101 +1106,67 @@
 						<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
 						<div class="infldset">
-							<p><?php echo $lang_prof_reg['Time zone info'] ?></p>
-							<label><?php echo $lang_prof_reg['Time zone']."\n" ?>
+							<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
 							<br /><select name="form[timezone]">
-								<option value="-12"<?php if ($user['timezone'] == -12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-12:00'] ?></option>
-								<option value="-11"<?php if ($user['timezone'] == -11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-11:00'] ?></option>
-								<option value="-10"<?php if ($user['timezone'] == -10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-10:00'] ?></option>
-								<option value="-9.5"<?php if ($user['timezone'] == -9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:30'] ?></option>
-								<option value="-9"<?php if ($user['timezone'] == -9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:00'] ?></option>
-								<option value="-8.5"<?php if ($user['timezone'] == -8.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:30'] ?></option>
-								<option value="-8"<?php if ($user['timezone'] == -8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:00'] ?></option>
-								<option value="-7"<?php if ($user['timezone'] == -7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-07:00'] ?></option>
-								<option value="-6"<?php if ($user['timezone'] == -6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-06:00'] ?></option>
-								<option value="-5"<?php if ($user['timezone'] == -5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-05:00'] ?></option>
-								<option value="-4"<?php if ($user['timezone'] == -4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-04:00'] ?></option>
-								<option value="-3.5"<?php if ($user['timezone'] == -3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:30'] ?></option>
-								<option value="-3"<?php if ($user['timezone'] == -3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:00'] ?></option>
-								<option value="-2"<?php if ($user['timezone'] == -2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-02:00'] ?></option>
-								<option value="-1"<?php if ($user['timezone'] == -1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-01:00'] ?></option>
-								<option value="0"<?php if ($user['timezone'] == 0) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC'] ?></option>
-								<option value="1"<?php if ($user['timezone'] == 1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+01:00'] ?></option>
-								<option value="2"<?php if ($user['timezone'] == 2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+02:00'] ?></option>
-								<option value="3"<?php if ($user['timezone'] == 3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:00'] ?></option>
-								<option value="3.5"<?php if ($user['timezone'] == 3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:30'] ?></option>
-								<option value="4"<?php if ($user['timezone'] == 4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:00'] ?></option>
-								<option value="4.5"<?php if ($user['timezone'] == 4.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:30'] ?></option>
-								<option value="5"<?php if ($user['timezone'] == 5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:00'] ?></option>
-								<option value="5.5"<?php if ($user['timezone'] == 5.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:30'] ?></option>
-								<option value="5.75"<?php if ($user['timezone'] == 5.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:45'] ?></option>
-								<option value="6"<?php if ($user['timezone'] == 6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:00'] ?></option>
-								<option value="6.5"<?php if ($user['timezone'] == 6.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:30'] ?></option>
-								<option value="7"<?php if ($user['timezone'] == 7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+07:00'] ?></option>
-								<option value="8"<?php if ($user['timezone'] == 8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:00'] ?></option>
-								<option value="8.75"<?php if ($user['timezone'] == 8.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:45'] ?></option>
-								<option value="9"<?php if ($user['timezone'] == 9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:00'] ?></option>
-								<option value="9.5"<?php if ($user['timezone'] == 9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:30'] ?></option>
-								<option value="10"<?php if ($user['timezone'] == 10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:00'] ?></option>
-								<option value="10.5"<?php if ($user['timezone'] == 10.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:30'] ?></option>
-								<option value="11"<?php if ($user['timezone'] == 11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:00'] ?></option>
-								<option value="11.5"<?php if ($user['timezone'] == 11.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:30'] ?></option>
-								<option value="12"<?php if ($user['timezone'] == 12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:00'] ?></option>
-								<option value="12.75"<?php if ($user['timezone'] == 12.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:45'] ?></option>
-								<option value="13"<?php if ($user['timezone'] == 13) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+13:00'] ?></option>
-								<option value="14"<?php if ($user['timezone'] == 14) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+14:00'] ?></option>
+								<option value="-12"<?php if ($user['timezone'] == -12) echo ' selected="selected"' ?>>-12</option>
+								<option value="-11"<?php if ($user['timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+								<option value="-10"<?php if ($user['timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+								<option value="-9.5"<?php if ($user['timezone'] == -9.5) echo ' selected="selected"' ?>>-09.5</option>
+								<option value="-9"<?php if ($user['timezone'] == -9) echo ' selected="selected"' ?>>-09</option>
+								<option value="-8.5"<?php if ($user['timezone'] == -8.5) echo ' selected="selected"' ?>>-08.5</option>
+								<option value="-8"<?php if ($user['timezone'] == -8) echo ' selected="selected"' ?>>-08 PST</option>
+								<option value="-7"<?php if ($user['timezone'] == -7) echo ' selected="selected"' ?>>-07 MST</option>
+								<option value="-6"<?php if ($user['timezone'] == -6) echo ' selected="selected"' ?>>-06 CST</option>
+								<option value="-5"<?php if ($user['timezone'] == -5) echo ' selected="selected"' ?>>-05 EST</option>
+								<option value="-4"<?php if ($user['timezone'] == -4) echo ' selected="selected"' ?>>-04 AST</option>
+								<option value="-3.5"<?php if ($user['timezone'] == -3.5) echo ' selected="selected"' ?>>-03.5</option>
+								<option value="-3"<?php if ($user['timezone'] == -3) echo ' selected="selected"' ?>>-03 ADT</option>
+								<option value="-2"<?php if ($user['timezone'] == -2) echo ' selected="selected"' ?>>-02</option>
+								<option value="-1"<?php if ($user['timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+								<option value="0"<?php if ($user['timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+								<option value="1"<?php if ($user['timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+								<option value="2"<?php if ($user['timezone'] == 2) echo ' selected="selected"' ?>>+02</option>
+								<option value="3"<?php if ($user['timezone'] == 3) echo ' selected="selected"' ?>>+03</option>
+								<option value="3.5"<?php if ($user['timezone'] == 3.5) echo ' selected="selected"' ?>>+03.5</option>
+								<option value="4"<?php if ($user['timezone'] == 4) echo ' selected="selected"' ?>>+04</option>
+								<option value="4.5"<?php if ($user['timezone'] == 4.5) echo ' selected="selected"' ?>>+04.5</option>
+								<option value="5"<?php if ($user['timezone'] == 5) echo ' selected="selected"' ?>>+05</option>
+								<option value="5.5"<?php if ($user['timezone'] == 5.5) echo ' selected="selected"' ?>>+05.5</option>
+								<option value="6"<?php if ($user['timezone'] == 6) echo ' selected="selected"' ?>>+06</option>
+								<option value="6.5"<?php if ($user['timezone'] == 6.5) echo ' selected="selected"' ?>>+06.5</option>
+								<option value="7"<?php if ($user['timezone'] == 7) echo ' selected="selected"' ?>>+07</option>
+								<option value="8"<?php if ($user['timezone'] == 8) echo ' selected="selected"' ?>>+08</option>
+								<option value="9"<?php if ($user['timezone'] == 9) echo ' selected="selected"' ?>>+09</option>
+								<option value="9.5"<?php if ($user['timezone'] == 9.5) echo ' selected="selected"' ?>>+09.5</option>
+								<option value="10"<?php if ($user['timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+								<option value="10.5"<?php if ($user['timezone'] == 10.5) echo ' selected="selected"' ?>>+10.5</option>
+								<option value="11"<?php if ($user['timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+								<option value="11.5"<?php if ($user['timezone'] == 11.5) echo ' selected="selected"' ?>>+11.5</option>
+								<option value="12"<?php if ($user['timezone'] == 12) echo ' selected="selected"' ?>>+12</option>
+								<option value="13"<?php if ($user['timezone'] == 13) echo ' selected="selected"' ?>>+13</option>
+								<option value="14"<?php if ($user['timezone'] == 14) echo ' selected="selected"' ?>>+14</option>
 							</select>
 							<br /></label>
-							<div class="rbox">
-								<label><input type="checkbox" name="form[dst]" value="1"<?php if ($user['dst'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['DST'] ?><br /></label>
-							</div>
-							<label><?php echo $lang_prof_reg['Time format'] ?>
-
-							<br /><select name="form[time_format]">
-<?php
-								foreach (array_unique($forum_time_formats) as $key => $time_format)
-								{
-									echo "\t\t\t\t\t\t\t\t".'<option value="'.$key.'"';
-									if ($user['time_format'] == $key)
-										echo ' selected="selected"';
-									echo '>'. format_time(time(), false, null, $time_format, true, true);
-									if ($key == 0)
-										echo ' ('.$lang_prof_reg['Default'].')';
-									echo "</option>\n";
-								}
-								?>
-							</select>
-							<br /></label>
-							<label><?php echo $lang_prof_reg['Date format'] ?>
-
-							<br /><select name="form[date_format]">
-<?php
-								foreach (array_unique($forum_date_formats) as $key => $date_format)
-								{
-									echo "\t\t\t\t\t\t\t\t".'<option value="'.$key.'"';
-									if ($user['date_format'] == $key)
-										echo ' selected="selected"';
-									echo '>'. format_time(time(), true, $date_format, null, false, true);
-									if ($key == 0)
-										echo ' ('.$lang_prof_reg['Default'].')';
-									echo "</option>\n";
-								}
-								?>
-							</select>
-							<br /></label>
-
-<?php
-
-		$languages = forum_list_langs();
+<?php
+
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
 
 		// Only display the language selection box if there's more than one language available
 		if (count($languages) > 1)
 		{
-
-?>
-							<label><?php echo $lang_prof_reg['Language'] ?>
+			natsort($languages);
+
+?>
+							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
 							<br /><select name="form[language]">
 <?php
 
-			foreach ($languages as $temp)
+			while (list(, $temp) = @each($languages))
 			{
 				if ($user['language'] == $temp)
@@ -1380,14 +1191,13 @@
 						<legend><?php echo $lang_profile['User activity'] ?></legend>
 						<div class="infldset">
-							<p><?php printf($lang_profile['Registered info'], format_time($user['registered'], true).(($pun_user['is_admmod']) ? ' (<a href="moderate.php?get_host='.pun_htmlspecialchars($user['registration_ip']).'">'.pun_htmlspecialchars($user['registration_ip']).'</a>)' : '')) ?></p>
-							<p><?php printf($lang_profile['Last post info'], $last_post) ?></p>
-							<p><?php printf($lang_profile['Last visit info'], format_time($user['last_visit'])) ?></p>
-							<?php echo $posts_field ?>
-<?php if ($pun_user['is_admmod']): ?>							<label><?php echo $lang_profile['Admin note'] ?><br />
+							<p><?php echo $lang_common['Registered'] ?>: <?php echo format_time($user['registered'], true); if ($pun_user['g_id'] < PUN_GUEST) echo ' (<a href="moderate.php?get_host='.pun_htmlspecialchars($user['registration_ip']).'">'.pun_htmlspecialchars($user['registration_ip']).'</a>)'; ?></p>
+							<p><?php echo $lang_common['Last post'] ?>: <?php echo $last_post ?></p>
+								<?php echo $posts_field ?>
+<?php if ($pun_user['g_id'] < PUN_GUEST): ?>							<label><?php echo $lang_profile['Admin note'] ?><br />
 							<input id="admin_note" type="text" name="admin_note" value="<?php echo pun_htmlspecialchars($user['admin_note']) ?>" size="30" maxlength="30" /><br /></label>
-<?php endif; ?>						</div>
-					</fieldset>
+						</div>
+<?php endif; ?>					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1399,8 +1209,7 @@
 	{
 		if ($pun_user['g_set_title'] == '1')
-			$title_field = '<label>'.$lang_common['Title'].' <em>('.$lang_profile['Leave blank'].')</em><br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n";
-
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section personal']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+			$title_field = '<label>'.$lang_common['Title'].'&#160;&#160;(<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n";
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1418,5 +1227,5 @@
 							<input type="hidden" name="form_sent" value="1" />
 							<label><?php echo $lang_profile['Realname'] ?><br /><input type="text" name="form[realname]" value="<?php echo pun_htmlspecialchars($user['realname']) ?>" size="40" maxlength="40" /><br /></label>
-<?php if (isset($title_field)): ?>							<?php echo $title_field ?>
+<?php if (isset($title_field)): ?>					<?php echo $title_field ?>
 <?php endif; ?>							<label><?php echo $lang_profile['Location'] ?><br /><input type="text" name="form[location]" value="<?php echo pun_htmlspecialchars($user['location']) ?>" size="30" maxlength="30" /><br /></label>
 							<label><?php echo $lang_profile['Website'] ?><br /><input type="text" name="form[url]" value="<?php echo pun_htmlspecialchars($user['url']) ?>" size="50" maxlength="80" /><br /></label>
@@ -1424,5 +1233,5 @@
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1434,6 +1243,5 @@
 	{
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section messaging']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1458,5 +1266,5 @@
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1467,22 +1275,24 @@
 	else if ($section == 'personality')
 	{
-		if ($pun_config['o_avatars'] == '0' && $pun_config['o_signatures'] == '0')
-			message($lang_common['Bad request']);
-
-		$avatar_field = '<span><a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Change avatar'].'</a></span>';
-
-		$user_avatar = generate_avatar_markup($id);
-		if ($user_avatar)
-			$avatar_field .= ' <span><a href="profile.php?action=delete_avatar&amp;id='.$id.'">'.$lang_profile['Delete avatar'].'</a></span>';
+		$avatar_field = '<a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Change avatar'].'</a>';
+		if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.gif'))
+			$avatar_format = 'gif';
+		else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.jpg'))
+			$avatar_format = 'jpg';
+		else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.png'))
+			$avatar_format = 'png';
 		else
-			$avatar_field = '<span><a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Upload avatar'].'</a></span>';
+			$avatar_field = '<a href="profile.php?action=upload_avatar&amp;id='.$id.'">'.$lang_profile['Upload avatar'].'</a>';
+
+		// Display the delete avatar link?
+		if ($img_size)
+			$avatar_field .= '&#160;&#160;&#160;<a href="profile.php?action=delete_avatar&amp;id='.$id.'">'.$lang_profile['Delete avatar'].'</a>';
 
 		if ($user['signature'] != '')
-			$signature_preview = '<p>'.$lang_profile['Sig preview'].'</p>'."\n\t\t\t\t\t\t\t".'<div class="postsignature postmsg">'."\n\t\t\t\t\t\t\t\t".'<hr />'."\n\t\t\t\t\t\t\t\t".$parsed_signature."\n\t\t\t\t\t\t\t".'</div>'."\n";
+			$signature_preview = '<p>'.$lang_profile['Sig preview'].'</p>'."\n\t\t\t\t\t".'<div class="postsignature">'."\n\t\t\t\t\t\t".'<hr />'."\n\t\t\t\t\t\t".$parsed_signature."\n\t\t\t\t\t".'</div>'."\n";
 		else
 			$signature_preview = '<p>'.$lang_profile['No sig'].'</p>'."\n";
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section personality']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1500,11 +1310,14 @@
 						<legend><?php echo $lang_profile['Avatar legend'] ?></legend>
 						<div class="infldset">
-<?php if ($user_avatar): ?>							<div class="useravatar"><?php echo $user_avatar ?></div>
-<?php endif; ?>							<p><?php echo $lang_profile['Avatar info'] ?></p>
-							<p class="clearb actions"><?php echo $avatar_field ?></p>
+<?php if (isset($avatar_format)): ?>					<img src="<?php echo $pun_config['o_avatars_dir'].'/'.$id.'.'.$avatar_format ?>" <?php echo $img_size[3] ?> alt="" />
+<?php endif; ?>					<p><?php echo $lang_profile['Avatar info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[use_avatar]" value="1"<?php if ($user['use_avatar'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Use avatar'] ?><br /></label>
+							</div>
+							<p class="clearb"><?php echo $avatar_field ?></p>
 						</div>
 					</fieldset>
 				</div>
-<?php endif; if ($pun_config['o_signatures'] == '1'): ?>				<div class="inform">
+<?php endif; ?>				<div class="inform">
 					<fieldset>
 						<legend><?php echo $lang_profile['Signature legend'] ?></legend>
@@ -1512,11 +1325,11 @@
 							<p><?php echo $lang_profile['Signature info'] ?></p>
 							<div class="txtarea">
-								<label><?php printf($lang_profile['Sig max size'], forum_number_format($pun_config['p_sig_length']), $pun_config['p_sig_lines']) ?><br />
+								<label><?php echo $lang_profile['Sig max length'] ?>: <?php echo $pun_config['p_sig_length'] ?> / <?php echo $lang_profile['Sig max lines'] ?>: <?php echo $pun_config['p_sig_lines'] ?><br />
 								<textarea name="signature" rows="4" cols="65"><?php echo pun_htmlspecialchars($user['signature']) ?></textarea><br /></label>
 							</div>
 							<ul class="bblinks">
-								<li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($pun_config['p_sig_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-								<li><span><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a> <?php echo ($pun_config['p_sig_bbcode'] == '1' && $pun_config['p_sig_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-								<li><span><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($pun_config['o_smilies_sig'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
+								<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_sig_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+								<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_sig_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+								<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies_sig'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
 							</ul>
 							<?php echo $signature_preview ?>
@@ -1524,5 +1337,5 @@
 					</fieldset>
 				</div>
-<?php endif; ?>				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1533,6 +1346,5 @@
 	else if ($section == 'display')
 	{
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section display']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1547,5 +1359,12 @@
 <?php
 
-		$styles = forum_list_styles();
+		$styles = array();
+		$d = dir(PUN_ROOT.'style');
+		while (($entry = $d->read()) !== false)
+		{
+			if (substr($entry, strlen($entry)-4) == '.css')
+				$styles[] = substr($entry, 0, strlen($entry)-4);
+		}
+		$d->close();
 
 		// Only display the style selection box if there's more than one style available
@@ -1554,5 +1373,5 @@
 		else if (count($styles) > 1)
 		{
-
+			natsort($styles);
 ?>
 				<div class="inform">
@@ -1560,9 +1379,10 @@
 						<legend><?php echo $lang_profile['Style legend'] ?></legend>
 						<div class="infldset">
-							<label><?php echo $lang_profile['Styles'] ?><br />
+							<label><?php echo $lang_profile['Style info'] ?><br />
+
 							<select name="form[style]">
 <?php
 
-			foreach ($styles as $temp)
+			while (list(, $temp) = @each($styles))
 			{
 				if ($user['style'] == $temp)
@@ -1583,5 +1403,4 @@
 
 ?>
-<?php if ($pun_config['o_smilies'] == '1' || $pun_config['o_smilies_sig'] == '1' || $pun_config['o_signatures'] == '1' || $pun_config['o_avatars'] == '1' || ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1')): ?>
 				<div class="inform">
 					<fieldset>
@@ -1590,15 +1409,13 @@
 							<p><?php echo $lang_profile['Post display info'] ?></p>
 							<div class="rbox">
-<?php if ($pun_config['o_smilies'] == '1' || $pun_config['o_smilies_sig'] == '1'): ?>								<label><input type="checkbox" name="form[show_smilies]" value="1"<?php if ($user['show_smilies'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show smilies'] ?><br /></label>
-<?php endif; if ($pun_config['o_signatures'] == '1'): ?>								<label><input type="checkbox" name="form[show_sig]" value="1"<?php if ($user['show_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show sigs'] ?><br /></label>
-<?php endif; if ($pun_config['o_avatars'] == '1'): ?>								<label><input type="checkbox" name="form[show_avatars]" value="1"<?php if ($user['show_avatars'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show avatars'] ?><br /></label>
-<?php endif; if ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1'): ?>								<label><input type="checkbox" name="form[show_img]" value="1"<?php if ($user['show_img'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images'] ?><br /></label>
-<?php endif; if ($pun_config['o_signatures'] == '1' && $pun_config['p_sig_bbcode'] == '1' && $pun_config['p_sig_img_tag'] == '1'): ?>								<label><input type="checkbox" name="form[show_img_sig]" value="1"<?php if ($user['show_img_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images sigs'] ?><br /></label>
-<?php endif; ?>
+								<label><input type="checkbox" name="form[show_smilies]" value="1"<?php if ($user['show_smilies'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show smilies'] ?><br /></label>
+								<label><input type="checkbox" name="form[show_sig]" value="1"<?php if ($user['show_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show sigs'] ?><br /></label>
+<?php if ($pun_config['o_avatars'] == '1'): ?>							<label><input type="checkbox" name="form[show_avatars]" value="1"<?php if ($user['show_avatars'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show avatars'] ?><br /></label>
+<?php endif; ?>								<label><input type="checkbox" name="form[show_img]" value="1"<?php if ($user['show_img'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images'] ?><br /></label>
+								<label><input type="checkbox" name="form[show_img_sig]" value="1"<?php if ($user['show_img_sig'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Show images sigs'] ?><br /></label>
 							</div>
 						</div>
 					</fieldset>
 				</div>
-<?php endif; ?>
 				<div class="inform">
 					<fieldset>
@@ -1611,5 +1428,5 @@
 					</fieldset>
 				</div>
-				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" />  <?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1620,6 +1437,5 @@
 	else if ($section == 'privacy')
 	{
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section privacy']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1636,26 +1452,22 @@
 						<div class="infldset">
 							<input type="hidden" name="form_sent" value="1" />
-							<p><?php echo $lang_prof_reg['Email setting info'] ?></p>
+							<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
 							<div class="rbox">
-								<label><input type="radio" name="form[email_setting]" value="0"<?php if ($user['email_setting'] == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 1'] ?><br /></label>
-								<label><input type="radio" name="form[email_setting]" value="1"<?php if ($user['email_setting'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 2'] ?><br /></label>
-								<label><input type="radio" name="form[email_setting]" value="2"<?php if ($user['email_setting'] == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 3'] ?><br /></label>
+								<label><input type="radio" name="form[email_setting]" value="0"<?php if ($user['email_setting'] == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
+								<label><input type="radio" name="form[email_setting]" value="1"<?php if ($user['email_setting'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
+								<label><input type="radio" name="form[email_setting]" value="2"<?php if ($user['email_setting'] == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
+							</div>
+							<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[save_pass]" value="1"<?php if ($user['save_pass'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
+							</div>
+							<p><?php echo $lang_profile['Notify full info'] ?></p>
+							<div class="rbox">
+								<label><input type="checkbox" name="form[notify_with_post]" value="1"<?php if ($user['notify_with_post'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Notify full'] ?><br /></label>
 							</div>
 						</div>
 					</fieldset>
 				</div>
-<?php if ($pun_config['o_forum_subscriptions'] == '1' || $pun_config['o_topic_subscriptions'] == '1'): ?>				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_profile['Subscription legend'] ?></legend>
-						<div class="infldset">
-							<div class="rbox">
-								<label><input type="checkbox" name="form[notify_with_post]" value="1"<?php if ($user['notify_with_post'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Notify full'] ?><br /></label>
-<?php if ($pun_config['o_topic_subscriptions'] == '1'): ?>								<label><input type="checkbox" name="form[auto_notify]" value="1"<?php if ($user['auto_notify'] == '1') echo ' checked="checked"' ?> /><?php echo $lang_profile['Auto notify full'] ?><br /></label>
-<?php endif; ?>
-							</div>
-						</div>
-					</fieldset>
-				</div>
-<?php endif; ?>				<p class="buttons"><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /> <?php echo $lang_profile['Instructions'] ?></p>
+				<p><input type="submit" name="update" value="<?php echo $lang_common['Submit'] ?>" /><?php echo $lang_profile['Instructions'] ?></p>
 			</form>
 		</div>
@@ -1666,9 +1478,8 @@
 	else if ($section == 'admin')
 	{
-		if (!$pun_user['is_admmod'] || ($pun_user['g_moderator'] == '1' && $pun_user['g_mod_ban_users'] == '0'))
+		if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
 			message($lang_common['Bad request']);
 
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['Profile'], $lang_profile['Section admin']);
-		define('PUN_ACTIVE_PAGE', 'profile');
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
 		require PUN_ROOT.'header.php';
 
@@ -1679,5 +1490,5 @@
 		<h2><span><?php echo pun_htmlspecialchars($user['username']).' - '.$lang_profile['Section admin'] ?></span></h2>
 		<div class="box">
-			<form id="profile7" method="post" action="profile.php?section=admin&amp;id=<?php echo $id ?>">
+			<form id="profile7" method="post" action="profile.php?section=admin&amp;id=<?php echo $id ?>&amp;action=foo">
 				<div class="inform">
 				<input type="hidden" name="form_sent" value="1" />
@@ -1685,5 +1496,5 @@
 <?php
 
-		if ($pun_user['g_moderator'] == '1')
+		if ($pun_user['g_id'] == PUN_MOD)
 		{
 
@@ -1700,6 +1511,6 @@
 		else
 		{
-			if ($pun_user['id'] != $id)
-			{
+			if ($pun_user['id'] != $id)  
+			{  
 
 ?>
@@ -1709,13 +1520,13 @@
 <?php
 
-				$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
-
-				while ($cur_group = $db->fetch_assoc($result))
-				{
-					if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == ''))
-						echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
-					else
-						echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
-				}
+					$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
+
+					while ($cur_group = $db->fetch_assoc($result))  
+					{  
+						if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == ''))
+							echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+						else  
+							echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+					}  
 
 ?>
@@ -1727,5 +1538,5 @@
 				<div class="inform">
 					<fieldset>
-<?php
+<?php  
 
 			}
@@ -1734,5 +1545,5 @@
 						<legend><?php echo $lang_profile['Delete ban legend'] ?></legend>
 						<div class="infldset">
-							<input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" /> <input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" />
+							<input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" />&#160;&#160;<input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" />
 						</div>
 					</fieldset>
@@ -1740,5 +1551,5 @@
 <?php
 
-			if ($user['g_moderator'] == '1' || $user['g_id'] == PUN_ADMIN)
+			if ($user['g_id'] == PUN_MOD || $user['g_id'] == PUN_ADMIN)
 			{
 
@@ -1751,10 +1562,10 @@
 <?php
 
-				$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.moderators FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.moderators FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
 
 				$cur_category = 0;
 				while ($cur_forum = $db->fetch_assoc($result))
 				{
-					if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
+					if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 					{
 						if ($cur_category)
@@ -1792,6 +1603,4 @@
 
 	}
-	else
-		message($lang_common['Bad request']);
 
 ?>
Index: /trunk/web/punbb/pun_integration.php
===================================================================
--- /trunk/web/punbb/pun_integration.php	(revision 10)
+++ /trunk/web/punbb/pun_integration.php	(revision 1)
@@ -1,12 +1,5 @@
 <?php
-
-  if(!isset($env))
-  { $site_path = "../";
-    require $site_path."pathes.php";
-    require_once $site_path.RSR_APP_PATH."env.php";
-    $env = new env($site_path.RSR_CONFIG_FILE, $site_path);
-  }
-
-  # traitement de la requete
+  
+  # traitement de la requÃÂšte
   require $env->path("app")."main.php";
 
Index: /trunk/web/punbb/register.php
===================================================================
--- /trunk/web/punbb/register.php	(revision 10)
+++ /trunk/web/punbb/register.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -35,11 +52,10 @@
 else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
 {
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register'], $lang_register['Forum rules']);
-	define('PUN_ACTIVE_PAGE', 'register');
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
 	require PUN_ROOT.'header.php';
 
 ?>
-<div id="rules" class="blockform">
-	<div class="hd"><h2><span><?php echo $lang_register['Forum rules'] ?></span></h2></div>
+<div class="blockform">
+	<h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
 	<div class="box">
 		<form method="get" action="register.php">
@@ -48,9 +64,9 @@
 					<legend><?php echo $lang_register['Rules legend'] ?></legend>
 					<div class="infldset">
-						<div class="usercontent"><?php echo $pun_config['o_rules_message'] ?></div>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /> <input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
+						<p><?php echo $pun_config['o_rules_message'] ?></p>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
 		</form>
 	</div>
@@ -61,17 +77,8 @@
 }
 
-// Start with a clean slate
-$errors = array();
-
-if (isset($_POST['form_sent']))
+
+else if (isset($_POST['form_sent']))
 {
-	// Check that someone from this IP didn't register a user within the last hour (DoS prevention)
-	$result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-
-	if ($db->num_rows($result))
-		message($lang_register['Registration flood']);
-
-
-	$username = pun_trim($_POST['req_user']);
+	$username = pun_trim($_POST['req_username']);
 	$email1 = strtolower(trim($_POST['req_email1']));
 
@@ -85,43 +92,74 @@
 	else
 	{
-		$password1 = pun_trim($_POST['req_password1']);
-		$password2 = pun_trim($_POST['req_password2']);
-	}
+		$password1 = trim($_POST['req_password1']);
+		$password2 = trim($_POST['req_password2']);
+	}
+
+	// Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
+	$username = preg_replace('#\s+#s', ' ', $username);
 
 	// Validate username and passwords
-	check_username($username);
-
-	if (pun_strlen($password1) < 4)
-		$errors[] = $lang_prof_reg['Pass too short'];
+	if (strlen($username) < 2)
+		message($lang_prof_reg['Username too short']);
+	else if (pun_strlen($username) > 25)	// This usually doesn't happen since the form element only accepts 25 characters
+	    message($lang_common['Bad request']);
+	else if (strlen($password1) < 4)
+		message($lang_prof_reg['Pass too short']);
 	else if ($password1 != $password2)
-		$errors[] = $lang_prof_reg['Pass not match'];
-
-	// Validate email
+		message($lang_prof_reg['Pass not match']);
+	else if (!strcasecmp($username, 'invitÃ©') || !strcasecmp($username, $lang_common['Guest']))
+		message($lang_prof_reg['Username guest']);
+	else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
+		message($lang_prof_reg['Username IP']);
+	else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
+		message($lang_prof_reg['Username reserved chars']);
+	else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
+		message($lang_prof_reg['Username BBCode']);
+
+	// Check username for any censored words
+	if ($pun_config['o_censoring'] == '1')
+	{
+		// If the censored username differs from the username
+		if (censor_words($username) != $username)
+			message($lang_register['Username censor']);
+	}
+
+	// Check that the username (or a too similar username) is not already registered
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
+
+	if ($db->num_rows($result))
+	{
+		$busy = $db->result($result);
+		message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
+	}
+
+
+	// Validate e-mail
 	require PUN_ROOT.'include/email.php';
 
 	if (!is_valid_email($email1))
-		$errors[] = $lang_common['Invalid email'];
+		message($lang_common['Invalid e-mail']);
 	else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
-		$errors[] = $lang_register['Email not match'];
-
-	// Check if it's a banned email address
+		message($lang_register['E-mail not match']);
+
+	// Check it it's a banned e-mail address
 	if (is_banned_email($email1))
 	{
 		if ($pun_config['p_allow_banned_email'] == '0')
-			$errors[] = $lang_prof_reg['Banned email'];
-
-		$banned_email = true; // Used later when we send an alert email
+			message($lang_prof_reg['Banned e-mail']);
+
+		$banned_email = true;	// Used later when we send an alert e-mail
 	}
 	else
 		$banned_email = false;
 
-	// Check if someone else already has registered with that email address
+	// Check if someone else already has registered with that e-mail address
 	$dupe_list = array();
 
-	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email1).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 	if ($db->num_rows($result))
 	{
 		if ($pun_config['p_allow_dupe_email'] == '0')
-			$errors[] = $lang_prof_reg['Dupe email'];
+			message($lang_prof_reg['Dupe e-mail']);
 
 		while ($cur_dupe = $db->fetch_assoc($result))
@@ -129,171 +167,88 @@
 	}
 
-	// Make sure we got a valid language string
-	if (isset($_POST['language']))
-	{
-		$language = preg_replace('%[\.\\\/]%', '', $_POST['language']);
-		if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
-			message($lang_common['Bad request']);
-	}
-	else
-		$language = $pun_config['o_default_lang'];
-
-	$timezone = round($_POST['timezone'], 1);
-
-	$dst = isset($_POST['dst']) ? '1' : '0';
+	$timezone = intval($_POST['timezone']);
+	$language = isset($_POST['language']) ? $_POST['language'] : $pun_config['o_default_lang'];
+	$save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
 
 	$email_setting = intval($_POST['email_setting']);
-	if ($email_setting < 0 || $email_setting > 2)
-		$email_setting = $pun_config['o_default_email_setting'];
-
-	// Did everything go according to plan?
-	if (empty($errors))
-	{
-		// Insert the new user into the database. We do this now to get the last inserted ID for later use
-		$now = time();
-
-		$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
-		$password_hash = pun_hash($password1);
-
-		// Add the user
-		$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, timezone, dst, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$db->escape($email1).'\', '.$email_setting.', '.$timezone.' , '.$dst.', \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
-		$new_uid = $db->insert_id();
-
-		// If the mailing list isn't empty, we may need to send out some alerts
-		if ($pun_config['o_mailing_list'] != '')
-		{
-			// If we previously found out that the email was banned
-			if ($banned_email)
-			{
-				// Load the "banned email register" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/banned_email_register.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_message = str_replace('<username>', $username, $mail_message);
-				$mail_message = str_replace('<email>', $email1, $mail_message);
-				$mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
-			}
-
-			// If we previously found out that the email was a dupe
-			if (!empty($dupe_list))
-			{
-				// Load the "dupe email register" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/dupe_email_register.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_message = str_replace('<username>', $username, $mail_message);
-				$mail_message = str_replace('<dupe_list>', implode(', ', $dupe_list), $mail_message);
-				$mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
-			}
-
-			// Should we alert people on the admin mailing list that a new user has registered?
-			if ($pun_config['o_regs_report'] == '1')
-			{
-				// Load the "new user" template
-				$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/new_user.tpl'));
-
-				// The first row contains the subject
-				$first_crlf = strpos($mail_tpl, "\n");
-				$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-				$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-				$mail_message = str_replace('<username>', $username, $mail_message);
-				$mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
-				$mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
-				$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-				pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
-			}
-		}
-
-		// Must the user verify the registration or do we log him/her in right now?
-		if ($pun_config['o_regs_verify'] == '1')
-		{
-			// Load the "welcome" template
-			$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
-
-			// The first row contains the subject
-			$first_crlf = strpos($mail_tpl, "\n");
-			$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
-			$mail_message = trim(substr($mail_tpl, $first_crlf));
-
-			$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
-			$mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
-			$mail_message = str_replace('<username>', $username, $mail_message);
-			$mail_message = str_replace('<password>', $password1, $mail_message);
-			$mail_message = str_replace('<login_url>', get_base_url().'/login.php', $mail_message);
-			$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
-
-			pun_mail($email1, $mail_subject, $mail_message);
-
-			message($lang_register['Reg email'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
-		}
-
-		// Regenerate the users info cache
-		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-			require PUN_ROOT.'include/cache.php';
-
-		generate_users_info_cache();
-
-		pun_setcookie($new_uid, $password_hash, time() + $pun_config['o_timeout_visit']);
-
-		redirect('index.php', $lang_register['Reg complete']);
-	}
+	if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
+
+	// Insert the new user into the database. We do this now to get the last inserted id for later use.
+	$now = time();
+
+	$intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
+	$password_hash = pun_hash($password1);
+
+	// Add the user
+	$db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Impossible de crÃ©er un utilisateur', __FILE__, __LINE__, $db->error());
+	$new_uid = $db->insert_id();
+
+
+	// If we previously found out that the e-mail was banned
+	if ($banned_email && $pun_config['o_mailing_list'] != '')
+	{
+		$mail_subject = 'Alerte - Adresse e-mail bannis dÃ©tectÃ©e';
+		$mail_message = 'L\'utilisateur \''.$username.'\' s\est inscrit avec l\'adresse e-mail bannis : '.$email1."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// If we previously found out that the e-mail was a dupe
+	if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
+	{
+		$mail_subject = 'Alerte - Adresse e-mail en doublon dÃ©tÃ©ctÃ©e';
+		$mail_message = 'L\'utilisateur \''.$username.'\' s\'est inscrit avec l\'adresse qui appartient Ã©galement Ã  : '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// Should we alert people on the admin mailing list that a new user has registered?
+	if ($pun_config['o_regs_report'] == '1')
+	{
+		$mail_subject = 'Alerte - Nouvelle inscription';
+		$mail_message = 'L\'utilisateur \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne rÃ©pondez pas Ã  ce message)';
+
+		pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
+	}
+
+	// Must the user verify the registration or do we log him/her in right now?
+	if ($pun_config['o_regs_verify'] == '1')
+	{
+		// Load the "welcome" template
+		$mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
+
+		// The first row contains the subject
+		$first_crlf = strpos($mail_tpl, "\n");
+		$mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
+		$mail_message = trim(substr($mail_tpl, $first_crlf));
+
+		$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
+		$mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+		$mail_message = str_replace('<username>', $username, $mail_message);
+		$mail_message = str_replace('<password>', $password1, $mail_message);
+		$mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
+		$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
+
+		pun_mail($email1, $mail_subject, $mail_message);
+
+		message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
+	}
+
+	pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);
+
+	redirect(isset($_GET["from"]) ? urldecode($_GET["from"]) : "index.php", $lang_register['Reg complete']);
 }
 
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register']);
-$required_fields = array('req_user' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['Email'], 'req_email2' => $lang_common['Email'].' 2');
-$focus_element = array('register', 'req_user');
-define('PUN_ACTIVE_PAGE', 'register');
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
+$required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
+$focus_element = array('register', 'req_username');
 require PUN_ROOT.'header.php';
 
-$timezone = isset($timezone) ? $timezone : $pun_config['o_default_timezone'];
-$dst = isset($dst) ? $dst : $pun_config['o_default_dst'];
-$email_setting = isset($email_setting) ? $email_setting : $pun_config['o_default_email_setting'];
-
-// If there are errors, we display them
-if (!empty($errors))
-{
-
-?>
-<div id="posterror" class="block">
-	<h2><span><?php echo $lang_register['Registration errors'] ?></span></h2>
-	<div class="box">
-		<div class="inbox error-info">
-			<p><?php echo $lang_register['Registration errors info'] ?></p>
-			<ul class="error-list">
-<?php
-
-	foreach ($errors as $cur_error)
-		echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
-?>
-			</ul>
-		</div>
-	</div>
-</div>
-
-<?php
-
-}
-?>
-<div id="regform" class="blockform">
+?>
+<div class="blockform">
 	<h2><span><?php echo $lang_register['Register'] ?></span></h2>
 	<div class="box">
-		<form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
+  <form id="register" method="post" action="register.php?action=register<?php echo isset($_GET["from"]) ? "&from=".$_GET["from"] : ""; ?>"
+                      onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
 			<div class="inform">
 				<div class="forminfo">
@@ -306,5 +261,5 @@
 					<div class="infldset">
 						<input type="hidden" name="form_sent" value="1" />
-						<label class="required"><strong><?php echo $lang_common['Username'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_user" value="<?php if (isset($_POST['req_user'])) echo pun_htmlspecialchars($_POST['req_user']); ?>" size="25" maxlength="25" /><br /></label>
+						<label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
 					</div>
 				</fieldset>
@@ -312,8 +267,8 @@
 <?php if ($pun_config['o_regs_verify'] == '0'): ?>			<div class="inform">
 				<fieldset>
-					<legend><?php echo $lang_register['Pass legend'] ?></legend>
-					<div class="infldset">
-						<label class="conl required"><strong><?php echo $lang_common['Password'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password1" value="<?php if (isset($_POST['req_password1'])) echo pun_htmlspecialchars($_POST['req_password1']); ?>" size="16" /><br /></label>
-						<label class="conl required"><strong><?php echo $lang_prof_reg['Confirm pass'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password2" value="<?php if (isset($_POST['req_password2'])) echo pun_htmlspecialchars($_POST['req_password2']); ?>" size="16" /><br /></label>
+					<legend><?php echo $lang_register['Pass legend 1'] ?></legend>
+					<div class="infldset">
+						<label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
+						<label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
 						<p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
 					</div>
@@ -322,11 +277,11 @@
 <?php endif; ?>			<div class="inform">
 				<fieldset>
-					<legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['Email legend 2'] : $lang_prof_reg['Email legend'] ?></legend>
-					<div class="infldset">
-<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<p><?php echo $lang_register['Email info'] ?></p>
-<?php endif; ?>						<label class="required"><strong><?php echo $lang_common['Email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<input type="text" name="req_email1" value="<?php if (isset($_POST['req_email1'])) echo pun_htmlspecialchars($_POST['req_email1']); ?>" size="50" maxlength="80" /><br /></label>
-<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<label class="required"><strong><?php echo $lang_register['Confirm email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
-						<input type="text" name="req_email2" value="<?php if (isset($_POST['req_email2'])) echo pun_htmlspecialchars($_POST['req_email2']); ?>" size="50" maxlength="80" /><br /></label>
+					<legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
+					<div class="infldset">
+<?php if ($pun_config['o_regs_verify'] == '1'): ?>			<p><?php echo $lang_register['E-mail info'] ?></p>
+<?php endif; ?>					<label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
+						<input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
+<?php if ($pun_config['o_regs_verify'] == '1'): ?>						<label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
+						<input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
 <?php endif; ?>					</div>
 				</fieldset>
@@ -336,55 +291,55 @@
 					<legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
 					<div class="infldset">
-						<p><?php echo $lang_prof_reg['Time zone info'] ?></p>
-						<label><?php echo $lang_prof_reg['Time zone']."\n" ?>
+						<label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
 						<br /><select id="time_zone" name="timezone">
-							<option value="-12"<?php if ($timezone == -12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-12:00'] ?></option>
-							<option value="-11"<?php if ($timezone == -11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-11:00'] ?></option>
-							<option value="-10"<?php if ($timezone == -10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-10:00'] ?></option>
-							<option value="-9.5"<?php if ($timezone == -9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:30'] ?></option>
-							<option value="-9"<?php if ($timezone == -9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:00'] ?></option>
-							<option value="-8.5"<?php if ($timezone == -8.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:30'] ?></option>
-							<option value="-8"<?php if ($timezone == -8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:00'] ?></option>
-							<option value="-7"<?php if ($timezone == -7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-07:00'] ?></option>
-							<option value="-6"<?php if ($timezone == -6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-06:00'] ?></option>
-							<option value="-5"<?php if ($timezone == -5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-05:00'] ?></option>
-							<option value="-4"<?php if ($timezone == -4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-04:00'] ?></option>
-							<option value="-3.5"<?php if ($timezone == -3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:30'] ?></option>
-							<option value="-3"<?php if ($timezone == -3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:00'] ?></option>
-							<option value="-2"<?php if ($timezone == -2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-02:00'] ?></option>
-							<option value="-1"<?php if ($timezone == -1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-01:00'] ?></option>
-							<option value="0"<?php if ($timezone == 0) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC'] ?></option>
-							<option value="1"<?php if ($timezone == 1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+01:00'] ?></option>
-							<option value="2"<?php if ($timezone == 2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+02:00'] ?></option>
-							<option value="3"<?php if ($timezone == 3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:00'] ?></option>
-							<option value="3.5"<?php if ($timezone == 3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:30'] ?></option>
-							<option value="4"<?php if ($timezone == 4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:00'] ?></option>
-							<option value="4.5"<?php if ($timezone == 4.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:30'] ?></option>
-							<option value="5"<?php if ($timezone == 5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:00'] ?></option>
-							<option value="5.5"<?php if ($timezone == 5.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:30'] ?></option>
-							<option value="5.75"<?php if ($timezone == 5.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:45'] ?></option>
-							<option value="6"<?php if ($timezone == 6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:00'] ?></option>
-							<option value="6.5"<?php if ($timezone == 6.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:30'] ?></option>
-							<option value="7"<?php if ($timezone == 7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+07:00'] ?></option>
-							<option value="8"<?php if ($timezone == 8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:00'] ?></option>
-							<option value="8.75"<?php if ($timezone == 8.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:45'] ?></option>
-							<option value="9"<?php if ($timezone == 9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:00'] ?></option>
-							<option value="9.5"<?php if ($timezone == 9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:30'] ?></option>
-							<option value="10"<?php if ($timezone == 10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:00'] ?></option>
-							<option value="10.5"<?php if ($timezone == 10.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:30'] ?></option>
-							<option value="11"<?php if ($timezone == 11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:00'] ?></option>
-							<option value="11.5"<?php if ($timezone == 11.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:30'] ?></option>
-							<option value="12"<?php if ($timezone == 12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:00'] ?></option>
-							<option value="12.75"<?php if ($timezone == 12.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:45'] ?></option>
-							<option value="13"<?php if ($timezone == 13) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+13:00'] ?></option>
-							<option value="14"<?php if ($timezone == 14) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+14:00'] ?></option>
+							<option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
+							<option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
+							<option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
+							<option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
+							<option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
+							<option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
+							<option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
+							<option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
+							<option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
+							<option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
+							<option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
+							<option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
+							<option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
+							<option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
+							<option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
+							<option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
+							<option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
+							<option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
+							<option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
+							<option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
+							<option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
+							<option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
+							<option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
+							<option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
+							<option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
+							<option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
+							<option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
+							<option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
+							<option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
+							<option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
+							<option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
+							<option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
+							<option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
+							<option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
+							<option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
+							<option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
+							<option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
 						</select>
 						<br /></label>
-						<div class="rbox">
-							<label><input type="checkbox" name="dst" value="1"<?php if ($dst == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['DST'] ?><br /></label>
-						</div>
-<?php
-
-		$languages = forum_list_langs();
+<?php
+
+		$languages = array();
+		$d = dir(PUN_ROOT.'lang');
+		while (($entry = $d->read()) !== false)
+		{
+			if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
+				$languages[] = $entry;
+		}
+		$d->close();
 
 		// Only display the language selection box if there's more than one language available
@@ -393,9 +348,9 @@
 
 ?>
-							<label><?php echo $lang_prof_reg['Language'] ?>
+							<label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
 							<br /><select name="language">
 <?php
 
-			foreach ($languages as $temp)
+			while (list(, $temp) = @each($languages))
 			{
 				if ($pun_config['o_default_lang'] == $temp)
@@ -419,14 +374,18 @@
 					<legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
 					<div class="infldset">
-						<p><?php echo $lang_prof_reg['Email setting info'] ?></p>
+						<p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
 						<div class="rbox">
-							<label><input type="radio" name="email_setting" value="0"<?php if ($email_setting == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 1'] ?><br /></label>
-							<label><input type="radio" name="email_setting" value="1"<?php if ($email_setting == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 2'] ?><br /></label>
-							<label><input type="radio" name="email_setting" value="2"<?php if ($email_setting == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 3'] ?><br /></label>
+							<label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
+							<label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
+							<label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
 						</div>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
+						<p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
+						<div class="rbox">
+							<label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
+						</div>
+					</div>
+				</fieldset>
+			</div>
+			<p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
 		</form>
 	</div>
Index: /trunk/web/punbb/search.php
===================================================================
--- /trunk/web/punbb/search.php	(revision 10)
+++ /trunk/web/punbb/search.php	(revision 1)
@@ -1,19 +1,37 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // The contents of this file are very much inspired by the file search.php
-// from the phpBB Group forum software phpBB2 (http://www.phpbb.com)
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+// from the phpBB Group forum software phpBB2 (http://www.phpbb.com).
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
+
 
 // Load the search.php language file
 require PUN_ROOT.'lang/'.$pun_user['language'].'/search.php';
-require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
 
 
@@ -23,5 +41,8 @@
 	message($lang_search['No search permission']);
 
-require PUN_ROOT.'include/search_idx.php';
+
+// Detect two byte character sets
+$multibyte = (isset($lang_common['lang_multibyte']) && $lang_common['lang_multibyte']) ? true : false;
+
 
 // Figure out what to do :-)
@@ -29,14 +50,7 @@
 {
 	$action = (isset($_GET['action'])) ? $_GET['action'] : null;
-	$forums = isset($_GET['forums']) ? (is_array($_GET['forums']) ? $_GET['forums'] : explode(',', $_GET['forums'])) : (isset($_GET['forum']) ? array($_GET['forum']) : array());
-	$sort_dir = (isset($_GET['sort_dir']) && $_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC';
-
-	$forums = array_map('intval', $forums);
-
-	// Allow the old action names for backwards compatibility reasons
-	if ($action == 'show_user')
-		$action = 'show_user_posts';
-	else if ($action == 'show_24h')
-		$action = 'show_recent';
+	$forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1;
+	$sort_dir = (isset($_GET['sort_dir'])) ? (($_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC') : 'DESC';
+	if (isset($search_id)) unset($search_id);
 
 	// If a search_id was supplied
@@ -50,11 +64,11 @@
 	else if ($action == 'search')
 	{
-		$keywords = (isset($_GET['keywords'])) ? utf8_strtolower(pun_trim($_GET['keywords'])) : null;
-		$author = (isset($_GET['author'])) ? utf8_strtolower(pun_trim($_GET['author'])) : null;
-
-		if (preg_match('%^[\*\%]+$%', $keywords) || (pun_strlen(str_replace(array('*', '%'), '', $keywords)) < PUN_SEARCH_MIN_WORD && !is_cjk($keywords)))
+		$keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null;
+		$author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null;
+		
+		if (preg_match('#^[\*%]+$#', $keywords) || strlen(str_replace(array('*', '%'), '', $keywords)) < 3)
 			$keywords = '';
 
-		if (preg_match('%^[\*\%]+$%', $author) || pun_strlen(str_replace(array('*', '%'), '', $author)) < 2)
+		if (preg_match('#^[\*%]+$#', $author) || strlen(str_replace(array('*', '%'), '', $author)) < 3)
 			$author = '';
 
@@ -65,28 +79,20 @@
 			$author = str_replace('*', '%', $author);
 
-		$show_as = (isset($_GET['show_as']) && $_GET['show_as'] == 'topics') ? 'topics' : 'posts';
-		$sort_by = (isset($_GET['sort_by'])) ? intval($_GET['sort_by']) : 0;
-		$search_in = (!isset($_GET['search_in']) || $_GET['search_in'] == '0') ? 0 : (($_GET['search_in'] == '1') ? 1 : -1);
+		$show_as = (isset($_GET['show_as'])) ? $_GET['show_as'] : 'posts';
+		$sort_by = (isset($_GET['sort_by'])) ? intval($_GET['sort_by']) : null;
+		$search_in = (!isset($_GET['search_in']) || $_GET['search_in'] == 'all') ? 0 : (($_GET['search_in'] == 'message') ? 1 : -1);
 	}
-	// If it's a user search (by ID)
-	else if ($action == 'show_user_posts' || $action == 'show_user_topics' || $action == 'show_subscriptions')
+	// If it's a user search (by id)
+	else if ($action == 'show_user')
 	{
-		$user_id = (isset($_GET['user_id'])) ? intval($_GET['user_id']) : $pun_user['id'];
+		$user_id = intval($_GET['user_id']);
 		if ($user_id < 2)
 			message($lang_common['Bad request']);
-
-		// Subscribed topics can only be viewed by admins, moderators and the users themselves
-		if ($action == 'show_subscriptions' && !$pun_user['is_admmod'] && $user_id != $pun_user['id'])
-			message($lang_common['No permission']);
 	}
-	else if ($action == 'show_recent')
-		$interval = isset($_GET['value']) ? intval($_GET['value']) : 86400;
-	else if ($action == 'show_replies')
+	else
 	{
-		if ($pun_user['is_guest'])
+		if ($action != 'show_new' && $action != 'show_24h' && $action != 'show_unanswered' && $action != 'show_subscriptions')
 			message($lang_common['Bad request']);
 	}
-	else if ($action != 'show_new' && $action != 'show_unanswered')
-		message($lang_common['Bad request']);
 
 
@@ -96,15 +102,14 @@
 		$ident = ($pun_user['is_guest']) ? get_remote_address() : $pun_user['username'];
 
-		$result = $db->query('SELECT search_data FROM '.$db->prefix.'search_cache WHERE id='.$search_id.' AND ident=\''.$db->escape($ident).'\'') or error('Unable to fetch search results', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT search_data FROM '.$db->prefix.'search_cache WHERE id='.$search_id.' AND ident=\''.$db->escape($ident).'\'') or error('Impossible de retrouver les rÃ©sultats de la recherche', __FILE__, __LINE__, $db->error());
 		if ($row = $db->fetch_assoc($result))
 		{
 			$temp = unserialize($row['search_data']);
 
-			$search_ids = unserialize($temp['search_ids']);
+			$search_results = $temp['search_results'];
 			$num_hits = $temp['num_hits'];
 			$sort_by = $temp['sort_by'];
 			$sort_dir = $temp['sort_dir'];
 			$show_as = $temp['show_as'];
-			$search_type = $temp['search_type'];
 
 			unset($temp);
@@ -118,62 +123,54 @@
 
 		// Search a specific forum?
-		$forum_sql = (!empty($forums) || (empty($forums) && $pun_config['o_search_all_forums'] == '0' && !$pun_user['is_admmod'])) ? ' AND t.forum_id IN ('.implode(',', $forums).')' : '';
+		$forum_sql = ($forum != -1) ? ' AND t.forum_id = '.$forum : '';
 
 		if (!empty($author) || !empty($keywords))
 		{
-			// Flood protection
-			if ($pun_user['last_search'] && (time() - $pun_user['last_search']) < $pun_user['g_search_flood'] && (time() - $pun_user['last_search']) >= 0)
-				message(sprintf($lang_search['Search flood'], $pun_user['g_search_flood']));
-
-			if (!$pun_user['is_guest'])
-				$db->query('UPDATE '.$db->prefix.'users SET last_search='.time().' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-			else
-				$db->query('UPDATE '.$db->prefix.'online SET last_search='.time().' WHERE ident=\''.$db->escape(get_remote_address()).'\'' ) or error('Unable to update user', __FILE__, __LINE__, $db->error());
-
-			switch ($sort_by)
-			{
-				case 1:
-					$sort_by_sql = ($show_as == 'topics') ? 't.poster' : 'p.poster';
-					$sort_type = SORT_STRING;
-					break;
-
-				case 2:
-					$sort_by_sql = 't.subject';
-					$sort_type = SORT_STRING;
-					break;
-
-				case 3:
-					$sort_by_sql = 't.forum_id';
-					$sort_type = SORT_NUMERIC;
-					break;
-
-				case 4:
-					$sort_by_sql = 't.last_post';
-					$sort_type = SORT_NUMERIC;
-					break;
-
-				default:
-					$sort_by_sql = ($show_as == 'topics') ? 't.last_post' : 'p.posted';
-					$sort_type = SORT_NUMERIC;
-					break;
-			}
-
 			// If it's a search for keywords
 			if ($keywords)
 			{
-				// split the keywords into words
-				$keywords_array = split_words($keywords, false);
-
-				if (empty($keywords_array))
-					message($lang_search['No hits']);
-
-				// Should we search in message body or topic subject specifically?
-				$search_in_cond = ($search_in) ? (($search_in > 0) ? ' AND m.subject_match = 0' : ' AND m.subject_match = 1') : '';
+				$stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt');
+				$stopwords = array_map('trim', $stopwords);
+
+				// Are we searching for multibyte charset text?
+				if ($multibyte)
+				{
+					// Strip out excessive whitespace
+					$keywords = trim(preg_replace('#\s+#', ' ', $keywords));
+
+					$keywords_array = explode(' ', $keywords);
+				}
+				else
+				{
+					// Filter out non-alphabetical chars
+					$noise_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!', 'Â€');
+					$noise_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ',  ' ', ' ', ' ');
+					$keywords = str_replace($noise_match, $noise_replace, $keywords);
+
+					// Strip out excessive whitespace
+					$keywords = trim(preg_replace('#\s+#', ' ', $keywords));
+
+					// Fill an array with all the words
+					$keywords_array = explode(' ', $keywords);
+
+					if (empty($keywords_array))
+						message($lang_search['No hits']);
+
+					while (list($i, $word) = @each($keywords_array))
+					{
+						$num_chars = pun_strlen($word);
+
+						if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
+							unset($keywords_array[$i]);
+					}
+
+					// Should we search in message body or topic subject specifically?
+					$search_in_cond = ($search_in) ? (($search_in > 0) ? ' AND m.subject_match = 0' : ' AND m.subject_match = 1') : '';
+				}
 
 				$word_count = 0;
 				$match_type = 'and';
-
-				$sort_data = array();
-				foreach ($keywords_array as $cur_word)
+				@reset($keywords_array);
+				while (list(, $cur_word) = @each($keywords_array))
 				{
 					switch ($cur_word)
@@ -187,45 +184,45 @@
 						default:
 						{
-							if (is_cjk($cur_word))
+							// Are we searching for multibyte charset text?
+							if ($multibyte)
 							{
-								$where_cond = str_replace('*', '%', $cur_word);
-								$where_cond = ($search_in ? (($search_in > 0) ? 'p.message LIKE \'%'.$db->escape($where_cond).'%\'' : 't.subject LIKE \'%'.$db->escape($where_cond).'%\'') : 'p.message LIKE \'%'.$db->escape($where_cond).'%\' OR t.subject LIKE \'%'.$db->escape($where_cond).'%\'');
-
-								$result = $db->query('SELECT p.id AS post_id, p.topic_id, '.$sort_by_sql.' AS sort_by FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE ('.$where_cond.') AND (fp.read_forum IS NULL OR fp.read_forum=1)'.$forum_sql, true) or error('Unable to search for posts', __FILE__, __LINE__, $db->error());
+								$cur_word = $db->escape('%'.str_replace('*', '', $cur_word).'%');
+								$cur_word_like = ($db_type == 'pgsql') ? 'ILIKE \''.$cur_word.'\'' : 'LIKE \''.$cur_word.'\'';
+
+								if ($search_in > 0)
+									$sql = 'SELECT id FROM '.$db->prefix.'posts WHERE message '.$cur_word_like;
+								else if ($search_in < 0)
+									$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
+								else
+									$sql = 'SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.message '.$cur_word_like.' OR t.subject '.$cur_word_like.' GROUP BY p.id, t.id';
 							}
 							else
-								$result = $db->query('SELECT m.post_id, p.topic_id, '.$sort_by_sql.' AS sort_by FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON m.word_id = w.id INNER JOIN '.$db->prefix.'posts AS p ON p.id=m.post_id INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE w.word LIKE \''.$db->escape(str_replace('*', '%', $cur_word)).'\''.$search_in_cond.' AND (fp.read_forum IS NULL OR fp.read_forum=1)'.$forum_sql, true) or error('Unable to search for posts', __FILE__, __LINE__, $db->error());
+							{
+								$cur_word = str_replace('*', '%', $cur_word);
+								$sql = 'SELECT m.post_id FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON m.word_id = w.id WHERE w.word LIKE \''.$cur_word.'\''.$search_in_cond;
+							}
+
+							$result = $db->query($sql, true) or error('Impossible de rechercher les messages', __FILE__, __LINE__, $db->error());
 
 							$row = array();
-							while ($temp = $db->fetch_assoc($result))
+							while ($temp = $db->fetch_row($result))
 							{
-								$row[$temp['post_id']] = $temp['topic_id'];
+								$row[$temp[0]] = 1;
 
 								if (!$word_count)
-								{
-									$keyword_results[$temp['post_id']] = $temp['topic_id'];
-									$sort_data[$temp['post_id']] = $temp['sort_by'];
-								}
+									$result_list[$temp[0]] = 1;
 								else if ($match_type == 'or')
-								{
-									$keyword_results[$temp['post_id']] = $temp['topic_id'];
-									$sort_data[$temp['post_id']] = $temp['sort_by'];
-								}
+									$result_list[$temp[0]] = 1;
 								else if ($match_type == 'not')
-								{
-									unset($keyword_results[$temp['post_id']]);
-									unset($sort_data[$temp['post_id']]);
-								}
+									$result_list[$temp[0]] = 0;
 							}
 
 							if ($match_type == 'and' && $word_count)
 							{
-								foreach ($keyword_results as $post_id => $topic_id)
+								@reset($result_list);
+								while (list($post_id,) = @each($result_list))
 								{
 									if (!isset($row[$post_id]))
-									{
-										unset($keyword_results[$post_id]);
-										unset($sort_data[$post_id]);
-									}
+										$result_list[$post_id] = 0;
 								}
 							}
@@ -239,30 +236,25 @@
 				}
 
-				// Sort the results - annoyingly array_multisort re-indexes arrays with numeric keys, so we need to split the keys out into a seperate array then combine them again after
-				$post_ids = array_keys($keyword_results);
-				$topic_ids = array_values($keyword_results);
-
-				array_multisort(array_values($sort_data), $sort_dir == 'DESC' ? SORT_DESC : SORT_ASC, $sort_type, $post_ids, $topic_ids);
-
-				// combine the arrays back into a key=>value array (array_combine is PHP5 only unfortunately)
-				$num_results = count($keyword_results);
-				$keyword_results = array();
-				for ($i = 0;$i < $num_results;$i++)
-					$keyword_results[$post_ids[$i]] = $topic_ids[$i];
-
-				unset($sort_data, $post_ids, $topic_ids);
+				@reset($result_list);
+				while (list($post_id, $matches) = @each($result_list))
+				{
+					if ($matches)
+						$keyword_results[] = $post_id;
+				}
+
+				unset($result_list);
 			}
 
 			// If it's a search for author name (and that author name isn't Guest)
-			if ($author && $author != 'guest' && $author != utf8_strtolower($lang_common['Guest']))
+			if ($author && strcasecmp($author, 'Guest') && strcasecmp($author, $lang_common['Guest']))
 			{
 				switch ($db_type)
 				{
 					case 'pgsql':
-						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username ILIKE \''.$db->escape($author).'\'') or error('Unable to fetch users', __FILE__, __LINE__, $db->error());
+						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username ILIKE \''.$db->escape($author).'\'') or error('Impossible de retrouver les membres', __FILE__, __LINE__, $db->error());
 						break;
 
 					default:
-						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username LIKE \''.$db->escape($author).'\'') or error('Unable to fetch users', __FILE__, __LINE__, $db->error());
+						$result = $db->query('SELECT id FROM '.$db->prefix.'users WHERE username LIKE \''.$db->escape($author).'\'') or error('Impossible de retrouver les membres', __FILE__, __LINE__, $db->error());
 						break;
 				}
@@ -270,11 +262,13 @@
 				if ($db->num_rows($result))
 				{
-					$user_ids = array();
+					$user_ids = '';
 					while ($row = $db->fetch_row($result))
-						$user_ids[] = $row[0];
-
-					$result = $db->query('SELECT p.id AS post_id, p.topic_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id IN('.implode(',', $user_ids).')'.$forum_sql.' ORDER BY '.$sort_by_sql.' '.$sort_dir) or error('Unable to fetch matched posts list', __FILE__, __LINE__, $db->error());
-					while ($temp = $db->fetch_assoc($result))
-						$author_results[$temp['post_id']] = $temp['topic_id'];
+						$user_ids .= (($user_ids != '') ? ',' : '').$row[0];
+
+					$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE poster_id IN('.$user_ids.')') or error('Impossible de retrouver la liste des messages correspondants', __FILE__, __LINE__, $db->error());
+
+					$search_ids = array();
+					while ($row = $db->fetch_row($result))
+						$author_results[] = $row[0];
 
 					$db->free_result($result);
@@ -282,43 +276,49 @@
 			}
 
-			// If we searched for both keywords and author name we want the intersection between the results
+
 			if ($author && $keywords)
 			{
-				$search_ids = array_intersect_assoc($keyword_results, $author_results);
-				$search_type = array('both', array($keywords, pun_trim($_GET['author'])), implode(',', $forums), $search_in);
+				// If we searched for both keywords and author name we want the intersection between the results
+				$search_ids = array_intersect($keyword_results, $author_results);
+				unset($keyword_results, $author_results);
 			}
 			else if ($keywords)
-			{
 				$search_ids = $keyword_results;
-				$search_type = array('keywords', $keywords, implode(',', $forums), $search_in);
-			}
 			else
-			{
 				$search_ids = $author_results;
-				$search_type = array('author', pun_trim($_GET['author']), implode(',', $forums), $search_in);
-			}
-
-			unset($keyword_results, $author_results);
-
-			if ($show_as == 'topics')
-				$search_ids = array_values($search_ids);
-			else
-				$search_ids = array_keys($search_ids);
-
-			$search_ids = array_unique($search_ids);
 
 			$num_hits = count($search_ids);
 			if (!$num_hits)
 				message($lang_search['No hits']);
-		}
-		else if ($action == 'show_new' || $action == 'show_recent' || $action == 'show_replies' || $action == 'show_user_posts' || $action == 'show_user_topics' || $action == 'show_subscriptions' || $action == 'show_unanswered')
-		{
-			$search_type = array('action', $action);
-			$show_as = 'topics';
-			// We want to sort things after last post
-			$sort_by = 0;
-			$sort_dir = 'DESC';
-
-			// If it's a search for new posts since last visit
+
+
+			if ($show_as == 'topics')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN('.implode(',', $search_ids).')'.$forum_sql.' GROUP BY t.id', true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+				$search_ids = array();
+				while ($row = $db->fetch_row($result))
+					$search_ids[] = $row[0];
+
+				$db->free_result($result);
+
+				$num_hits = count($search_ids);
+			}
+			else
+			{
+				$result = $db->query('SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id IN('.implode(',', $search_ids).')'.$forum_sql, true) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+				$search_ids = array();
+				while ($row = $db->fetch_row($result))
+					$search_ids[] = $row[0];
+
+				$db->free_result($result);
+
+				$num_hits = count($search_ids);
+			}
+		}
+		else if ($action == 'show_new' || $action == 'show_24h' || $action == 'show_user' || $action == 'show_subscriptions' || $action == 'show_unanswered')
+		{
+			// If it's a search for new posts
 			if ($action == 'show_new')
 			{
@@ -326,5 +326,5 @@
 					message($lang_common['No permission']);
 
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit']) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 				$num_hits = $db->num_rows($result);
 
@@ -332,8 +332,8 @@
 					message($lang_search['No new posts']);
 			}
-			// If it's a search for recent posts (in a certain time interval)
-			else if ($action == 'show_recent')
-			{
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - $interval).' AND t.moved_to IS NULL'.(isset($_GET['fid']) ? ' AND t.forum_id='.intval($_GET['fid']) : '').' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
+			// If it's a search for todays posts
+			else if ($action == 'show_24h')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.(time() - 86400)) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 				$num_hits = $db->num_rows($result);
 
@@ -341,8 +341,8 @@
 					message($lang_search['No recent posts']);
 			}
-			// If it's a search for topics in which the user has posted
-			else if ($action == 'show_replies')
-			{
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$pun_user['id'].' GROUP BY t.id'.($db_type == 'pgsql' ? ', t.last_post' : '').' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
+			// If it's a search for posts by a specific user ID
+			else if ($action == 'show_user')
+			{
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' GROUP BY t.id') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 				$num_hits = $db->num_rows($result);
 
@@ -350,30 +350,4 @@
 					message($lang_search['No user posts']);
 			}
-			// If it's a search for posts by a specific user ID
-			else if ($action == 'show_user_posts')
-			{
-				$show_as = 'posts';
-
-				$result = $db->query('SELECT p.id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON p.topic_id=t.id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' ORDER BY p.posted DESC') or error('Unable to fetch user posts', __FILE__, __LINE__, $db->error());
-				$num_hits = $db->num_rows($result);
-
-				if (!$num_hits)
-					message($lang_search['No user posts']);
-
-				// Pass on the user ID so that we can later know whos posts we're searching for
-				$search_type[2] = $user_id;
-			}
-			// If it's a search for topics by a specific user ID
-			else if ($action == 'show_user_topics')
-			{
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.first_post_id=p.id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' ORDER BY t.last_post DESC') or error('Unable to fetch user topics', __FILE__, __LINE__, $db->error());
-				$num_hits = $db->num_rows($result);
-
-				if (!$num_hits)
-					message($lang_search['No user topics']);
-
-				// Pass on the user ID so that we can later know whos topics we're searching for
-				$search_type[2] = $user_id;
-			}
 			// If it's a search for subscribed topics
 			else if ($action == 'show_subscriptions')
@@ -382,17 +356,14 @@
 					message($lang_common['Bad request']);
 
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$user_id.') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1)') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 				$num_hits = $db->num_rows($result);
 
 				if (!$num_hits)
 					message($lang_search['No subscriptions']);
-
-				// Pass on user ID so that we can later know whose subscriptions we're searching for
-				$search_type[2] = $user_id;
 			}
 			// If it's a search for unanswered posts
 			else
 			{
-				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL') or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
 				$num_hits = $db->num_rows($result);
 
@@ -400,4 +371,7 @@
 					message($lang_search['No unanswered']);
 			}
+
+			// We want to sort things after last post
+			$sort_by = 4;
 
 			$search_ids = array();
@@ -406,4 +380,6 @@
 
 			$db->free_result($result);
+
+			$show_as = 'topics';
 		}
 		else
@@ -413,5 +389,5 @@
 		// Prune "old" search results
 		$old_searches = array();
-		$result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT ident FROM '.$db->prefix.'online') or error('Impossible de retrouver la liste de utilisateurs en ligne', __FILE__, __LINE__, $db->error());
 
 		if ($db->num_rows($result))
@@ -420,23 +396,24 @@
 				$old_searches[] = '\''.$db->escape($row[0]).'\'';
 
-			$db->query('DELETE FROM '.$db->prefix.'search_cache WHERE ident NOT IN('.implode(',', $old_searches).')') or error('Unable to delete search results', __FILE__, __LINE__, $db->error());
-		}
+			$db->query('DELETE FROM '.$db->prefix.'search_cache WHERE ident NOT IN('.implode(',', $old_searches).')') or error('Impossible de supprimer les rÃ©sultats de recherches', __FILE__, __LINE__, $db->error());
+		}
+
+		// Final search results
+		$search_results = implode(',', $search_ids);
 
 		// Fill an array with our results and search properties
-		$temp = serialize(array(
-			'search_ids'		=> serialize($search_ids),
-			'num_hits'			=> $num_hits,
-			'sort_by'			=> $sort_by,
-			'sort_dir'			=> $sort_dir,
-			'show_as'			=> $show_as,
-			'search_type'		=> $search_type
-		));
+		$temp['search_results'] = $search_results;
+		$temp['num_hits'] = $num_hits;
+		$temp['sort_by'] = $sort_by;
+		$temp['sort_dir'] = $sort_dir;
+		$temp['show_as'] = $show_as;
+		$temp = serialize($temp);
 		$search_id = mt_rand(1, 2147483647);
 
 		$ident = ($pun_user['is_guest']) ? get_remote_address() : $pun_user['username'];
 
-		$db->query('INSERT INTO '.$db->prefix.'search_cache (id, ident, search_data) VALUES('.$search_id.', \''.$db->escape($ident).'\', \''.$db->escape($temp).'\')') or error('Unable to insert search results', __FILE__, __LINE__, $db->error());
-
-		if ($search_type[0] != 'action')
+		$db->query('INSERT INTO '.$db->prefix.'search_cache (id, ident, search_data) VALUES('.$search_id.', \''.$db->escape($ident).'\', \''.$db->escape($temp).'\')') or error('Impossible d\'insÃ©rer les rÃ©sultats de recherche', __FILE__, __LINE__, $db->error());
+
+		if ($action != 'show_new' && $action != 'show_24h')
 		{
 			$db->end_transaction();
@@ -449,13 +426,9 @@
 	}
 
-	$forum_actions = array();
-
-	// If we're on the new posts search, display a "mark all as read" link
-	if (!$pun_user['is_guest'] && $search_type[0] == 'action' && $search_type[1] == 'show_new')
-		$forum_actions[] = '<a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a>';
 
 	// Fetch results to display
-	if (!empty($search_ids))
+	if ($search_results != '')
 	{
+		$group_by_sql = '';
 		switch ($sort_by)
 		{
@@ -472,8 +445,27 @@
 				break;
 
+			case 4:
+				$sort_by_sql = 't.last_post';
+				break;
+
 			default:
-				$sort_by_sql = ($show_as == 'topics') ? 't.last_post' : 'p.posted';
+			{
+				$sort_by_sql = ($show_as == 'topics') ? 't.posted' : 'p.posted';
+
+				if ($show_as == 'topics')
+					$group_by_sql = ', t.posted';
+
 				break;
-		}
+			}
+		}
+
+		if ($show_as == 'posts')
+		{
+			$substr_sql = ($db_type != 'sqlite') ? 'SUBSTRING' : 'SUBSTR';
+			$sql = 'SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, '.$substr_sql.'(p.message, 1, 1000) AS message, t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE p.id IN('.$search_results.') ORDER BY '.$sort_by_sql;
+		}
+		else
+			$sql = 'SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id IN('.$search_results.') GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id'.$group_by_sql.' ORDER BY '.$sort_by_sql;
+
 
 		// Determine the topic or post offset (based on $_GET['p'])
@@ -481,18 +473,14 @@
 		$num_pages = ceil($num_hits / $per_page);
 
-		$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
+		$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 		$start_from = $per_page * ($p - 1);
 
 		// Generate paging links
-		$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'search.php?search_id='.$search_id);
-
-		// throw away the first $start_from of $search_ids, only keep the top $per_page of $search_ids
-		$search_ids = array_slice($search_ids, $start_from, $per_page);
-
-		// Run the query and fetch the results
-		if ($show_as == 'posts')
-			$result = $db->query('SELECT p.id AS pid, p.poster AS pposter, p.posted AS pposted, p.poster_id, p.message, p.hide_smilies, t.id AS tid, t.poster, t.subject, t.first_post_id, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.forum_id, f.forum_name FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE p.id IN('.implode(',', $search_ids).') ORDER BY '.$sort_by_sql.' '.$sort_dir) or error('Unable to fetch search results', __FILE__, __LINE__, $db->error());
-		else
-			$result = $db->query('SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.sticky, t.forum_id, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.id IN('.implode(',', $search_ids).') ORDER BY '.$sort_by_sql.' '.$sort_dir) or error('Unable to fetch search results', __FILE__, __LINE__, $db->error());
+		$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'search.php?search_id='.$search_id);
+
+
+		$sql .= ' '.$sort_dir.' LIMIT '.$start_from.', '.$per_page;
+
+		$result = $db->query($sql) or error('Impossible de retrouver les rÃ©sultats de recherches', __FILE__, __LINE__, $db->error());
 
 		$search_set = array();
@@ -500,68 +488,14 @@
 			$search_set[] = $row;
 
-		$crumbs_text = array();
-		$crumbs_text['show_as'] = $lang_search['Search'];
-
-		if ($search_type[0] == 'action')
-		{
-			if ($search_type[1] == 'show_user_topics')
-				$crumbs_text['search_type'] = '<a href="search.php?action=show_user_topics&amp;user_id='.$search_type[2].'">'.sprintf($lang_search['Quick search show_user_topics'], pun_htmlspecialchars($search_set[0]['poster'])).'</a>';
-			else if ($search_type[1] == 'show_user_posts')
-				$crumbs_text['search_type'] = '<a href="search.php?action=show_user_posts&amp;user_id='.$search_type[2].'">'.sprintf($lang_search['Quick search show_user_posts'], pun_htmlspecialchars($search_set[0]['pposter'])).'</a>';
-			else if ($search_type[1] == 'show_subscriptions')
-			{
-				// Fetch username of subscriber
-				$subscriber_id = $search_type[2];
-				$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$subscriber_id) or error('Unable to fetch username of subscriber', __FILE__, __LINE__, $db->error());
-
-				if ($db->num_rows($result))
-					$subscriber_name = $db->result($result);
-				else
-					message($lang_common['Bad request']);
-
-				$crumbs_text['search_type'] = '<a href="search.php?action=show_subscriptions&amp;user_id='.$subscriber_id.'">'.sprintf($lang_search['Quick search show_subscriptions'], pun_htmlspecialchars($subscriber_name)).'</a>';
-			}
-			else
-				$crumbs_text['search_type'] = '<a href="search.php?action='.$search_type[1].'">'.$lang_search['Quick search '.$search_type[1]].'</a>';
-		}
-		else
-		{
-			$keywords = $author = '';
-
-			if ($search_type[0] == 'both')
-			{
-				list ($keywords, $author) = $search_type[1];
-				$crumbs_text['search_type'] = sprintf($lang_search['By both show as '.$show_as], pun_htmlspecialchars($keywords), pun_htmlspecialchars($author));
-			}
-			else if ($search_type[0] == 'keywords')
-			{
-				$keywords = $search_type[1];
-				$crumbs_text['search_type'] = sprintf($lang_search['By keywords show as '.$show_as], pun_htmlspecialchars($keywords));
-			}
-			else if ($search_type[0] == 'author')
-			{
-				$author = $search_type[1];
-				$crumbs_text['search_type'] = sprintf($lang_search['By user show as '.$show_as], pun_htmlspecialchars($author));
-			}
-
-			$crumbs_text['search_type'] = '<a href="search.php?action=search&amp;keywords='.urlencode($keywords).'&amp;author='.urlencode($author).'&amp;forums='.$search_type[2].'&amp;search_in='.$search_type[3].'&amp;sort_by='.$sort_by.'&amp;sort_dir='.$sort_dir.'&amp;show_as='.$show_as.'">'.$crumbs_text['search_type'].'</a>';
-		}
-
-		$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_search['Search results']);
-		define('PUN_ACTIVE_PAGE', 'search');
+		$db->free_result($result);
+
+		$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_search['Search results'];
 		require PUN_ROOT.'header.php';
+
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="search.php"><?php echo $crumbs_text['show_as'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $crumbs_text['search_type'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
 	</div>
 </div>
@@ -569,11 +503,13 @@
 <?php
 
+		//Set background switching on for show as posts
+		$bg_switch = true;
+
 		if ($show_as == 'topics')
 		{
-			$topic_count = 0;
 
 ?>
 <div id="vf" class="blocktable">
-	<h2><span><?php echo $lang_search['Search results'] ?></span></h2>
+	<h2><span><?php echo $lang_search['Search results']; ?></span></h2>
 	<div class="box">
 		<div class="inbox">
@@ -581,5 +517,5 @@
 			<thead>
 				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
+					<th class="tcl" scope="col"><?php echo $lang_common['Topic']; ?></th>
 					<th class="tc2" scope="col"><?php echo $lang_common['Forum'] ?></th>
 					<th class="tc3" scope="col"><?php echo $lang_common['Replies'] ?></th>
@@ -591,87 +527,73 @@
 
 		}
-		else if ($show_as == 'posts')
-		{
-			require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
-
-			require PUN_ROOT.'include/parser.php';
-
-			$post_count = 0;
-		}
-
-		// Get topic/forum tracking data
-		if (!$pun_user['is_guest'])
-			$tracked_topics = get_tracked_topics();
-
-		foreach ($search_set as $cur_search)
-		{
-			$forum = '<a href="viewforum.php?id='.$cur_search['forum_id'].'">'.pun_htmlspecialchars($cur_search['forum_name']).'</a>';
+
+		// Fetch the list of forums
+		$result = $db->query('SELECT id, forum_name FROM '.$db->prefix.'forums') or error('Impossible de retrouver la liste des forums', __FILE__, __LINE__, $db->error());
+
+		$forum_list = array();
+		while ($forum_list[] = $db->fetch_row($result))
+			;
+
+		// Finally, lets loop through the results and output them
+		for ($i = 0; $i < count($search_set); ++$i)
+		{
+			@reset($forum_list);
+			while (list(, $temp) = @each($forum_list))
+			{
+				if ($temp[0] == $search_set[$i]['forum_id'])
+					$forum = '<a href="viewforum.php?id='.$temp[0].'">'.pun_htmlspecialchars($temp[1]).'</a>';
+			}
 
 			if ($pun_config['o_censoring'] == '1')
-				$cur_search['subject'] = censor_words($cur_search['subject']);
+				$search_set[$i]['subject'] = censor_words($search_set[$i]['subject']);
+
 
 			if ($show_as == 'posts')
 			{
-				++$post_count;
-				$icon_type = 'icon';
-
-				if (!$pun_user['is_guest'] && $cur_search['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_search['tid']]) || $tracked_topics['topics'][$cur_search['tid']] < $cur_search['last_post']) && (!isset($tracked_topics['forums'][$cur_search['forum_id']]) || $tracked_topics['forums'][$cur_search['forum_id']] < $cur_search['last_post']))
-				{
-					$item_status = 'inew';
-					$icon_type = 'icon icon-new';
-					$icon_text = $lang_topic['New icon'];
-				}
-				else
-				{
-					$item_status = '';
-					$icon_text = '<!-- -->';
-				}
+				$icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n";
+				$subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>';
+
+				if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit'])
+					$icon = '<div class="icon inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n";
+
 
 				if ($pun_config['o_censoring'] == '1')
-					$cur_search['message'] = censor_words($cur_search['message']);
-
-				$message = parse_message($cur_search['message'], $cur_search['hide_smilies']);
-				$pposter = pun_htmlspecialchars($cur_search['pposter']);
-
-				if ($cur_search['poster_id'] > 1)
-				{
-					if ($pun_user['g_view_users'] == '1')
-						$pposter = '<strong><a href="profile.php?id='.$cur_search['poster_id'].'">'.$pposter.'</a></strong>';
-					else
-						$pposter = '<strong>'.$pposter.'</strong>';
-				}
+					$search_set[$i]['message'] = censor_words($search_set[$i]['message']);
+
+				$message = str_replace("\n", '<br />', pun_htmlspecialchars($search_set[$i]['message']));
+				$pposter = pun_htmlspecialchars($search_set[$i]['pposter']);
+
+				if ($search_set[$i]['poster_id'] > 1)
+					$pposter = '<strong><a href="profile.php?id='.$search_set[$i]['poster_id'].'">'.$pposter.'</a></strong>';
+
+				if (pun_strlen($message) >= 1000)
+					$message .= ' &hellip;';
+
+				$vtpost1 = ($i == 0) ? ' vtp1' : '';
+
+				// Switch the background color for every message.
+				$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+				$vtbg = ($bg_switch) ? ' rowodd' : ' roweven';
 
 
 ?>
-<div class="blockpost<?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?><?php if ($cur_search['pid'] == $cur_search['first_post_id']) echo ' firstpost' ?><?php if ($post_count == 1) echo ' blockpost1' ?><?php if ($item_status != '') echo ' '.$item_status ?>">
-	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <span><?php if ($cur_search['pid'] != $cur_search['first_post_id']) echo $lang_topic['Re'].' ' ?><?php echo $forum ?></span> <span>Â»&#160;<a href="viewtopic.php?id=<?php echo $cur_search['tid'] ?>"><?php echo pun_htmlspecialchars($cur_search['subject']) ?></a></span> <span>Â»&#160;<a href="viewtopic.php?pid=<?php echo $cur_search['pid'].'#p'.$cur_search['pid'] ?>"><?php echo format_time($cur_search['pposted']) ?></a></span></span></h2>
+<div class="blockpost searchposts<?php echo $vtbg ?>">
+	<h2><?php echo $forum ?>&#160;&raquo;&#160;<?php echo $subject ?>&#160;&raquo;&#160;<a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo format_time($search_set[$i]['pposted']) ?></a></h2>
 	<div class="box">
 		<div class="inbox">
-			<div class="postbody">
-				<div class="postleft">
-					<dl>
-						<dt><?php echo $pposter ?></dt>
-<?php if ($cur_search['pid'] == $cur_search['first_post_id']) : ?>						<dd><span><?php echo $lang_topic['Replies'].' '.forum_number_format($cur_search['num_replies']) ?></span></dd>
-<?php endif; ?>
-						<dd><div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo $icon_text ?></div></div></dd>
-					</dl>
-				</div>
-				<div class="postright">
-					<div class="postmsg">
-						<?php echo $message."\n" ?>
-					</div>
-				</div>
-				<div class="clearer"></div>
+			<div class="postleft">
+				<dl>
+					<dt><?php echo $pposter ?></dt>
+					<dd>Replies: <?php echo $search_set[$i]['num_replies'] ?></dd>
+					<dd><?php echo $icon; ?></dd>
+					<dd><p class="clearb"><a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo $lang_search['Go to post'] ?></a></p></dd>
+				</dl>
 			</div>
-		</div>
-		<div class="inbox">
-			<div class="postfoot clearb">
-				<div class="postfootright">
-					<ul>
-						<li><span><a href="viewtopic.php?id=<?php echo $cur_search['tid'] ?>"><?php echo $lang_search['Go to topic'] ?></a></span></li>
-						<li><span><a href="viewtopic.php?pid=<?php echo $cur_search['pid'].'#p'.$cur_search['pid'] ?>"><?php echo $lang_search['Go to post'] ?></a></span></li>
-					</ul>
+			<div class="postright">
+				<div class="postmsg">
+					<p><?php echo $message ?></p>
 				</div>
 			</div>
+			<div class="clearer"></div>
 		</div>
 	</div>
@@ -682,40 +604,34 @@
 			else
 			{
-				++$topic_count;
-				$status_text = array();
-				$item_status = ($topic_count % 2 == 0) ? 'roweven' : 'rowodd';
+				$icon = '<div class="icon"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n";
+
+				$icon_text = $lang_common['Normal icon'];
+				$item_status = '';
 				$icon_type = 'icon';
 
-				$subject = '<a href="viewtopic.php?id='.$cur_search['tid'].'">'.pun_htmlspecialchars($cur_search['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['poster']).'</span>';
-
-				if ($cur_search['sticky'] == '1')
-				{
-					$item_status .= ' isticky';
-					$status_text[] = '<span class="stickytext">'.$lang_forum['Sticky'].'</span>';
-				}
-
-				if ($cur_search['closed'] != '0')
-				{
-					$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
-					$item_status .= ' iclosed';
-				}
-
-				if (!$pun_user['is_guest'] && $cur_search['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_search['tid']]) || $tracked_topics['topics'][$cur_search['tid']] < $cur_search['last_post']) && (!isset($tracked_topics['forums'][$cur_search['forum_id']]) || $tracked_topics['forums'][$cur_search['forum_id']] < $cur_search['last_post']))
-				{
+
+				$subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($search_set[$i]['poster']).'</span>';
+
+				if ($search_set[$i]['closed'] != '0')
+				{
+					$icon_text = $lang_common['Closed icon'];
+					$item_status = 'iclosed';
+				}
+
+				if (!$pun_user['is_guest'] && $search_set[$i]['last_post'] > $pun_user['last_visit'])
+				{
+					$icon_text .= ' '.$lang_common['New icon'];
 					$item_status .= ' inew';
-					$icon_type = 'icon icon-new';
+					$icon_type = 'icon inew';
 					$subject = '<strong>'.$subject.'</strong>';
-					$subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_search['tid'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
+					$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$search_set[$i]['tid'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
 				}
 				else
 					$subject_new_posts = null;
 
-				// Insert the status text before the subject
-				$subject = implode(' ', $status_text).' '.$subject;
-
-				$num_pages_topic = ceil(($cur_search['num_replies'] + 1) / $pun_user['disp_posts']);
+				$num_pages_topic = ceil(($search_set[$i]['num_replies'] + 1) / $pun_user['disp_posts']);
 
 				if ($num_pages_topic > 1)
-					$subject_multipage = '<span class="pagestext">[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_search['tid']).' ]</span>';
+					$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$search_set[$i]['tid']).' ]';
 				else
 					$subject_multipage = null;
@@ -724,14 +640,14 @@
 				if (!empty($subject_new_posts) || !empty($subject_multipage))
 				{
-					$subject .= !empty($subject_new_posts) ? ' '.$subject_new_posts : '';
+					$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
 					$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
 				}
 
 ?>
-				<tr class="<?php echo $item_status ?>">
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
 					<td class="tcl">
-						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($topic_count + $start_from) ?></div></div>
-						<div class="tclcon">
-							<div>
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
+							<div class="tclcon">
 								<?php echo $subject."\n" ?>
 							</div>
@@ -739,6 +655,6 @@
 					</td>
 					<td class="tc2"><?php echo $forum ?></td>
-					<td class="tc3"><?php echo forum_number_format($cur_search['num_replies']) ?></td>
-					<td class="tcr"><?php echo '<a href="viewtopic.php?pid='.$cur_search['last_post_id'].'#p'.$cur_search['last_post_id'].'">'.format_time($cur_search['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['last_poster']) ?></span></td>
+					<td class="tc3"><?php echo $search_set[$i]['num_replies'] ?></td>
+					<td class="tcr"><?php echo '<a href="viewtopic.php?pid='.$search_set[$i]['last_post_id'].'#p'.$search_set[$i]['last_post_id'].'">'.format_time($search_set[$i]['last_post']).'</a> '.$lang_common['by'].'&#160;'.pun_htmlspecialchars($search_set[$i]['last_poster']) ?></td>
 				</tr>
 <?php
@@ -752,19 +668,11 @@
 ?>
 <div class="<?php echo ($show_as == 'topics') ? 'linksb' : 'postlinksb'; ?>">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="search.php"><?php echo $crumbs_text['show_as'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $crumbs_text['search_type'] ?></strong></li>
-		</ul>
-<?php echo (!empty($forum_actions) ? "\t\t".'<p class="subscribelink clearb">'.implode(' - ', $forum_actions).'</p>'."\n" : '') ?>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<p class="pagelink"><?php echo $paging_links ?></p>
 	</div>
 </div>
 <?php
 
+		$footer_style = 'search';
 		require PUN_ROOT.'footer.php';
 	}
@@ -774,7 +682,6 @@
 
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_search['Search']);
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_search['Search'];
 $focus_element = array('search', 'keywords');
-define('PUN_ACTIVE_PAGE', 'search');
 require PUN_ROOT.'header.php';
 
@@ -799,71 +706,40 @@
 					<legend><?php echo $lang_search['Search in legend'] ?></legend>
 					<div class="infldset">
+						<label class="conl"><?php echo $lang_search['Forum search'] ?>
+						<br /><select id="forum" name="forum">
 <?php
 
-$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
-
-// We either show a list of forums of which multiple can be selected
-if ($pun_config['o_search_all_forums'] == '1' || $pun_user['is_admmod'])
+if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+	echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n";
+
+$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Impossible de retrouver la liste des catÃ©gories et des forums', __FILE__, __LINE__, $db->error());
+
+$cur_category = 0;
+while ($cur_forum = $db->fetch_assoc($result))
 {
-	echo "\t\t\t\t\t\t".'<div class="conl multiselect">'.$lang_search['Forum search']."\n";
-	echo "\t\t\t\t\t\t".'<br />'."\n";
-	echo "\t\t\t\t\t\t".'<div class="checklist">'."\n";
-
-	$cur_category = 0;
-	while ($cur_forum = $db->fetch_assoc($result))
+	if ($cur_forum['cid'] != $cur_category)	// A new category since last iteration?
 	{
-		if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
-		{
-			if ($cur_category)
-				echo "\t\t\t\t\t\t\t".'</fieldset>'."\n";
-
-			echo "\t\t\t\t\t\t\t".'<fieldset><legend><span>'.pun_htmlspecialchars($cur_forum['cat_name']).'</span></legend>'."\n";
-			$cur_category = $cur_forum['cid'];
-		}
-
-		echo "\t\t\t\t\t\t\t\t".'<div class="checklist-item"><span class="fld-input"><input type="checkbox" name="forums[]" id="forum-'.$cur_forum['fid'].'" value="'.$cur_forum['fid'].'" /></span> <label for="forum-'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</label></div>'."\n";
+		if ($cur_category)
+			echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
+
+		echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
+		$cur_category = $cur_forum['cid'];
 	}
 
-	echo "\t\t\t\t\t\t\t".'</fieldset>'."\n";
-	echo "\t\t\t\t\t\t".'</div>'."\n";
-	echo "\t\t\t\t\t\t".'</div>'."\n";
+	echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
 }
-// ... or a simple select list for one forum only
-else
-{
-	echo "\t\t\t\t\t\t".'<label class="conl">'.$lang_search['Forum search']."\n";
-	echo "\t\t\t\t\t\t".'<br />'."\n";
-	echo "\t\t\t\t\t\t".'<select id="forum" name="forum">'."\n";
-
-	$cur_category = 0;
-	while ($cur_forum = $db->fetch_assoc($result))
-	{
-		if ($cur_forum['cid'] != $cur_category) // A new category since last iteration?
-		{
-			if ($cur_category)
-				echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
-
-			echo "\t\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
-			$cur_category = $cur_forum['cid'];
-		}
-
-		echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";
-	}
-
-	echo "\t\t\t\t\t\t\t".'</optgroup>'."\n";
-	echo "\t\t\t\t\t\t".'</select>'."\n";
-	echo "\t\t\t\t\t\t".'<br /></label>'."\n";
-}
 
 ?>
-						<label class="conl"><?php echo $lang_search['Search in']."\n" ?>
-						<br /><select id="search_in" name="search_in">
-							<option value="0"><?php echo $lang_search['Message and subject'] ?></option>
-							<option value="1"><?php echo $lang_search['Message only'] ?></option>
-							<option value="-1"><?php echo $lang_search['Topic only'] ?></option>
+							</optgroup>
 						</select>
 						<br /></label>
-						<p class="clearl"><?php echo $lang_search['Search in info'] ?></p>
-<?php echo ($pun_config['o_search_all_forums'] == '1' || $pun_user['is_admmod'] ? '<p>'.$lang_search['Search multiple forums info'].'</p>' : '') ?>
+						<label class="conl"><?php echo $lang_search['Search in'] ?>
+						<br /><select id="search_in" name="search_in">
+							<option value="all"><?php echo $lang_search['Message and subject'] ?></option>
+							<option value="message"><?php echo $lang_search['Message only'] ?></option>
+							<option value="topic"><?php echo $lang_search['Topic only'] ?></option>
+						</select>
+						<br /></label>
+						<p class="clearb"><?php echo $lang_search['Search in info'] ?></p>
 					</div>
 				</fieldset>
@@ -873,5 +749,5 @@
 					<legend><?php echo $lang_search['Search results legend'] ?></legend>
 					<div class="infldset">
-						<label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
+						<label class="conl"><?php echo $lang_search['Sort by'] ?>
 						<br /><select name="sort_by">
 							<option value="0"><?php echo $lang_search['Sort by post time'] ?></option>
@@ -881,5 +757,5 @@
 						</select>
 						<br /></label>
-						<label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
+						<label class="conl"><?php echo $lang_search['Sort order'] ?>
 						<br /><select name="sort_dir">
 							<option value="DESC"><?php echo $lang_search['Descending'] ?></option>
@@ -887,5 +763,5 @@
 						</select>
 						<br /></label>
-						<label class="conl"><?php echo $lang_search['Show as']."\n" ?>
+						<label class="conl"><?php echo $lang_search['Show as'] ?>
 						<br /><select name="show_as">
 							<option value="topics"><?php echo $lang_search['Show as topics'] ?></option>
@@ -897,5 +773,5 @@
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
+			<p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
 		</form>
 	</div>
Index: unk/web/punbb/style/Air.css
===================================================================
--- /trunk/web/punbb/style/Air.css	(revision 10)
+++ 	(revision )
@@ -1,1687 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-html, body, .pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3, .pun h4, .pun h5, .pun pre, .pun blockquote,
-.pun ul, .pun ol, .pun li, .pun dl, .pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun legend .pun img,
-.pun abbr, .pun cite {
-	border: 0;
-	font-style: normal;
-	font-weight: normal;
-	margin: 0;
-	padding: 0;
-}
-
-.pun ul, .pun ol {
-	list-style: none;
-}
-
-.pun select {
-	padding-bottom: 1px;
-	padding-top: 1px;
-}
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 81.25%/1.462em Arial, Helvetica, sans-serif;
-}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun legend {
-	font-family: Arial, Helvetica, sans-serif;
-	font-size: 1em;
-}
-
-.pun pre, .pun code {
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace;
-	font-size: 1em;
-}
-
-.pun pre code {
-	font-size: 1em;
-}
-
-.pun table {
-	border-collapse: collapse;
-	border-spacing: 0;
-	border: 0;
-	empty-cells: show;
-	width: 100%;
-}
-
-.pun h1 {
-	font:2.154em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h2, .pun .hd h2 {
-	font: 1.462em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h3 {
-	font-size: 1.154em;
-	line-height: 1.267em;
-	padding: 7px 0;
-}
-
-.pun h4 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun h5, .pun h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun p, .pun ul, .pun ol, .pun dl, .pun th, .pun td, .pun legend {
-	padding: 7px 0;
-}
-
-.pun strong, .pun th, .pun span.warntext, .pun p.warntext {
-	font-weight: bold;
-}
-
-.pun em {
-	font-style: italic;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	text-decoration: none;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	text-decoration: underline;
-}
-
-.pun .actions span {
-	padding-left: 16px;
-	padding-right: 8px;
-	background: url(Air/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #debug h2, #brdstats .conl dt, #brdstats .conr dt, #modcontrols dt,
-#searchlinks dt, div.postright h3, .pun .subscribelink span, #announce .hd, #reportform h2, #punmoderate #vf h2,
-#punviewforum #vf h2, .pun .required strong span, .pun .icon div {
-	display: block;
-	overflow: hidden;
-	position: absolute;
-	text-indent: -9999em;
-	width: 0;
-}
-
-/* Generic Float Clear
-----------------------------------------------------------------*/
-
-.pun .inbox, .pun #brdmain, .pun .crumbs, .pun .pagepost, .pun .block2col {
-	min-height: 1px;
-}
-
-* html .pun .inbox, * html .pun #brdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: inline-block;
-}
-
-* html .pun .inbox, * html .pun #bdrdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: block;
-}
-
-.pun .inbox:after, .pun #brdmain:after, .pun .crumbs:after, .pun .pagepost:after, .pun .block2col:after {
-	content: " ";
-	display: block;
-	height: 0;
-	font-size: 0;
-	clear: both;
-	visibility: hidden;
-}
-
-.pun .block2col .inbox:after {
-	content: none;
-	clear: none;
-}
-
-.clearl {
-	clear: left;
-}
-
-
-/*****************************************************************
-2. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-.pun {
-	padding: 30px 40px;
-}
-
-#punredirect, #punmaint {
-	padding: 60px 20% 12px 20%;
-}
-
-#puninstall, #pundb_update {
-	padding: 20px 10%;
-}
-
-.pun .punwrap {
-	border: 1px solid;
-	padding: 18px;
-}
-
-.pun .top-box {
-	height: 18px;
-	margin-bottom: -18px;
-	position: relative;
-	background: url(Air/img/main_top.png) top left no-repeat;
-}
-
-.pun .top-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Air/img/main_top.png) top right no-repeat;
-}
-
-.pun .end-box {
-	margin-top: -17px;
-	height: 18px;
-	position: relative;
-	background: url(Air/img/main_end.png) bottom left no-repeat;
-}
-
-.pun .end-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Air/img/main_end.png) bottom right no-repeat;
-}
-
-#punredirect h2, #punmaint h2 {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	margin-bottom: 3px;
-}
-
-/* Section Spacing and Borders
-----------------------------------------------------------------*/
-
-#brdmain {
-	border-style: solid none;
-	border-width: 2px 0;
-	margin-bottom: 12px;
-	padding: 12px 0;
-}
-
-#punindex #brdmain {
-	padding-top: 24px;
-}
-
-#punredirect #brdmain, #punmaint #brdmain {
-	border: 0;
-	margin: 0;
-	padding: 0;
-}
-
-#brdstats {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 24px;
-	padding-top: 12px;
-}
-
-#quickpost {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 12px;
-	padding-top: 12px;
-}
-
-#announce {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	padding-top: 3px;
-}
-
-/*****************************************************************
-3. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Logo, Description and Main Menu
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	padding: 0 0 10px 0;
-}
-
-#brddesc {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 10px 0;
-}
-
-#brddesc p {
-	padding: 0;
-}
-
-#brdmenu ul {
-	padding: 0;
-}
-
-#brdmenu li {
-	float: left;
-}
-
-#brdmenu a:link, #brdmenu a:visited {
-	border-right-style: solid;
-	border-width: 1px;
-	display: block;
-	min-width: 60px;
-	padding: 12px 16px 6px 8px;
-	white-space: nowrap;
-}
-
-#brdmenu a:hover, #brmenu a:active, #brdmenu a:focus {
-	text-decoration: none;
-}
-
-/* Welcome Box
-----------------------------------------------------------------*/
-
-#brdwelcome {
-	padding: 10px 0;
-}
-
-#brdwelcome .conl, #brdwelcome .conr, #brdwelcome p, #brdwelcome li {
-	display: inline;
-	padding: 0;
-}
-
-#brdwelcome .conl {
-  float: left;
-}
-
-#brdwelcome .conr {
-  float: right;
-}
-
-#brdwelcome li span {
-	background: url(Air/img/bull.png) center left no-repeat;
-	padding-left: 18px;
-	margin-right: 3px;
-	display: inline-block;
-	line-height: normal;
-	white-space: nowrap;
-}
-
-#brdwelcome .conl li:first-child span {
-	padding-left: 0;
-	background: none;
-}
-
-/* Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-}
-
-#brdstats #onlinelist {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	clear: both;
-}
-
-#brdstats #onlinelist dt, #brdstats #onlinelist dd {
-	display: inline;
-}
-
-/* Footer
-----------------------------------------------------------------*/
-
-.pun #modcontrols {
-	border-style: none none dotted none;
-	border-width: 0 0 1px 0;
-	margin-bottom: 4px;
-	text-align: center;
-	width: 100%;
-}
-
-.pun #modcontrols dd {
-	display: inline;
-}
-
-.pun #brdfooter #modcontrols dd span {
-	background: url(Air/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter .conl {
-	float: left;
-}
-
-.pun #brdfooter .conr {
-	text-align: right;
-	float: right;
-}
-
-.pun #brdfooter #poweredby a {
-	font-size: 1.077em;
-	font-weight: bold;
-}
-
-.pun #brdfooter #qjump {
-	padding-top: 5px;
-}
-
-.pun #brdfooter #qjump * {
-	white-space: nowrap;
-}
-
-.pun #brdfooter #searchlinks dd span {
-	background: url(Air/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter #feedlinks {
-	padding-bottom: 0;
-}
-
-.pun #brdfooter #feedlinks span {
-	background: url(Air/img/feed.png) center left no-repeat;
-	display: inline-block;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #debugtime {
-	border-style: dotted none none none;
-	border-width: 1px 0 0 0;
-	margin-top: 7px;
-	text-align: center;
-}
-
-/* Breadcrumbs, Postlink, Pagination
-----------------------------------------------------------------*/
-
-.pun .linkst .inbox, .pun linksb .inbox, .pun .postlinksb .inbox {
-	overflow: hidden;
-}
-
-.pun .linksb, .pun .postlinksb, .pun .linkst, .pun .crumbs {
-	clear: both;
-	position: relative;
-}
-
-.pun .linkst .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.462em;
-	line-height: 1.211em;
-	padding: 7px 0;
-}
-
-.pun .linksb .crumbs, .pun .postlinksb .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.154em;
-}
-
-.pun .linkst .crumbsplus .pagepost {
-	border-top-style: dotted;
-	border-top-width: 1px;
-}
-
-.pun .linksb .crumbsplus .pagepost, .pun .postlinksb .crumbsplus .pagepost {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-}
-
-.pun .postlinksb .crumbs {
-	margin-right: 11em;
-}
-
-.pun .crumbs li {
-	float: left;
-	padding-right: 0.4em;
-	white-space: nowrap;
-}
-
-.pun .crumbs li strong {
-	font-weight: normal;
-}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-}
-
-.pun .pagelink strong, .pun .pagelink a, .pun .pagelink span.spacer {
-	border-style: none none none solid;
-	border-width: 0 0 0 1px;
-	display: inline-block;
-	padding: 0 12px 0 10px;
-	margin-right: -6px;
-}
-
-.pun .pagelink .item1 {
-	border: 0;
-}
-
-.pun .pagelink .pages-label {
-	display: inline-block;
-}
-
-.pun .postlink {
-	float: right;
-	font-weight: bold;
-	text-align: right;
-}
-
-.pun .modbuttons {
-	float: right;
-	padding: 5px 0 3px 0;
-}
-
-.pun .modbuttons input {
-	margin-left: 8px;
-}
-
-.pun .subscribelink {
-	position: absolute;
-	right: 0;
-	text-align: right;
-	top: 33px;
-}
-
-#punindex .subscribelink {
-	top: 0px;
-}
-
-#punindex .linksb {
-	height: 12px;
-}
-
-/*****************************************************************
-4. MAIN TABLES
-*****************************************************************/
-
-.pun #brdmain .blocktable {
-	position: relative;
-}
-
-#punindex #brdmain .blocktable h2, #punsearch #vf h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	margin: 1px 1px 0 1px;
-	padding-left: 8px;
-	position: absolute;
-	left: 0;
-	white-space: nowrap;
-	z-index: 100;
-}
-
-#punindex .blocktable th.tcl, #punsearch #vf th.tcl {
-	font-size: 0;
-	text-indent: -9999em;
-}
-
-.pun .blocktable .box {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blocktable .box {
-	display: inline-block;
-}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	margin-bottom: -1px;
-}
-
-.pun .blocktable th {
-	padding: 7px 8px;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable td {
-	padding: 7px 8px;
-	line-height: 1.3077em;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable h3 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blocktable p {
-	padding: 0;
-}
-
-.pun .blocktable .tcl p {
-	padding: 5px 0 0 0;
-}
-
-.pun .blocktable .tcl {
-	width: auto;
-}
-
-.pun .blocktable .tc2, .pun .blocktable .tc3, .pun .blocktable .tcmod {
-	padding-left: 0;
-	padding-right: 0;
-	text-align: center;
-	width: 11%;
-}
-
-.pun .blocktable .tcr {
-	width: 30%;
-}
-
-.pun .blocktable td .newtext, .pun .blocktable td .pagestext, .pun .blocktable td .byuser {
-	white-space: nowrap;
-}
-
-.pun .blocktable .tcl h3 span.newtext {
-	font-size: 0.929em;
-	font-weight: normal;
-}
-
-.pun #vf td.tcl span.stickytext, .pun #vf td.tcl span.closedtext {
-	font-size: 1em;
-	font-weight: bold;
-}
-
-#punsearch #vf .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 18%;
-}
-
-#users1 .tcr {
-	width: 25%;
-}
-
-#users1 .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 25%;
-}
-
-#debug {
-	margin-top: 12px;
-}
-
-#debug .tcl {
-	width: 10%;
-}
-
-#punredirect #debug .tcl, #punmaint #debug .tcl {
-	width: 20%;
-}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-}
-
-#punindex .tcr .byuser {
-	display: block
-}
-
-#punindex td.tc2, #punindex td.tc3, #punindex td.tcr, .pun #vf td.tc2, .pun #vf td.tc3,
-.pun #vf td.tcr, #punindex td.tcl div.forumdesc, .pun #vf td.tcl span {
-	font-size: 0.923em;
-}
-
-.pun #vf td.tcl a {
-	font-weight: bold;
-}
-
-.pun #vf td.tcl span a {
-	font-weight: normal;
-}
-
-.pun .blocktable .tclcon {
-	height: 1%;
-	min-height: 1px;
-	overflow: hidden;
-	padding: 0 11px 0 12px;
-	position: relative;
-}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-}
-
-.pun .icon {
-	border-style: solid;
-	border-width: 8px;
-	float: left;
-	height: 0;
-	overflow: hidden;
-	width: 0;
-}
-
-.pun .iposted .ipost {
-	font-weight: bold;
-	left: 0;
-	padding-left: 4px;
-	position: absolute;
-	text-align: center;
-	top: 0;
-	width: 8px;
-}
-
-/*****************************************************************
-MAIN POSTS
-*****************************************************************/
-
-/* Structure
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blockpost {
-	display: inline-block;
-}
-
-.pun .blockpost h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	white-space: nowrap;
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	height: 1.462em;
-	padding: 0.538em 8px 0.538em 236px;
-	font-weight: normal;
-}
-
-#punsearch .blockpost h2 {
-	height: auto;
-	padding-left: 36px;
-	white-space: normal;
-}
-
-#punsearch .blockpost h2 span span {
-	white-space: nowrap;
-	display: inline-block;
-	font: 1.077em "Trebuchet MS", Arial, Helvetica, sans-serif
-}
-
-#punsearch .blockpost .icon {
-	position: absolute;
-	top: 0;
-	margin-top: -2.154em;
-}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-}
-
-.pun .blockpost .inbox {
-	float: right;
-	position: relative;
-	width: 100%;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	border-left-style: solid;
-	border-left-width: 1px;
-	float: right;
-	margin-right: -218px;
-	position: relative;
-	text-align: left;
-	width: 100%;
-}
-
-.pun .blockpost .postleft, .pun .blockpost .postfootleft {
-	width: 194px;
-	padding: 7px 12px 7px 12px;
-	float: left;
-	margin-left: -218px;
-	position: relative;
-}
-
-.pun .blockpost .postleft dl {
-	padding: 0;
-}
-
-#punviewtopic .blockpost dt, #punmoderate .blockpost dt {
-	display: block;
-	position: absolute;
-	padding: 0.538em 0 0.538em 12px;
-	height: 1.462em;
-	top: -2.615em;
-	left: 0;
-	overflow: hidden;
-	width: 206px;
-}
-
-.pun .blockpost dt strong {
-	font-size: 1.231em;
-	font-weight: bold;
-}
-
-.pun .blockpost .postleft dd {
-	font-size: 0.923em;
-}
-
-.pun .blockpost .postleft .usertitle {
-	padding: 4px 0 6px 0;
-	font-size: 1em;
-}
-
-.pun .blockpost .postleft .postavatar {
-	display: block;
-	margin: 0 0 4px 0;
-}
-
-.pun .blockpost .postright {
-	position: relative;
-	padding: 4px 230px 7px 18px;
-}
-
-.pun .postmsg {
-	width:100%;
-	overflow: hidden;
-	word-wrap: break-word;
-}
-
-.pun .blockpost .postfootright {
-	position: relative;
-	padding: 7px 230px 7px 18px;
-	text-align: right;
-}
-
-.pun .postfoot p, .pun .postfoot ul {
-	padding: 0;
-}
-
-.pun .blockpost .postfootright li {
-	display: inline;
-}
-
-.pun .blockpost .postfootright li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Air/img/bull.png) center left no-repeat;
-}
-
-.pun .blockpost .usercontacts {
-	padding: 7px 0;
-}
-
-.pun .blockpost .usercontacts .email {
-	background: url(Air/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .blockpost .usercontacts .website {
-	background: url(Air/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .postsignature hr {
-	border:none;
-	height: 1px;
-	margin-left: 0px;
-	text-align: left;
-}
-
-/* Content (includes other user content)
-----------------------------------------------------------------*/
-
-.pun .usercontent {
-	padding: 7px 0;
-}
-
-.pun .postmsg p, .pun .postmsg li, #punhelp p samp {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .usercontent h1, .pun .usercontent h2, .pun .usercontent h3,
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	padding: 7px 0 0 0;
-}
-
-.pun .postmsg h5, #punhelp h5 {
-	font-size: 1.231em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	list-style: disc;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	list-style: decimal;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha;
-}
-
-.pun .usercontent li, .pun .postmsg li {
-	padding: 0 3px;
-}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0;
-}
-
-.pun span.bbu {
-	text-decoration: underline;
-}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-}
-
-.pun .blockpost .postmsg .postedit {
-	font-size: 0.857em;
-}
-
-.pun .blockform .postsignature, .pun .blockpost .postsignature {
-	font-size: 0.923em;
-}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px 1px 1px 3px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	font-weight: bold;
-	line-height: 1.462em;
-}
-
-.pun .quotebox blockquote {
-	overflow: hidden;
-	width: 100%;
-}
-
-.pun .codebox pre {
-	overflow-y:hidden;
-	overflow: auto;
-	width: 100%;
-	direction: ltr;
-	text-align: left;
-}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-*:first-child+html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-.pun .codebox pre code {
-	padding: 0.75em;
-	white-space: pre;
-}
-
-.pun div[class*=codebox] pre code {
-	display: inline-block;
-}
-
-* html .pun .codebox pre code {
-	display: block;
-}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-}
-
-.pun .postmsg img, #punhelp samp img {
-	vertical-align: text-top;
-}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-/*****************************************************************
-MAIN FORMS
-*****************************************************************/
-
-#punedit .blockform h2, #punpost .blockform h2, #postpreview h2, #posterror h2,
-.pun #quickpost h2, .pun #reportform h2, #pundelete .blockform h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	white-space: nowrap;
-	padding: 10px 19px 4px 37px;
-	border: 0;
-}
-
-#punpost .blockform h2, #punedit .blockform h2,.pun #quickpost h2,
-#pundelete .blockform h2 {
-	margin: 1px 1px 0 1px;
-	width: 25em;
-	position: absolute;
-	z-index: 100;
-}
-
-.pun #quickpost legend, #punpost legend, #punedit legend {
-	width: 25em;
-	overflow: hidden;
-	white-space: nowrap;
-}
-
-.pun .blockform .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 12px;
-}
-
-.pun #posterror {
-	border-style: solid;
-	border-width: 1px;
-}
-
-.pun #posterror .box {
-	padding: 0 18px 12px 18px;
-}
-
-* html .pun .blockform .box, * html .pun #posterror {
-	display: inline-block;
-}
-
-.pun .blockform .forminfo, .pun .error-info {
-	padding: 12px 18px;
-	border-style: solid;
-	border-width: 1px;
-	position: relative;
-}
-
-.pun .blockform .forminfo {
-	margin-top: 12px;
-}
-
-#pundelete .blockform .forminfo {
-	margin-top: 33px;
-}
-
-.pun .forminfo h3 {
-	padding-bottom: 0;
-}
-
-.pun .error-list li {
-	padding-left: 24px;
-	background: url(Air/img/exclaim.png) center left no-repeat;
-}
-
-.pun .inform {
-	padding: 0 18px;
-}
-
-.pun legend {
-	font-weight: bold;
-	padding: 10px 19px 4px 19px;
-}
-
-* html .pun legend {
-	margin-left: -7px;
-}
-
-*:first-child+html .pun legend {
-	margin-left: -7px;
-}
-
-.pun .infldset {
-	border-style: solid;
-	border-width: 1px;
-	padding: 12px 18px;
-}
-
-#punregister #rules .infldset {
-	padding: 5px 18px;
-}
-
-.pun fieldset p {
-	padding: 0 0 7px 0;
-	width: 100%;
-}
-
-.pun fieldset .usercontent p {
-	padding: 7px 0;
-}
-
-.pun fieldset label {
-	display: block;
-	padding: 0 0 7px 0;
-}
-
-.pun label em {
-	font-weight: normal;
-	font-style: normal;
-}
-
-.pun .required strong {
-	background: url(Air/img/asterisk.png) center right no-repeat;
-	font-weight: normal;
-	padding-right: 14px;
-	white-space: pre;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun label input, .pun label select, .pun label textarea {
-	margin-top: 2px;
-}
-
-.pun label.conl {
-	display: inline-block;
-	padding-right: 12px;
-}
-
-.pun form .buttons {
-	padding: 8px 19px 8px 34px;
-	margin-bottom: -12px;
-}
-
-.pun .blockform .buttons input {
-	margin-right: 12px;
-}
-
-.pun .rbox {
-	padding: 3px 0;
-}
-
-.pun .rbox label {
-	padding: 3px 0 3px 1.75em;
-	position: relative;
-	min-height: 1px;
-}
-
-* html .pun .rbox label {
-	text-indent: -3px;
-	height: 1%;
-}
-
-.pun .rbox input {
-	margin: 3px 0.75em 3px -1.75em;
-	float: left;
-	position: relative;
-	vertical-align: middle;
-	padding: 0;
-	height: 1em;
-	width: 1em;
-}
-
-.pun input[type=text], .pun select, .pun textarea {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 98%;
-}
-
-.pun #quickpost .txtarea {
-	padding-right: 12px;
-	position: relative;
-}
-
-.pun .blockform .bblinks {
-	padding-top: 0;
-}
-
-.pun .blockform .bblinks li {
-	display: inline;
-}
-
-.pun .blockform .bblinks li span {
-	background: url(Air/img/help.png) center left no-repeat;
-	margin-right: 8px;
-	padding-left: 20px;
-	display: inline-block;
-}
-
-.pun #quickpost .bblinks {
-	padding-top: 0;
-}
-
-.pun #quickpost .bblinks li {
-	display: inline;
-}
-
-.pun #login p.clearb {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	font-size: 0;
-	height: 0;
-	line-height: 0;
-	margin-top: 7px;
-	overflow: hidden;
-	padding-bottom: 3px;
-	padding-top: 7px;
-	text-indent: -9999em;
-	width: 100%;
-}
-
-.pun #postreview {
-	padding-top: 12px;
-}
-
-.pun #postpreview, .pun #posterror {
-	margin-bottom: 12px;
-}
-
-.pun #postpreview .postright {
-	padding: 0;
-}
-
-.pun #postpreview .postbody {
-	border-style: solid;
-	border-width: 1px;
-	float: none;
-	margin: 0 18px 12px 18px;
-	padding: 0;
-	padding: 4px 18px 4px 18px;
-	width: auto;
-}
-
-.pun span.email {
-	background: url(Air/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun span.website {
-	background: url(Air/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-#punmisc #rules .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 5px 18px;
-}
-
-
-#punhelp .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 7px 12px;
-}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.25em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-}
-
-.pun .checklist legend {
-	padding: 0;
-}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-}
-
-.pun .checklist .checklist-item {
-	position: relative;
-}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 1.75em;
-}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.55em;
-	width: 1.55em;
-}
-
-/*****************************************************************
-PROFILES (+ ADMIN MENU)
-*****************************************************************/
-
-/* Profile / Admin
-----------------------------------------------------------------*/
-
-.pun .blockmenu {
-	width: 13em;
-	float: left;
-	padding-bottom: 12px;
-}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 15em;
-}
-
-.pun .blockmenu .block2 {
-	padding-top: 19px;
-}
-
-.pun .blockmenu ul {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 0;
-}
-
-.pun .blockmenu li {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	display: block;
-	padding: 9px 6px 3px 6px;
-	min-height: 1px;
-	text-decoration: none;
-}
-
-* html .pun .blockmenu a:link,  * html .pun .blockmenu a:visited {
-	height: 1%;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	text-decoration: none;
-}
-
-#viewprofile .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 18px;
-}
-
-#viewprofile dt, #adstats dt {
-	padding: 7px 0;
-	position: absolute;
-	width: 13em;
-	left: 0;
-}
-
-#viewprofile dl {
-	border-style: solid none none none;
-	border-width: 1px;
-	margin: 7px 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#adintro, #adstats {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adintro li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Air/img/bull.png) center left no-repeat;
-}
-
-#adstats .inbox, #adintro .inbox {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adstats dl {
-	margin: 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#viewprofile dd, #adstats dd {
-	border-style: none none solid none;
-	border-width: 1px;
-	padding: 7px 0 7px 13em;
-}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Basic defaults and Common Items
-----------------------------------------------------------------*/
-
-html, body, .pun {
-	background: #f6f9fc;
-	color: #333;
-}
-
-.pun .punwrap {
-	background: #fff;
-	border-color: #cad7e1;
-	color: #566579;
-}
-
-#brdtitle #brddesc, .pun .pagepost, #brdstats #onlinelist, #brdfooter #searchlinks, #brdfooter #modcontrols,
-#punmaint h2, #punredirect h2, #adminconsole .submittop, .pun #debugtime, .pun .pagelink a, .pun .pagelink * {
-	border-color: #b9c5ce;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	color: #2365B0;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #b50000;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #22538a;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #b50000;
-}
-
-/* Primary Navigation
-----------------------------------------------------------------*/
-
-#brdmenu {
-	background: #44699c;
-}
-
-#brdmenu a, #brdmenu a:link, #brdmenu a:visited {
-	background: #44699c;
-	border-color: #fff;
-	color: #d4dae2;
-}
-
-#brdmenu a:hover, #brdmenu a:active, #brdmenu a:focus {
-	background: #b50000;
-	border-color: #fff;
-	color: #fff;
-}
-
-/* Main Tables
-----------------------------------------------------------------*/
-
-.pun .blocktable .box {
-	background: #fcfdfe;
-	border-color: #b9c5ce #d9e1e7;
-}
-
-#punindex .blocktable h2, .pun #vf h2 {
-	color: #357082;
-}
-
-#adminconsole fieldset th, #adminconsole fieldset td {
-	background: #f6f9fc;
-	border-color: #dfe6ee;
-}
-
-.pun #users1 h2 {
-	background: #fff;
-}
-
-.pun .blocktable td {
-	border-color: #dfe6ee;
-}
-
-.pun .blocktable th {
-	background: #ebf1f5;
-	border-color: #cad7e1;
-	color: #357082;
-}
-
-.pun .blocktable td.tcl span.stickytext {
-	color: #3399CC;
-}
-
-/* Main Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	background: #f6f9fc;
-	border-color: #b9c5ce #d9e1e7;
-}
-
-.pun .blockpost h2 {
-	background: #ebf1f5;
-	border-color: #cad7e1;
-	color: #357082;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	background: #fcfdfe;
-	border-color: #dfe6ee;
-}
-
-.pun .blockpost .postfootright li {
-	color: #fcfdfe;
-}
-
-.pun .postmsg, #punhelp code, #punhelp samp {
-	color: #333;
-}
-
-.pun .postsignature, .pun .postmsg .postedit {
-	color: #566579;
-}
-
-.pun .quotebox {
-	background: #f8f9f0;
-	border-color: #7aadbd;
-	color: #566579;
-}
-
-.pun .quotebox cite {
-	color: #357082;
-}
-
-.pun .codebox, #punhelp .codebox code {
-	background: #333;
-	color: #fff;
-}
-
-.pun .postmsg hr {
-	background: #b9c5ce;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-}
-
-/* Main Forms + Profile
-----------------------------------------------------------------*/
-
-.pun .blockform .box, #adstats, #adintro, #postpreview, #posterror {
-	border-color: #b9c5ce #d9e1e7;
-	background: #ebf1f5;
-}
-
-#punmisc #rules .box, #punhelp .box {
-	border-color: #b9c5ce #d9e1e7;
-	background: #f6f9fc;
-}
-
-.pun #quickpost h2, #punpost .blockform h2, #punedit .blockform h2, #posterror h2,
-#pundelete .blockform h2 {
-	background: #ebf1f5;
-	color: #357082;
-}
-
-.pun .forminfo {
-	background: #fff;
-	border-color: #dfe6ee;
-}
-
-#puninstall form#install .forminfo {
-	background: #44699c;
-	color: #fff;
-}
-
-.pun #posterror .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-}
-
-#puninstall form#install .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-	color: #333;
-}
-
-.pun .infldset, #adintro .inbox, #adstats .inbox {
-	background: #f6f9fc;
-	border-color: #dfe6ee;
-}
-
-.pun label, .pun legend, #adminconsole fieldset th {
-	color: #357082;
-}
-
-.pun fieldset p {
-	border-color: #b9c5ce;
-}
-
-.pun .blockmenu ul, .pun .blockmenu li {
-	border-color: #b9c5ce;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	background: #ffffe6;
-}
-
-.pun .blockmenu .isactive a:link, .pun .blockmenu .isactive a:visited {
-	color: #333;
-	background: #f6f9fc;
-	}
-
-.pun #viewprofile .box {
-	border-color: #b9c5ce #d9e1e7;
-	background: #ebf1f5;
-}
-
-.pun #viewprofile dt, #adstats dt {
-	color: #357082;
-}
-
-.pun #viewprofile dl, .pun #viewprofile dd, #adstats dl, #adstats dd {
-	border-color: #dfe6ee;
-}
-
-#adminconsole fieldset td.nodefault {
-	background: #d59b9b;
-}
-
-.pun .multiselect {
-	color: #357082;
-}
-
-.pun .checklist {
-	background: white;
-	border-color: #ccc;
-}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #e8ecf1 #d4d9dd #dfe3e8 #e8ecf1;
-}
-
-.pun .iredirect .icon {
-	border-color: #b9c5ce;
-	border-width: 1px;
-	padding: 7px;
-}
-
-.pun .inew .icon {
-	border-color: #91b3d9 #87a8d1 #6c85bb #7292c3;
-}
Index: unk/web/punbb/style/Cobalt.css
===================================================================
--- /trunk/web/punbb/style/Cobalt.css	(revision 10)
+++ 	(revision )
@@ -1,1171 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun {
-	color: #d4d4d4
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #383838
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #424242
-	}
-
-.pun h2, #brdmenu {
-	background-color: #565656;
-	color: #d4d4d4
-	}
-
-.pun th {
-	background-color: #484848
-	}
-
-.pun legend {
-	color: #60a0dc
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #d4d4d4
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #d4d4d4
-	}
-
-.pun textarea, .pun input, .pun select {
-	background-color: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #D4D4D4;
-	}
-
-.pun .checklist {
-	border-color: #666;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #383838
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #424242
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #424242
-	}
-
-.pun .blockpost h2 {
-	background-color: #565656
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #a19e96
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #606060;
-	color: #606060
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color:#565656
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #565656
-	}
-
-.pun th {
-	border-color: #484848
-	}
-
-.pun fieldset {
-	border-color: #606060
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #383838
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #606060
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #60a0dc
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #80d6ff
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #60a0dc;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #80d6ff;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #d4d4d4
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #d4d4d4
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #ff4000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #ff5010
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #484848 #404040 #3c3c3c #444444
-	}
-
-.pun .iredirect .icon {
-	border-color: #383838 #383838 #383838 #383838
-	}
-
-.pun .inew .icon {
-	border-color: #5496d8 #4b85c0 #4377ac #4f8dcb
-	}
Index: unk/web/punbb/style/Earth.css
===================================================================
--- /trunk/web/punbb/style/Earth.css	(revision 10)
+++ 	(revision )
@@ -1,1686 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-html, body, .pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3, .pun h4, .pun h5, .pun pre, .pun blockquote,
-.pun ul, .pun ol, .pun li, .pun dl, .pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun legend .pun img,
-.pun abbr, .pun cite {
-	border: 0;
-	font-style: normal;
-	font-weight: normal;
-	margin: 0;
-	padding: 0;
-}
-
-.pun ul, .pun ol {
-	list-style: none;
-}
-
-.pun select {
-	padding-bottom: 1px;
-	padding-top: 1px;
-}
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 81.25%/1.462em Arial, Helvetica, sans-serif;
-}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun legend {
-	font-family: Arial, Helvetica, sans-serif;
-	font-size: 1em;
-}
-
-.pun pre, .pun code {
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace;
-	font-size: 1em;
-}
-
-.pun pre code {
-	font-size: 1em;
-}
-
-.pun table {
-	border-collapse: collapse;
-	border-spacing: 0;
-	border: 0;
-	empty-cells: show;
-	width: 100%;
-}
-
-.pun h1 {
-	font:2.154em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h2, .pun .hd h2 {
-	font: 1.462em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h3 {
-	font-size: 1.154em;
-	line-height: 1.267em;
-	padding: 7px 0;
-}
-
-.pun h4 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun h5, .pun h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun p, .pun ul, .pun ol, .pun dl, .pun th, .pun td, .pun legend {
-	padding: 7px 0;
-}
-
-.pun strong, .pun th, .pun span.warntext, .pun p.warntext {
-	font-weight: bold;
-}
-
-.pun em {
-	font-style: italic;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	text-decoration: none;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	text-decoration: underline;
-}
-
-.pun .actions span {
-	padding-left: 16px;
-	padding-right: 8px;
-	background: url(Earth/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #debug h2, #brdstats .conl dt, #brdstats .conr dt, #modcontrols dt,
-#searchlinks dt, div.postright h3, .pun .subscribelink span, #announce .hd, #reportform h2, #punmoderate #vf h2,
-#punviewforum #vf h2, .pun .required strong span, .pun .icon div {
-	display: block;
-	overflow: hidden;
-	position: absolute;
-	text-indent: -9999em;
-	width: 0;
-}
-
-/* Generic Float Clear
-----------------------------------------------------------------*/
-
-.pun .inbox, .pun #brdmain, .pun .crumbs, .pun .pagepost, .pun .block2col {
-	min-height: 1px;
-}
-
-* html .pun .inbox, * html .pun #brdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: inline-block;
-}
-
-* html .pun .inbox, * html .pun #bdrdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: block;
-}
-
-.pun .inbox:after, .pun #brdmain:after, .pun .crumbs:after, .pun .pagepost:after, .pun .block2col:after {
-	content: " ";
-	display: block;
-	height: 0;
-	font-size: 0;
-	clear: both;
-	visibility: hidden;
-}
-
-.pun .block2col .inbox:after {
-	content: none;
-	clear: none;
-}
-
-.clearl {
-	clear: left;
-}
-
-/*****************************************************************
-2. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-.pun {
-	padding: 30px 40px;
-}
-
-#punredirect, #punmaint {
-	padding: 60px 20% 12px 20%;
-}
-
-#puninstall, #pundb_update {
-	padding: 20px 10%;
-}
-
-.pun .punwrap {
-	border: 1px solid;
-	padding: 18px;
-}
-
-.pun .top-box {
-	height: 18px;
-	margin-bottom: -18px;
-	position: relative;
-	background: url(Earth/img/main_top.png) top left no-repeat;
-}
-
-.pun .top-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Earth/img/main_top.png) top right no-repeat;
-}
-
-.pun .end-box {
-	margin-top: -17px;
-	height: 18px;
-	position: relative;
-	background: url(Earth/img/main_end.png) bottom left no-repeat;
-}
-
-.pun .end-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Earth/img/main_end.png) bottom right no-repeat;
-}
-
-#punredirect h2, #punmaint h2 {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	margin-bottom: 3px;
-}
-
-/* Section Spacing and Borders
-----------------------------------------------------------------*/
-
-#brdmain {
-	border-style: solid none;
-	border-width: 2px 0;
-	margin-bottom: 12px;
-	padding: 12px 0;
-}
-
-#punindex #brdmain {
-	padding-top: 24px;
-}
-
-#punredirect #brdmain, #punmaint #brdmain {
-	border: 0;
-	margin: 0;
-	padding: 0;
-}
-
-#brdstats {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 24px;
-	padding-top: 12px;
-}
-
-#quickpost {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 12px;
-	padding-top: 12px;
-}
-
-#announce {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	padding-top: 3px;
-}
-
-/*****************************************************************
-3. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Logo, Description and Main Menu
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	padding: 0 0 10px 0;
-}
-
-#brddesc {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 10px 0;
-}
-
-#brddesc p {
-	padding: 0;
-}
-
-#brdmenu ul {
-	padding: 0;
-}
-
-#brdmenu li {
-	float: left;
-}
-
-#brdmenu a:link, #brdmenu a:visited {
-	border-right-style: solid;
-	border-width: 1px;
-	display: block;
-	min-width: 60px;
-	padding: 12px 16px 6px 8px;
-	white-space: nowrap;
-}
-
-#brdmenu a:hover, #brmenu a:active, #brdmenu a:focus {
-	text-decoration: none;
-}
-
-/* Welcome Box
-----------------------------------------------------------------*/
-
-#brdwelcome {
-	padding: 10px 0;
-}
-
-#brdwelcome .conl, #brdwelcome .conr, #brdwelcome p, #brdwelcome li {
-	display: inline;
-	padding: 0;
-}
-
-#brdwelcome .conl {
-  float: left;
-}
-
-#brdwelcome .conr {
-  float: right;
-}
-
-#brdwelcome li span {
-	background: url(Earth/img/bull.png) center left no-repeat;
-	padding-left: 18px;
-	margin-right: 3px;
-	display: inline-block;
-	line-height: normal;
-	white-space: nowrap;
-}
-
-#brdwelcome .conl li:first-child span {
-	padding-left: 0;
-	background: none;
-}
-
-/* Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-}
-
-#brdstats #onlinelist {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	clear: both;
-}
-
-#brdstats #onlinelist dt, #brdstats #onlinelist dd {
-	display: inline;
-}
-
-/* Footer
-----------------------------------------------------------------*/
-
-.pun #modcontrols {
-	border-style: none none dotted none;
-	border-width: 0 0 1px 0;
-	margin-bottom: 4px;
-	text-align: center;
-	width: 100%;
-}
-
-.pun #modcontrols dd {
-	display: inline;
-}
-
-.pun #brdfooter #modcontrols dd span {
-	background: url(Earth/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter .conl {
-	float: left;
-}
-
-.pun #brdfooter .conr {
-	text-align: right;
-	float: right;
-}
-
-.pun #brdfooter #poweredby a {
-	font-size: 1.077em;
-	font-weight: bold;
-}
-
-.pun #brdfooter #qjump {
-	padding-top: 5px;
-}
-
-.pun #brdfooter #qjump * {
-	white-space: nowrap;
-}
-
-.pun #brdfooter #searchlinks dd span {
-	background: url(Earth/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter #feedlinks {
-	padding-bottom: 0;
-}
-
-.pun #brdfooter #feedlinks span {
-	background: url(Earth/img/feed.png) center left no-repeat;
-	display: inline-block;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #debugtime {
-	border-style: dotted none none none;
-	border-width: 1px 0 0 0;
-	margin-top: 7px;
-	text-align: center;
-}
-
-/* Breadcrumbs, Postlink, Pagination
-----------------------------------------------------------------*/
-
-.pun .linkst .inbox, .pun linksb .inbox, .pun .postlinksb .inbox {
-	overflow: hidden;
-}
-
-.pun .linksb, .pun .postlinksb, .pun .linkst, .pun .crumbs {
-	clear: both;
-	position: relative;
-}
-
-.pun .linkst .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.462em;
-	line-height: 1.211em;
-	padding: 7px 0;
-}
-
-.pun .linksb .crumbs, .pun .postlinksb .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.154em;
-}
-
-.pun .linkst .crumbsplus .pagepost {
-	border-top-style: dotted;
-	border-top-width: 1px;
-}
-
-.pun .linksb .crumbsplus .pagepost, .pun .postlinksb .crumbsplus .pagepost {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-}
-
-.pun .postlinksb .crumbs {
-	margin-right: 11em;
-}
-
-.pun .crumbs li {
-	float: left;
-	padding-right: 0.4em;
-	white-space: nowrap;
-}
-
-.pun .crumbs li strong {
-	font-weight: normal;
-}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-}
-
-.pun .pagelink strong, .pun .pagelink a, .pun .pagelink span.spacer {
-	border-style: none none none solid;
-	border-width: 0 0 0 1px;
-	display: inline-block;
-	padding: 0 12px 0 10px;
-	margin-right: -6px;
-}
-
-.pun .pagelink .item1 {
-	border: 0;
-}
-
-.pun .pagelink .pages-label {
-	display: inline-block;
-}
-
-.pun .postlink {
-	float: right;
-	font-weight: bold;
-	text-align: right;
-}
-
-.pun .modbuttons {
-	float: right;
-	padding: 5px 0 3px 0;
-}
-
-.pun .modbuttons input {
-	margin-left: 8px;
-}
-
-.pun .subscribelink {
-	position: absolute;
-	right: 0;
-	text-align: right;
-	top: 33px;
-}
-
-#punindex .subscribelink {
-	top: 0px;
-}
-
-#punindex .linksb {
-	height: 12px;
-}
-
-/*****************************************************************
-4. MAIN TABLES
-*****************************************************************/
-
-.pun #brdmain .blocktable {
-	position: relative;
-}
-
-#punindex #brdmain .blocktable h2, #punsearch #vf h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	margin: 1px 1px 0 1px;
-	padding-left: 8px;
-	position: absolute;
-	left: 0;
-	white-space: nowrap;
-	z-index: 100;
-}
-
-#punindex .blocktable th.tcl, #punsearch #vf th.tcl {
-	font-size: 0;
-	text-indent: -9999em;
-}
-
-.pun .blocktable .box {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blocktable .box {
-	display: inline-block;
-}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	margin-bottom: -1px;
-}
-
-.pun .blocktable th {
-	padding: 7px 8px;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable td {
-	padding: 7px 8px;
-	line-height: 1.3077em;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable h3 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blocktable p {
-	padding: 0;
-}
-
-.pun .blocktable .tcl p {
-	padding: 5px 0 0 0;
-}
-
-.pun .blocktable .tcl {
-	width: auto;
-}
-
-.pun .blocktable .tc2, .pun .blocktable .tc3, .pun .blocktable .tcmod {
-	padding-left: 0;
-	padding-right: 0;
-	text-align: center;
-	width: 11%;
-}
-
-.pun .blocktable .tcr {
-	width: 30%;
-}
-
-.pun .blocktable td .newtext, .pun .blocktable td .pagestext, .pun .blocktable td .byuser {
-	white-space: nowrap;
-}
-
-.pun .blocktable .tcl h3 span.newtext {
-	font-size: 0.929em;
-	font-weight: normal;
-}
-
-.pun #vf td.tcl span.stickytext, .pun #vf td.tcl span.closedtext {
-	font-size: 1em;
-	font-weight: bold;
-}
-
-#punsearch #vf .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 18%;
-}
-
-#users1 .tcr {
-	width: 25%;
-}
-
-#users1 .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 25%;
-}
-
-#debug {
-	margin-top: 12px;
-}
-
-#debug .tcl {
-	width: 10%;
-}
-
-#punredirect #debug .tcl, #punmaint #debug .tcl {
-	width: 20%;
-}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-}
-
-#punindex .tcr .byuser {
-	display: block
-}
-
-#punindex td.tc2, #punindex td.tc3, #punindex td.tcr, .pun #vf td.tc2, .pun #vf td.tc3,
-.pun #vf td.tcr, #punindex td.tcl div.forumdesc, .pun #vf td.tcl span {
-	font-size: 0.923em;
-}
-
-.pun #vf td.tcl a {
-	font-weight: bold;
-}
-
-.pun #vf td.tcl span a {
-	font-weight: normal;
-}
-
-.pun .blocktable .tclcon {
-	height: 1%;
-	min-height: 1px;
-	overflow: hidden;
-	padding: 0 11px 0 12px;
-	position: relative;
-}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-}
-
-.pun .icon {
-	border-style: solid;
-	border-width: 8px;
-	float: left;
-	height: 0;
-	overflow: hidden;
-	width: 0;
-}
-
-.pun .iposted .ipost {
-	font-weight: bold;
-	left: 0;
-	padding-left: 4px;
-	position: absolute;
-	text-align: center;
-	top: 0;
-	width: 8px;
-}
-
-/*****************************************************************
-MAIN POSTS
-*****************************************************************/
-
-/* Structure
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blockpost {
-	display: inline-block;
-}
-
-.pun .blockpost h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	white-space: nowrap;
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	height: 1.462em;
-	padding: 0.538em 8px 0.538em 236px;
-	font-weight: normal;
-}
-
-#punsearch .blockpost h2 {
-	height: auto;
-	padding-left: 36px;
-	white-space: normal;
-}
-
-#punsearch .blockpost h2 span span {
-	white-space: nowrap;
-	display: inline-block;
-	font: 1.077em "Trebuchet MS", Arial, Helvetica, sans-serif
-}
-
-#punsearch .blockpost .icon {
-	position: absolute;
-	top: 0;
-	margin-top: -2.154em;
-}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-}
-
-.pun .blockpost .inbox {
-	float: right;
-	position: relative;
-	width: 100%;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	border-left-style: solid;
-	border-left-width: 1px;
-	float: right;
-	margin-right: -218px;
-	position: relative;
-	text-align: left;
-	width: 100%;
-}
-
-.pun .blockpost .postleft, .pun .blockpost .postfootleft {
-	width: 194px;
-	padding: 7px 12px 7px 12px;
-	float: left;
-	margin-left: -218px;
-	position: relative;
-}
-
-.pun .blockpost .postleft dl {
-	padding: 0;
-}
-
-#punviewtopic .blockpost dt, #punmoderate .blockpost dt {
-	display: block;
-	position: absolute;
-	padding: 0.538em 0 0.538em 12px;
-	height: 1.462em;
-	top: -2.615em;
-	left: 0;
-	overflow: hidden;
-	width: 206px;
-}
-
-.pun .blockpost dt strong {
-	font-size: 1.231em;
-	font-weight: bold;
-}
-
-.pun .blockpost .postleft dd {
-	font-size: 0.923em;
-}
-
-.pun .blockpost .postleft .usertitle {
-	padding: 4px 0 6px 0;
-	font-size: 1em;
-}
-
-.pun .blockpost .postleft .postavatar {
-	display: block;
-	margin: 0 0 4px 0;
-}
-
-.pun .blockpost .postright {
-	position: relative;
-	padding: 4px 230px 7px 18px;
-}
-
-.pun .postmsg {
-	width:100%;
-	overflow: hidden;
-	word-wrap: break-word;
-}
-
-.pun .blockpost .postfootright {
-	position: relative;
-	padding: 7px 230px 7px 18px;
-	text-align: right;
-}
-
-.pun .postfoot p, .pun .postfoot ul {
-	padding: 0;
-}
-
-.pun .blockpost .postfootright li {
-	display: inline;
-}
-
-.pun .blockpost .postfootright li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Earth/img/bull.png) center left no-repeat;
-}
-
-.pun .blockpost .usercontacts {
-	padding: 7px 0;
-}
-
-.pun .blockpost .usercontacts .email {
-	background: url(Earth/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .blockpost .usercontacts .website {
-	background: url(Earth/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .postsignature hr {
-	border:none;
-	height: 1px;
-	margin-left: 0px;
-	text-align: left;
-}
-
-/* Content (includes other user content)
-----------------------------------------------------------------*/
-
-.pun .usercontent {
-	padding: 7px 0;
-}
-
-.pun .postmsg p, .pun .postmsg li, #punhelp p samp {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .usercontent h1, .pun .usercontent h2, .pun .usercontent h3,
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	padding: 7px 0 0 0;
-}
-
-.pun .postmsg h5, #punhelp h5 {
-	font-size: 1.231em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	list-style: disc;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	list-style: decimal;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha;
-}
-
-.pun .usercontent li, .pun .postmsg li {
-	padding: 0 3px;
-}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0;
-}
-
-.pun span.bbu {
-	text-decoration: underline;
-}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-}
-
-.pun .blockpost .postmsg .postedit {
-	font-size: 0.857em;
-}
-
-.pun .blockform .postsignature, .pun .blockpost .postsignature {
-	font-size: 0.923em;
-}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px 1px 1px 3px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	font-weight: bold;
-	line-height: 1.462em;
-}
-
-.pun .quotebox blockquote {
-	overflow: hidden;
-	width: 100%;
-}
-
-.pun .codebox pre {
-	overflow-y:hidden;
-	overflow: auto;
-	width: 100%;
-	direction: ltr;
-	text-align: left;
-}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-*:first-child+html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-.pun .codebox pre code {
-	padding: 0.75em;
-	white-space: pre;
-}
-
-.pun div[class*=codebox] pre code {
-	display: inline-block;
-}
-
-* html .pun .codebox pre code {
-	display: block;
-}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-}
-
-.pun .postmsg img, #punhelp samp img {
-	vertical-align: text-top;
-}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-/*****************************************************************
-MAIN FORMS
-*****************************************************************/
-
-#punedit .blockform h2, #punpost .blockform h2, #postpreview h2, #posterror h2,
-.pun #quickpost h2, .pun #reportform h2, #pundelete .blockform h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	white-space: nowrap;
-	padding: 10px 19px 4px 37px;
-	border: 0;
-}
-
-#punpost .blockform h2, #punedit .blockform h2,.pun #quickpost h2,
-#pundelete .blockform h2 {
-	margin: 1px 1px 0 1px;
-	width: 25em;
-	position: absolute;
-	z-index: 100;
-}
-
-.pun #quickpost legend, #punpost legend, #punedit legend {
-	width: 25em;
-	overflow: hidden;
-	white-space: nowrap;
-}
-
-.pun .blockform .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 12px;
-}
-
-.pun #posterror {
-	border-style: solid;
-	border-width: 1px;
-}
-
-.pun #posterror .box {
-	padding: 0 18px 12px 18px;
-}
-
-* html .pun .blockform .box, * html .pun #posterror {
-	display: inline-block;
-}
-
-.pun .blockform .forminfo, .pun .error-info {
-	padding: 12px 18px;
-	border-style: solid;
-	border-width: 1px;
-	position: relative;
-}
-
-.pun .blockform .forminfo {
-	margin-top: 12px;
-}
-
-#pundelete .blockform .forminfo {
-	margin-top: 33px;
-}
-
-.pun .forminfo h3 {
-	padding-bottom: 0;
-}
-
-.pun .error-list li {
-	padding-left: 24px;
-	background: url(Earth/img/exclaim.png) center left no-repeat;
-}
-
-.pun .inform {
-	padding: 0 18px;
-}
-
-.pun legend {
-	font-weight: bold;
-	padding: 10px 19px 4px 19px;
-}
-
-* html .pun legend {
-	margin-left: -7px;
-}
-
-*:first-child+html .pun legend {
-	margin-left: -7px;
-}
-
-.pun .infldset {
-	border-style: solid;
-	border-width: 1px;
-	padding: 12px 18px;
-}
-
-#punregister #rules .infldset {
-	padding: 5px 18px;
-}
-
-.pun fieldset p {
-	padding: 0 0 7px 0;
-	width: 100%;
-}
-
-.pun fieldset .usercontent p {
-	padding: 7px 0;
-}
-
-.pun fieldset label {
-	display: block;
-	padding: 0 0 7px 0;
-}
-
-.pun label em {
-	font-weight: normal;
-	font-style: normal;
-}
-
-.pun .required strong {
-	background: url(Earth/img/asterisk.png) center right no-repeat;
-	font-weight: normal;
-	padding-right: 14px;
-	white-space: pre;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun label input, .pun label select, .pun label textarea {
-	margin-top: 2px;
-}
-
-.pun label.conl {
-	display: inline-block;
-	padding-right: 12px;
-}
-
-.pun form .buttons {
-	padding: 8px 19px 8px 34px;
-	margin-bottom: -12px;
-}
-
-.pun .blockform .buttons input {
-	margin-right: 12px;
-}
-
-.pun .rbox {
-	padding: 3px 0;
-}
-
-.pun .rbox label {
-	padding: 3px 0 3px 1.75em;
-	position: relative;
-	min-height: 1px;
-}
-
-* html .pun .rbox label {
-	text-indent: -3px;
-	height: 1%;
-}
-
-.pun .rbox input {
-	margin: 3px 0.75em 3px -1.75em;
-	float: left;
-	position: relative;
-	vertical-align: middle;
-	padding: 0;
-	height: 1em;
-	width: 1em;
-}
-
-.pun input[type=text], .pun select, .pun textarea {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 98%;
-}
-
-.pun #quickpost .txtarea {
-	padding-right: 12px;
-	position: relative;
-}
-
-.pun .blockform .bblinks {
-	padding-top: 0;
-}
-
-.pun .blockform .bblinks li {
-	display: inline;
-}
-
-.pun .blockform .bblinks li span {
-	background: url(Earth/img/help.png) center left no-repeat;
-	margin-right: 8px;
-	padding-left: 20px;
-	display: inline-block;
-}
-
-.pun #quickpost .bblinks {
-	padding-top: 0;
-}
-
-.pun #quickpost .bblinks li {
-	display: inline;
-}
-
-.pun #login p.clearb {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	font-size: 0;
-	height: 0;
-	line-height: 0;
-	margin-top: 7px;
-	overflow: hidden;
-	padding-bottom: 3px;
-	padding-top: 7px;
-	text-indent: -9999em;
-	width: 100%;
-}
-
-.pun #postreview {
-	padding-top: 12px;
-}
-
-.pun #postpreview, .pun #posterror {
-	margin-bottom: 12px;
-}
-
-.pun #postpreview .postright {
-	padding: 0;
-}
-
-.pun #postpreview .postbody {
-	border-style: solid;
-	border-width: 1px;
-	float: none;
-	margin: 0 18px 12px 18px;
-	padding: 0;
-	padding: 4px 18px 4px 18px;
-	width: auto;
-}
-
-.pun span.email {
-	background: url(Earth/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun span.website {
-	background: url(Earth/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-#punmisc #rules .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 5px 18px;
-}
-
-
-#punhelp .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 7px 12px;
-}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.25em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-}
-
-.pun .checklist legend {
-	padding: 0;
-}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-}
-
-.pun .checklist .checklist-item {
-	position: relative;
-}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 1.75em;
-}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.55em;
-	width: 1.55em;
-}
-
-/*****************************************************************
-PROFILES (+ ADMIN MENU)
-*****************************************************************/
-
-/* Profile / Admin
-----------------------------------------------------------------*/
-
-.pun .blockmenu {
-	width: 13em;
-	float: left;
-	padding-bottom: 12px;
-}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 15em;
-}
-
-.pun .blockmenu .block2 {
-	padding-top: 19px;
-}
-
-.pun .blockmenu ul {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 0;
-}
-
-.pun .blockmenu li {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	display: block;
-	padding: 9px 6px 3px 6px;
-	min-height: 1px;
-	text-decoration: none;
-}
-
-* html .pun .blockmenu a:link,  * html .pun .blockmenu a:visited {
-	height: 1%;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	text-decoration: none;
-}
-
-#viewprofile .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 18px;
-}
-
-#viewprofile dt, #adstats dt {
-	padding: 7px 0;
-	position: absolute;
-	width: 13em;
-	left: 0;
-}
-
-#viewprofile dl {
-	border-style: solid none none none;
-	border-width: 1px;
-	margin: 7px 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#adintro, #adstats {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adintro li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Earth/img/bull.png) center left no-repeat;
-}
-
-#adstats .inbox, #adintro .inbox {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adstats dl {
-	margin: 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#viewprofile dd, #adstats dd {
-	border-style: none none solid none;
-	border-width: 1px;
-	padding: 7px 0 7px 13em;
-}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Basic defaults and Common Items
-----------------------------------------------------------------*/
-
-html, body, .pun {
-	background: #eaede2;
-	color: #333;
-}
-
-.pun .punwrap {
-	background: #fff;
-	border-color: #ccd7c1;
-	color: #526550;
-}
-
-#brdtitle #brddesc, .pun .pagepost, #brdstats #onlinelist, #brdfooter #searchlinks, #brdfooter #modcontrols,
-#punmaint h2, #punredirect h2, #adminconsole .submittop, .pun #debugtime, .pun .pagelink a, .pun .pagelink * {
-	border-color: #bbc6b2;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	color: #047E00;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #73A900;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #047E00;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #73A900;
-}
-
-/* Primary Navigation
-----------------------------------------------------------------*/
-
-#brdmenu {
-	background: #32671d;
-}
-
-#brdmenu a, #brdmenu a:link, #brdmenu a:visited {
-	background: #32671d;
-	border-color: #fff;
-	color: #e3e3c8;
-}
-
-#brdmenu a:hover, #brdmenu a:active, #brdmenu a:focus {
-	background: #2ca100;
-	border-color: #fff;
-	color: #fff;
-}
-
-/* Main Tables
-----------------------------------------------------------------*/
-
-.pun .blocktable .box {
-	background: #fcfcf4;
-	border-color: #bbc6b2 #d8dccf;
-}
-
-#punindex .blocktable h2, .pun #vf h2 {
-	color: #83866a;
-}
-
-#adminconsole fieldset th, #adminconsole fieldset td {
-	background: #f6f6ea;
-	border-color: #dce6d8;
-}
-
-.pun #users1 h2 {
-	background: #fff;
-}
-
-.pun .blocktable td {
-	border-color: #dce6d8;
-}
-
-.pun .blocktable th {
-	background: #eaecda;
-	border-color: #ccd7c1;
-	color: #83866a;
-}
-
-.pun .blocktable td.tcl span.stickytext {
-	color: #c08b20;
-}
-
-/* Main Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	background: #f6f6ea;
-	border-color: #bbc6b2 #d8dccf;
-}
-
-.pun .blockpost h2 {
-	background: #eaecda;
-	border-color: #ccd7c1;
-	color: #83866a;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	background: #fcfcf4;
-	border-color: #dce6d8;
-}
-
-.pun .blockpost .postfootright li {
-	color: #fcfcf4;
-}
-
-.pun .postmsg, #punhelp code, #punhelp samp {
-	color: #333;
-}
-
-.pun .postsignature, .pun .postmsg .postedit {
-	color: #526550;
-}
-
-.pun .quotebox {
-	background: #f9fae5;
-	border-color: #bdbc7a;
-	color: #566579;
-}
-
-.pun .quotebox cite {
-	color: #83866a;
-}
-
-.pun .codebox, #punhelp .codebox code {
-	background: #333;
-	color: #fff;
-}
-
-.pun .postmsg hr {
-	background: #bbc6b2;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-}
-
-/* Main Forms + Profile
-----------------------------------------------------------------*/
-
-.pun .blockform .box, #adstats, #adintro, #postpreview, #posterror {
-	border-color: #bbc6b2 #d8dccf;
-	background: #eaecda;
-}
-
-#punmisc #rules .box, #punhelp .box {
-	border-color: #bbc6b2 #d8dccf;
-	background: #f6f6ea;
-}
-
-.pun #quickpost h2, #punpost .blockform h2, #punedit .blockform h2, #posterror h2,
-#pundelete .blockform h2 {
-	background: #eaecda;
-	color: #83866a;
-}
-
-.pun .forminfo {
-	background: #fff;
-	border-color: #dce6d8;
-}
-
-#puninstall form#install .forminfo {
-	background: #32671d;
-	color: #fff;
-}
-
-.pun #posterror .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-}
-
-#puninstall form#install .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-	color: #333;
-}
-
-.pun .infldset, #adintro .inbox, #adstats .inbox {
-	background: #f6f6ea;
-	border-color: #dce6d8;
-}
-
-.pun label, .pun legend, #adminconsole fieldset th {
-	color: #83866a;
-}
-
-.pun fieldset p {
-	border-color: #bbc6b2;
-}
-
-.pun .blockmenu ul, .pun .blockmenu li {
-	border-color: #bbc6b2;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	background: #ffffe6;
-}
-
-.pun .blockmenu .isactive a:link, .pun .blockmenu .isactive a:visited {
-	color: #333;
-	background: #f6f6ea;
-	}
-
-.pun #viewprofile .box {
-	border-color: #bbc6b2 #d8dccf;
-	background: #eaecda;
-}
-
-.pun #viewprofile dt, #adstats dt {
-	color: #83866a;
-}
-
-.pun #viewprofile dl, .pun #viewprofile dd, #adstats dl, #adstats dd {
-	border-color: #dce6d8;
-}
-
-#adminconsole fieldset td.nodefault {
-	background: #d59b9b;
-}
-
-.pun .multiselect {
-	color: #83866A;
-}
-
-.pun .checklist {
-	background: white;
-	border-color: #ccc;
-}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #eef1e8 #dbddd4 #e6e8df #eef1e8;
-}
-
-.pun .iredirect .icon {
-	border-color: #bbc6b2;
-	border-width: 1px;
-	padding: 7px;
-}
-
-.pun .inew .icon {
-	border-color: #50a42f #408426 #32671d #4a982c;
-}
Index: unk/web/punbb/style/Fire.css
===================================================================
--- /trunk/web/punbb/style/Fire.css	(revision 10)
+++ 	(revision )
@@ -1,1686 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-html, body, .pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3, .pun h4, .pun h5, .pun pre, .pun blockquote,
-.pun ul, .pun ol, .pun li, .pun dl, .pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun legend .pun img,
-.pun abbr, .pun cite {
-	border: 0;
-	font-style: normal;
-	font-weight: normal;
-	margin: 0;
-	padding: 0;
-}
-
-.pun ul, .pun ol {
-	list-style: none;
-}
-
-.pun select {
-	padding-bottom: 1px;
-	padding-top: 1px;
-}
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 81.25%/1.462em Arial, Helvetica, sans-serif;
-}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun legend {
-	font-family: Arial, Helvetica, sans-serif;
-	font-size: 1em;
-}
-
-.pun pre, .pun code {
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace;
-	font-size: 1em;
-}
-
-.pun pre code {
-	font-size: 1em;
-}
-
-.pun table {
-	border-collapse: collapse;
-	border-spacing: 0;
-	border: 0;
-	empty-cells: show;
-	width: 100%;
-}
-
-.pun h1 {
-	font:2.154em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h2, .pun .hd h2 {
-	font: 1.462em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
-	padding: 7px 0;
-}
-
-.pun h3 {
-	font-size: 1.154em;
-	line-height: 1.267em;
-	padding: 7px 0;
-}
-
-.pun h4 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun h5, .pun h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun p, .pun ul, .pun ol, .pun dl, .pun th, .pun td, .pun legend {
-	padding: 7px 0;
-}
-
-.pun strong, .pun th, .pun span.warntext, .pun p.warntext {
-	font-weight: bold;
-}
-
-.pun em {
-	font-style: italic;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	text-decoration: none;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	text-decoration: underline;
-}
-
-.pun .actions span {
-	padding-left: 16px;
-	padding-right: 8px;
-	background: url(Fire/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #debug h2, #brdstats .conl dt, #brdstats .conr dt, #modcontrols dt,
-#searchlinks dt, div.postright h3, .pun .subscribelink span, #announce .hd, #reportform h2, #punmoderate #vf h2,
-#punviewforum #vf h2, .pun .required strong span, .pun .icon div {
-	display: block;
-	overflow: hidden;
-	position: absolute;
-	text-indent: -9999em;
-	width: 0;
-}
-
-/* Generic Float Clear
-----------------------------------------------------------------*/
-
-.pun .inbox, .pun #brdmain, .pun .crumbs, .pun .pagepost, .pun .block2col {
-	min-height: 1px;
-}
-
-* html .pun .inbox, * html .pun #brdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: inline-block;
-}
-
-* html .pun .inbox, * html .pun #bdrdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
-	display: block;
-}
-
-.pun .inbox:after, .pun #brdmain:after, .pun .crumbs:after, .pun .pagepost:after, .pun .block2col:after {
-	content: " ";
-	display: block;
-	height: 0;
-	font-size: 0;
-	clear: both;
-	visibility: hidden;
-}
-
-.pun .block2col .inbox:after {
-	content: none;
-	clear: none;
-}
-
-.clearl {
-	clear: left;
-}
-
-/*****************************************************************
-2. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-.pun {
-	padding: 30px 40px;
-}
-
-#punredirect, #punmaint {
-	padding: 60px 20% 12px 20%;
-}
-
-#puninstall, #pundb_update {
-	padding: 20px 10%;
-}
-
-.pun .punwrap {
-	border: 1px solid;
-	padding: 18px;
-}
-
-.pun .top-box {
-	height: 18px;
-	margin-bottom: -18px;
-	position: relative;
-	background: url(Fire/img/main_top.png) top left no-repeat;
-}
-
-.pun .top-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Fire/img/main_top.png) top right no-repeat;
-}
-
-.pun .end-box {
-	margin-top: -17px;
-	height: 18px;
-	position: relative;
-	background: url(Fire/img/main_end.png) bottom left no-repeat;
-}
-
-.pun .end-box div {
-	height: 18px;
-	margin-left: 50%;
-	background: url(Fire/img/main_end.png) bottom right no-repeat;
-}
-
-#punredirect h2, #punmaint h2 {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	margin-bottom: 3px;
-}
-
-/* Section Spacing and Borders
-----------------------------------------------------------------*/
-
-#brdmain {
-	border-style: solid none;
-	border-width: 2px 0;
-	margin-bottom: 12px;
-	padding: 12px 0;
-}
-
-#punindex #brdmain {
-	padding-top: 24px;
-}
-
-#punredirect #brdmain, #punmaint #brdmain {
-	border: 0;
-	margin: 0;
-	padding: 0;
-}
-
-#brdstats {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 24px;
-	padding-top: 12px;
-}
-
-#quickpost {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	margin-top: 12px;
-	padding-top: 12px;
-}
-
-#announce {
-	border-style: solid none none none;
-	border-width: 2px 0 0 0;
-	padding-top: 3px;
-}
-
-/*****************************************************************
-3. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Logo, Description and Main Menu
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	padding: 0 0 10px 0;
-}
-
-#brddesc {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 10px 0;
-}
-
-#brddesc p {
-	padding: 0;
-}
-
-#brdmenu ul {
-	padding: 0;
-}
-
-#brdmenu li {
-	float: left;
-}
-
-#brdmenu a:link, #brdmenu a:visited {
-	border-right-style: solid;
-	border-width: 1px;
-	display: block;
-	min-width: 60px;
-	padding: 12px 16px 6px 8px;
-	white-space: nowrap;
-}
-
-#brdmenu a:hover, #brmenu a:active, #brdmenu a:focus {
-	text-decoration: none;
-}
-
-/* Welcome Box
-----------------------------------------------------------------*/
-
-#brdwelcome {
-	padding: 10px 0;
-}
-
-#brdwelcome .conl, #brdwelcome .conr, #brdwelcome p, #brdwelcome li {
-	display: inline;
-	padding: 0;
-}
-
-#brdwelcome .conl {
-  float: left;
-}
-
-#brdwelcome .conr {
-  float: right;
-}
-
-#brdwelcome li span {
-	background: url(Fire/img/bull.png) center left no-repeat;
-	padding-left: 18px;
-	margin-right: 3px;
-	display: inline-block;
-	line-height: normal;
-	white-space: nowrap;
-}
-
-#brdwelcome .conl li:first-child span {
-	padding-left: 0;
-	background: none;
-}
-
-/* Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-}
-
-#brdstats #onlinelist {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	clear: both;
-}
-
-#brdstats #onlinelist dt, #brdstats #onlinelist dd {
-	display: inline;
-}
-
-/* Footer
-----------------------------------------------------------------*/
-
-.pun #modcontrols {
-	border-style: none none dotted none;
-	border-width: 0 0 1px 0;
-	margin-bottom: 4px;
-	text-align: center;
-	width: 100%;
-}
-
-.pun #modcontrols dd {
-	display: inline;
-}
-
-.pun #brdfooter #modcontrols dd span {
-	background: url(Fire/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter .conl {
-	float: left;
-}
-
-.pun #brdfooter .conr {
-	text-align: right;
-	float: right;
-}
-
-.pun #brdfooter #poweredby a {
-	font-size: 1.077em;
-	font-weight: bold;
-}
-
-.pun #brdfooter #qjump {
-	padding-top: 5px;
-}
-
-.pun #brdfooter #qjump * {
-	white-space: nowrap;
-}
-
-.pun #brdfooter #searchlinks dd span {
-	background: url(Fire/img/bull.png) center left no-repeat;
-	display: inline-block;
-	line-height: normal;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #brdfooter #feedlinks {
-	padding-bottom: 0;
-}
-
-.pun #brdfooter #feedlinks span {
-	background: url(Fire/img/feed.png) center left no-repeat;
-	display: inline-block;
-	padding-left: 18px;
-	white-space: nowrap;
-}
-
-.pun #debugtime {
-	border-style: dotted none none none;
-	border-width: 1px 0 0 0;
-	margin-top: 7px;
-	text-align: center;
-}
-
-/* Breadcrumbs, Postlink, Pagination
-----------------------------------------------------------------*/
-
-.pun .linkst .inbox, .pun linksb .inbox, .pun .postlinksb .inbox {
-	overflow: hidden;
-}
-
-.pun .linksb, .pun .postlinksb, .pun .linkst, .pun .crumbs {
-	clear: both;
-	position: relative;
-}
-
-.pun .linkst .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.462em;
-	line-height: 1.211em;
-	padding: 7px 0;
-}
-
-.pun .linksb .crumbs, .pun .postlinksb .crumbs {
-	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
-	font-size: 1.154em;
-}
-
-.pun .linkst .crumbsplus .pagepost {
-	border-top-style: dotted;
-	border-top-width: 1px;
-}
-
-.pun .linksb .crumbsplus .pagepost, .pun .postlinksb .crumbsplus .pagepost {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-}
-
-.pun .postlinksb .crumbs {
-	margin-right: 11em;
-}
-
-.pun .crumbs li {
-	float: left;
-	padding-right: 0.4em;
-	white-space: nowrap;
-}
-
-.pun .crumbs li strong {
-	font-weight: normal;
-}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-}
-
-.pun .pagelink strong, .pun .pagelink a, .pun .pagelink span.spacer {
-	border-style: none none none solid;
-	border-width: 0 0 0 1px;
-	display: inline-block;
-	padding: 0 12px 0 10px;
-	margin-right: -6px;
-}
-
-.pun .pagelink .item1 {
-	border: 0;
-}
-
-.pun .pagelink .pages-label {
-	display: inline-block;
-}
-
-.pun .postlink {
-	float: right;
-	font-weight: bold;
-	text-align: right;
-}
-
-.pun .modbuttons {
-	float: right;
-	padding: 5px 0 3px 0;
-}
-
-.pun .modbuttons input {
-	margin-left: 8px;
-}
-
-.pun .subscribelink {
-	position: absolute;
-	right: 0;
-	text-align: right;
-	top: 33px;
-}
-
-#punindex .subscribelink {
-	top: 0px;
-}
-
-#punindex .linksb {
-	height: 12px;
-}
-
-/*****************************************************************
-4. MAIN TABLES
-*****************************************************************/
-
-.pun #brdmain .blocktable {
-	position: relative;
-}
-
-#punindex #brdmain .blocktable h2, #punsearch #vf h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	margin: 1px 1px 0 1px;
-	padding-left: 8px;
-	position: absolute;
-	left: 0;
-	white-space: nowrap;
-	z-index: 100;
-}
-
-#punindex .blocktable th.tcl, #punsearch #vf th.tcl {
-	font-size: 0;
-	text-indent: -9999em;
-}
-
-.pun .blocktable .box {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blocktable .box {
-	display: inline-block;
-}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	margin-bottom: -1px;
-}
-
-.pun .blocktable th {
-	padding: 7px 8px;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable td {
-	padding: 7px 8px;
-	line-height: 1.3077em;
-	border-style: none none solid none;
-	border-width: 1px;
-	text-align: left;
-}
-
-.pun .blocktable h3 {
-	font-size: 1.077em;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blocktable p {
-	padding: 0;
-}
-
-.pun .blocktable .tcl p {
-	padding: 5px 0 0 0;
-}
-
-.pun .blocktable .tcl {
-	width: auto;
-}
-
-.pun .blocktable .tc2, .pun .blocktable .tc3, .pun .blocktable .tcmod {
-	padding-left: 0;
-	padding-right: 0;
-	text-align: center;
-	width: 11%;
-}
-
-.pun .blocktable .tcr {
-	width: 30%;
-}
-
-.pun .blocktable td .newtext, .pun .blocktable td .pagestext, .pun .blocktable td .byuser {
-	white-space: nowrap;
-}
-
-.pun .blocktable .tcl h3 span.newtext {
-	font-size: 0.929em;
-	font-weight: normal;
-}
-
-.pun #vf td.tcl span.stickytext, .pun #vf td.tcl span.closedtext {
-	font-size: 1em;
-	font-weight: bold;
-}
-
-#punsearch #vf .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 18%;
-}
-
-#users1 .tcr {
-	width: 25%;
-}
-
-#users1 .tc2 {
-	padding-left: 8px;
-	padding-right: 8px;
-	text-align: left;
-	width: 25%;
-}
-
-#debug {
-	margin-top: 12px;
-}
-
-#debug .tcl {
-	width: 10%;
-}
-
-#punredirect #debug .tcl, #punmaint #debug .tcl {
-	width: 20%;
-}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-}
-
-#punindex .tcr .byuser {
-	display: block
-}
-
-#punindex td.tc2, #punindex td.tc3, #punindex td.tcr, .pun #vf td.tc2, .pun #vf td.tc3,
-.pun #vf td.tcr, #punindex td.tcl div.forumdesc, .pun #vf td.tcl span {
-	font-size: 0.923em;
-}
-
-.pun #vf td.tcl a {
-	font-weight: bold;
-}
-
-.pun #vf td.tcl span a {
-	font-weight: normal;
-}
-
-.pun .blocktable .tclcon {
-	height: 1%;
-	min-height: 1px;
-	overflow: hidden;
-	padding: 0 11px 0 12px;
-	position: relative;
-}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-}
-
-.pun .icon {
-	border-style: solid;
-	border-width: 8px;
-	float: left;
-	height: 0;
-	overflow: hidden;
-	width: 0;
-}
-
-.pun .iposted .ipost {
-	font-weight: bold;
-	left: 0;
-	padding-left: 4px;
-	position: absolute;
-	text-align: center;
-	top: 0;
-	width: 8px;
-}
-
-/*****************************************************************
-MAIN POSTS
-*****************************************************************/
-
-/* Structure
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	border-style: solid;
-	border-width: 1px;
-	margin-bottom: -1px;
-	overflow: hidden;
-	position: relative;
-}
-
-* html .pun .blockpost {
-	display: inline-block;
-}
-
-.pun .blockpost h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	white-space: nowrap;
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	height: 1.462em;
-	padding: 0.538em 8px 0.538em 236px;
-	font-weight: normal;
-}
-
-#punsearch .blockpost h2 {
-	height: auto;
-	padding-left: 36px;
-	white-space: normal;
-}
-
-#punsearch .blockpost h2 span span {
-	white-space: nowrap;
-	display: inline-block;
-	font: 1.077em "Trebuchet MS", Arial, Helvetica, sans-serif
-}
-
-#punsearch .blockpost .icon {
-	position: absolute;
-	top: 0;
-	margin-top: -2.154em;
-}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-}
-
-.pun .blockpost .inbox {
-	float: right;
-	position: relative;
-	width: 100%;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	border-left-style: solid;
-	border-left-width: 1px;
-	float: right;
-	margin-right: -218px;
-	position: relative;
-	text-align: left;
-	width: 100%;
-}
-
-.pun .blockpost .postleft, .pun .blockpost .postfootleft {
-	width: 194px;
-	padding: 7px 12px 7px 12px;
-	float: left;
-	margin-left: -218px;
-	position: relative;
-}
-
-.pun .blockpost .postleft dl {
-	padding: 0;
-}
-
-#punviewtopic .blockpost dt, #punmoderate .blockpost dt {
-	display: block;
-	position: absolute;
-	padding: 0.538em 0 0.538em 12px;
-	height: 1.462em;
-	top: -2.615em;
-	left: 0;
-	overflow: hidden;
-	width: 206px;
-}
-
-.pun .blockpost dt strong {
-	font-size: 1.231em;
-	font-weight: bold;
-}
-
-.pun .blockpost .postleft dd {
-	font-size: 0.923em;
-}
-
-.pun .blockpost .postleft .usertitle {
-	padding: 4px 0 6px 0;
-	font-size: 1em;
-}
-
-.pun .blockpost .postleft .postavatar {
-	display: block;
-	margin: 0 0 4px 0;
-}
-
-.pun .blockpost .postright {
-	position: relative;
-	padding: 4px 230px 7px 18px;
-}
-
-.pun .postmsg {
-	width:100%;
-	overflow: hidden;
-	word-wrap: break-word;
-}
-
-.pun .blockpost .postfootright {
-	position: relative;
-	padding: 7px 230px 7px 18px;
-	text-align: right;
-}
-
-.pun .postfoot p, .pun .postfoot ul {
-	padding: 0;
-}
-
-.pun .blockpost .postfootright li {
-	display: inline;
-}
-
-.pun .blockpost .postfootright li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Fire/img/bull.png) center left no-repeat;
-}
-
-.pun .blockpost .usercontacts {
-	padding: 7px 0;
-}
-
-.pun .blockpost .usercontacts .email {
-	background: url(Fire/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .blockpost .usercontacts .website {
-	background: url(Fire/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun .postsignature hr {
-	border:none;
-	height: 1px;
-	margin-left: 0px;
-	text-align: left;
-}
-
-/* Content (includes other user content)
-----------------------------------------------------------------*/
-
-.pun .usercontent {
-	padding: 7px 0;
-}
-
-.pun .postmsg p, .pun .postmsg li, #punhelp p samp {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .usercontent h1, .pun .usercontent h2, .pun .usercontent h3,
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	padding: 7px 0 0 0;
-}
-
-.pun .postmsg h5, #punhelp h5 {
-	font-size: 1.231em;
-	font-weight: bold;
-	padding: 7px 0;
-}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	list-style: disc;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	list-style: decimal;
-	padding: 4px 13px 4px 30px;
-}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha;
-}
-
-.pun .usercontent li, .pun .postmsg li {
-	padding: 0 3px;
-}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0;
-}
-
-.pun span.bbu {
-	text-decoration: underline;
-}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-}
-
-.pun .blockpost .postmsg .postedit {
-	font-size: 0.857em;
-}
-
-.pun .blockform .postsignature, .pun .blockpost .postsignature {
-	font-size: 0.923em;
-}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px 1px 1px 3px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	font-weight: bold;
-	line-height: 1.462em;
-}
-
-.pun .quotebox blockquote {
-	overflow: hidden;
-	width: 100%;
-}
-
-.pun .codebox pre {
-	overflow-y:hidden;
-	overflow: auto;
-	width: 100%;
-	direction: ltr;
-	text-align: left;
-}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-*:first-child+html .pun .codebox pre {
-	padding-bottom: 10px;
-}
-
-.pun .codebox pre code {
-	padding: 0.75em;
-	white-space: pre;
-}
-
-.pun div[class*=codebox] pre code {
-	display: inline-block;
-}
-
-* html .pun .codebox pre code {
-	display: block;
-}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-}
-
-.pun .postmsg img, #punhelp samp img {
-	vertical-align: text-top;
-}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-/*****************************************************************
-MAIN FORMS
-*****************************************************************/
-
-#punedit .blockform h2, #punpost .blockform h2, #postpreview h2, #posterror h2,
-.pun #quickpost h2, .pun #reportform h2, #pundelete .blockform h2 {
-	font: 1em/1.462em Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	white-space: nowrap;
-	padding: 10px 19px 4px 37px;
-	border: 0;
-}
-
-#punpost .blockform h2, #punedit .blockform h2,.pun #quickpost h2,
-#pundelete .blockform h2 {
-	margin: 1px 1px 0 1px;
-	width: 25em;
-	position: absolute;
-	z-index: 100;
-}
-
-.pun #quickpost legend, #punpost legend, #punedit legend {
-	width: 25em;
-	overflow: hidden;
-	white-space: nowrap;
-}
-
-.pun .blockform .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 12px;
-}
-
-.pun #posterror {
-	border-style: solid;
-	border-width: 1px;
-}
-
-.pun #posterror .box {
-	padding: 0 18px 12px 18px;
-}
-
-* html .pun .blockform .box, * html .pun #posterror {
-	display: inline-block;
-}
-
-.pun .blockform .forminfo, .pun .error-info {
-	padding: 12px 18px;
-	border-style: solid;
-	border-width: 1px;
-	position: relative;
-}
-
-.pun .blockform .forminfo {
-	margin-top: 12px;
-}
-
-#pundelete .blockform .forminfo {
-	margin-top: 33px;
-}
-
-.pun .forminfo h3 {
-	padding-bottom: 0;
-}
-
-.pun .error-list li {
-	padding-left: 24px;
-	background: url(Fire/img/exclaim.png) center left no-repeat;
-}
-
-.pun .inform {
-	padding: 0 18px;
-}
-
-.pun legend {
-	font-weight: bold;
-	padding: 10px 19px 4px 19px;
-}
-
-* html .pun legend {
-	margin-left: -7px;
-}
-
-*:first-child+html .pun legend {
-	margin-left: -7px;
-}
-
-.pun .infldset {
-	border-style: solid;
-	border-width: 1px;
-	padding: 12px 18px;
-}
-
-#punregister #rules .infldset {
-	padding: 5px 18px;
-}
-
-.pun fieldset p {
-	padding: 0 0 7px 0;
-	width: 100%;
-}
-
-.pun fieldset .usercontent p {
-	padding: 7px 0;
-}
-
-.pun fieldset label {
-	display: block;
-	padding: 0 0 7px 0;
-}
-
-.pun label em {
-	font-weight: normal;
-	font-style: normal;
-}
-
-.pun .required strong {
-	background: url(Fire/img/asterisk.png) center right no-repeat;
-	font-weight: normal;
-	padding-right: 14px;
-	white-space: pre;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun label input, .pun label select, .pun label textarea {
-	margin-top: 2px;
-}
-
-.pun label.conl {
-	display: inline-block;
-	padding-right: 12px;
-}
-
-.pun form .buttons {
-	padding: 8px 19px 8px 34px;
-	margin-bottom: -12px;
-}
-
-.pun .blockform .buttons input {
-	margin-right: 12px;
-}
-
-.pun .rbox {
-	padding: 3px 0;
-}
-
-.pun .rbox label {
-	padding: 3px 0 3px 1.75em;
-	position: relative;
-	min-height: 1px;
-}
-
-* html .pun .rbox label {
-	text-indent: -3px;
-	height: 1%;
-}
-
-.pun .rbox input {
-	margin: 3px 0.75em 3px -1.75em;
-	float: left;
-	position: relative;
-	vertical-align: middle;
-	padding: 0;
-	height: 1em;
-	width: 1em;
-}
-
-.pun input[type=text], .pun select, .pun textarea {
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 98%;
-}
-
-.pun #quickpost .txtarea {
-	padding-right: 12px;
-	position: relative;
-}
-
-.pun .blockform .bblinks {
-	padding-top: 0;
-}
-
-.pun .blockform .bblinks li {
-	display: inline;
-}
-
-.pun .blockform .bblinks li span {
-	background: url(Fire/img/help.png) center left no-repeat;
-	margin-right: 8px;
-	padding-left: 20px;
-	display: inline-block;
-}
-
-.pun #quickpost .bblinks {
-	padding-top: 0;
-}
-
-.pun #quickpost .bblinks li {
-	display: inline;
-}
-
-.pun #login p.clearb {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	font-size: 0;
-	height: 0;
-	line-height: 0;
-	margin-top: 7px;
-	overflow: hidden;
-	padding-bottom: 3px;
-	padding-top: 7px;
-	text-indent: -9999em;
-	width: 100%;
-}
-
-.pun #postreview {
-	padding-top: 12px;
-}
-
-.pun #postpreview, .pun #posterror {
-	margin-bottom: 12px;
-}
-
-.pun #postpreview .postright {
-	padding: 0;
-}
-
-.pun #postpreview .postbody {
-	border-style: solid;
-	border-width: 1px;
-	float: none;
-	margin: 0 18px 12px 18px;
-	padding: 0;
-	padding: 4px 18px 4px 18px;
-	width: auto;
-}
-
-.pun span.email {
-	background: url(Fire/img/email.png) left 65% no-repeat;
-	margin-right: 5px;
-	padding-left: 21px;
-	display: inline-block;
-	line-height: normal;
-}
-
-.pun span.website {
-	background: url(Fire/img/ext.png) left 65% no-repeat;
-	padding-left: 18px;
-	display: inline-block;
-	line-height: normal;
-}
-
-#punmisc #rules .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 5px 18px;
-}
-
-
-#punhelp .box {
-	border-style: solid;
-	border-width: 1px;
-	padding: 7px 12px;
-}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.25em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-}
-
-.pun .checklist legend {
-	padding: 0;
-}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-}
-
-.pun .checklist .checklist-item {
-	position: relative;
-}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 1.75em;
-}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.55em;
-	width: 1.55em;
-}
-
-/*****************************************************************
-PROFILES (+ ADMIN MENU)
-*****************************************************************/
-
-/* Profile / Admin
-----------------------------------------------------------------*/
-
-.pun .blockmenu {
-	width: 13em;
-	float: left;
-	padding-bottom: 12px;
-}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 15em;
-}
-
-.pun .blockmenu .block2 {
-	padding-top: 19px;
-}
-
-.pun .blockmenu ul {
-	border-top-style: dotted;
-	border-top-width: 1px;
-	padding: 0;
-}
-
-.pun .blockmenu li {
-	border-bottom-style: dotted;
-	border-bottom-width: 1px;
-	font-weight: bold;
-	padding: 0;
-}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	display: block;
-	padding: 9px 6px 3px 6px;
-	min-height: 1px;
-	text-decoration: none;
-}
-
-* html .pun .blockmenu a:link,  * html .pun .blockmenu a:visited {
-	height: 1%;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	text-decoration: none;
-}
-
-#viewprofile .box {
-	border-style: solid;
-	border-width: 1px;
-	padding-bottom: 18px;
-}
-
-#viewprofile dt, #adstats dt {
-	padding: 7px 0;
-	position: absolute;
-	width: 13em;
-	left: 0;
-}
-
-#viewprofile dl {
-	border-style: solid none none none;
-	border-width: 1px;
-	margin: 7px 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#adintro, #adstats {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adintro li span {
-	display: inline-block;
-	padding-left: 16px;
-	margin-left: 8px;
-	line-height: normal;
-	background: url(Fire/img/bull.png) center left no-repeat;
-}
-
-#adstats .inbox, #adintro .inbox {
-	border-style: solid;
-	border-width: 1px;
-	padding: 18px;
-}
-
-#adstats dl {
-	margin: 0;
-	padding: 0;
-	width: 100%;
-	position: relative;
-}
-
-#viewprofile dd, #adstats dd {
-	border-style: none none solid none;
-	border-width: 1px;
-	padding: 7px 0 7px 13em;
-}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Basic defaults and Common Items
-----------------------------------------------------------------*/
-
-html, body, .pun {
-	background: #eeedea;
-	color: #333;
-}
-
-.pun .punwrap {
-	background: #fff;
-	border-color: #e1d9ca;
-	color: #665858;
-}
-
-#brdtitle #brddesc, .pun .pagepost, #brdstats #onlinelist, #brdfooter #searchlinks, #brdfooter #modcontrols,
-#punmaint h2, #punredirect h2, #adminconsole .submittop, .pun #debugtime, .pun .pagelink * {
-	border-color: #cec7b9;
-}
-
-.pun a, .pun a:link, .pun a:visited {
-	color: #990000;
-}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #f60;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #990000;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #f60;
-}
-
-/* Primary Navigation
-----------------------------------------------------------------*/
-
-#brdmenu {
-	background: #990000;
-}
-
-#brdmenu a, #brdmenu a:link, #brdmenu a:visited {
-	background: #990000;
-	border-color: #fff;
-	color: #ddd;
-}
-
-#brdmenu a:hover, #brdmenu a:active, #brdmenu a:focus {
-	background: #f60;
-	border-color: #fff;
-	color: #fff;
-}
-
-/* Main Tables
-----------------------------------------------------------------*/
-
-.pun .blocktable .box {
-	background: #fbfaf5;
-	border-color: #cec7b9 #e7e2d9;
-}
-
-#punindex .blocktable h2, .pun #vf h2 {
-	color: #836359;
-}
-
-#adminconsole fieldset th, #adminconsole fieldset td {
-	background: #f3f2ed;
-	border-color: #ebe0dc;
-}
-
-.pun #users1 h2 {
-	background: #fff;
-}
-
-.pun .blocktable td {
-	border-color: #ebe0dc;
-}
-
-.pun .blocktable th {
-	background: #ecebe7;
-	border-color: #e1d9ca;
-	color: #836359;
-}
-
-.pun .blocktable td.tcl span.stickytext {
-	color: #000;
-}
-
-/* Main Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost {
-	background: #f3f2ed;
-	border-color: #cec7b9 #e7e2d9;
-}
-
-.pun .blockpost h2 {
-	background: #ecebe7;
-	border-color: #e1d9ca;
-	color: #836359;
-}
-
-.pun .blockpost .postbody, .pun .blockpost .postfoot {
-	background: #fbfaf5;
-	border-color: #ebe0dc;
-}
-
-.pun .blockpost .postfootright li {
-	color: #fbfaf5;
-}
-
-.pun .postmsg, #punhelp code, #punhelp samp {
-	color: #333;
-}
-
-.pun .postsignature, .pun .postmsg .postedit {
-	color: #665858;
-}
-
-.pun .quotebox {
-	background: #f4f4e8;
-	border-color: #ccc;
-	color: #665858;
-}
-
-.pun .quotebox cite {
-	color: #836359;
-}
-
-.pun .codebox, #punhelp .codebox code {
-	background: #333;
-	color: #fff;
-}
-
-.pun .postmsg hr {
-	background: #cec7b9;
-}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-}
-
-/* Main Forms + Profile
-----------------------------------------------------------------*/
-
-.pun .blockform .box, #adstats, #adintro, #postpreview, #posterror {
-	border-color: #cec7b9 #e7e2d9;
-	background: #ecebe7;
-}
-
-#punmisc #rules .box, #punhelp .box {
-	border-color: #cec7b9 #e7e2d9;
-	background: #f3f2ed;
-}
-
-.pun #quickpost h2, #punpost .blockform h2, #punedit .blockform h2, #posterror h2,
-#pundelete .blockform h2 {
-	background: #ecebe7;
-	color: #836359;
-}
-
-.pun .forminfo {
-	background: #fff;
-	border-color: #ebe0dc;
-}
-
-#puninstall form#install .forminfo {
-	background: #990000;
-	color: #fff;
-}
-
-.pun #posterror .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-}
-
-#puninstall form#install .error-info {
-	background: #ffffe1;
-	border-color: #dfe6ee;
-	color: #333;
-}
-
-.pun .infldset, #adintro .inbox, #adstats .inbox {
-	background: #f3f2ed;
-	border-color: #ebe0dc;
-}
-
-.pun label, .pun legend, #adminconsole fieldset th {
-	color: #836359;
-}
-
-.pun fieldset p {
-	border-color: #cec7b9;
-}
-
-.pun .blockmenu ul, .pun .blockmenu li {
-	border-color: #cec7b9;
-}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
-	background: #ffffe6;
-}
-
-.pun .blockmenu .isactive a:link, .pun .blockmenu .isactive a:visited {
-	color: #333;
-	background: #f3f2ed;
-	}
-
-.pun #viewprofile .box {
-	border-color: #cec7b9 #e7e2d9;
-	background: #ecebe7;
-}
-
-.pun #viewprofile dt, #adstats dt {
-	color: #836359;
-}
-
-.pun #viewprofile dl, .pun #viewprofile dd, #adstats dl, #adstats dd {
-	border-color: #ebe0dc;
-}
-
-#adminconsole fieldset td.nodefault {
-	background: #d59b9b;
-}
-
-.pun .multiselect {
-	color: #836359;
-}
-
-.pun .checklist {
-	background: white;
-	border-color: #ccc;
-}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #f1eee8 #dddad4 #e8e5df #f1efe8;
-}
-
-.pun .iredirect .icon {
-	border-color: #cec7b9;
-	border-width: 1px;
-	padding: 7px;
-}
-
-.pun .inew .icon {
-	border-color: #ca0000 #ab0000 #bb0000 #d30000;
-}
Index: unk/web/punbb/style/Lithium.css
===================================================================
--- /trunk/web/punbb/style/Lithium.css	(revision 10)
+++ 	(revision )
@@ -1,1170 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #fff;
-	color: #333
-	}
-
-.pun {
-	color: #333
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #f1f1f1
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #dedfdf
-	}
-
-.pun h2, #brdmenu {
-	background-color: #6c8a3f;
-	color: #fff
-	}
-
-.pun th {
-	background-color: #d1d1d1
-	}
-
-.pun legend {
-	color: #6c8a3f
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #333
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #333
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #333;
-	}
-
-.pun .checklist {
-	border-color: #ACA899;
-	}
-
-/* posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #dedfdf
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #f1f1f1
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #f1f1f1
-	}
-
-#punhelp .codebox, #punhelp .quotebox {
-	background-color: #f9f9f9;
-	}
-
-.pun .blockpost h2 {
-	background-color: #7ea34b
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #b7d094
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #333;
-	color: #333
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color: #6c8a3f
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #cedeb9
-	}
-
-.pun th {
-	border-color: #d1d1d1
-	}
-
-.pun fieldset {
-	border-color: #aca899
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #f1f1f1
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #aca899 #fff #fff #aca899
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #638137
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #8eb653
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #638137;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #8eb653;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #fff
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #fff
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #b42000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #b42000
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #e6e6e6 #dedede #dadada #e2e2e2
-	}
-
-.pun .iredirect .icon {
-	border-color: #f1f1f1 #f1f1f1 #f1f1f1 #f1f1f1
-	}
-
-.pun .inew .icon {
-	border-color: #8bb453 #7a9e48 #709142 #799c47
-	}
Index: /trunk/web/punbb/style/Mercury.css
===================================================================
--- /trunk/web/punbb/style/Mercury.css	(revision 10)
+++ /trunk/web/punbb/style/Mercury.css	(revision 1)
@@ -1,1171 +1,258 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun {
-	color: #d4d4d4
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #383838
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #424242
-	}
-
-.pun h2, #brdmenu {
-	background-color: #565656;
-	color: #d4d4d4
-	}
-
-.pun th {
-	background-color: #484848
-	}
-
-.pun legend {
-	color: #f6b620
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #d4d4d4
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #d4d4d4
-	}
-
-.pun textarea, .pun input, .pun select {
-	background-color: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #D4D4D4;
-	}
-
-.pun .checklist {
-	border-color: #666;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #383838
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #424242
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #424242
-	}
-
-.pun .blockpost h2 {
-	background-color: #565656
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #a19e96
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #606060;
-	color: #606060
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color:#565656
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #565656
-	}
-
-.pun th {
-	border-color: #484848
-	}
-
-.pun fieldset {
-	border-color: #565656
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #383838
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #565656
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #f6b620
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #ffee40
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #f6b620;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #ffee40;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #d4d4d4
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #d4d4d4
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #ff4000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #ff5010
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #484848 #404040 #3c3c3c #444444
-	}
-
-.pun .iredirect .icon {
-	border-color: #383838 #383838 #383838 #383838
-	}
-
-.pun .inew .icon {
-	border-color: #f6b620 #ecae1f #d09a1b #e1a61d
-	}
+/****************************************************************/
+/* 1. IMPORTED STYLESHEETS */
+/****************************************************************/
+
+/* Import the basic setup styles */
+@import url(imports/base.css);
+/* Import the colour scheme */
+@import url(imports/Mercury_cs.css);
+
+/****************************************************************/
+/* 2. TEXT SETTINGS */
+/****************************************************************/
+
+/* 2.1 This sets the default Font Group */
+
+.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
+	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
+}
+
+.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}
+
+/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
+* HTML .pun {FONT-SIZE: 68.75%}
+/* End IE Win Font Size */
+
+/* Set font size for tables because IE requires it */
+.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}
+
+/* 2.2 Set the font-size for preformatted text i.e in code boxes */
+
+.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}
+
+/* 2.3 Font size for headers */
+
+.pun H2, .pun H4 {FONT-SIZE: 1em}
+.pun H3 {FONT-SIZE: 1.1em}
+#brdtitle H1 {FONT-SIZE: 1.4em}
+
+/* 2.4 Larger text for particular items */
+DIV.postmsg P {LINE-HEIGHT: 1.4}
+DIV.postleft DT {FONT-SIZE: 1.1em}
+.pun PRE {FONT-SIZE: 1.2em}
+
+/* 2.5 Bold text */
+
+DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
+DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}
+
+/****************************************************************/
+/* 3. LINKS */
+/****************************************************************/
+
+/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */
+
+#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
+.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
+.blockmenu A:link, .blockmenu A:visited {
+	TEXT-DECORATION: none
+}
+
+/* 3.2 Underline on hover for links in headers and main menu */
+
+#brdmenu A:hover, .blockpost H2 A:hover {TEXT-DECORATION: underline}
+
+/****************************************************************/
+/* 4. BORDER WIDTH AND STYLE */
+/****************************************************************/
+
+/* 4.1 By default borders are 1px solid */
+
+DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/* 4.2 Special settings for the board header. */
+
+#brdheader DIV.box {BORDER-TOP-WIDTH: 4px}
+
+/* 4.3 Borders for table cells */
+
+.pun TD, .pun TH {
+	BORDER-BOTTOM: none;
+	BORDER-RIGHT: none
+}
+
+.pun .tcl {BORDER-LEFT: none}
+
+/* 4.4 Special setting for fieldsets to preserve IE defaults */
+
+DIV>FIELDSET {
+	BORDER-STYLE: solid;
+	BORDER-WIDTH: 1px
+}
+
+/****************************************************************/
+/* 5. VERTICAL AND PAGE SPACING */
+/****************************************************************/
+
+/* 5.1 Page margins */
+
+HTML, BODY {MARGIN: 0; PADDING: 0}
+#punwrap {margin:12px 20px}
+
+/* 5.2 Creates vertical space between main board elements (Margins) */
+
+DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
+#punindex DIV.blocktable, DIV.blockpost {MARGIN-BOTTOM: 6px}
+DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}
+
+/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */
+
+DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
+DIV.postlinksb {MARGIN-TOP: -6px}
+
+/* 5.4 Put a 12px gap above the board information box in index because the category tables only
+have a 6px space beneath them */
+
+#brdstats {MARGIN-TOP: 12px}
+
+/****************************************************************/
+/* 6. SPACING AROUND CONTENT */
+/****************************************************************/
+
+/* 6.1 Default padding for main items */
+
+DIV.block DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
+.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}
+.pun H2 {PADDING: 4px 6px}
+
+/* 6.2 Special spacing for various elements */
+
+.pun H1 {PADDING: 3px 0px 0px 0}
+#brdtitle P {PADDING-TOP: 0px}
+DIV.linkst {PADDING: 8px 6px 3px 6px}
+DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
+#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
+#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}
+
+/* 6.4 Create some horizontal spacing for various elements */
+
+#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}
+
+/****************************************************************/
+/* 7. SPACING FOR TABLES */
+/****************************************************************/
+
+.pun TH, .pun TD {PADDING: 4px 6px}
+.pun TD P {PADDING: 5px 0 0 0}
+
+/****************************************************************/
+/* 8. SPACING FOR POSTS */
+/****************************************************************/
+
+/* 8.1 Padding around left and right columns in viewtopic */
+
+DIV.postleft DL, DIV.postright {PADDING: 6px}
+
+/* 8.2 Extra spacing for poster contact details and avatar */
+
+DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
+DD.postavatar {MARGIN-BOTTOM: 5px}
+
+/* 8.3 Extra top spacing for signatures and edited by */
+
+DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}
+
+/* 8.4 Spacing for code and quote boxes */
+
+DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
+.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}
+
+/* 8.5 Padding for the action links and online indicator in viewtopic */
+
+DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}
+
+/* 8.6 This is the input on moderators multi-delete view */
+
+DIV.blockpost INPUT, DIV.blockpost LABEL {
+	PADDING: 3px;
+	DISPLAY: inline
+}
+
+P.multidelete {
+	PADDING-TOP: 15px;
+	PADDING-BOTTOM: 5px
+}
+
+/* 8.7 Make sure paragraphs in posts don't get any padding */
+
+DIV.postmsg P {PADDING: 0}
+
+/****************************************************************/
+/* 9. SPECIAL SPACING FOR FORMS */
+/****************************************************************/
+
+/* 9.1 Padding around fieldsets */
+
+DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
+DIV.inform {PADDING-BOTTOM: 12px}
+
+/* 9.2 Padding inside fieldsets */
+
+.pun FIELDSET {PADDING: 0px 12px 0px 12px}
+DIV.infldset {PADDING: 9px 0px 12px 0}
+.pun LEGEND {PADDING: 0px 6px}
+
+/* 9.3 The information box at the top of the registration form and elsewhere */
+
+DIV.forminfo {
+	MARGIN-BOTTOM: 12px;
+	PADDING: 9px 10px
+}
+
+/* 9.4 BBCode help links in post forms */
+
+UL.bblinks LI {PADDING-RIGHT: 20px}
+
+UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}
+
+/* 9.5 Horizontal positioning for the submit button on forms */
+
+DIV.blockform P INPUT {MARGIN-LEFT: 12px}
+
+/****************************************************************/
+/* 10. POST STATUS INDICATORS */
+/****************************************************************/
+
+/* 10.1 These are the post status indicators which appear at the left of some tables. 
+.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
+.isticky = sticky topics. By default only .inew is different from the default.*/
+
+DIV.icon {
+	FLOAT: left;
+	MARGIN-TOP: 0.1em;
+	MARGIN-LEFT: 0.2em;
+	DISPLAY: block;
+	BORDER-WIDTH: 0.6em 0.6em 0.6em 0.6em;
+	BORDER-STYLE: solid
+}
+
+DIV.searchposts DIV.icon {MARGIN-LEFT: 0}
+
+/* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The
+margin creates space for the post status indicator */
+
+TD DIV.tclcon {MARGIN-LEFT: 2.3em}
+
+
+
+
+
+
+
+
+
+
+
Index: unk/web/punbb/style/Oxygen.css
===================================================================
--- /trunk/web/punbb/style/Oxygen.css	(revision 10)
+++ 	(revision )
@@ -1,1171 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun small, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #fff;
-	color: #333
-	}
-
-.pun {
-	color: #333
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #f1f1f1
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#adminconsole fieldset td, .pun .blockmenu .box, #adstats dd, #brdfooter #modcontrols {
-	background-color: #dedfdf
-	}
-
-.pun h2, #brdmenu {
-	background-color: #0066b9;
-	color: #fff
-	}
-
-.pun th {
-	background-color: #d1d1d1
-	}
-
-.pun legend {
-	color: #005cb1
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #333
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #333
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #333;
-	}
-
-.pun .checklist {
-	border-color: #ACA899;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #dedfdf
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #f1f1f1
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #f1f1f1
-	}
-
-#punhelp .codebox, #punhelp .quotebox {
-	background-color: #f9f9f9;
-	}
-
-.pun .blockpost h2 {
-	background-color: #006fc9
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #aabdcd
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #333;
-	color: #333
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color: #0066b9
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #bbcede
-	}
-
-.pun th {
-	border-color: #d1d1d1
-	}
-
-.pun fieldset {
-	border-color: #aca899
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #f1f1f1
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #aca899 #fff #fff #aca899
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #005cb1
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #b42000
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #005cb1;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #b42000;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #fff
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #fff
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #b42000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #b42000
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #e6e6e6 #dedede #dadada #e2e2e2
-	}
-
-.pun .iredirect .icon {
-	border-color: #f1f1f1 #f1f1f1 #f1f1f1 #f1f1f1
-	}
-
-.pun .inew .icon {
-	border-color: #0080d7 #0065c0 #0058b3 #0072ca
-	}
Index: unk/web/punbb/style/Radium.css
===================================================================
--- /trunk/web/punbb/style/Radium.css	(revision 10)
+++ 	(revision )
@@ -1,1171 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun {
-	color: #d4d4d4
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #383838
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #424242
-	}
-
-.pun h2, #brdmenu {
-	background-color: #565656;
-	color: #d4d4d4
-	}
-
-.pun th {
-	background-color: #484848
-	}
-
-.pun legend {
-	color: #60c860
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #d4d4d4
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #d4d4d4
-	}
-
-.pun textarea, .pun input, .pun select {
-	background-color: #2a2a2a;
-	color: #d4d4d4
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #D4D4D4;
-	}
-
-.pun .checklist {
-	border-color: #666;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #383838
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #424242
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #424242
-	}
-
-.pun .blockpost h2 {
-	background-color: #565656
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #a19e96
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #606060;
-	color: #606060
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color:#565656
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #565656
-	}
-
-.pun th {
-	border-color: #484848
-	}
-
-.pun fieldset {
-	border-color: #606060
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #383838
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #606060
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #60c860
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #80ee80
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #60c860;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #80ee80;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #d4d4d4
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #d4d4d4
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #ff4000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #ff5010
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #484848 #404040 #3c3c3c #444444
-	}
-
-.pun .iredirect .icon {
-	border-color: #383838 #383838 #383838 #383838
-	}
-
-.pun .inew .icon {
-	border-color: #60c860 #54af54 #499849 #59b657
-	}
Index: unk/web/punbb/style/Sulfur.css
===================================================================
--- /trunk/web/punbb/style/Sulfur.css	(revision 10)
+++ 	(revision )
@@ -1,1170 +1,0 @@
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3, span.closedtext,
-.pun .required strong span {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 68.75%/1.4545em Verdana, Helvetica, Arial, sans-serif;
-	line-height: normal;
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: verdana, helvetica, arial, sans-serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1em;
-	font-weight: normal;
-	padding: 4px 6px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.75em 0
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-html, body {
-	margin: 0;
-	padding: 0
-	}
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#brdtitle p {
-	padding-top: 0px
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .blockpost {
-	margin-bottom: -1px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-#brdheader .box {
-	border-top-width: 4px;
-	}
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu li {
-	display: inline;
-	margin-right: 12px;
-	}
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none
-	}
-
-#brdmenu a:hover, #brdmenu a:active {
-	text-decoration: underline
-	}
-
-#brdwelcome .conl {
-	float: left;
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .pagelink {
-	float: left;
-	white-space: nowrap;
-	}
-
-.pun .postlink {
-	font-weight: bold;
-	white-space: nowrap;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	text-decoration: none
-	}
-
-.pun .postlink a:hover, .pun .postlink a:active {
-	text-decoration: underline;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin:0 6px;
-	}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td, .pun th {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .tcl h3 span.newtext {
-	font-size: 0.917em;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap;
-	font-weight: normal;
-	}
-
-.pun td span.byuser {
-	white-space: nowrap;
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	margin: 0.1em 0 0 0.2em;
-	border-width: 0.6em;
-	border-style: solid;
-	height: 0;
-	width: 0;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-.pun .blockform form, .pun .fakeform {
-	PADDING: 20px 20px 15px 20px
-	}
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-.pun .inform {
-	padding-bottom: 12px
-	}
-
-.pun fieldset {
-	padding: 0px 12px 0px 12px;
-	border-style: solid;
-	border-width: 1px
-	}
-
-.pun legend {
-	padding: 0px 6px
-	}
-
-.pun .infldset {
-	padding: 9px 0px 12px 0
-	}
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 75%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 12px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun p.actions span {
-	margin-right: 12px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.3em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist fieldset {
-	border: 0;
-	padding: 0;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	margin: .2em 0;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 2.1em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.15em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 10px 6px 5px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-.pun .codebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0;
-	}
-
-.pun .quotebox {
-	border-style: solid;
-	border-width: 1px;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .postmsg .postimg img {
-	max-width: 98%;
-	vertical-align: middle;
-	margin: 7px 0.5em 7px 0;
-}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-style: solid;
-	border-width: 2px;
-}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-#debugtime {
-	margin-top: -12px;
-	text-align: center;
-	}
-
-#brdwelcome, #brdfooter dl a, div.blockmenu li, div.rbox input {
-	line-height: 1.4em
-	}
-
-#announce div.inbox div {
-	padding: 3px 0
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #fff;
-	color: #333
-	}
-
-.pun {
-	color: #333
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #f1f1f1
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #dedfdf
-	}
-
-.pun h2, #brdmenu {
-	background-color: #b84623;
-	color: #fff
-	}
-
-.pun th {
-	background-color: #d1d1d1
-	}
-
-.pun legend {
-	color: #822100
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #333
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #333
-	}
-
-.pun .multiselect, .pun .checklist {
-	color: #333;
-	}
-
-.pun .checklist {
-	border-color: #ACA899;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #dedfdf
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #f1f1f1
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #f1f1f1
-	}
-
-#punhelp .codebox, #punhelp .quotebox {
-	background-color: #f9f9f9;
-	}
-
-.pun .blockpost h2 {
-	background-color: #d25028
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #fccfc1
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-.pun hr {
-	background-color: #333;
-	color: #333
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-color: #b84623
-	}
-
-.pun td, #brdfooter #modcontrols {
-	border-color: #e1c3c3
-	}
-
-.pun th {
-	border-color: #d1d1d1
-	}
-
-.pun fieldset {
-	border-color: #aca899
-	}
-
-#adminconsole td, #adminconsole th {
-	border-color: #f1f1f1
-	}
-
-.pun .quotebox, .pun .codebox, .pun .forminfo,
-.pun .blockpost label, .pun .deletemsg {
-	border-color: #aca899 #fff #fff #aca899
-	}
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #822100
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #ca3300
-	}
-
-.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
-	border-color: #822100;
-}
-
-.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
-	border-color: #ca3300;
-}
-
-.pun h2 a:link, .pun h2 a:visited,
-#brdmenu a:link, #brdmenu a:visited {
-	color: #fff
-	}
-
-.pun h2 a:hover, .pun h2 a:active,
-#brdmenu a:hover, #brdmenu a:active {
-	color: #fff
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #b42000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #b42000
-	}
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	border-color: #e6e6e6 #dedede #dadada #e2e2e2
-	}
-
-.pun .iredirect .icon {
-	border-color: #f1f1f1 #f1f1f1 #f1f1f1 #f1f1f1
-	}
-
-.pun .inew .icon {
-	border-color: #c23000 #af2c00 #992600 #ac2b00
-	}
Index: unk/web/punbb/style/Technetium.css
===================================================================
--- /trunk/web/punbb/style/Technetium.css	(revision 10)
+++ 	(revision )
@@ -1,1409 +1,0 @@
-/*****************************************************************
-Technitium theme CSS
-
-Yes, it is valid CSS 3, but unfortunately border-radius doesn't seem to work correctly in my Firefox version so I have to give it the moz versions, which break the validator. Sorry.
-*****************************************************************/
-
-/*****************************************************************
-1. INITIAL SETTINGS
-*****************************************************************/
-
-/* Limited Reset
-----------------------------------------------------------------*/
-
-.pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3,
-.pun h4, .pun h5, .pun pre, .pun blockquote, .pun ul, .pun ol, .pun li, .pun dl,
-.pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun img, .pun abbr, .pun cite {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	}
-
-.pun ul, .pun ol {
-	list-style: none
-	}
-
-
-/* Structural Settings
-----------------------------------------------------------------*/
-
-body {
-	line-height: 1.9em;
-}
-
-.pun {
-	width: 95%;
-	margin: 0 auto;
-	}
-
-.pun .clearer, .pun .nosize {
-	height: 0;
-	width: 0;
-	line-height: 0;
-	font-size: 0;
-	overflow: hidden
-	}
-
-.pun .clearer, .pun .clearb {
-	clear: both
-	}
-
-.pun .nosize {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	width: 0;
-	}
-
-* html .inbox, * html .inform, * html .pun, * html .tclcon, * html .codebox {
-	height: 1px
-	}
-
-.pun, .pun .inbox, .pun .inform, .pun .tclcon, .pun .codebox {
-	min-height: 1px
-	}
-
-.clearl {
-	clear: left;
-	}
-
-/* Hidden Elements
-----------------------------------------------------------------*/
-
-#brdfooter h2, #brdstats h2, #brdstats .conl dt, #brdstats .conr dt,
-#modcontrols dt, #searchlinks dt, div.postright h3 {
-	position: absolute;
-	display: block;
-	overflow: hidden;
-	width: 0;
-	left: -9999em;
-	text-indent: -9999em;
-	}
-
-/*****************************************************************
-2. TEXT & CONTENT
-*****************************************************************/
-
-/* Text Defaults
-----------------------------------------------------------------*/
-
-.pun {
-	font: 10pt Georgia, Times, "Times New Roman", serif
-	}
-
-.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun samp, .pun legend {
-	font-size: 1em;
-	font-family: Georgia, Times, "Times New Roman", serif;
-	}
-
-.pun pre, .pun code {
-	font-size: 1.182em;
-	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace
-	}
-
-.pun pre code {
-	font-size: 1em;
-	}
-
-.pun strong {
-	font-weight: bold;
-	}
-
-.pun em {
-	font-style: italic;
-	}
-
-#vf td {
-	font-size: 1.1em;
-	}
-
-
-/* Content Defaults
-----------------------------------------------------------------*/
-
-.pun p, .pun ul, .pun ol, .pun dl {
-	font-size: 1em;
-	padding: 3px 0;
-	}
-
-.pun h2 {
-	font-size: 1.5em;
-	font-weight: normal;
-	padding: 4px 6px;
-	padding: 6px;
-	-moz-border-radius-topleft: 0.3em;
-	-moz-border-radius-topright: 0.3em;
-	-webkit-border-top-left-radius: 0.3em;
-	-webkit-border-top-right-radius: 0.3em;
-	}
-
-.pun h2 #brdmenu {
-	font-size: 1.1em;
-	}
-
-.pun .blockpost h2 {
-	font-size: 1.0em;
-	padding: 8px;
-	}
-
-.pun h3 {
-	font-size: 1.091em;
-	padding: 3px 0;
-	}
-
-.pun table p, .pun table h3 {
-	padding: 0;
-	}
-
-.pun span.warntext, .pun p.warntext {
-	font-weight: bold
-	}
-
-.pun .postleft dl dt {
-	font-size: 1.4em;
-	}
-
-/* User Content (Announcements, Rules, Posts)
-----------------------------------------------------------------*/
-
-.pun .usercontent p, .pun .postmsg p {
-	padding: 0.5em 0;
-	line-height: 1.6em;
-	}
-
-.pun .usercontent ul, .pun .postmsg ul {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: disc
-	}
-
-.pun .usercontent ol, .pun .postmsg ol {
-	padding: 0.75em 1em 0.75em 2.5em;
-	list-style: decimal
-	}
-
-.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
-	list-style: lower-alpha
-	}
-
-.pun .usercontent li ol, .pun .usercontent li ul, .pun .postmsg li ol, .pun .postmsg li ul {
-	padding: 0.25em 1em 0.75em 2.5em
-	}
-
-.pun .usercontent li p, .pun .postmsg li p {
-	padding: 0
-	}
-
-.pun .usercontent h1 {
-	font-size: 1.4em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h2 {
-	font-size: 1.2em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h3 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
-	font-size: 1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0
-	}
-
-.pun .quotebox cite {
-	font-weight: bold;
-	font-style: normal;
-	padding: 0.75em 0.75em 0 0.75em
-	}
-
-.pun span.bbu {
-	text-decoration: underline
-	}
-
-.pun span.bbs, .pun del {
-	text-decoration: line-through;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	text-decoration: none;
-	}
-
-.pun div.postmsg h5, #punhelp h5 {
-	font-size: 1.1em;
-	font-weight: bold;
-	padding: 0.75em 0 0 0;
-	}
-
-/*****************************************************************
-3. COMMON STYLES
-*****************************************************************/
-
-/* Page Layout
-----------------------------------------------------------------*/
-
-.pun {
-	margin: 12px 20px
-	}
-
-#punredirect, #punmaint, #puninstall, #pundb_update {
-	margin: 50px 20% 12px 20%;
-	width: auto;
-	}
-
-
-/* Vertical Element Spacing
-----------------------------------------------------------------*/
-
-#brdheader {
-	margin: 0 0 12px 0;
-	}
-
-#announce, #brdstats {
-	margin: 12px 0 12px 0;
-	}
-
-.pun .blocktable, .pun .block, .pun .blockform, .pun .block2col, #postreview {
-	margin-bottom: 12px
-	}
-
-#punindex .blocktable, .pun .blockpost {
-	margin-bottom: 6px
-	}
-
-#postreview .box {
-	margin-bottom: 3px;
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-bottom: 0px
-	}
-
-.pun .linkst, .pun .linksb {
-	margin-top: -12px
-	}
-
-.pun .postlinksb {
-	margin-top: -6px
-	}
-
-
-/* External Borders
-----------------------------------------------------------------*/
-
-.pun .box {
-	border-style: solid;
-	border-width: 1px;
-	}
-
-
-.pun h2 {
-	border-width: 1px;
-	border-style: solid;
-	border-bottom: none;
-}
-
-
-/* Default Internal Spacing
-----------------------------------------------------------------*/
-
-.pun .block .inbox, .pun .blockmenu .inbox {
-	padding: 3px 6px
-	}
-
-/*****************************************************************
-4. COMMON BOARD ELEMENTS
-*****************************************************************/
-
-/* Board Header
-----------------------------------------------------------------*/
-
-#brdtitle h1 {
-	font-size: 1.5em;
-	line-height: 1.1em;
-	padding: 3px 0 0 0;
-	}
-
-#brdmenu {
-	font-size:1.2em;
-	}
-
-#brddesc {
-	padding: 3px 0;
-	}
-
-#brddesc * {
-	padding-top: 0;
-	padding-bottom: 0;
-	}
-
-
-#brdmenu li {
-	display: inline;
-	margin-right: 10px;
-	margin-top: 12px;
-	margin-bottom: 12px;
-	}
-
-
-#brdmenu a:link, #brdmenu a:visited {
-	text-decoration: none;
-	text-shadow: #FFF 1px -1px 0.4em;
-	padding: 0.2em;
-	}
-
-#brdwelcome .conl {
-	float: left;
-	white-space: nowrap;
-	}
-
-#brdwelcome li {
-	float:left;
-	margin-right:8px;
-	white-space:nowrap;
-}
-
-#brdwelcome .conl li strong:after {
-	content: '.'
-	}
-
-#brdwelcome .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdwelcome .conr li {
-	float: right;
-	text-align: right;
-	}
-
-/* Breadcrumbs and Post Links
-----------------------------------------------------------------*/
-
-.pun .linkst {
-	padding: 8px 6px 3px 6px
-	}
-
-.pun .linksb, .pun .postlinksb {
-	padding: 3px 6px 8px 6px
-	}
-
-.pun .crumbs {
-	clear: both;
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .crumbs li {
-	display: inline;
-	white-space: nowrap;
-	font-weight: bold;
-	}
-
-.pun .linkst .crumbs {
-	font-size: 1.3em;
-	}
-
-.pun .pagelink {
-	float: left;
-	display: block;
-	white-space: normal;
-	}
-
-.pun .postlink {
-	font-size: 1.1em;
-	font-weight: bold;
-	white-space: wrap;
-	text-decoration: none;
-	}
-
-.pun .linkst .postlink {
-	position: relative;
-	margin-top: -0.2em;
-	margin-bottom: 0.5em;
-	}
-
-.pun .linksb .postlink, .pun .postlinksb .postlink {
-	position: relative;
-	margin-top: 0.5em;
-	margin-bottom: -0.5em;
-	}
-
-.pun .postlink, .pun .modbuttons {
-	float: right;
-	text-align: right;
-	}
-
-.pun .modbuttons {
-	padding: 1px 0;
-	white-space: nowrap;
-	}
-
-.pun .modbuttons input {
-	margin-left: 6px;
-	}
-
-#punindex .subscribelink {
-	margin-top: 6px;
-	}
-
-/* Board Footer
-----------------------------------------------------------------*/
-
-#brdfooter #modcontrols {
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	text-align: center;
-	}
-
-#brdfooter #modcontrols dd {
-	display: inline;
-	margin-right: 10px;
-	}
-
-#brdfooter .conl {
-	float: left;
-	}
-
-#brdfooter .conr {
-	float: right;
-	text-align: right;
-	}
-
-#brdfooter #feedlinks span {
-	background:url("Technetium/feed.png") no-repeat scroll left center transparent;
-	padding-left:18px;
-	display: inline;
-}
-
-
-/* Board Stats
-----------------------------------------------------------------*/
-
-#brdstats .conl {
-	float: left;
-	}
-
-#brdstats .conr {
-	float: right;
-	text-align: right;
-	}
-
-#onlinelist dd, #onlinelist dt {
-	display: inline;
-	}
-
-
-/*****************************************************************
-5. MAIN TABLES
-*****************************************************************/
-
-.pun table {
-	width: 100%;
-	border-collapse: collapse;
-	border-spacing: 0;
-	empty-cells: show;
-	}
-
-.pun .blocktable table {
-	table-layout: fixed;
-	}
-
-.pun td, .pun th {
-	padding: 4px 6px;
-	line-height: 1.4em;
-	text-align: left;
-	font-weight: normal;
-	}
-
-.pun td {
-	border-style: solid none none solid;
-	border-width: 1px;
-	}
-
-.pun .tcl {
-	border-left: 0;
-	width: auto;
-	}
-
-.pun .tc2, .pun .tc3, .pun .tcmod {
-	width: 10%;
-	text-align: center;
-	padding: 4px 0;
-	}
-
-.pun .tcr {
-	width: 30%;
-	}
-
-.pun .tcl h3 {
-	font-size: 1.3em;
-	font-weight: bold;
-	}
-
-.pun .tcl span.newtext, .pun .tcl span.pagestext {
-	white-space: nowrap
-	}
-
-.pun .tcl p {
-	padding: 5px 0 0 0
-	}
-
-#punsearch #vf .tc2 {
-	width: 18%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#users1 .tcr {
-	width: 25%
-	}
-
-#users1 .tc2 {
-	width: 25%;
-	text-align: left;
-	padding: 4px 6px;
-	}
-
-#debug .tcl {
-	width: 10%
-	}
-
-#debug .tcr {
-	width: 90%;
-	white-space: normal
-	}
-
-#punindex .tcr .byuser {
-	display: block
-	}
-
-.pun .blocktable .tclcon {
-	padding: 0 11px 0 12px;
-	overflow: hidden;
-	height: 1%;
-	min-height: 1px;
-	position: relative;
-	}
-
-.pun .blocktable .tclcon div {
-	width: 100%;
-	overflow: hidden;
-	}
-
-.pun .icon {
-	height: 24px;
-	width: 24px;
-	overflow: hidden;
-	float: left;
-	}
-
-.pun .icon div {
-	position: absolute;
-	left: -9999em;
-	text-indent: -9999em;
-	height: 0;
-	}
-
-.pun .iposted .ipost {
-	position: absolute;
-	left: 0;
-	font-weight: bold;
-	width: 8px;
-	padding-left: 4px;
-	text-align: center;
-	top: 0;
-	}
-
-.pun .stickytext {
-	display: none;
-	}
-
-.pun .movedtext {
-	display: none;
-}
-
-.pun .closedtext {
-	font-weight: bold;
-	}
-/*****************************************************************
-6. MAIN FORMS
-*****************************************************************/
-
-
-.pun .forminfo {
-	margin-bottom: 12px;
-	padding: 9px 10px;
-	border-style: solid;
-	border-width: 1px;
-	}
-
-.pun .forminfo h3 {
-	font-weight: bold;
-	}
-
-
-
-.pun .inform {
-	padding: 0 18px;
-}
-
-.pun fieldset {
-	overflow: hidden;
-	width: 100%;
-	padding-bottom: 0.8em;
-}
-
-.pun legend {
-	font-size: 1.2em;
-	font-weight: bold;
-	margin-left: -7px;
-	padding: 10px 19px 7px 19px;
-}
-
-.pun div[class*="inform"] legend {
-	margin-left: 0;
-}
-
-.pun .infldset {
-	border-style: solid;
-	border-width: 1px;
-	display: inline-block;
-	overflow: hidden;
-	padding: 12px 18px;
-}
-
-.pun div[class*="infldset"] {
-	display: block;
-}
-
-#punregister #rules .infldset {
-	padding: 5px 18px;
-}
-
-.pun fieldset p {
-	clear: both;
-	padding: 0 0 7px 0;
-	width: 100%;
-}
-
-.pun fieldset .usercontent p {
-	padding: 7px 0;
-}
-
-.pun fieldset label {
-	clear: both;
-	display: block;
-	padding: 0 0 7px 0;
-}
-
-
-.pun label {
-	display: block;
-	padding: 3px 0
-	}
-
-.pun label.conl {
-	float: left;
-	overflow: visible;
-	margin-right: 10px
-	}
-
-.pun select {
-	padding-top: 1px;
-	padding-bottom: 1px;
-	}
-
-.pun fieldset .rbox {
-	}
-
-.pun fieldset .rbox br {
-	display: none;
-	}
-
-.pun fieldset .rbox label {
-	padding: 3px 0 3px 25px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun fieldset .rbox input {
-	margin: 0 9px 0 -25px;
-	padding: 0;
-	width: 16px;
-	position: relative;
-	vertical-align: middle;
-	}
-
-.pun .txtarea {
-	width: 90%
-	}
-
-.pun .txtarea textarea, .pun input.longinput {
-	width: 100%
-	}
-
-.pun .bblinks {
-	padding-bottom: 10px;
-	padding-left: 4px
-	}
-
-.pun .bblinks li {
-	display: inline;
-	padding-right: 20px
-	}
-
-.pun .blockform .buttons {
-	padding-left: 18px;
-	padding-bottom: 5px;
-	}
-
-.pun .blockform .buttons input {
-	margin-right: 8px;
-	}
-
-#posterror ul {
-	list-style: square;
-	padding: 3px 0 3px 24px;
-	}
-
-.pun .deletemsg {
-	border-style: solid;
-	border-width: 1px;
-	padding: 6px 15px;
-	}
-
-.pun .multiselect {
-	float: left;
-	padding-bottom: 7px;
-	}
-
-.pun .checklist {
-	border-width: 1px;
-	border-style: solid;
-	max-height: 9em;
-	width: 20em;
-	overflow: auto;
-	padding: 0.25em 0.5em;
-	margin: 0.25em 16px 0 0.15em;
-	}
-
-.pun .checklist legend {
-	padding: 0;
-	}
-
-.pun .checklist legend span {
-	width: auto;
-	max-width: 25em;
-	}
-
-.pun .checklist .checklist-item {
-	position: relative;
-	}
-
-.pun .checklist .checklist-item label {
-	padding: 0 0 0 1.75em;
-	}
-
-.pun .checklist .checklist-item .fld-input {
-	position: absolute;
-	left: 0;
-	top: 0;
-	padding: 0;
-	margin: 0;
-	}
-
-.pun .checklist .checklist-item input {
-	margin: 0;
-	height: 1.55em;
-	width: 1.55em;
-	}
-
-/*****************************************************************
-7. PROFILES AND ADMIN
-*****************************************************************/
-
-.pun .block2col {
-	padding-bottom: 1px
-	}
-
-.pun .block2col .blockform, .pun .block2col .block {
-	margin-left: 14em
-	}
-
-.pun .blockmenu {
-	float:left;
-	width: 13em
-	}
-
-.pun .blockmenu li {
-	padding: 3px 0;
-	font-weight: bold;
-	}
-
-.pun .blockmenu a:link, .pun .blockmenu a:visited {
-	text-decoration: none
-	}
-
-.pun .blockmenu a:hover, .pun .blockmenu a:active {
-	text-decoration: underline
-	}
-
-#viewprofile dl {
-	float: left;
-	width: 100%;
-	overflow: hidden
-	}
-
-#viewprofile dd {
-	margin-left: 14em;
-	padding: 3px;
-	}
-
-#viewprofile dt {
-	float: left;
-	width: 13em;
-	margin: 3px 0;
-	}
-
-#profileavatar img {
-	float: right;
-	margin-left: 1em
-	}
-
-/*****************************************************************
-8. MAIN POSTS
-*****************************************************************/
-
-.pun .blockpost h2 a:link, .pun .blockpost h2 a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost h2 a:hover, .pun .blockpost h2 a:active {
-	text-decoration: underline;
-	}
-
-.pun .blockpost h2 .conr {
-	float: right;
-	text-align: right;
-	}
-
-#punsearch .blockpost h2 span {
-	white-space: nowrap;
-	}
-
-.pun .blockpost .box {
-	overflow: hidden;
-	}
-
-.pun .postleft, .pun .postfootleft {
-	float:left;
-	width: 18em;
-	overflow: hidden;
-	position: relative;
-	overflow: hidden;
-	}
-
-.pun .postleft dl {
-	padding: 0.5em 6px;
-	}
-
-.pun .postleft .usercontacts, .pun .postleft .icon {
-	margin-top: 6px
-	}
-
-.pun .postleft .postavatar, .pun .postleft .usertitle {
-	margin-bottom: 6px;
-	display: block;
-	}
-
-.pun .blockpost dt {
-	font-size: 1.091em;
-	font-weight: bold;
-	}
-
-.pun .blockpost dt a:link, .pun .blockpost dt a:visited {
-	text-decoration: none;
-	}
-
-.pun .blockpost dt a:hover, .pun .blockpost dt a:active {
-	text-decoration: underline;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-width: 18em;
-	border-left-style: solid
-	}
-
-#postpreview .postright {
-	border-left: 0
-	}
-
-.pun .postright {
-	padding: 0 6px;
-	}
-
-.pun .postfootright, .pun .multidelete {
-	text-align: right
-	}
-
-.pun .postmsg {
-	width:98%;
-	overflow: hidden;
-	padding-bottom: 6px;
-	word-wrap: break-word;
-	}
-
-.pun .postfootright ul, .pun .postfootright div, .pun .postfootright p,
-.pun .postfootleft p {
-	padding: 6px 6px 6px 6px;
-	}
-
-.pun .postfootright li {
-	display: inline;
-	}
-
-.pun .postfootright li:before {
-	content: " | ";
-	}
-
-.pun .postfootright li:first-child:before {
-	content: "";
-	}
-
-.pun .postfootright a:link, .pun .postfootright a:visited {
-	text-decoration: none
-	}
-
-.pun .postfootright a:hover, .pun .postfootright a:active {
-	text-decoration: underline
-	}
-
-
-.pun .quotebox, .pun .codebox {
-	border-style: solid;
-	border-width: 2px;
-	border-left: 5px solid;
-	margin: 0.75em 1em;
-	padding: 0 0.75em;
-	}
-
-.pun .quotebox cite {
-	display: block;
-	padding: 0.75em 0 0 0;
-	}
-
-.pun .quotebox blockquote {
-	width: 100%;
-	overflow: hidden
-	}
-
-.pun .codebox pre {
-	overflow: auto;
-	width: 100%;
-	overflow-y:hidden
-	}
-
-* html .pun .codebox pre {
-	padding-bottom: 10px;
-	}
-
-*+html .pun .codebox pre {
-	padding-bottom: 10px
-	}
-
-.pun .codebox pre code {
-	display: block;
-	padding: 0.75em;
-	}
-
-.pun .codebox pre.vscroll {
-	height: 32em;
-	overflow: auto;
-	overflow-y: auto
-	}
-
-.pun .postmsg img.postimg, .pun .postmsg a img.postimg {
-	max-width: 100%;
-	vertical-align: middle;
-	}
-
-.pun .postmsg img {
-	vertical-align: bottom;
-	}
-
-.pun .postsignature hr {
-	margin-left: 0px;
-	width: 200px;
-	text-align: left;
-	height: 1px;
-	border:none
-	}
-
-.pun .blockpost label {
-	padding: 3px 6px;
-	border-style: solid;
-	border-width: 1px;
-	vertical-align: middle;
-	display: inline-block;
-	}
-
-.pun .blockpost label * {
-	vertical-align: middle;
-	margin: 0;
-	padding: 0;
-	}
-
-
-/****************************************************************/
-/* 9. HELP FILES AND MISC. */
-/****************************************************************/
-
-#punhelp h2 {
-	margin-top: 12px
-	}
-
-#punhelp div.box {
-	padding: 10px
-	}
-
-/*****************************************************************
-COLOUR SCHEME
-*****************************************************************/
-
-/* Background / Text
-----------------------------------------------------------------*/
-
-body {
-	background: #fff url("Technetium/bg.png") repeat-x top;
-	color: #122434
-	}
-
-.pun {
-	color: #122434
-	}
-
-.pun .box, #adminconsole fieldset th {
-	background-color: #FBFCFD;
-	background-image: url("Technetium/light-shade.png");
-	background-position: bottom;
-	background-repeat: repeat-x;
-	}
-
-.pun td.tc2, .pun td.tc3, .pun td.tcmod, #postpreview, #viewprofile dd, .pun .forminfo,
-#brdfooter #modcontrols, #adminconsole fieldset td, .pun .blockmenu .box, #adstats dd {
-	background-color: #F4F9FD;
-	background-image: url("Technetium/light-shade.png");
-	background-repeat: repeat-x;
-	background-position: bottom;
-	}
-
-.pun h2, #brdmenu {
-	background-color: #C5D8EB;
-	color: #122434;
-	background-image: url("Technetium/dark-shade.png");
-	background-repeat: repeat-x;
-	background-position: top;
-	}
-
-.pun h2  {
-	background-color: #C5D8EB;
-	background-image: url("Technetium/inv-shade.png");
-	background-repeat: repeat-x;
-	color: #122434;
-	text-shadow: #FFF 1px -1px 0.7em;
-	}
-
-.pun #announce h2  {
-	display: none;
-	}
-
-.box #announce-block {
-	background-color: #FDFCE3;
-}
-
-.pun th {
-	background-color: #EFF3F8;
-	background-image: url("Technetium/light-shade.png");
-	background-repeat: repeat-x;
-	}
-
-.pun td {
-	background-image: url("Technetium/light-shade.png");
-	background-color: #FBFCFD;
-	background-position: bottom;
-	background-repeat: repeat-x;
-	}
-
-.pun .isticky td {
-	background-color: #E4EBF1;
-	}
-
-.pun .iclosed td {
-	background-color: #ECEEF0
-	}
-
-.pun .iclosed.isticky td {
-	background-color: #CDD6E0;
-	}
-
-.pun legend {
-	color: #122434
-	}
-
-.pun .blockmenu li.isactive a, #posterror li strong {
-	color: #333
-	}
-
-.pun .usercontent * {
-	background: transparent;
-	color: #333
-	}
-
-#adminmenu .box {
-	background: #FBFCFD;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited, .pun .postlink a:active  {
-	background-color:#F0F5FA;
-	background-image:url(Technetium/inv-shade.png);
-	background-repeat:repeat-x;
-	border: 1px solid;
-	color:#2B3037;
-	text-shadow: #FFF 1px -1px 0.4em;
-	padding: 0.3em;
-	border-radius: 0.4em;
-	position: relative;
-	-moz-border-radius: 0.4em;
-	-webkit-border-top-left-radius: 0.4em;
-	-webkit-border-top-right-radius: 0.4em;
-	-webkit-border-bottom-left-radius: 0.4em;
-	-webkit-border-bottom-right-radius: 0.4em;
-
-	}
-
-.pun .postlink a:hover {
-	background-color: #C0D6E9;
-	color: #000;
-	}
-
-#brdheader .box {
-	background-color:#F0F5FA;
-	background-image:url(Technetium/light-shade.png);
-	background-repeat:repeat-x;
-	background-position: top;
-	color:#122434;
-	border-radius: 0.4em;
-	-moz-border-radius: 0.4em;
-	-webkit-border-top-left-radius: 0.4em;
-	-webkit-border-top-right-radius: 0.4em;
-	-webkit-border-bottom-left-radius: 0.4em;
-	-webkit-border-bottom-right-radius: 0.4em;
-	}
-
-.pun #brdtitle {
-	background-color: #D1E1EF;
-	background-image: url("Technetium/inv-shade.png");
-	background-repeat: repeat-x;
-	text-shadow: #FFF 1px -1px 0.4em;
-	}
-
-
-.pun .infldset, #pundelete .deletemsg, #adintro .inbox, #adstats .inbox {
-	background: #FBFCFD url(Technetium/light-shade.png) bottom repeat-x;
-	border-color: #C0CCD8;
-}
-
-#adintro ul {
-	list-style-type: disc;
-	margin-left: 8px;
-	padding-left: 16px;
-	}
-
-.pun .multiselect {
-	color: #122434;
-	}
-
-.pun .checklist {
-	background: white;
-	border-color: #A2B5CC;
-	}
-
-/* Posts
-----------------------------------------------------------------*/
-
-.pun .blockpost .box, .pun .postright, .pun .postfootright, .pun .deletemsg {
-	background-color: #F8FAFD;
-	}
-
-.pun .postright, .pun .postfootright {
-	border-left-color: #F0F5FA
-	}
-
-.pun .postleft, .pun .postfootleft, .pun .blockpost label, .pun .codebox, .pun .quotebox {
-	background-color: #F0F5FA
-	}
-
-#punhelp .codebox, #punhelp .quotebox {
-	background-color: #f9f9f9;
-	}
-
-.pun .blockpost h2 {
-	background-color: #F0F5FA;
-	}
-
-.pun .blockpost h2 span.conr {
-	color: #aabdcd
-	}
-
-.pun hr {
-	background-color: #333;
-	color: #333
-	}
-
-.pun .quotebox {
-	background-color: #FAFCFE;
-	}
-
-.pun .postmsg ins, #punhelp samp ins {
-	background-color: #ff0;
-	}
-
-/* Borders
-----------------------------------------------------------------*/
-
-.pun .box, .pun h2, #brdfooter #modcontrols {
-	border-color: #A2B5CC;
-}
-
-.blocktable #announce h2 {
-	border-color: #F6B620;
-}
-
-.pun td {
-	border-color: #A2B5CC;
-	}
-
-.pun th, .pun fieldset {
-	border-color: #A2B5CC;
-	}
-
-#adminconsole td, #adminconsole th {
-	border-style:solid;
-	border-width:1px 0px !important;
-}
-
-#adminconsole th {
-	border-width: 1px 0px 1px 1px !important;
-}
-
-#adminconsole td {
-	border-width: 1px 1px 1px 1px !important;
-}
-
-.pun .forminfo, .pun .blockpost label, .pun .deletemsg {
-	border-color: #aca899 #fff #fff #aca899;
-	}
-
-.pun .quotebox, .pun .codebox {
-	border-color: #BCD2E9;
-	}
-
-.pun .postlink a:link, .pun .postlink a:visited {
-	border-color: #C0D6E9
-	}
-
-
-/* Links
-----------------------------------------------------------------*/
-
-.pun a:link, .pun a:visited {
-	color: #1F537B;
-	text-decoration: none;
-	}
-
-.pun a:hover, .pun a:active, .pun a:focus {
-	color: #9E1D00
-	}
-
-#brdmenu li a:active, #brdmenu li a:link, #brdmenu li a:visited {
-	color: #1F2E3D;
-	}
-
-#brdmenu li a:hover {
-	color: #000;
-	text-shadow: #8895A2 1px -1px 0.4em;
-	}
-
-#vf a {
-	font-weight: bold;
-	}
-
-.pun .postreport a:link, .pun .postreport a:visited,
-.pun .iclosed td.tcl a:link, .pun .iclosed td.tcl a:visited {
-	color: #888
-	}
-
-.pun .isticky.iclosed td.tcl a:link, .pun .isticky.iclosed td.tcl a:visited {
-	color: #475F6B !important;
-	}
-
-.pun .isticky.iclosed td.tcl a:hover {
-	color: #577382 !important;
-	}
-
-
-.pun .postreport a:hover, .pun .postreport a:active,
-.pun .iclosed td.tcl a:hover, .pun .iclosed td.tcl a:active {
-	color: #aaa
-	}
-
-.pun .maintenancelink a:link, .pun .maintenancelink a:visited {
-	color: #b42000
-	}
-
-.pun .maintenancelink a:hover, .pun .maintenancelink a:active {
-	color: #b42000
-	}
-
-
-/* Status Indicators
-----------------------------------------------------------------*/
-
-.pun .icon {
-	background-image:url(Technetium/icon-nonew.png);
-	}
-
-.pun .iredirect .icon {
-	background-image:url(Technetium/icon-moved.png);
-	}
-
-.pun .inew .icon{
-	background-image:url(Technetium/icon-new.png);
-	}
-
-.pun .iclosed .icon  {
-	background-image:url(Technetium/icon-closed.png);
-	}
-
-.pun .isticky .icon {
-	background-image:url(Technetium/icon-nonew-sticky.png);
-	}
-
-.pun .isticky.inew .icon {
-	background-image:url(Technetium/icon-new-sticky.png);
-	}
-
-.pun .iclosed.isticky .icon {
-	background-image:url(Technetium/icon-closed-sticky.png);
-	}
-
-.pun .imoved .icon {
-	background-image:url(Technetium/icon-moved.png);
-	}
Index: /trunk/web/punbb/style/imports/Mercury_cs.css
===================================================================
--- /trunk/web/punbb/style/imports/Mercury_cs.css	(revision 10)
+++ /trunk/web/punbb/style/imports/Mercury_cs.css	(revision 1)
@@ -5,5 +5,5 @@
 /* 1.1 Default background colour and text colour */
 
-BODY {BACKGROUND-COLOR: #1f1f1f}
+/*BODY {BACKGROUND-COLOR: #ffffff}*/
 
 .pun {COLOR: #D4D4D4}
@@ -115,3 +115,3 @@
 DIV.icon {BORDER-COLOR: #484848 #404040 #3C3C3C #444444}
 TR.iredirect DIV.icon {BORDER-COLOR: #383838 #383838 #383838 #383838}
-DIV.icon-new {BORDER-COLOR: #F6B620 #ECAE1F #D09A1B #E1A61D}
+DIV.inew {BORDER-COLOR: #F6B620 #ECAE1F #D09A1B #E1A61D}
Index: /trunk/web/punbb/style/imports/base_admin.css
===================================================================
--- /trunk/web/punbb/style/imports/base_admin.css	(revision 10)
+++ /trunk/web/punbb/style/imports/base_admin.css	(revision 1)
@@ -4,5 +4,5 @@
 * HTML #adstats DD {HEIGHT: 1%}
 #adstats DD {MARGIN-LEFT: 14em; PADDING: 3px; MARGIN-BOTTOM: 5px; LINE-HEIGHT: 1.5em}
-#adstats DT {FLOAT: left; WIDTH: 13em; PADDING: 3px; LINE-HEIGHT: 1.5em}
+#adstats DT {FLOAT:left; WIDTH: 13em; PADDING: 3px; line-height: 1.5em}
 #adstats {PADDING: 15px 15px 5px 10px}
 #adintro {PADDING: 5px}
@@ -17,10 +17,10 @@
 #adminconsole TABLE.aligntop TH, #adminconsole TABLE.aligntop TD {VERTICAL-ALIGN: top}
 #adminconsole TABLE.aligntop TH {PADDING-TOP: 0.7em}
-#adminconsole TD, #adminconsole TH {BORDER-STYLE: solid; BORDER-WIDTH: 3px 0 3px 0}
+#adminconsole TD, #adminconsole TH {BORDER-STYLE: solid; BORDER-WIDTH: 3px 0px 3px 0px}
 #adminconsole P {PADDING-BOTTOM: 6px}
 #adminconsole .topspace {PADDING-TOP: 6px}
 #adminconsole P.submittop, #adminconsole P.submitend {TEXT-ALIGN: center}
 #adminconsole TH.hidehead {COLOR: #f1f1f1}
-#adminconsole THEAD TH {PADDING-BOTTOM: 0}
+#adminconsole THEAD TH {PADDING-BOTTOM: 0px}
 #adminconsole P.linkactions {FONT-WEIGHT: bold; PADDING-LEFT: 5px}
 #adminconsole TH INPUT, #adminconsole DIV.fsetsubmit {MARGIN-TOP: 6px}
@@ -29,24 +29,17 @@
 #categoryedit .tcl {WIDTH: 25%}
 #censoring .tcl, #censoring .tc2, #ranks .tcl, #ranks .tc2 {WIDTH: 20%}
-#edforum .tcl, #edforum .tc2 {WIDTH: 8%}
-#edforum .tc2 {WIDTH: 6%}
-
 TABLE#forumperms TH, TABLE#forumperms TD {WHITE-SPACE: normal; WIDTH: auto; TEXT-ALIGN: center}
 TABLE#forumperms .atcl {TEXT-ALIGN: left; WIDTH: 15em; WHITE-SPACE: nowrap}
 #adminconsole TD.nodefault {BACKGROUND-COLOR: #D59B9B}
 
-/*** User/Ban Search Result Tables ***/
-#users2 TH, #bans1 TH {TEXT-ALIGN: left}
-#users2 TH.tcmod {TEXT-ALIGN: center}
-#users2 .tcl, #bans1 .tcl {WIDTH: auto; TEXT-ALIGN: left; PADDING: 4px 6px}
-#users2 .tc2, #bans1 .tc2 {WIDTH: 18%; TEXT-ALIGN: left; PADDING: 4px 6px}
-#users2 .tc3, #users2 .tc5, #bans1 .tc3, #bans1 .tc5, #bans1 .tc6 {WIDTH: 12%; TEXT-ALIGN: left; PADDING: 4px 6px}
-#users2 .tc4, #bans1 .tc4 {WIDTH: 10%; TEXT-ALIGN: center}
-#users2 .tcr {WIDTH: 20%; WHITE-SPACE: nowrap}
-#bans1 .tcr {WIDTH: 15%; WHITE-SPACE: nowrap}
-#users2 .tcmod {WIDTH: 10%; TEXT-ALIGN: center}
+/*** User Search Result Tables ***/
+#users2 TH, #users2 TH {TEXT-ALIGN: left}
+#users2 .tcl, #users2 .tc3, #users2 .tc5 {WIDTH: 15%; TEXT-ALIGN: left}
+#users2 .tc2 {WIDTH: 22%; TEXT-ALIGN: left}
+#users2 .tc4 {WIDTH: 8%}
+#users2 .tc4 {TEXT-ALIGN: center}
+#users2 .tcr {WHITE-SPACE: nowrap}
 #adminconsole #linkst, #adminconsole #linksb A {FONT-WEIGHT: bold}
 
 /*** Plugins ***/
-.plugin .inbox {PADDING-BOTTOM: 10px}
-.plugin p {PADDING: 10px 10px 0}
+#exampleplugin .inbox {PADDING: 6px 6px 0px 6px}
Index: /trunk/web/punbb/style/imports/index.html
===================================================================
--- /trunk/web/punbb/style/imports/index.html	(revision 10)
+++ /trunk/web/punbb/style/imports/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/style/index.html
===================================================================
--- /trunk/web/punbb/style/index.html	(revision 10)
+++ /trunk/web/punbb/style/index.html	(revision 1)
@@ -1,1 +1,8 @@
-<html><head><title>.</title></head><body>.</body></html>
+<html>
+<head>
+<title>.</title>
+</head>
+<body>
+.
+</body>
+</html>
Index: /trunk/web/punbb/userlist.php
===================================================================
--- /trunk/web/punbb/userlist.php	(revision 10)
+++ /trunk/web/punbb/userlist.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
+/***********************************************************************
 
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -13,6 +30,5 @@
 if ($pun_user['g_read_board'] == '0')
 	message($lang_common['No view']);
-else if ($pun_user['g_view_users'] == '0')
-	message($lang_common['No permission']);
+
 
 // Load the userlist.php language file
@@ -24,40 +40,17 @@
 
 // Determine if we are allowed to view post counts
-$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod']) ? true : false;
+$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;
 
-$username = isset($_GET['username']) && $pun_user['g_search_users'] == '1' ? pun_trim($_GET['username']) : '';
-$show_group = isset($_GET['show_group']) ? intval($_GET['show_group']) : -1;
-$sort_by = isset($_GET['sort_by']) && (in_array($_GET['sort_by'], array('username', 'registered')) || ($_GET['sort_by'] == 'num_posts' && $show_post_count)) ? $_GET['sort_by'] : 'username';
-$sort_dir = isset($_GET['sort_dir']) && $_GET['sort_dir'] == 'DESC' ? 'DESC' : 'ASC';
+$username = (isset($_GET['username']) && $pun_user['g_search_users'] == '1') ? $_GET['username'] : '';
+$show_group = (!isset($_GET['show_group']) || intval($_GET['show_group']) < -1 && intval($_GET['show_group']) > 2) ? -1 : intval($_GET['show_group']);
+$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
+$sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']);
 
-// Create any SQL for the WHERE clause
-$where_sql = array();
-$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
 
-if ($username != '')
-	$where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
-if ($show_group > -1)
-	$where_sql[] = 'u.group_id='.$show_group;
-
-// Fetch user count
-$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u WHERE u.id>1 AND u.group_id!='.PUN_UNVERIFIED.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
-$num_users = $db->result($result);
-
-// Determine the user offset (based on $_GET['p'])
-$num_pages = ceil($num_users / 50);
-
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-$start_from = 50 * ($p - 1);
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['User list']);
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list'];
 if ($pun_user['g_search_users'] == '1')
 	$focus_element = array('userlist', 'username');
 
-// Generate paging links
-$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&amp;show_group='.$show_group.'&amp;sort_by='.$sort_by.'&amp;sort_dir='.$sort_dir);
-
-
 define('PUN_ALLOW_INDEX', 1);
-define('PUN_ACTIVE_PAGE', 'userlist');
 require PUN_ROOT.'header.php';
 
@@ -66,54 +59,80 @@
 	<h2><span><?php echo $lang_search['User search'] ?></span></h2>
 	<div class="box">
-		<form id="userlist" method="get" action="userlist.php">
-			<div class="inform">
-				<fieldset>
-					<legend><?php echo $lang_ul['User find legend'] ?></legend>
-					<div class="infldset">
-<?php if ($pun_user['g_search_users'] == '1'): ?>						<label class="conl"><?php echo $lang_common['Username'] ?><br /><input type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
-<?php endif; ?>						<label class="conl"><?php echo $lang_ul['User group']."\n" ?>
-						<br /><select name="show_group">
-							<option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
+	<form id="userlist" method="get" action="userlist.php">
+		<div class="inform">
+			<fieldset>
+				<legend><?php echo $lang_ul['User find legend'] ?></legend>
+				<div class="infldset">
+<?php if ($pun_user['g_search_users'] == '1'): ?>					<label class="conl"><?php echo $lang_common['Username'] ?><br /><input type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
+<?php endif; ?>					<label class="conl"><?php echo $lang_ul['User group']."\n" ?>
+					<br /><select name="show_group">
+						<option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
 <?php
 
-$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Impossible de retrouver la liste des groupes utilisateurs', __FILE__, __LINE__, $db->error());
 
 while ($cur_group = $db->fetch_assoc($result))
 {
 	if ($cur_group['g_id'] == $show_group)
-		echo "\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+		echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
 	else
-		echo "\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
+		echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
 }
 
 ?>
-						</select>
-						<br /></label>
-						<label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
-						<br /><select name="sort_by">
-							<option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
-							<option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
-<?php if ($show_post_count): ?>							<option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
-<?php endif; ?>						</select>
-						<br /></label>
-						<label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
-						<br /><select name="sort_dir">
-							<option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
-							<option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
-						</select>
-						<br /></label>
-						<p class="clearb"><?php echo ($pun_user['g_search_users'] == '1' ? $lang_ul['User search info'].' ' : '').$lang_ul['User sort info']; ?></p>
-					</div>
-				</fieldset>
-			</div>
-			<p class="buttons"><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
-		</form>
+					</select>
+					<br /></label>
+					<label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
+					<br /><select name="sort_by">
+						<option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
+						<option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
+<?php if ($show_post_count): ?>						<option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
+<?php endif; ?>					</select>
+					<br /></label>
+					<label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
+					<br /><select name="sort_dir">
+						<option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
+						<option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
+					</select>
+					<br /></label>
+					<p class="clearb"><?php echo $lang_ul['User search info'] ?></p>
+				</div>
+			</fieldset>
+		</div>
+		<p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
+	</form>
 	</div>
 </div>
+<?php
 
+
+// Create any SQL for the WHERE clause
+$where_sql = array();
+$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
+
+if ($pun_user['g_search_users'] == '1' && $username != '')
+	$where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
+if ($show_group > -1)
+	$where_sql[] = 'u.group_id='.$show_group;
+
+// Fetch user count
+$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE u.id>1 AND '.implode(' AND ', $where_sql) : '')) or error('Impossible de retrouver le nombre total de membres', __FILE__, __LINE__, $db->error());
+$num_users = $db->result($result);
+
+
+// Determine the user offset (based on $_GET['p'])
+$num_pages = ceil($num_users / 50);
+
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$start_from = 50 * ($p - 1);
+
+// Generate paging links
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&amp;show_group='.$show_group.'&amp;sort_by='.$sort_by.'&amp;sort_dir='.strtoupper($sort_dir));
+
+
+?>
 <div class="linkst">
 	<div class="inbox">
 		<p class="pagelink"><?php echo $paging_links ?></p>
-		<div class="clearer"></div>
 	</div>
 </div>
@@ -123,28 +142,20 @@
 	<div class="box">
 		<div class="inbox">
-			<table cellspacing="0">
-			<thead>
-				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_common['Title'] ?></th>
-<?php if ($show_post_count): ?>					<th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
-<?php endif; ?>					<th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
-				</tr>
-			</thead>
-			<tbody>
+		<table cellspacing="0">
+		<thead>
+			<tr>
+				<th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
+				<th class="tc2" scope="col"><?php echo $lang_common['Title'] ?></th>
+<?php if ($show_post_count): ?>				<th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
+<?php endif; ?>				<th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
+			</tr>
+		</thead>
+		<tbody>
 <?php
 
-// Retrieve a list of user IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
-$result = $db->query('SELECT u.id FROM '.$db->prefix.'users AS u WHERE u.id>1 AND u.group_id!='.PUN_UNVERIFIED.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.', u.id ASC LIMIT '.$start_from.', 50') or error('Unable to fetch user IDs', __FILE__, __LINE__, $db->error());
-
+// Grab the users
+$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Impossible de retrouver la liste des membres', __FILE__, __LINE__, $db->error());
 if ($db->num_rows($result))
 {
-	$user_ids = array();
-	for ($i = 0;$cur_user_id = $db->result($result, $i);$i++)
-		$user_ids[] = $cur_user_id;
-
-	// Grab the users
-	$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id IN('.implode(',', $user_ids).') ORDER BY '.$sort_by.' '.$sort_dir.', u.id ASC') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
-
 	while ($user_data = $db->fetch_assoc($result))
 	{
@@ -155,5 +166,5 @@
 					<td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
 					<td class="tc2"><?php echo $user_title_field ?></td>
-<?php if ($show_post_count): ?>					<td class="tc3"><?php echo forum_number_format($user_data['num_posts']) ?></td>
+<?php if ($show_post_count): ?>					<td class="tc3"><?php echo $user_data['num_posts'] ?></td>
 <?php endif; ?>
 					<td class="tcr"><?php echo format_time($user_data['registered'], true) ?></td>
@@ -176,5 +187,4 @@
 	<div class="inbox">
 		<p class="pagelink"><?php echo $paging_links ?></p>
-		<div class="clearer"></div>
 	</div>
 </div>
Index: /trunk/web/punbb/viewforum.php
===================================================================
--- /trunk/web/punbb/viewforum.php	(revision 10)
+++ /trunk/web/punbb/viewforum.php	(revision 1)
@@ -1,11 +1,28 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 
@@ -23,9 +40,5 @@
 
 // Fetch some info about the forum
-if (!$pun_user['is_guest'])
-	$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, s.user_id AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_subscriptions AS s ON (f.id=s.forum_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
-else
-	$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, 0 AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
-
+$result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Impossible de retrouver les informations du forum', __FILE__, __LINE__, $db->error());
 if (!$db->num_rows($result))
 	message($lang_common['Bad request']);
@@ -41,78 +54,37 @@
 
 // Sort out who the moderators are and if we are currently a moderator (or an admin)
-$mods_array = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
-$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
-
-switch ($cur_forum['sort_by'])
-{
-	case 0:
-		$sort_by = 'last_post DESC';
-		break;
-	case 1:
-		$sort_by = 'posted DESC';
-		break;
-	case 2:
-		$sort_by = 'subject ASC';
-		break;
-	default:
-		$sort_by = 'last_post DESC';
-		break;
-}
+$mods_array = array();
+if ($cur_forum['moderators'] != '')
+	$mods_array = unserialize($cur_forum['moderators']);
+
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
 
 // Can we or can we not post new topics?
 if (($cur_forum['post_topics'] == '' && $pun_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod)
-	$post_link = "\t\t\t".'<p class="postlink conr"><a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a></p>'."\n";
+	$post_link = "\t\t".'<p class="postlink conr"><a href="post.php?fid='.$id.'">'.$lang_forum['Post topic'].'</a></p>'."\n";
 else
 	$post_link = '';
 
-// Get topic/forum tracking data
-if (!$pun_user['is_guest'])
-	$tracked_topics = get_tracked_topics();
 
 // Determine the topic offset (based on $_GET['p'])
 $num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = $pun_user['disp_topics'] * ($p - 1);
 
 // Generate paging links
-$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'viewforum.php?id='.$id);
-
-if ($pun_config['o_feed_type'] == '1')
-	$page_head = array('feed' => '<link rel="alternate" type="application/rss+xml" href="extern.php?action=feed&amp;fid='.$id.'&amp;type=rss" title="'.$lang_common['RSS forum feed'].'" />');
-else if ($pun_config['o_feed_type'] == '2')
-	$page_head = array('feed' => '<link rel="alternate" type="application/atom+xml" href="extern.php?action=feed&amp;fid='.$id.'&amp;type=atom" title="'.$lang_common['Atom forum feed'].'" />');
-
-$forum_actions = array();
-
-if (!$pun_user['is_guest'])
-{
-	if ($pun_config['o_forum_subscriptions'] == '1')
-	{
-		if ($cur_forum['is_subscribed'])
-			$forum_actions[] = '<span>'.$lang_forum['Is subscribed'].' - </span><a href="misc.php?action=unsubscribe&amp;fid='.$id.'">'.$lang_forum['Unsubscribe'].'</a>';
-		else
-			$forum_actions[] = '<a href="misc.php?action=subscribe&amp;fid='.$id.'">'.$lang_forum['Subscribe'].'</a>';
-	}
-
-	$forum_actions[] = '<a href="misc.php?action=markforumread&amp;fid='.$id.'">'.$lang_common['Mark forum read'].'</a>';
-}
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_forum['forum_name']));
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id);
+
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_forum['forum_name']);
 define('PUN_ALLOW_INDEX', 1);
-define('PUN_ACTIVE_PAGE', 'index');
 require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $id ?>"><strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></a></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
 <?php echo $post_link ?>
-		</div>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
 		<div class="clearer"></div>
 	</div>
@@ -128,6 +100,6 @@
 					<th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
 					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
-<?php if ($pun_config['o_topic_views'] == '1'): ?>					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
-<?php endif; ?>					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
+					<th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
+					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
 				</tr>
 			</thead>
@@ -135,80 +107,71 @@
 <?php
 
-// Retrieve a list of topic IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
-$result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.$sort_by.', id DESC LIMIT '.$start_from.', '.$pun_user['disp_topics']) or error('Unable to fetch topic IDs', __FILE__, __LINE__, $db->error());
-
-// If there are topics in this forum
+// Fetch list of topics to display on this page
+if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
+{
+	// Without "the dot"
+	$sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+}
+else
+{
+	// With "the dot"
+	switch ($db_type)
+	{
+		case 'mysql':
+		case 'mysqli':
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+			break;
+
+		case 'sqlite':
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.id IN(SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'].') GROUP BY t.id ORDER BY t.sticky DESC, t.last_post DESC';
+			break;
+
+		default:
+			$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
+			break;
+
+	}
+}
+
+$result = $db->query($sql) or error('Impossible de retrouver la liste des discussions', __FILE__, __LINE__, $db->error());
+
+// If there are topics in this forum.
 if ($db->num_rows($result))
 {
-	$topic_ids = array();
-	for ($i = 0;$cur_topic_id = $db->result($result, $i);$i++)
-		$topic_ids[] = $cur_topic_id;
-
-	if (empty($topic_ids))
-		error('The topic table and forum table seem to be out of sync!', __FILE__, __LINE__);
-
-	// Fetch list of topics to display on this page
-	if ($pun_user['is_guest'] || $pun_config['o_show_dot'] == '0')
-	{
-		// Without "the dot"
-		$sql = 'SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topic_ids).') ORDER BY sticky DESC, '.$sort_by.', id DESC';
-	}
-	else
-	{
-		// With "the dot"
-		$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' WHERE t.id IN('.implode(',', $topic_ids).') GROUP BY t.id'.($db_type == 'pgsql' ? ', t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id' : '').' ORDER BY t.sticky DESC, t.'.$sort_by.', t.id DESC';
-	}
-
-	$result = $db->query($sql) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
-
-	$topic_count = 0;
 	while ($cur_topic = $db->fetch_assoc($result))
 	{
-		++$topic_count;
-		$status_text = array();
-		$item_status = ($topic_count % 2 == 0) ? 'roweven' : 'rowodd';
+		$icon_text = $lang_common['Normal icon'];
+		$item_status = '';
 		$icon_type = 'icon';
 
 		if ($cur_topic['moved_to'] == null)
-			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
-		else
-			$last_post = '- - -';
+			$last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
+		else
+			$last_post = '&#160;';
 
 		if ($pun_config['o_censoring'] == '1')
 			$cur_topic['subject'] = censor_words($cur_topic['subject']);
 
-		if ($cur_topic['sticky'] == '1')
-		{
-			$item_status .= ' isticky';
-			$status_text[] = '<span class="stickytext">'.$lang_forum['Sticky'].'</span>';
-		}
-
 		if ($cur_topic['moved_to'] != 0)
-		{
-			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
-			$item_status .= ' imoved';
-		}
+			$subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
 		else if ($cur_topic['closed'] == '0')
-			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-		else
-		{
-			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
-			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
-			$item_status .= ' iclosed';
-		}
-
-		if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$id]) || $tracked_topics['forums'][$id] < $cur_topic['last_post']) && $cur_topic['moved_to'] == null)
-		{
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+		else
+		{
+			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].'&#160;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
+			$icon_text = $lang_common['Closed icon'];
+			$item_status = 'iclosed';
+		}
+
+		if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && $cur_topic['moved_to'] == null)
+		{
+			$icon_text .= ' '.$lang_common['New icon'];
 			$item_status .= ' inew';
-			$icon_type = 'icon icon-new';
+			$icon_type = 'icon inew';
 			$subject = '<strong>'.$subject.'</strong>';
-			$subject_new_posts = '<span class="newtext">[ <a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]</span>';
+			$subject_new_posts = '<span class="newtext">[&#160;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&#160;]</span>';
 		}
 		else
 			$subject_new_posts = null;
-
-		// Insert the status text before the subject
-		$subject = implode(' ', $status_text).' '.$subject;
 
 		// Should we display the dot or not? :)
@@ -216,8 +179,14 @@
 		{
 			if ($cur_topic['has_posted'] == $pun_user['id'])
-			{
-				$subject = '<strong class="ipost">Â·&#160;</strong>'.$subject;
-				$item_status .= ' iposted';
-			}
+				$subject = '<strong>&middot;</strong>&#160;'.$subject;
+			else
+				$subject = '&#160;&#160;'.$subject;
+		}
+
+		if ($cur_topic['sticky'] == '1')
+		{
+			$subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
+			$item_status .= ' isticky';
+			$icon_text .= ' '.$lang_forum['Sticky'];
 		}
 
@@ -225,5 +194,5 @@
 
 		if ($num_pages_topic > 1)
-			$subject_multipage = '<span class="pagestext">[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]</span>';
+			$subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
 		else
 			$subject_multipage = null;
@@ -232,21 +201,21 @@
 		if (!empty($subject_new_posts) || !empty($subject_multipage))
 		{
-			$subject .= !empty($subject_new_posts) ? ' '.$subject_new_posts : '';
+			$subject .= '&#160; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
 			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
 		}
 
 ?>
-				<tr class="<?php echo $item_status ?>">
+				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
 					<td class="tcl">
-						<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($topic_count + $start_from) ?></div></div>
-						<div class="tclcon">
-							<div>
+						<div class="intd">
+							<div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
+							<div class="tclcon">
 								<?php echo $subject."\n" ?>
 							</div>
 						</div>
 					</td>
-					<td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? forum_number_format($cur_topic['num_replies']) : '-' ?></td>
-<?php if ($pun_config['o_topic_views'] == '1'): ?>					<td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? forum_number_format($cur_topic['num_views']) : '-' ?></td>
-<?php endif; ?>					<td class="tcr"><?php echo $last_post ?></td>
+					<td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : '&#160;' ?></td>
+					<td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : '&#160;' ?></td>
+					<td class="tcr"><?php echo $last_post ?></td>
 				</tr>
 <?php
@@ -256,16 +225,8 @@
 else
 {
-	$colspan = ($pun_config['o_topic_views'] == '1') ? 4 : 3;
-
-?>
-				<tr class="rowodd inone">
-					<td class="tcl" colspan="<?php echo $colspan ?>">
-						<div class="icon inone"><div class="nosize"><!-- --></div></div>
-						<div class="tclcon">
-							<div>
-								<strong><?php echo $lang_forum['Empty forum'] ?></strong>
-							</div>
-						</div>
-					</td>
+
+?>
+				<tr>
+					<td class="tcl" colspan="4"><?php echo $lang_forum['Empty forum'] ?></td>
 				</tr>
 <?php
@@ -281,14 +242,8 @@
 
 <div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
 <?php echo $post_link ?>
-		</div>
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $id ?>"><strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></a></li>
-		</ul>
-<?php echo (!empty($forum_actions) ? "\t\t".'<p class="subscribelink clearb">'.implode(' - ', $forum_actions).'</p>'."\n" : '') ?>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a>&#160;</li><li>&raquo;&#160;<?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul>
 		<div class="clearer"></div>
 	</div>
@@ -299,2 +254,3 @@
 $footer_style = 'viewforum';
 require PUN_ROOT.'footer.php';
+
Index: /trunk/web/punbb/viewtopic.php
===================================================================
--- /trunk/web/punbb/viewtopic.php	(revision 10)
+++ /trunk/web/punbb/viewtopic.php	(revision 1)
@@ -1,13 +1,29 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
-
-define('PUN_ROOT', dirname(__FILE__).'/');
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB 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 2 of the License,
+  or (at your option) any later version.
+
+  PunBB 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, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
+
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
-
 
 if ($pun_user['g_read_board'] == '0')
@@ -28,38 +44,36 @@
 if ($pid)
 {
-	$result = $db->query('SELECT topic_id, posted FROM '.$db->prefix.'posts WHERE id='.$pid) or error('Unable to fetch topic ID', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT topic_id FROM '.$db->prefix.'posts WHERE id='.$pid) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
 	if (!$db->num_rows($result))
 		message($lang_common['Bad request']);
 
-	list($id, $posted) = $db->fetch_row($result);
-
-	// Determine on what page the post is located (depending on $forum_user['disp_posts'])
-	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted<'.$posted) or error('Unable to count previous posts', __FILE__, __LINE__, $db->error());
-	$num_posts = $db->result($result) + 1;
-
-	$_GET['p'] = ceil($num_posts / $pun_user['disp_posts']);
+	$id = $db->result($result);
+
+	// Determine on what page the post is located (depending on $pun_user['disp_posts'])
+	$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY posted') or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	$num_posts = $db->num_rows($result);
+
+	for ($i = 0; $i < $num_posts; ++$i)
+	{
+		$cur_id = $db->result($result, $i);
+		if ($cur_id == $pid)
+			break;
+	}
+	++$i;	// we started at 0
+
+	$_GET['p'] = ceil($i / $pun_user['disp_posts']);
 }
 
 // If action=new, we redirect to the first new post (if any)
-else if ($action == 'new')
-{
-	if (!$pun_user['is_guest'])
-	{
-		// We need to check if this topic has been viewed recently by the user
-		$tracked_topics = get_tracked_topics();
-		$last_viewed = isset($tracked_topics['topics'][$id]) ? $tracked_topics['topics'][$id] : $pun_user['last_visit'];
-
-		$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted>'.$last_viewed) or error('Unable to fetch first new post info', __FILE__, __LINE__, $db->error());
-		$first_new_post_id = $db->result($result);
-
-		if ($first_new_post_id)
-		{
-			header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id);
-			exit;
-		}
-	}
-
-	// If there is no new post, we go to the last post
-	header('Location: viewtopic.php?id='.$id.'&action=last');
+else if ($action == 'new' && !$pun_user['is_guest'])
+{
+	$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted>'.$pun_user['last_visit']) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
+	$first_new_post_id = $db->result($result);
+
+	if ($first_new_post_id)
+		header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id);
+	else	// If there is no new post, we go to the last post
+		header('Location: viewtopic.php?id='.$id.'&action=last');
+
 	exit;
 }
@@ -68,5 +82,5 @@
 else if ($action == 'last')
 {
-	$result = $db->query('SELECT MAX(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id) or error('Unable to fetch last post info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT MAX(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id) or error('Impossible de retrouver les informations du message', __FILE__, __LINE__, $db->error());
 	$last_post_id = $db->result($result);
 
@@ -81,7 +95,7 @@
 // Fetch some info about the topic
 if (!$pun_user['is_guest'])
-	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());
 else
-	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
+	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Impossible de retrouver les informations de la discussion', __FILE__, __LINE__, $db->error());
 
 if (!$db->num_rows($result))
@@ -92,5 +106,5 @@
 // Sort out who the moderators are and if we are currently a moderator (or an admin)
 $mods_array = ($cur_topic['moderators'] != '') ? unserialize($cur_topic['moderators']) : array();
-$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
+$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
 
 // Can we or can we not post replies?
@@ -98,7 +112,7 @@
 {
 	if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1' || $is_admmod)
-		$post_link = "\t\t\t".'<p class="postlink conr"><a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a></p>'."\n";
+		$post_link = '<a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
 	else
-		$post_link = '';
+		$post_link = '&#160;';
 }
 else
@@ -108,15 +122,4 @@
 	if ($is_admmod)
 		$post_link .= ' / <a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';
-
-	$post_link = "\t\t\t".'<p class="postlink conr">'.$post_link.'</p>'."\n";
-}
-
-
-// Add/update this topic in our list of tracked topics
-if (!$pun_user['is_guest'])
-{
-	$tracked_topics = get_tracked_topics();
-	$tracked_topics['topics'][$id] = time();
-	set_tracked_topics($tracked_topics);
 }
 
@@ -125,9 +128,9 @@
 $num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
+$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = $pun_user['disp_posts'] * ($p - 1);
 
 // Generate paging links
-$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'viewtopic.php?id='.$id);
+$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewtopic.php?id='.$id);
 
 
@@ -138,53 +141,33 @@
 $quickpost = false;
 if ($pun_config['o_quickpost'] == '1' &&
+	!$pun_user['is_guest'] &&
 	($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) &&
 	($cur_topic['closed'] == '0' || $is_admmod))
 {
-	// Load the post.php language file
-	require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
-
 	$required_fields = array('req_message' => $lang_common['Message']);
-	if ($pun_user['is_guest'])
-	{
-		$required_fields['req_username'] = $lang_post['Guest name'];
-		if ($pun_config['p_force_guest_email'] == '1')
-			$required_fields['req_email'] = $lang_common['Email'];
-	}
 	$quickpost = true;
 }
 
-if (!$pun_user['is_guest'] && $pun_config['o_topic_subscriptions'] == '1')
+if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == '1')
 {
 	if ($cur_topic['is_subscribed'])
 		// I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
-		$subscraction = "\t\t".'<p class="subscribelink clearb"><span>'.$lang_topic['Is subscribed'].' - </span><a href="misc.php?action=unsubscribe&amp;tid='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n";
+		$subscraction = '<p class="subscribelink clearb">'.$lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n";
 	else
-		$subscraction = "\t\t".'<p class="subscribelink clearb"><a href="misc.php?action=subscribe&amp;tid='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n";
+		$subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n";
 }
 else
-	$subscraction = '';
-
-if ($pun_config['o_feed_type'] == '1')
-	$page_head = array('feed' => '<link rel="alternate" type="application/rss+xml" href="extern.php?action=feed&amp;tid='.$id.'&amp;type=rss" title="'.$lang_common['RSS topic feed'].'" />');
-else if ($pun_config['o_feed_type'] == '2')
-	$page_head = array('feed' => '<link rel="alternate" type="application/atom+xml" href="extern.php?action=feed&amp;tid='.$id.'&amp;type=atom" title="'.$lang_common['Atom topic feed'].'" />');
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), pun_htmlspecialchars($cur_topic['subject']));
+	$subscraction = '<div class="clearer"></div>'."\n";
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title'].' / '.$cur_topic['subject']);
 define('PUN_ALLOW_INDEX', 1);
-define('PUN_ACTIVE_PAGE', 'index');
 require PUN_ROOT.'header.php';
 
 ?>
 <div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $id ?>"><strong><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></strong></a></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-<?php echo $post_link ?>
-		</div>
+	<div class="inbox">
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<p class="postlink conr"><?php echo $post_link ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
 		<div class="clearer"></div>
 	</div>
@@ -196,18 +179,9 @@
 require PUN_ROOT.'include/parser.php';
 
-$post_count = 0; // Keep track of post numbers
-
-// Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
-$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY id LIMIT '.$start_from.','.$pun_user['disp_posts']) or error('Unable to fetch post IDs', __FILE__, __LINE__, $db->error());
-
-$post_ids = array();
-for ($i = 0;$cur_post_id = $db->result($result, $i);$i++)
-	$post_ids[] = $cur_post_id;
-
-if (empty($post_ids))
-	error('The post table and topic table seem to be out of sync!', __FILE__, __LINE__);
+$bg_switch = true;	// Used for switching background color in posts
+$post_count = 0;	// Keep track of post numbers
 
 // Retrieve the posts (and their respective poster/online status)
-$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.id IN ('.implode(',', $post_ids).') ORDER BY p.id', true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 while ($cur_post = $db->fetch_assoc($result))
 {
@@ -220,12 +194,8 @@
 	$signature = '';
 
-	// If the poster is a registered user
+	// If the poster is a registered user.
 	if ($cur_post['poster_id'] > 1)
 	{
-		if ($pun_user['g_view_users'] == '1')
-			$username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';
-		else
-			$username = pun_htmlspecialchars($cur_post['username']);
-
+		$username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';
 		$user_title = get_title($cur_post);
 
@@ -234,13 +204,17 @@
 
 		// Format the online indicator
-		$is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : '<span>'.$lang_topic['Offline'].'</span>';
-
-		if ($pun_config['o_avatars'] == '1' && $pun_user['show_avatars'] != '0')
+		$is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : $lang_topic['Offline'];
+
+		if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
 		{
-			if (isset($user_avatar_cache[$cur_post['poster_id']]))
-				$user_avatar = $user_avatar_cache[$cur_post['poster_id']];
-			else
-				$user_avatar = $user_avatar_cache[$cur_post['poster_id']] = generate_avatar_markup($cur_post['poster_id']);
+			if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
+			else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
+				$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
 		}
+		else
+			$user_avatar = '';
 
 		// We only show location, register date, post count and the contact links if "Show user info" is enabled
@@ -252,33 +226,28 @@
 					$cur_post['location'] = censor_words($cur_post['location']);
 
-				$user_info[] = '<dd><span>'.$lang_topic['From'].' '.pun_htmlspecialchars($cur_post['location']).'</span></dd>';
+				$user_info[] = '<dd>'.$lang_topic['From'].': '.pun_htmlspecialchars($cur_post['location']);
 			}
 
-			$user_info[] = '<dd><span>'.$lang_topic['Registered'].' '.format_time($cur_post['registered'], true).'</span></dd>';
-
-			if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod'])
-				$user_info[] = '<dd><span>'.$lang_topic['Posts'].' '.forum_number_format($cur_post['num_posts']).'</span></dd>';
-
-			// Now let's deal with the contact links (Email and URL)
-			if ((($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['is_admmod']) && $pun_user['g_send_email'] == '1')
-				$user_contacts[] = '<span class="email"><a href="mailto:'.$cur_post['email'].'">'.$lang_common['Email'].'</a></span>';
-			else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
-				$user_contacts[] = '<span class="email"><a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['Email'].'</a></span>';
+			$user_info[] = '<dd>'.$lang_common['Registered'].': '.date($pun_config['o_date_format'], $cur_post['registered']);
+
+			if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
+				$user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];
+
+			// Now let's deal with the contact links (E-mail and URL)
+			if (($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['g_id'] < PUN_GUEST)
+				$user_contacts[] = '<a href="mailto:'.$cur_post['email'].'">'.$lang_common['E-mail'].'</a>';
+			else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'])
+				$user_contacts[] = '<a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['E-mail'].'</a>';
 
 			if ($cur_post['url'] != '')
-			{
-				if ($pun_config['o_censoring'] == '1')
-					$cur_post['url'] = censor_words($cur_post['url']);
-
-				$user_contacts[] = '<span class="website"><a href="'.pun_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a></span>';
-			}
+				$user_contacts[] = '<a href="'.pun_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a>';
 		}
 
-		if ($pun_user['is_admmod'])
+		if ($pun_user['g_id'] < PUN_GUEST)
 		{
-			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.$cur_post['poster_ip'].'">'.$lang_topic['IP address logged'].'</a></span></dd>';
+			$user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
 
 			if ($cur_post['admin_note'] != '')
-				$user_info[] = '<dd><span>'.$lang_topic['Note'].' <strong>'.pun_htmlspecialchars($cur_post['admin_note']).'</strong></span></dd>';
+				$user_info[] = '<dd>'.$lang_topic['Note'].': <strong>'.pun_htmlspecialchars($cur_post['admin_note']).'</strong>';
 		}
 	}
@@ -289,9 +258,9 @@
 		$user_title = get_title($cur_post);
 
-		if ($pun_user['is_admmod'])
-			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.$cur_post['poster_ip'].'">'.$lang_topic['IP address logged'].'</a></span></dd>';
-
-		if ($pun_config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
-			$user_contacts[] = '<span class="email"><a href="mailto:'.$cur_post['poster_email'].'">'.$lang_common['Email'].'</a></span>';
+		if ($pun_user['g_id'] < PUN_GUEST)
+			$user_info[] = '<dd>IP: <a href="moderate.php?get_host='.$cur_post['id'].'">'.$cur_post['poster_ip'].'</a>';
+
+		if ($pun_config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$pun_user['is_guest'])
+			$user_contacts[] = '<a href="mailto:'.$cur_post['poster_email'].'">'.$lang_common['E-mail'].'</a>';
 	}
 
@@ -300,5 +269,5 @@
 	{
 		if (!$pun_user['is_guest'])
-			$post_actions[] = '<li class="postreport"><span><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a></span></li>';
+			$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';
 
 		if ($cur_topic['closed'] == '0')
@@ -307,26 +276,42 @@
 			{
 				if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1'))
-					$post_actions[] = '<li class="postdelete"><span><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a></span></li>';
+					$post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>';
 				if ($pun_user['g_edit_posts'] == '1')
-					$post_actions[] = '<li class="postedit"><span><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a></span></li>';
+					$post_actions[] = '<li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>';
 			}
 
 			if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1')
-				$post_actions[] = '<li class="postquote"><span><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a></span></li>';
+				$post_actions[] = '<li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
 		}
 	}
 	else
-	{
-		$post_actions[] = '<li class="postreport"><span><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a></span></li>';
-		$post_actions[] = '<li class="postdelete"><span><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a></span></li>';
-		$post_actions[] = '<li class="postedit"><span><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a></span></li>';
-		$post_actions[] = '<li class="postquote"><span><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a></span></li>';
-	}
+		$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';
+
+
+	// Switch the background color for every message.
+	$bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
+	$vtbg = ($bg_switch) ? ' roweven' : ' rowodd';
+
 
 	// Perform the main parsing of the message (BBCode, smilies, censor words etc)
-	$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
+
+// ----------------------------------------------------
+// ajout dj3c1t 01/2008
+//
+// pour pouvoir poster des players dans les ÃÂ©ditos et les news, on autorise le code html
+// lorsque c'est la team RSR qui poste.
+//
+
+	if($cur_post['g_id'] == 1)
+        { $cur_post['message'] = str_replace
+          ( array("&gt;", "&lt;", "&quot;"),
+            array(">", "<", "\""),
+            parse_message($cur_post['message'], $cur_post['hide_smilies'])
+          );
+        }
+        else $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
 
 	// Do signature parsing/caching
-	if ($pun_config['o_signatures'] == '1' && $cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
+	if ($cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
 	{
 		if (isset($signature_cache[$cur_post['poster_id']]))
@@ -340,33 +325,28 @@
 
 ?>
-<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?><?php if ($cur_post['id'] == $cur_topic['first_post_id']) echo ' firstpost'; ?><?php if ($post_count == 1) echo ' blockpost1'; ?>">
-	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
+<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo $vtbg ?><?php if (($post_count + $start_from) == 1) echo ' firstpost'; ?>">
+	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?>&#160;</span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
 	<div class="box">
 		<div class="inbox">
-			<div class="postbody">
-				<div class="postleft">
-					<dl>
-						<dt><strong><?php echo $username ?></strong></dt>
-						<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
-<?php if ($user_avatar != '') echo "\t\t\t\t\t\t".'<dd class="postavatar">'.$user_avatar.'</dd>'."\n"; ?>
-<?php if (count($user_info)) echo "\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $user_info)."\n"; ?>
-<?php if (count($user_contacts)) echo "\t\t\t\t\t\t".'<dd class="usercontacts">'.implode(' ', $user_contacts).'</dd>'."\n"; ?>
-					</dl>
+			<div class="postleft">
+				<dl>
+					<dt><strong><?php echo $username ?></strong></dt>
+					<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
+					<dd class="postavatar"><?php echo $user_avatar ?></dd>
+<?php if (count($user_info)) echo "\t\t\t\t\t".implode('</dd>'."\n\t\t\t\t\t", $user_info).'</dd>'."\n"; ?>
+<?php if (count($user_contacts)) echo "\t\t\t\t\t".'<dd class="usercontacts">'.implode('&#160;&#160;', $user_contacts).'</dd>'."\n"; ?>
+				</dl>
+			</div>
+			<div class="postright">
+				<h3><?php if (($post_count + $start_from) > 1) echo ' Re: '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>
+				<div class="postmsg">
+					<?php echo $cur_post['message']."\n" ?>
+<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
 				</div>
-				<div class="postright">
-					<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>
-					<div class="postmsg">
-						<?php echo $cur_post['message']."\n" ?>
-<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
-					</div>
-<?php if ($signature != '') echo "\t\t\t\t\t".'<div class="postsignature postmsg"><hr />'.$signature.'</div>'."\n"; ?>
-				</div>
+<?php if ($signature != '') echo "\t\t\t\t".'<div class="postsignature"><hr />'.$signature.'</div>'."\n"; ?>
 			</div>
-		</div>
-		<div class="inbox">
-			<div class="postfoot clearb">
-				<div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div>
-<?php if (count($post_actions)) echo "\t\t\t\t".'<div class="postfootright">'."\n\t\t\t\t\t".'<ul>'."\n\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $post_actions)."\n\t\t\t\t\t".'</ul>'."\n\t\t\t\t".'</div>'."\n" ?>
-			</div>
+			<div class="clearer"></div>
+			<div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div>
+			<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($lang_topic['Link separator'].'</li>', $post_actions).'</li></ul></div>'."\n" : '<div>&#160;</div></div>'."\n" ?>
 		</div>
 	</div>
@@ -379,16 +359,9 @@
 ?>
 <div class="postlinksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink conl"><?php echo $paging_links ?></p>
-<?php echo $post_link ?>
-		</div>
-		<ul class="crumbs">
-			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
-			<li><span>Â»&#160;</span><a href="viewtopic.php?id=<?php echo $id ?>"><strong><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></strong></a></li>
-		</ul>
-<?php echo $subscraction ?>
-		<div class="clearer"></div>
+	<div class="inbox">
+		<p class="postlink conr"><?php echo $post_link ?></p>
+		<p class="pagelink conl"><?php echo $paging_links ?></p>
+		<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li>&#160;&raquo;&#160;<a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li>&#160;&raquo;&#160;<?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul>
+		<?php echo $subscraction ?>
 	</div>
 </div>
@@ -400,11 +373,10 @@
 {
 
-$cur_index = 1;
-
 ?>
-<div id="quickpost" class="blockform">
+<div class="blockform">
 	<h2><span><?php echo $lang_topic['Quick post'] ?></span></h2>
 	<div class="box">
-		<form id="quickpostform" method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
+		<form id="post" method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
+
 			<div class="inform">
 				<fieldset>
@@ -412,35 +384,16 @@
 					<div class="infldset txtarea">
 						<input type="hidden" name="form_sent" value="1" />
-<?php if ($pun_config['o_topic_subscriptions'] == '1' && ($pun_user['auto_notify'] == '1' || $cur_topic['is_subscribed'])): ?>						<input type="hidden" name="subscribe" value="1" />
-<?php endif; ?>
-<?php
-
-if ($pun_user['is_guest'])
-{
-	$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['Email'].' <span>'.$lang_common['Required'].'</span></strong>' : $lang_common['Email'];
-	$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';
-
-?>
-						<label class="conl required"><strong><?php echo $lang_post['Guest name'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="25" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
-						<label class="conl<?php echo ($pun_config['p_force_guest_email'] == '1') ? ' required' : '' ?>"><?php echo $email_label ?><br /><input type="text" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="50" maxlength="80" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
-						<div class="clearer"></div>
-<?php
-
-	echo "\t\t\t\t\t\t".'<label class="required"><strong>'.$lang_common['Message'].' <span>'.$lang_common['Required'].'</span></strong><br />';
-}
-else
-	echo "\t\t\t\t\t\t".'<label>';
-
-?>
-<textarea name="req_message" rows="7" cols="75" tabindex="<?php echo $cur_index++ ?>"></textarea></label>
+						<input type="hidden" name="form_user" value="<?php echo (!$pun_user['is_guest']) ? pun_htmlspecialchars($pun_user['username']) : 'Guest'; ?>" />
+						<?php require PUN_ROOT.'mod_easy_bbcode.php'; ?>
+						<label><textarea name="req_message" rows="7" cols="75" tabindex="1"></textarea></label>
 						<ul class="bblinks">
-							<li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
-							<li><span><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
+							<li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
+							<li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
 						</ul>
 					</div>
 				</fieldset>
 			</div>
-			<p class="buttons"><input type="submit" name="submit" tabindex="<?php echo $cur_index++ ?>" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /> <input type="submit" name="preview" value="<?php echo $lang_topic['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /></p>
+			<p><input type="submit" name="submit" tabindex="2" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
 		</form>
 	</div>
@@ -451,6 +404,6 @@
 
 // Increment "num_views" for topic
-if ($pun_config['o_topic_views'] == '1')
-	$db->query('UPDATE '.$db->prefix.'topics SET num_views=num_views+1 WHERE id='.$id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());
+$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
+$db->query('UPDATE '.$low_prio.$db->prefix.'topics SET num_views=num_views+1 WHERE id='.$id) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
 
 $forum_id = $cur_topic['forum_id'];
