#LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass docbook-book \begin_preamble \end_preamble \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Title PHP-Nuke: Management and Programming \layout SGML \layout SGML \layout SGML Chris Karakas \layout SGML \layout SGML www.karakas—online.de \layout SGML \layout SGML \layout SGML \layout SGML Claudio Erba \layout SGML \layout SGML www.spaghettibrain.com \layout SGML \layout SGML \layout SGML \layout SGML Conversion from LyX to DocBook SGML, Index, document generation, PHP-Nuke module, see Credits \layout SGML Chris Karakas \layout SGML \layout SGML www.karakas—online.de \layout SGML \layout SGML \layout SGML \layout SGML Translation from italian (v.1.0) and translation project coordination, see Credits \layout SGML Andre Purfield \layout SGML \layout SGML oss.cs—consultants.com \layout SGML \layout SGML \layout SGML \layout SGML Translation from italian (v.1.0), see Credits \layout SGML Fortunato Matarazzo \layout SGML \layout SGML \layout SGML Translation from italian (v.1.0), see Credits \layout SGML Chris Karakas \layout SGML \layout SGML www.karakas—online.de \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML PHP-Nuke \layout SGML programming \layout SGML management \layout SGML tutorial \layout SGML PHP \layout SGML MySQL \layout SGML Linux \layout SGML structure \layout SGML news \layout SGML content management system \layout SGML CMS \layout SGML UNIX \layout SGML nuke \layout SGML modules \layout SGML blocks \layout SGML topics \layout SGML themes \layout SGML architecture \layout SGML howto \layout SGML guide \layout SGML content \layout SGML download \layout SGML book \layout SGML installation \layout SGML permissions \layout SGML error \layout SGML sessions \layout SGML security \layout SGML caching \layout SGML optimization \layout SGML javascript \layout SGML googletap \layout SGML backup \layout SGML flash \layout SGML \layout Abstract \begin_inset Graphics FormatVersion 1 filename logo1.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \layout Abstract \begin_inset Graphics FormatVersion 1 filename logo2.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \layout Abstract There has always been the necessity to have a definitive guide on PHP-Nuke. This guide describes the installation and structure of PHP-Nuke and the details of customizing the front end to suit the users' needs. The architecture of PHP-Nuke, with its modules, blocks, topics and themes is presented in detail, as well as the interplay of PHP and MySQL for the creation of a mighty content management system (CMS).It also delves into more advanced issues, like the programming of PHP-Nuke blocks and modules, security, acceleration, and optimization. Day-to-day operations and miscellaneous topics are also covered. \layout SGML \layout SGML \layout SGML 2.1 \layout SGML \layout SGML 04.08.2005 \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML Security bugfix and maintainance release. Fixed typos, made some improvements, closed a security hole in the section on How to include a HTML file and its links (thanks to waraxe for this, see http://www.waraxe.us), closed the same security hole in the PHP-Nuke module version of this document, added code for keycaps, applications, acronyms and product names in the CSS and some enhancements in jadetex.cfg. \layout SGML \layout SGML \layout SGML \layout SGML 2.0 \layout SGML \layout SGML 16.02.2004 \layout SGML \layout SGML CK \layout SGML \layout SGML \layout SGML Added more than 400 pages of additional material. See Credits section for the exact details. \layout SGML \layout SGML \layout SGML \layout SGML 1.2.1 \layout SGML \layout SGML 22.08.2003 \layout SGML \layout SGML CK \layout SGML \layout SGML Now available as PHP-Nuke module too. Link to the module source in the Formats section. Smaller logo. \layout SGML \layout SGML \layout SGML \layout SGML 1.2 \layout SGML \layout SGML 29.05.2003 \layout SGML \layout SGML CK \layout SGML \layout SGML New logo, CSS stylesheet, HTML validation, footer icons. Incorporated LDP reviewer's comments. Created Aknowledgements and Availability of sources sections. \layout SGML \layout SGML \layout SGML \layout SGML 1.1 \layout SGML \layout SGML 13.02.2003 \layout SGML \layout SGML AP \layout SGML \layout SGML Cleaned up the wording and a few typos. \layout SGML \layout SGML \layout SGML \layout SGML 1.0 \layout SGML \layout SGML 09.01.2003 \layout SGML \layout SGML CK \layout SGML \layout SGML First complete version. \layout SGML \layout SGML \layout SGML \layout Chapter Terms of distribution \begin_inset LatexCommand \label{terms} \end_inset \layout Section Disclaimer \begin_inset LatexCommand \label{disclaimer} \end_inset \layout Standard No liability for the contents of this documents can be accepted. Use the concepts, \begin_inset LatexCommand \index{concepts} \end_inset examples and other content at your own risk. As this is a new edition of this document, there may be errors and inaccuracies , that may of course be damaging to your system. \begin_inset LatexCommand \index{system} \end_inset Proceed with caution, and although this is highly unlikely, the author does not take any responsibility for that. \layout Standard All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. \layout Standard Naming of particular products or brands should not be seen as endorsements. \layout Section Formats \begin_inset LatexCommand \label{formats} \end_inset \layout SGML \layout SGML \layout SGML Include the PHP-Nuke HOWTO as a module in your PHP-Nuke site! \layout SGML \layout SGML \layout SGML You can include the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset in your PHP-Nuke site as a module using either the method of \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module} \end_inset or the method of \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module-iframe} \end_inset ! \layout SGML \layout SGML \layout SGML To use the method of \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module} \end_inset , download the \begin_inset LatexCommand \url[PHP-Nuke module version of the PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/EN-Book-Nuke.tar.gz} \end_inset and install it according to the instruction in the accompanying INSTALL file. \layout SGML \layout SGML \layout SGML To use the method of \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module-iframe} \end_inset , just make a module with an index.php file exactly as in the example shown there. It will show the starting page of the PHP-HOWTO in an iframe ( \begin_inset LatexCommand \ref{fig-iframes} \end_inset ) and you will be able to navigate its pages without installing anything locally. You have Chris' explicit permission for this. \layout SGML ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout Standard This document is available in the following formats: \begin_inset LatexCommand \index{formats} \end_inset \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./book1.html} \end_inset , many HTML files (one for every section), for viewing with \begin_inset LatexCommand \url[any browser]{http://www.anybrowser.org/campaign/} \end_inset \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./EN-Book.html} \end_inset , one big HTML file \layout Itemize \begin_inset LatexCommand \url[PHP-Nuke Module]{http://www.karakas-online.de/EN-Book/EN-Book-Nuke.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[TXT (ASCII Text)]{./EN-Book.txt} \end_inset \layout Itemize \begin_inset LatexCommand \url[RTF (Rich Text Format)]{./EN-Book.rtf} \end_inset \layout Itemize \begin_inset LatexCommand \url[PDF (Portable Document Format)]{./EN-Book.pdf} \end_inset \layout Itemize \begin_inset LatexCommand \url[PS.GZ (Compressed Postscript)]{./EN-Book.ps.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[SGML (Standard Generalized Markup Language)]{./EN-Book.sgml} \end_inset , (with the \begin_inset LatexCommand \url[Appendix]{appendix.sgml} \end_inset ) \layout Itemize \begin_inset LatexCommand \url[LYX (LaTeX frontend LyX)]{./EN-Book.lyx} \end_inset , (with the \begin_inset LatexCommand \url[Appendix]{appendix.lyx} \end_inset ) \layout SGML \layout SGML RTF: Page numbers \layout SGML In order to get correct page numbers in Microsoft Word, type the following after opening the document: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML A \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML F9 \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In Word Viewer 97, you must instead do: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML N \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML P \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML See The OpenJade RTF backend for more details. \layout SGML \layout SGML \layout SGML IMPORTANT: Downloads for offline reading! \layout SGML \layout SGML If you want to download the HTML or RTF formats for offline reading, you will need to download the images as well - PNG for HTML and BMP for RTF, including the callouts! To save you the hassle, I have compiled the following zipped tar archives for offline reading: \layout SGML \layout SGML \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), many HTML files with images]{http://www.karakas-online.de/EN-Book/EN-Book-html.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), one big HTML file with images]{http://www.karakas-online.de/EN-Book/EN-Book-onehtml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), SGML file with images]{http://www.karakas-online.de/EN-Book/EN-Book-sgml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), RTF file with images]{http://www.karakas-online.de/EN-Book/EN-Book-rtf.tar.gz} \end_inset \layout Standard A tarball containing all the above formats, \begin_inset LatexCommand \index{formats} \end_inset including images, is also available: \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), All files]{http://www.karakas-online.de/EN-Book/EN-Book.tar.gz} \end_inset \layout Section Licence \begin_inset LatexCommand \label{licence} \end_inset \layout Standard Copyright © \begin_inset LatexCommand \index{copy} \end_inset version 1.0 2002 by \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset . Copyright © \begin_inset LatexCommand \index{copy} \end_inset version 2.0 2004 by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset and \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset . Copyright © \begin_inset LatexCommand \index{copy} \end_inset version 2.1 2005 by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset and \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset . Permission is granted to copy, \begin_inset LatexCommand \index{copy} \end_inset distribute and/or modify this document under the terms of the GNU Free Documentation License, \begin_inset LatexCommand \index{GNU Free Documentation License} \end_inset Version 1.2 or any later version published by the Free Software Foundation; \begin_inset LatexCommand \index{Free Software Foundation} \end_inset with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found in \begin_inset LatexCommand \ref{GNU-Free-Documenation-Licence} \end_inset , as well as at the \begin_inset LatexCommand \url[GNU Free Documentation License]{http://www.gnu.org/copyleft/fdl.html} \end_inset . \layout Standard Original version 1.0 by \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset , webmaster of \begin_inset LatexCommand \url[spaghettibrain]{www.spaghettibrain.com } \end_inset , PHP-Nuke italian Mirror, 2002. Second, revised and expanded, version 2.0 2004 by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset and \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset (see \begin_inset LatexCommand \ref{credits} \end_inset for details). Corrected 2.1 version 2005 by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset and \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset (see Revision History for details). \layout Standard This book, in all its versions (also those modified from third parties in italian, english or whichever other language), for will of the authors, may be reproduced also integrally without violating any law in asmuch as this book is released under the \begin_inset LatexCommand \url[GNU Free Documentation License]{http://www.gnu.org/copyleft/fdl.html} \end_inset , see \begin_inset LatexCommand \ref{GNU-Free-Documenation-Licence} \end_inset . \layout Standard This book: \layout Itemize May be modified partially or integrally creating manuals for companies, agencies or persons who deal with formatting, changing either the diagram \begin_inset LatexCommand \index{diagram} \end_inset or the contents or the pagination. \begin_inset LatexCommand \index{pagination} \end_inset \layout Itemize May be distributed either in its original or in modified form, or either in electronic or in paper format from either field periodicals or not, Internet sites and whichever other medium. \layout Itemize May be used as internal manual by companies, public or private agencies, or universities . \layout Itemize May be used distributed by universities as a hand-out. \begin_inset LatexCommand \index{hand-out} \end_inset \layout Itemize May even be resold without having to recognize any type of royalty to the authors on the condition that the purchasers be granted the freedom of making even integral copies, redistribute or resell them. \layout Section Availability of sources \begin_inset LatexCommand \label{availability-of-sources} \end_inset \layout Standard See \begin_inset LatexCommand \ref{formats} \end_inset for the modifiable sources of this document. These are the official versions. We (the authors, translators and current maintainers) plan to continue work on this document and add new chapters and enhancements. \begin_inset LatexCommand \index{enhancements} \end_inset If you want to see the version we are currently working on (the \begin_inset Quotes eld \end_inset bleeding edge \begin_inset Quotes erd \end_inset version), check \begin_inset LatexCommand \url[PHP-Nuke: Management and Programming]{http://www.karakas-online.de/EN-Book/} \end_inset from time to time. \layout Standard The modifiable sources of Claudio's text (in italian), the images and example files are available in sxi format (OpenOffice Impress) \begin_inset Foot collapsed false \layout Standard Openoffice is an office suite completely free which you can download from \begin_inset LatexCommand \url[OpenOffice]{http://www.openoffice.org} \end_inset . \end_inset on \begin_inset LatexCommand \url[Downloads Area PHPNuke BOOK - LIBRO on spaghettibrain]{http://www.spaghettibrain.com/modules.php?name=Archives&dcategory=PHPNuke+BOOK+-+LIBRO} \end_inset . \layout Section Credits \begin_inset LatexCommand \label{credits} \end_inset \layout Standard This section documents the efforts that have been invested into this document by its authors, contributors and the community. \begin_inset LatexCommand \index{community} \end_inset We tried hard to give credit where credit is due. However, this does not mean that we used only the sources mentioned explicitly here, in this section. Numerous other sources of information have been used, mainly Forums, such as: \layout Itemize \begin_inset LatexCommand \url[PHP-Nuke Forum]{http://www.karakas-online.de/forum/phpnuke.html} \end_inset of \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset . \layout Itemize \begin_inset LatexCommand \url[spaghettibrain]{http://www.spaghettibrain.com} \end_inset of \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset . \layout Itemize \begin_inset LatexCommand \url[nukeforums]{http://www.nukeforums.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[nukecops]{http://www.nukecops.com} \end_inset \layout Standard Whenever a source has been used, we have included a link to it. Thus, depending on the context, \begin_inset LatexCommand \index{context} \end_inset you should interpret the links in this document not only as a source of further information on a subject, \begin_inset LatexCommand \index{subject} \end_inset but also as Credit and a \begin_inset Quotes eld \end_inset Thank you \begin_inset Quotes erd \end_inset for the idea, the explanation, \begin_inset LatexCommand \index{explanation} \end_inset the discussion or the piece of code it offers. If you feel we have ovelooked something, please feel free to contact us. \layout Standard We do not offer a Bibliography, \begin_inset LatexCommand \index{Bibliography} \end_inset as strict academic criteria would require, but this may change in the future, as Chris is working on a \begin_inset LatexCommand \url[solution to the Bibliography problem]{http://www.karakas-online.de/mySGML/lyx-bibliography.html} \end_inset in the context of \begin_inset LatexCommand \url[LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset . \layout SGML \layout SGML How to enter hundreds of references in LyX \layout SGML \layout SGML If you look in the following \begin_inset LatexCommand \ref{credits-version-1.0} \end_inset , \begin_inset LatexCommand \ref{credits-versions-1.x} \end_inset and especially \begin_inset LatexCommand \ref{credits-version-2.0} \end_inset , you will notice the exceptionally large number of cross-references that had to be entered. Although a single cross-reference is inserted very easily in LyX (just choose Insert->Cross-reference from the menu, then choose the label of the reference you want), it becomes a real pain if you have to enter hundreds of them, as in our case. \layout SGML \layout SGML \layout SGML Chris' solution to this was to write a script that reads a LyX file and outputs another LyX file that contains references to all labels of the first one. It was easier to copy the references from the file thus created, paste them in \begin_inset LatexCommand \ref{credits-version-2.0} \end_inset (which deals with version 2.0), then delete references to parts that already existed in version 1.0, than try to insert references to all new parts of version 2.0 by using the menu. \layout SGML \layout SGML \layout SGML You can read about Chris' script in \begin_inset LatexCommand \url[Mass insertion of cross-references in LyX]{http://www.karakas-online.de/myLinuxTips/mass-insertion-of-cross-references-in-lyx.html} \end_inset . \layout SGML \layout SGML \layout Subsection Version 1.0 \begin_inset LatexCommand \label{credits-version-1.0} \end_inset \layout Standard This book started in version 1.0 as a document in italian language, written by \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset . It contained: \layout Itemize \begin_inset LatexCommand \ref{terms} \end_inset , consisting of \begin_inset LatexCommand \ref{disclaimer} \end_inset , \begin_inset LatexCommand \ref{formats} \end_inset , \begin_inset LatexCommand \ref{licence} \end_inset , \begin_inset LatexCommand \ref{availability-of-sources} \end_inset and \begin_inset LatexCommand \ref{aknowledgements} \end_inset . This was Chapter 1 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{introduction} \end_inset , consisting of \begin_inset LatexCommand \ref{purpose} \end_inset , \begin_inset LatexCommand \ref{whatis-phpnuke} \end_inset , \begin_inset LatexCommand \ref{history} \end_inset , \begin_inset LatexCommand \ref{communities} \end_inset , and \begin_inset LatexCommand \ref{whyphpnuke} \end_inset . This was Chapter 2 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{frontend} \end_inset , consisting of \begin_inset LatexCommand \ref{preinstalled-modules} \end_inset , a section on AvantGO, \begin_inset LatexCommand \index{AvantGO} \end_inset now removed, \begin_inset LatexCommand \ref{non-installed-modules} \end_inset and \begin_inset LatexCommand \ref{preinstalled-blocks} \end_inset . This was Chapter 3 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{backend} \end_inset , consisting of \begin_inset LatexCommand \ref{administration-functions} \end_inset and \begin_inset LatexCommand \ref{preferences} \end_inset . This was Chapter 4 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{installation} \end_inset consisting of \begin_inset LatexCommand \ref{installation-process} \end_inset , \begin_inset LatexCommand \ref{download} \end_inset , \begin_inset LatexCommand \ref{upload} \end_inset , \begin_inset LatexCommand \ref{permissions} \end_inset , \begin_inset LatexCommand \ref{phpmyadmin} \end_inset , \begin_inset LatexCommand \ref{whatis-phpmyadmin} \end_inset , \begin_inset LatexCommand \ref{install-db} \end_inset , \begin_inset LatexCommand \ref{config-php-file} \end_inset and \begin_inset LatexCommand \ref{resources} \end_inset . This was Chapter 5 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{architecture} \end_inset , consisting of \begin_inset LatexCommand \ref{directory-structure} \end_inset , \begin_inset LatexCommand \ref{main-page-management} \end_inset , \begin_inset LatexCommand \ref{module-management} \end_inset , and \begin_inset LatexCommand \ref{admin-management} \end_inset . This was Chapter 6 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{customization} \end_inset , consisting of \begin_inset LatexCommand \ref{topic-structure} \end_inset , \begin_inset LatexCommand \ref{template} \end_inset , \begin_inset LatexCommand \ref{example-creation-HTML-template} \end_inset and \begin_inset LatexCommand \ref{theme-rules} \end_inset . This was Chapter 7 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{blocks} \end_inset , consisting of \begin_inset LatexCommand \ref{block-types} \end_inset , \begin_inset LatexCommand \ref{block-creation} \end_inset , \begin_inset LatexCommand \ref{block-theory} \end_inset , \begin_inset LatexCommand \ref{block-practice} \end_inset . This was Chapter 8 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{creating-modules} \end_inset , consisting of \begin_inset LatexCommand \ref{creating-modules} \end_inset , \begin_inset LatexCommand \ref{module-structure} \end_inset , \begin_inset LatexCommand \ref{module-rules} \end_inset , \begin_inset LatexCommand \ref{module-public} \end_inset and \begin_inset LatexCommand \ref{module-admin} \end_inset . This was Chapter 9 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{security} \end_inset , consisting of \begin_inset LatexCommand \ref{permissions2} \end_inset , \begin_inset LatexCommand \ref{cookies} \end_inset and \begin_inset LatexCommand \ref{cookie-hijack} \end_inset . This was Chapter 10 of version 1.0. \layout Itemize \begin_inset LatexCommand \ref{tools} \end_inset , consisting of \begin_inset LatexCommand \ref{database-tables} \end_inset , \begin_inset LatexCommand \ref{sql-syntax} \end_inset , \begin_inset LatexCommand \ref{phpmyadmin2} \end_inset , \begin_inset LatexCommand \ref{whatis-phpmyadmin} \end_inset , \begin_inset LatexCommand \ref{install-phpMyAdmin} \end_inset , \begin_inset LatexCommand \ref{mysql-frontend} \end_inset and \begin_inset LatexCommand \ref{foxserv} \end_inset . This was Chapter 11 of version 1.0. \layout Standard Version 1.0 came with the following figures: \layout Itemize \begin_inset LatexCommand \ref{fig-homepage} \end_inset , \begin_inset LatexCommand \ref{fig-category} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-admin} \end_inset , \begin_inset LatexCommand \ref{fig-private-messages} \end_inset , \begin_inset LatexCommand \ref{fig-search} \end_inset , \begin_inset LatexCommand \ref{fig-stats} \end_inset , \begin_inset LatexCommand \ref{fig-your-account} \end_inset , \begin_inset LatexCommand \ref{fig-splatt-forum} \end_inset , \begin_inset LatexCommand \ref{fig-admin-panel} \end_inset , a screenshot of the News articles that has been removed, \begin_inset LatexCommand \ref{fig-file-structure} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-start} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-table-structure} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-sql-query} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-table-data} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-database-dump} \end_inset , \begin_inset LatexCommand \ref{fig-block-example} \end_inset , \begin_inset LatexCommand \ref{fig-inserting-values} \end_inset , \begin_inset LatexCommand \ref{fig-example-module} \end_inset , \begin_inset LatexCommand \ref{fig-forum_topics} \end_inset , \begin_inset LatexCommand \ref{fig-mysqlfront-connection} \end_inset , \begin_inset LatexCommand \ref{fig-mysqlfront-export-tables} \end_inset , \begin_inset LatexCommand \ref{fig-mysqlfront-SQL-query} \end_inset . \layout Standard Version 1.0 contained no tables. \begin_inset LatexCommand \index{tables} \end_inset \layout Standard Andre Purfield of \begin_inset LatexCommand \url[Open Source Solutions]{http://www.os-solutions.net} \end_inset started the translation project (see the \begin_inset LatexCommand \url[PHP-Nuke book translation thread]{http://www.nukeforums.com/forums/viewtopic.php?topic=11210&forum=23} \end_inset at nukeforums) and coordinated the work of the translators. \begin_inset LatexCommand \index{translators} \end_inset Fortunato Matarazzo made the transaltion of the version 1.0 Chapters 7, 8 and 9 (see above). \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset translated the rest. Andre imported Fortunato's part into LyX, \begin_inset LatexCommand \index{LyX} \end_inset remade many of the screenshots and also made corrections to the english text of the whole document. Chris imported his part in LyX, \begin_inset LatexCommand \index{LyX} \end_inset formatted the whole document, created the Index and processed the LyX file through his scripts (see \begin_inset LatexCommand \ref{book-behind-book} \end_inset , for details) to render all the versions and files available from \begin_inset LatexCommand \ref{formats} \end_inset . \layout Standard Chris also made PNG, \begin_inset LatexCommand \index{PNG} \end_inset PDF (encapsulated PDF), EPS (encapsulated Postscript) and BMP versions of all figures. The PDF and EPS versions are included in the PDF and PS versions of the document respectively. The PNG and BMP versions are used by the HTML and RTF versions of the document respectively and are supplied separately in the images folder. \layout Subsection Versions 1.x \begin_inset LatexCommand \label{credits-versions-1.x} \end_inset \layout Standard In the 1.x versions, various improvements have been made on the document, as can be seen in the Revision History in the front page: \layout Itemize Version 1.1: Andre Purfield of \begin_inset LatexCommand \url[Open Source Solutions]{http://www.os-solutions.net} \end_inset cleaned up the wording and a few typos. \layout Itemize Version 1.2: \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset made various improvements: \begin_deeper \layout Itemize Added a new logo. \begin_inset LatexCommand \index{logo} \end_inset \layout Itemize Added a \begin_inset LatexCommand \url[CSS stylesheet for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset . \layout Itemize Took care of HTML validation (all HTML pages now are validated as conforming to the HTML 4.01 Transitional standard \begin_inset Foot collapsed false \layout Standard all, that is, except those that contain \begin_inset LatexCommand \url[callouts]{http://www.karakas-online.de/mySGML/lyx-callouts.html} \end_inset , see \begin_inset LatexCommand \url[HTML validation]{http://www.karakas-online.de/mySGML/HTML-validation} \end_inset . \end_inset ). \layout Itemize Added footer icons that have the following property: if you click on them, they validate, \begin_inset LatexCommand \index{date} \end_inset depending on the icon, either the HTML code or the CSS code of the page being currently viewed. \layout Itemize Added translation links in the header and footer: \begin_inset LatexCommand \index{footer} \end_inset in the header of each page, you will find links to Google's automatic translati on of that page into 5 languages - french, \begin_inset LatexCommand \index{french} \end_inset german, italian, portuguese and spanish. In the footer of each page, on the other hand, you will find links to Alta Vista's automatic \begin_inset Quotes eld \end_inset Babelfish \begin_inset LatexCommand \index{Babelfish} \end_inset \begin_inset Quotes erd \end_inset translation of that page into 8 languages: chinese, german, japanese, korean, \begin_inset LatexCommand \index{korean} \end_inset french, \begin_inset LatexCommand \index{french} \end_inset italian, portuguese and spanish. \layout Itemize Incorporated LDP reviewer's comments. \begin_inset LatexCommand \index{comments} \end_inset \layout Itemize Created \begin_inset LatexCommand \ref{availability-of-sources} \end_inset and \begin_inset LatexCommand \ref{aknowledgements} \end_inset . \end_deeper \layout Itemize Version 1.2.1: Chris created the \begin_inset LatexCommand \url[PHP-Nuke HOWTO module for PHP-Nuke]{http://www.karakas-online.de/EN-Book/EN-Book-Nuke.tar.gz} \end_inset , a module that integrates this HOWTO into your PHP-Nuke site (you could install this module too, tip, tip!). Chris added a link to it in the Formats section ( \begin_inset LatexCommand \ref{formats} \end_inset ) and made a smaller logo. \begin_inset LatexCommand \index{logo} \end_inset \layout Standard Due to Chris' efforts, starting from version 1.2 this document is an official HOWTO of the \begin_inset LatexCommand \url[Linux Documentation Project]{http://www.tldp.org} \end_inset . \layout Standard Also, starting from PHP-Nuke version 6.7 FINAL, \begin_inset LatexCommand \index{FINAL} \end_inset this document is included in the docs folder of the standard PHP-Nuke package, as the official PHP-Nuke guide. \begin_inset LatexCommand \index{guide} \end_inset \layout SGML In all 1.x versions after 1.0, the original italian text has undergone no changes other than those related to translation. But behind the scenes, Chris and Claudio were working fervently for the next version 2.0, which was going to bring dramatic improvements, as you can read in \begin_inset LatexCommand \ref{credits-version-2.0} \end_inset . ]]> ]]> ]]> ]]> Inline graphic \layout Subsection Version 2.0 \begin_inset LatexCommand \label{credits-version-2.0} \end_inset \layout Standard In version 2.0, \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset added the following Chapters and Sections: \begin_inset LatexCommand \index{Sections} \end_inset \layout Itemize In \begin_inset LatexCommand \ref{terms} \end_inset : \begin_inset LatexCommand \ref{credits} \end_inset , \begin_inset LatexCommand \ref{credits-version-1.0} \end_inset , \begin_inset LatexCommand \ref{credits-versions-1.x} \end_inset , \begin_inset LatexCommand \ref{credits-version-2.0} \end_inset , \begin_inset LatexCommand \ref{credits-general} \end_inset , \begin_inset LatexCommand \ref{conventions} \end_inset , \begin_inset LatexCommand \ref{book-behind-book} \end_inset , \begin_inset LatexCommand \ref{general-idea} \end_inset , \begin_inset LatexCommand \ref{book-behind-book-line-of-attack} \end_inset and \begin_inset LatexCommand \ref{translate-php-nuke-howto} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{introduction} \end_inset : \begin_inset LatexCommand \ref{PHP-Nuke-forks} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-vs-Post-Nuke} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-vs-XOOPS} \end_inset and \begin_inset LatexCommand \ref{XOOPS-vs-Post-Nuke} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{installation} \end_inset : \begin_inset LatexCommand \ref{prerequisites} \end_inset , \begin_inset LatexCommand \ref{database-creation} \end_inset , \begin_inset LatexCommand \ref{install-PHP-Nuke-locally} \end_inset , \begin_inset LatexCommand \ref{XAMPP} \end_inset , \begin_inset LatexCommand \ref{Apache2Triad} \end_inset , \begin_inset LatexCommand \ref{more-than-one-php-nuke-sites} \end_inset , \begin_inset LatexCommand \ref{common-database} \end_inset , \begin_inset LatexCommand \ref{common-user-base} \end_inset , \begin_inset LatexCommand \ref{common-installation-problems} \end_inset , \begin_inset LatexCommand \ref{test-scripts} \end_inset , \begin_inset LatexCommand \ref{test-php} \end_inset , \begin_inset LatexCommand \ref{ConnectTest-php} \end_inset , \begin_inset LatexCommand \ref{analyze-php} \end_inset , \begin_inset LatexCommand \ref{Warning-mysql_fetch_row-supplied-argument} \end_inset , \begin_inset LatexCommand \ref{call-to-undefined-function} \end_inset , \begin_inset LatexCommand \ref{failed-opening-lang-php} \end_inset , \begin_inset LatexCommand \ref{failed-opening-sql-layer-php} \end_inset , \begin_inset LatexCommand \ref{sorry-such-file-doesnt-exist} \end_inset , \begin_inset LatexCommand \ref{warning-setlocale} \end_inset , \begin_inset LatexCommand \ref{security-code} \end_inset , \begin_inset LatexCommand \ref{bypass-security-code} \end_inset , \begin_inset LatexCommand \ref{warning-invalid-argument-supplied} \end_inset , \begin_inset LatexCommand \ref{Include-path} \end_inset , \begin_inset LatexCommand \ref{mail-problems} \end_inset , \begin_inset LatexCommand \ref{login-loop} \end_inset , \begin_inset LatexCommand \ref{SQL-syntax-error} \end_inset , \begin_inset LatexCommand \ref{error-update-private-forum-permissions} \end_inset , \begin_inset LatexCommand \ref{invalid-session-in-forums} \end_inset , \begin_inset LatexCommand \ref{cannot-create-administrator-account} \end_inset , \begin_inset LatexCommand \ref{administrator-password-lost} \end_inset , \begin_inset LatexCommand \ref{garbage-on-page} \end_inset , \begin_inset LatexCommand \ref{compressed-output-in-forums} \end_inset , \begin_inset LatexCommand \ref{cannot-add-header-information-in-forums} \end_inset , \begin_inset LatexCommand \ref{empty-page-in-windows} \end_inset , \begin_inset LatexCommand \ref{lots-of-Notice-lines} \end_inset , \begin_inset LatexCommand \ref{descriptive-error-message} \end_inset , \begin_inset LatexCommand \ref{common-miscellaneous-errors} \end_inset , \begin_inset LatexCommand \ref{RSS-block-error} \end_inset and \begin_inset LatexCommand \ref{MySQL-errno-145} \end_inset , \begin_inset LatexCommand \ref{modules-disappear} \end_inset , \begin_inset LatexCommand \ref{forums-cant-create-category-without-name} \end_inset and \begin_inset LatexCommand \ref{missing-blocks} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{upgrade-php-nuke} \end_inset : \begin_inset LatexCommand \ref{upgrade-php-nuke-60-65} \end_inset , \begin_inset LatexCommand \ref{upgrade-instructions-60-without-bbtonuke} \end_inset , \begin_inset LatexCommand \ref{upgrade-instructions-60-with-bbtonuke} \end_inset , \begin_inset LatexCommand \ref{upgrade-phpbb-php-nuke} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{move-php-nuke} \end_inset : \begin_inset LatexCommand \ref{transferring-local-installation-to-web} \end_inset and \begin_inset LatexCommand \ref{changing-web-hoster} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{php-nuke-add-ons} \end_inset : \begin_inset LatexCommand \ref{php-nuke-add-on-themes} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-AutoTheme} \end_inset , \begin_inset LatexCommand \ref{php-nuke-add-on-blocks} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Moon-Sun-block} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Meteosat-block} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-comic-block} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Menu-Builder} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Treemenu-with-PHP} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Treemenu-with-Javascript} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Google-AdSense-block} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Random-Quotes-block} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-add-on-modules} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Daily-Comic-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-event-calendar-module} \end_inset , \begin_inset LatexCommand \ref{NSN-Your-Account-Tweak-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Gallery-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-IP-Tracking-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Protector-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-WebCam-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-My-Headlines-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Tools-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Upload-module} \end_inset , \begin_inset LatexCommand \ref{Upload-add-on-for-phpBB} \end_inset , \begin_inset LatexCommand \ref{php-nuke-ODP-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-eCommerce-module} \end_inset and \begin_inset LatexCommand \ref{PHP-Nuke-WorkBoard-module} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{session-management} \end_inset : \begin_inset LatexCommand \ref{how-sessions-work} \end_inset and \begin_inset LatexCommand \ref{eliminate-session-checks} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset : \begin_inset LatexCommand \ref{vi} \end_inset , \begin_inset LatexCommand \ref{Emacs} \end_inset , \begin_inset LatexCommand \ref{Bluefish} \end_inset , \begin_inset LatexCommand \ref{UltraEdit} \end_inset , \begin_inset LatexCommand \ref{WinSyntax} \end_inset , \begin_inset LatexCommand \ref{HTMLKit} \end_inset , \begin_inset LatexCommand \ref{Crimson-Editor} \end_inset , \begin_inset LatexCommand \ref{PHPEd} \end_inset (FIXME: \begin_inset LatexCommand \index{FIXME} \end_inset Well, this may not be finished by the time version 2.0 is released, but the will to write it was certainly there! :-) ). \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-PHP-Nuke-database} \end_inset : \begin_inset LatexCommand \ref{user-extra-information} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-PHP-Nuke-texts} \end_inset : \begin_inset LatexCommand \ref{General-PHP-Nuke-texts} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-module-texts} \end_inset , and \begin_inset LatexCommand \ref{PHP-Nuke-module-and-block-titles} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{customization} \end_inset : \begin_inset LatexCommand \ref{php-nuke-theme-modifying-header} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-create-top-navigation-bar} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-insert-SlashOcean-search-box} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-change} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-change-logo} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-change-logo-dynamic} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-change-banner-placement} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-watermark-background-image} \end_inset , \begin_inset LatexCommand \ref{tab-body-tags} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-header-display-flash-object} \end_inset , \begin_inset LatexCommand \ref{hide-left-blocks} \end_inset , \begin_inset LatexCommand \ref{php-nuke-theme-modifying-body} \end_inset , \begin_inset LatexCommand \ref{multipage-news-articles} \end_inset , \begin_inset LatexCommand \ref{change-background-colour} \end_inset , \begin_inset LatexCommand \ref{php-nuke-theme-modifying-index} \end_inset , \begin_inset LatexCommand \ref{php-nuke-theme-modifying-footer} \end_inset , \begin_inset LatexCommand \ref{insert-right-extra-table} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-Copyright-notice} \end_inset , \begin_inset LatexCommand \ref{php-nuke-theme-modifying-icons} \end_inset , \begin_inset LatexCommand \ref{change-buggy-php-nuke-theme} \end_inset , \begin_inset LatexCommand \ref{prevent-users-from-changing-php-nuke-theme} \end_inset , \begin_inset LatexCommand \ref{change-php-nuke-theme-depending-on-module} \end_inset and \begin_inset LatexCommand \ref{change-font-size-php-nuke} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-php-nuke-html-header} \end_inset : \begin_inset LatexCommand \ref{favourites-icon-favicon-ico} \end_inset and \begin_inset LatexCommand \ref{prevent-statistics-module-gathering-hits} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-mainfile-php} \end_inset : \begin_inset LatexCommand \ref{allow-special-HTML-tags} \end_inset , \begin_inset LatexCommand \ref{change-order-of-messages} \end_inset and \begin_inset LatexCommand \ref{change-duration-of-public-broadcast-message} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-php-nuke-blocks} \end_inset : \begin_inset LatexCommand \ref{change-buggy-block} \end_inset , \begin_inset LatexCommand \ref{build-custom-module-blocks} \end_inset , \begin_inset LatexCommand \ref{fig-modules-block} \end_inset , \begin_inset LatexCommand \ref{simple-module-block} \end_inset , \begin_inset LatexCommand \ref{treemenu-block} \end_inset , \begin_inset LatexCommand \ref{fig-modules-block-2} \end_inset , \begin_inset LatexCommand \ref{general-idea} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu1} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu2} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu3} \end_inset , \begin_inset LatexCommand \ref{what-is-Treemenu} \end_inset , \begin_inset LatexCommand \ref{build-rss-blocks-with-variable-news-number} \end_inset and \begin_inset LatexCommand \ref{scrolling-headlines-in-blocks} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-php-nuke-modules} \end_inset : \begin_inset LatexCommand \ref{modifying-any-PHP-Nuke-module} \end_inset , \begin_inset LatexCommand \ref{hide-right-blocks} \end_inset , \begin_inset LatexCommand \ref{change-buggy-module} \end_inset , \begin_inset LatexCommand \ref{modifying-php-nuke-homepage} \end_inset , \begin_inset LatexCommand \ref{redirect-users-to-login-page} \end_inset , \begin_inset LatexCommand \ref{restrict-homepage-to-registered-users} \end_inset , \begin_inset LatexCommand \ref{modifying-php-nuke-module-faq} \end_inset , \begin_inset LatexCommand \ref{more-than-127-faq-answers} \end_inset , \begin_inset LatexCommand \ref{modifying-php-nuke-module-reviews} \end_inset , \begin_inset LatexCommand \ref{allow-only-registered-users-to-review} \end_inset , \begin_inset LatexCommand \ref{choose-images-from-dropdown-list} \end_inset , \begin_inset LatexCommand \ref{modifying-php-nuke-module-web-links} \end_inset , \begin_inset LatexCommand \ref{display-web-links-in-the-same-window} \end_inset , \begin_inset LatexCommand \ref{change-number-of-web-links-per-page} \end_inset , \begin_inset LatexCommand \ref{modifying-php-nuke-moduke-your-account} \end_inset , \begin_inset LatexCommand \ref{redirect-users-to-homepage} \end_inset , \begin_inset LatexCommand \ref{redirect-your-info-to-forums-user-profile} \end_inset , \begin_inset LatexCommand \ref{redirect-users-to-login-and-back} \end_inset , \begin_inset LatexCommand \ref{disable-registration} \end_inset , \begin_inset LatexCommand \ref{register-users-immediately} \end_inset , \begin_inset LatexCommand \ref{approve-users} \end_inset , \begin_inset LatexCommand \ref{register-users-through-iBill} \end_inset , \begin_inset LatexCommand \ref{change-maximum-username-length} \end_inset , \begin_inset LatexCommand \ref{modifying-PHP-Nuke-News-module} \end_inset , \begin_inset LatexCommand \ref{get-rid-of-br-in-news} \end_inset , \begin_inset LatexCommand \ref{modifying-PHP-Nuke-submit-news-module} \end_inset , \begin_inset LatexCommand \ref{bypass-article-approval} \end_inset , \begin_inset LatexCommand \ref{formatAidHeader-function} \end_inset , \begin_inset LatexCommand \ref{modifying-PHP-Nuke-sections-module} \end_inset , \begin_inset LatexCommand \ref{order-articles-in-sections} \end_inset , \begin_inset LatexCommand \ref{modifying-PHP-Nuke-downloads-module} \end_inset , \begin_inset LatexCommand \ref{URLs-longer-than-100-characters} \end_inset , \begin_inset LatexCommand \ref{modifying-PHP-Nuke-stories-archive} \end_inset and \begin_inset LatexCommand \ref{order-articles-in-stories-archive} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{modifying-PHP-Nuke-admin-panel} \end_inset : \begin_inset LatexCommand \ref{set-arbitrary-stories-number-in-home} \end_inset and \begin_inset LatexCommand \ref{allow-HTML-newsletter} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{blocks} \end_inset : \begin_inset LatexCommand \ref{Simple-Content-block} \end_inset , \begin_inset LatexCommand \ref{how-to-include-files} \end_inset , \begin_inset LatexCommand \ref{javascript-in-php-nuke-blocks} \end_inset , \begin_inset LatexCommand \ref{create-hello-world-block} \end_inset , \begin_inset LatexCommand \ref{create-fade-block} \end_inset , \begin_inset LatexCommand \ref{create-help-center-live-block} \end_inset , \begin_inset LatexCommand \ref{tab-Help-Center-Live-setcookie} \end_inset , \begin_inset LatexCommand \ref{advertisements-in-php-nuke-blocks} \end_inset , \begin_inset LatexCommand \ref{display-images-php-nuke-blocks} \end_inset , \begin_inset LatexCommand \ref{display-random-images-php-nuke-blocks} \end_inset , \begin_inset LatexCommand \ref{paypal-block-for-php-nuke} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{creating-modules} \end_inset : \begin_inset LatexCommand \ref{include-HTML-file-in-module} \end_inset , \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module} \end_inset , \begin_inset LatexCommand \ref{tab-changing-HTML-links} \end_inset , \begin_inset LatexCommand \ref{tab-changing-HTML-links-2} \end_inset , \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module-iframe} \end_inset , \begin_inset LatexCommand \ref{include-plain-text-file-in-module} \end_inset , \begin_inset LatexCommand \ref{javascript-in-php-nuke-modules} \end_inset , \begin_inset LatexCommand \ref{javascript-php} \end_inset , \begin_inset LatexCommand \ref{javascript-in-php-nuke-modules-complete} \end_inset , \begin_inset LatexCommand \ref{create-logout-module} \end_inset , \begin_inset LatexCommand \ref{advertisements-in-php-nuke-modules} \end_inset , \begin_inset LatexCommand \ref{Google-AdSense-in-news-module} \end_inset , \begin_inset LatexCommand \ref{Google-AdSense-on-top-of-php-nuke-module} \end_inset , \begin_inset LatexCommand \ref{HTML-forms-in-module} \end_inset , \layout Itemize The whole \begin_inset LatexCommand \ref{duplicating-PHP-Nuke-modules} \end_inset : \begin_inset LatexCommand \ref{duplicating-PHP-Nuke-FAQ-module} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{security} \end_inset : \begin_inset LatexCommand \ref{how-secure-is-php-nuke} \end_inset , \begin_inset LatexCommand \ref{security-record-software-popularity} \end_inset , \begin_inset LatexCommand \ref{common-php-nuke-security-vulnerabilities} \end_inset , \begin_inset LatexCommand \ref{cross-site-scripting-with-php-nuke} \end_inset , \begin_inset LatexCommand \ref{SQL-injection-with-php-nuke} \end_inset , \begin_inset LatexCommand \ref{path-disclosure-with-php-nuke} \end_inset , \begin_inset LatexCommand \ref{cross-site-tracing-with-php-nuke} \end_inset , \begin_inset LatexCommand \ref{guard-security-vulnerabilities-in-php-nuke} \end_inset , \begin_inset LatexCommand \ref{security-fixes} \end_inset , \begin_inset LatexCommand \ref{security-measures} \end_inset , \begin_inset LatexCommand \ref{security-audit} \end_inset , \begin_inset LatexCommand \ref{permissions2} \end_inset (some changes), \begin_inset LatexCommand \ref{user-cookie-change-duration} \end_inset , \begin_inset LatexCommand \ref{ban-IP-addresses} \end_inset and \begin_inset LatexCommand \ref{hacked-now-what} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{accelerating-php-nuke} \end_inset : \begin_inset LatexCommand \ref{caching-php-nuke} \end_inset , \begin_inset LatexCommand \ref{jpcache} \end_inset , \begin_inset LatexCommand \ref{jpcache-installation} \end_inset , \begin_inset LatexCommand \ref{jpcache-configuration} \end_inset , \begin_inset LatexCommand \ref{jpcache-use} \end_inset , \begin_inset LatexCommand \ref{cache-lite} \end_inset , \begin_inset LatexCommand \ref{cache-lite-installation} \end_inset , \begin_inset LatexCommand \ref{cache-lite-use} \end_inset , \begin_inset LatexCommand \ref{Turck-MMCache} \end_inset , \begin_inset LatexCommand \ref{Turck-MMCache-installation} \end_inset , \begin_inset LatexCommand \ref{Turck-MMCache-installation} \end_inset , \begin_inset LatexCommand \ref{Turck-MMCache-use} \end_inset and \begin_inset LatexCommand \ref{Caching-PHP-Nuke-Conclusion} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{optimizing-php-nuke} \end_inset : \begin_inset LatexCommand \ref{search-engines-and-dynamic-URLs} \end_inset , \begin_inset LatexCommand \ref{search-engines-and-GET-method} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-API-phases} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-ruleset-processing} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-quoting-special-characters} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-regex-backreferences} \end_inset , \begin_inset LatexCommand \ref{regular-expressions} \end_inset , \begin_inset LatexCommand \ref{htaccess-file} \end_inset , \begin_inset LatexCommand \ref{make-php-nuke-search-engine-friendly} \end_inset , \begin_inset LatexCommand \ref{GoogleTap} \end_inset , \begin_inset LatexCommand \ref{GoogleTap-requirements} \end_inset , \begin_inset LatexCommand \ref{GoogleTap-installation} \end_inset , \begin_inset LatexCommand \ref{GoogleTap-how-it-works} \end_inset , \begin_inset LatexCommand \ref{tab-urlin-urlout} \end_inset , \begin_inset LatexCommand \ref{make-PHP-Nuke-hot-link-stealth} \end_inset and \begin_inset LatexCommand \ref{make-dynamic-CSS} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{solve-common-problems-php-nuke} \end_inset : \begin_inset LatexCommand \ref{proceed-when-MySQL-slow} \end_inset , \begin_inset LatexCommand \ref{repair-corrupt-table} \end_inset , \begin_inset LatexCommand \ref{find-all-registration-links} \end_inset , \begin_inset LatexCommand \ref{allow-anonymous-web-link-submissions} \end_inset and \begin_inset LatexCommand \ref{disable-DEBUG-mode} \end_inset . \layout Itemize The whole \begin_inset LatexCommand \ref{miscellaneous} \end_inset : \begin_inset LatexCommand \ref{change-Home-module} \end_inset , \begin_inset LatexCommand \ref{PHP-Nuke-under-SSL} \end_inset , \begin_inset LatexCommand \ref{change-PHP-parameters} \end_inset , \begin_inset LatexCommand \ref{display-html-code-in-faq} \end_inset , \begin_inset LatexCommand \ref{enter-thousands-of-web-links} \end_inset , \begin_inset LatexCommand \ref{enter-thousands-of-download-links} \end_inset , \begin_inset LatexCommand \ref{check-validity-of-web-links} \end_inset , \begin_inset LatexCommand \ref{enter-thousands-of-ephemerids} \end_inset , \begin_inset LatexCommand \ref{make-encyclopedia-international} \end_inset , \begin_inset LatexCommand \ref{find-user-name} \end_inset , \begin_inset LatexCommand \ref{correct-thousands-of-users-fields} \end_inset , \begin_inset LatexCommand \ref{date-time} \end_inset , \begin_inset LatexCommand \ref{find-last-date} \end_inset , \begin_inset LatexCommand \ref{adjust-server-time} \end_inset , \begin_inset LatexCommand \ref{Discordian-Calendar} \end_inset , \begin_inset LatexCommand \ref{deal-with-quotes-in-sitename} \end_inset , \begin_inset LatexCommand \ref{flash-php-nuke-news} \end_inset and \begin_inset LatexCommand \ref{backup-mysql-using-browser} \end_inset . \layout Standard In version 2.0, \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset added the following Chapters and Sections: \begin_inset LatexCommand \index{Sections} \end_inset \layout Itemize In \begin_inset LatexCommand \ref{installation} \end_inset : \begin_inset LatexCommand \ref{phpmyadmin2} \end_inset , \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-Structure} \end_inset , \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-SQL} \end_inset , \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-Export} \end_inset , \begin_inset LatexCommand \ref{phpMyAdmin-other-commands} \end_inset , \begin_inset LatexCommand \ref{install-PHP-Nuke-nukesql} \end_inset , \begin_inset LatexCommand \ref{easyPHP} \end_inset , \begin_inset LatexCommand \ref{easyPHP-check-successful-installation} \end_inset , \begin_inset LatexCommand \ref{Mandrake-Linux-Apache-PHP-MySQL} \end_inset and \begin_inset LatexCommand \ref{Red-Hat-Linux-Apache-PHP-MySQL} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{upgrade-php-nuke} \end_inset : The introductory text ( \begin_inset LatexCommand \ref{upgrade-php-nuke} \end_inset ) and \begin_inset LatexCommand \ref{PHP-Nuke-upgrade-scripts} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{frontend} \end_inset : A lot of additions and improvements in the whole chapter: \begin_inset LatexCommand \ref{preinstalled-modules} \end_inset , \begin_inset LatexCommand \ref{non-installed-modules} \end_inset , \begin_inset LatexCommand \ref{preinstalled-blocks} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{backend} \end_inset : A lot of additions and improvements in the whole chapter: \begin_inset LatexCommand \ref{administration-functions} \end_inset , \begin_inset LatexCommand \ref{phpBB-Forum-administration} \end_inset (which was added in this version) and \begin_inset LatexCommand \ref{preferences} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{architecture} \end_inset : Some changes in \begin_inset LatexCommand \ref{directory-structure} \end_inset and \begin_inset LatexCommand \ref{main-page-management} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{solve-common-problems-php-nuke} \end_inset : \begin_inset LatexCommand \ref{restore-PHP-Nuke-from-backup} \end_inset , \begin_inset LatexCommand \ref{restore-single-table} \end_inset , \begin_inset LatexCommand \ref{restore-large-backup} \end_inset , \begin_inset LatexCommand \ref{install-new-modules} \end_inset , \begin_inset LatexCommand \ref{install-modules-with-no-database-change} \end_inset , \begin_inset LatexCommand \ref{install-modules-with-database-change} \end_inset , \begin_inset LatexCommand \ref{install-modules-with-database-files-change} \end_inset and \begin_inset LatexCommand \ref{install-patches-correct-errors} \end_inset . \layout Itemize In \begin_inset LatexCommand \ref{tools} \end_inset : \begin_inset LatexCommand \ref{HTML-syntax} \end_inset , \begin_inset LatexCommand \ref{HTML-format-text} \end_inset , \begin_inset LatexCommand \ref{HTML-create-link} \end_inset , \begin_inset LatexCommand \ref{HTML-insert-image} \end_inset , \begin_inset LatexCommand \ref{HTML-create-table} \end_inset , \begin_inset LatexCommand \ref{CSS-syntax} \end_inset , \begin_inset LatexCommand \ref{PHP-syntax} \end_inset , \begin_inset LatexCommand \ref{PHP-variables} \end_inset , \begin_inset LatexCommand \ref{PHP-functions} \end_inset and \begin_inset LatexCommand \ref{PHP-switches} \end_inset . \layout SGML \layout SGML Note \layout SGML \layout SGML As you can see, almost all labels of version 1.0 have been preserved in version 2.0 too. More specifically, all labels that give rise to HTML files have been preserved in the LyX file. That's no coincidence: \begin_inset LatexCommand \url[Cool labels don't change!]{http://www.karakas-online.de/mySGML/cool-labels-dont-change.html} \end_inset \layout SGML \layout SGML \layout Standard Chris translated Claudio's additions from italian and inserted some additions and many cross-references. \begin_inset LatexCommand \index{cross-references} \end_inset On the other hand, some of Claudio's information has found its way in the sections added by Chris. \begin_inset LatexCommand \index{Chris} \end_inset \layout Standard We have added the GNU Free Documentation Licence in the \begin_inset LatexCommand \ref{GNU-Free-Documenation-Licence} \end_inset . \layout Standard The following figures have been added in version 2.0: \layout Itemize Chris added: \begin_inset LatexCommand \ref{fig-ws_ftp-chmod-1} \end_inset , \begin_inset LatexCommand \ref{fig-ws_ftp-chmod-2} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-mysql-connection} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-warning-mysql} \end_inset , \begin_inset LatexCommand \ref{fig-modules-admin-2} \end_inset , \begin_inset LatexCommand \ref{fig-security-code} \end_inset , \begin_inset LatexCommand \ref{fig-phpinfo-gd} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-gd} \end_inset , \begin_inset LatexCommand \ref{fig-login-screen} \end_inset , \begin_inset LatexCommand \ref{fig-forum-3} \end_inset , \begin_inset LatexCommand \ref{fig-forum-4} \end_inset , \begin_inset LatexCommand \ref{fig-edit-admins-2} \end_inset , \begin_inset LatexCommand \ref{fig-edit-admins-3} \end_inset , \begin_inset LatexCommand \ref{fig-forum-gzip-compression} \end_inset , \begin_inset LatexCommand \ref{fig-modules-4} \end_inset , \begin_inset LatexCommand \ref{fig-missing-blocks} \end_inset , \begin_inset LatexCommand \ref{fig-phpbb-forum} \end_inset , \begin_inset LatexCommand \ref{fig-modules-block-3} \end_inset , \begin_inset LatexCommand \ref{fig-waiting-content-block-2} \end_inset , \begin_inset LatexCommand \ref{fig-languages} \end_inset , \begin_inset LatexCommand \ref{fig-stories} \end_inset , \begin_inset LatexCommand \ref{fig-article-poll} \end_inset , \begin_inset LatexCommand \ref{fig-article-poll-block} \end_inset , \begin_inset LatexCommand \ref{fig-backup} \end_inset , \begin_inset LatexCommand \ref{fig-banners} \end_inset , \begin_inset LatexCommand \ref{fig-blocks} \end_inset , \begin_inset LatexCommand \ref{fig-content} \end_inset , \begin_inset LatexCommand \ref{fig-downloads} \end_inset , \begin_inset LatexCommand \ref{fig-edit-admins} \end_inset , \begin_inset LatexCommand \ref{fig-edit-users} \end_inset , \begin_inset LatexCommand \ref{fig-encyclopedia} \end_inset , \begin_inset LatexCommand \ref{fig-ephemerids} \end_inset , \begin_inset LatexCommand \ref{fig-faq} \end_inset , \begin_inset LatexCommand \ref{fig-forum} \end_inset , \begin_inset LatexCommand \ref{fig-referers} \end_inset , \begin_inset LatexCommand \ref{fig-messages} \end_inset , \begin_inset LatexCommand \ref{fig-modules} \end_inset , \begin_inset LatexCommand \ref{fig-modules-admin} \end_inset , \begin_inset LatexCommand \ref{fig-newsletter} \end_inset , \begin_inset LatexCommand \ref{fig-optimize} \end_inset , \begin_inset LatexCommand \ref{fig-preferences} \end_inset , \begin_inset LatexCommand \ref{fig-reviews} \end_inset , \begin_inset LatexCommand \ref{fig-sections} \end_inset , \begin_inset LatexCommand \ref{fig-submissions} \end_inset , \begin_inset LatexCommand \ref{fig-surveys} \end_inset , \begin_inset LatexCommand \ref{fig-topics} \end_inset , \begin_inset LatexCommand \ref{fig-weblinks} \end_inset , \begin_inset LatexCommand \ref{fig-logout} \end_inset , \begin_inset LatexCommand \ref{fig-forum-2} \end_inset , \begin_inset LatexCommand \ref{fig-preferences-2} \end_inset , \begin_inset LatexCommand \ref{fig-general-site-info} \end_inset , \begin_inset LatexCommand \ref{fig-footer} \end_inset , \begin_inset LatexCommand \ref{fig-webmail-options} \end_inset , \begin_inset LatexCommand \ref{fig-moon-moonsun-sun} \end_inset , \begin_inset LatexCommand \ref{fig-meteosat} \end_inset , \begin_inset LatexCommand \ref{fig-my-menu} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu3-2} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu-js} \end_inset , \begin_inset LatexCommand \ref{fig-sommaire-parametrable} \end_inset , \begin_inset LatexCommand \ref{fig-Random-Quotes} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal1} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal2} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal3} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal4} \end_inset , \begin_inset LatexCommand \ref{fig-eventcal5} \end_inset , \begin_inset LatexCommand \ref{fig-your-account-tweak} \end_inset , \begin_inset LatexCommand \ref{fig-approve-membership-pending-applications} \end_inset , \begin_inset LatexCommand \ref{fig-approve-membership-approval-message} \end_inset , \begin_inset LatexCommand \ref{fig-approve-membership-email-management-1} \end_inset , \begin_inset LatexCommand \ref{fig-approve-membership-email-management-2} \end_inset , \begin_inset LatexCommand \ref{fig-gallery} \end_inset , \begin_inset LatexCommand \ref{fig-gallery-related-files} \end_inset , \begin_inset LatexCommand \ref{fig-ip-tracking} \end_inset , \begin_inset LatexCommand \ref{fig-ip-tracking-page-view-info} \end_inset , \begin_inset LatexCommand \ref{fig-camPortal-block} \end_inset , \begin_inset LatexCommand \ref{fig-camPortal} \end_inset , \begin_inset LatexCommand \ref{fig-conquercam} \end_inset , \begin_inset LatexCommand \ref{fig-myheadlines-box} \end_inset , \begin_inset LatexCommand \ref{fig-myheadlines-subscribe} \end_inset , \begin_inset LatexCommand \ref{fig-php-nuke-tools-block} \end_inset , \begin_inset LatexCommand \ref{fig-php-nuke-tools-module-creator} \end_inset , \begin_inset LatexCommand \ref{fig-upload} \end_inset , \begin_inset LatexCommand \ref{fig-odp} \end_inset , \begin_inset LatexCommand \ref{fig-calloways-cart-add-product} \end_inset , \begin_inset LatexCommand \ref{fig-workboard} \end_inset , \begin_inset LatexCommand \ref{fig-workboard-admin} \end_inset , \begin_inset LatexCommand \ref{fig-extra-info} \end_inset , \begin_inset LatexCommand \ref{fig-top-nav-bar} \end_inset , \begin_inset LatexCommand \ref{fig-posted-by} \end_inset , \begin_inset LatexCommand \ref{fig-messages-2} \end_inset , \begin_inset LatexCommand \ref{fig-modules-block} \end_inset , \begin_inset LatexCommand \ref{fig-modules-block-2} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu1} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu2} \end_inset , \begin_inset LatexCommand \ref{fig-treemenu3} \end_inset , \begin_inset LatexCommand \ref{fig-faq-3} \end_inset , \begin_inset LatexCommand \ref{fig-reviews-2} \end_inset , \begin_inset LatexCommand \ref{fig-weblinks-4} \end_inset , \begin_inset LatexCommand \ref{fig-your-info-profile-link} \end_inset , \begin_inset LatexCommand \ref{fig-forum-profile-link} \end_inset , \begin_inset LatexCommand \ref{fig-your-info-profile} \end_inset , \begin_inset LatexCommand \ref{fig-forum-profile} \end_inset , \begin_inset LatexCommand \ref{fig-stories-2} \end_inset , \begin_inset LatexCommand \ref{fig-submissions-2} \end_inset , \begin_inset LatexCommand \ref{fig-waiting-content-block} \end_inset , \begin_inset LatexCommand \ref{fig-sections-2} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-4} \end_inset , \begin_inset LatexCommand \ref{fig-stories-3} \end_inset , \begin_inset LatexCommand \ref{fig-admin-panel-2} \end_inset , \begin_inset LatexCommand \ref{fig-preferences-3} \end_inset , \begin_inset LatexCommand \ref{fig-newsletter-2} \end_inset , \begin_inset LatexCommand \ref{fig-blocks-2} \end_inset , \begin_inset LatexCommand \ref{fig-content-2} \end_inset , \begin_inset LatexCommand \ref{fig-hello-world-javascript} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-main} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-offline} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-trouble-ticket} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-online} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-request-monitor} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-user-notify} \end_inset , \begin_inset LatexCommand \ref{fig-help-center-live-block-user-request} \end_inset , \begin_inset LatexCommand \ref{fig-paypal1} \end_inset , \begin_inset LatexCommand \ref{fig-paypal2} \end_inset , \begin_inset LatexCommand \ref{fig-iframes} \end_inset , \begin_inset LatexCommand \ref{fig-logout-module} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-warning-php} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-warning-sitekey} \end_inset , \begin_inset LatexCommand \ref{fig-analyze-warning-webmail} \end_inset , \begin_inset LatexCommand \ref{fig-optimize-2} \end_inset , \begin_inset LatexCommand \ref{fig-optimize-php} \end_inset , \begin_inset LatexCommand \ref{fig-jpcache} \end_inset , \begin_inset LatexCommand \ref{fig-pear} \end_inset , \begin_inset LatexCommand \ref{fig-mmcache} \end_inset , \begin_inset LatexCommand \ref{fig-mod_rewrite-phpinfo} \end_inset , \begin_inset LatexCommand \ref{fig-mod_rewrite-control-flow} \end_inset , \begin_inset LatexCommand \ref{fig-mod_rewrite-back-reference} \end_inset , \begin_inset LatexCommand \ref{fig-regular-expressions} \end_inset , \begin_inset LatexCommand \ref{fig-backup-2} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-sql-query-2} \end_inset , \begin_inset LatexCommand \ref{fig-modules-3} \end_inset , \begin_inset LatexCommand \ref{fig-weblinks-5} \end_inset , \begin_inset LatexCommand \ref{fig-modules-2} \end_inset , \begin_inset LatexCommand \ref{fig-modules-admin-3} \end_inset , \begin_inset LatexCommand \ref{fig-faq-2} \end_inset , \begin_inset LatexCommand \ref{fig-weblinks-2} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-2} \end_inset , \begin_inset LatexCommand \ref{fig-weblinks-3} \end_inset , \begin_inset LatexCommand \ref{fig-ephemerids-2} \end_inset , \begin_inset LatexCommand \ref{fig-encyclopedia-2} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-3} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-add-download} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-add-download-2} \end_inset , \begin_inset LatexCommand \ref{fig-downloads-main-categories-maxdate} \end_inset , \begin_inset LatexCommand \ref{fig-your-info-profile-timezone} \end_inset and \begin_inset LatexCommand \ref{fig-page-area-model} \end_inset . \layout Itemize Claudio added: \begin_inset LatexCommand \ref{fig-php-nuke} \end_inset , \begin_inset LatexCommand \ref{fig-ws_ftp-general} \end_inset , \begin_inset LatexCommand \ref{fig-ws_ftp-local-remote} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-select-database} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-navigation-bar} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-field-functions} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-SQL} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-create-database} \end_inset , \begin_inset LatexCommand \ref{fig-easyphp} \end_inset , \begin_inset LatexCommand \ref{fig-easyphp2} \end_inset , \begin_inset LatexCommand \ref{fig-phpinfo-php-Windows} \end_inset , \begin_inset LatexCommand \ref{fig-apache-package} \end_inset , \begin_inset LatexCommand \ref{fig-mandrake-control-center} \end_inset , \begin_inset LatexCommand \ref{fig-red-hat-menu-packages} \end_inset , \begin_inset LatexCommand \ref{fig-red-hat-package-sections} \end_inset , \begin_inset LatexCommand \ref{fig-red-hat-service-configuration} \end_inset , \begin_inset LatexCommand \ref{fig-phpmyadmin-field-functions-2} \end_inset , \begin_inset LatexCommand \ref{fig-who-is-online} \end_inset , \begin_inset LatexCommand \ref{fig-surveys-block} \end_inset , \begin_inset LatexCommand \ref{fig-login} \end_inset , \begin_inset LatexCommand \ref{fig-add-topic} \end_inset , \begin_inset LatexCommand \ref{fig-php-nuke-html-folder} \end_inset , \begin_inset LatexCommand \ref{fig-theme-structure-nukenews} \end_inset , \begin_inset LatexCommand \ref{fig-theme-structure-other} \end_inset , \begin_inset LatexCommand \ref{fig-backup-db} \end_inset and \begin_inset LatexCommand \ref{fig-modules-admin-3} \end_inset . \layout Standard Again, as in version 1.0, Chris made PNG, \begin_inset LatexCommand \index{PNG} \end_inset PDF (encapsulated PDF), EPS (encapsulated Postscript) and BMP versions of \emph on all \emph default figures to be used in the various formats of the document. \layout Standard The following tables have been added in version 2.0: \layout Itemize Chris added: \begin_inset LatexCommand \ref{tab-sections} \end_inset , \begin_inset LatexCommand \ref{tab-body-tags} \end_inset , \begin_inset LatexCommand \ref{tab-filter_text} \end_inset , \begin_inset LatexCommand \ref{tab-check-html} \end_inset , \begin_inset LatexCommand \ref{tab-Help-Center-Live-setcookie} \end_inset , \begin_inset LatexCommand \ref{tab-changing-HTML-links} \end_inset , \begin_inset LatexCommand \ref{tab-changing-HTML-links-2} \end_inset , \begin_inset LatexCommand \ref{tab-security-vulnerabilities} \end_inset and \begin_inset LatexCommand \ref{tab-urlin-urlout} \end_inset . \layout Standard Chris wrote all new material of version 2.0 in LyX, \begin_inset LatexCommand \index{LyX} \end_inset formatted the whole document, created the Index (semi-automatically this time, through some of his sed and awk scripts, as described in \begin_inset LatexCommand \url[Document processing with LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset ) and processed the LyX file through his scripts (see \begin_inset LatexCommand \ref{book-behind-book} \end_inset , for details) to render all the versions and files available from \begin_inset LatexCommand \ref{formats} \end_inset . \layout Subsection Version 2.1 \begin_inset LatexCommand \label{credits-version-2.1} \end_inset \layout Standard In version 2.1, \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset added the following Chapters and Sections: \begin_inset LatexCommand \index{Sections} \end_inset \layout Itemize In \begin_inset LatexCommand \ref{include-HTML-file-in-module} \end_inset : how to include two files side-by-side in a module. \layout Subsection General \begin_inset LatexCommand \label{credits-general} \end_inset \layout Standard Some quotes have been taken from the installation files of \begin_inset LatexCommand \url[phpnuke.org]{http://phpnuke.oeg} \end_inset , as well as from the \begin_inset LatexCommand \url[MySQL manual]{http://www.mysql.com/documentation/} \end_inset . \layout Standard In \begin_inset LatexCommand \ref{regular-expressions} \end_inset we use material taken from \begin_inset LatexCommand \url[A Brief Introduction to Regular Expressions]{http://www.tldp.org/LDP/abs/html/x12265.html} \end_inset . \layout Standard The sections on mod_rewrite: \begin_inset LatexCommand \index{rewrite} \end_inset \begin_inset LatexCommand \ref{mod_rewrite-API-phases} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-ruleset-processing} \end_inset , \begin_inset LatexCommand \ref{fig-mod_rewrite-control-flow} \end_inset , \begin_inset LatexCommand \ref{mod_rewrite-quoting-special-characters} \end_inset and \begin_inset LatexCommand \ref{mod_rewrite-regex-backreferences} \end_inset have been taken from the \begin_inset LatexCommand \url[Apache Documentation of mod_rewrite]{http://httpd.apache.org/docs/mod/mod_rewrite.html} \end_inset . \layout Standard \begin_inset LatexCommand \ref{how-sessions-work} \end_inset and part of \begin_inset LatexCommand \ref{eliminate-session-checks} \end_inset were taken from a post of Paul S. Owen, \begin_inset LatexCommand \index{Owen} \end_inset Development Team Leader of \begin_inset LatexCommand \url[phpBB]{http://www.phpbb.com} \end_inset , in \begin_inset LatexCommand \url[http://www.phpbb.com/phpBB/viewtopic.php?t=69493]{http://www.phpbb.com/phpBB/viewtopic.php?t=69493} \end_inset , as well as in \begin_inset LatexCommand \url[http://www.phpbb.com/kb/article.php?article_id=54]{http://www.phpbb.com/kb/article.php?article_id=54} \end_inset and are included here with permission. \begin_inset LatexCommand \index{permission} \end_inset \layout Standard \begin_inset LatexCommand \ref{fig-page-area-model} \end_inset is taken from W3C's working draft \begin_inset LatexCommand \url[CSS3 Paged Media Module]{http://www.w3.org/TR/2003/WD-css3-page-20031218/} \end_inset , version of Dec. 18th 2003 and is Copyright © \begin_inset LatexCommand \index{copy} \end_inset 2003 \begin_inset LatexCommand \url[W3C]{http://www.w3.org} \end_inset ( \begin_inset LatexCommand \url[MIT]{http://www.lcs.mit.edu} \end_inset , \begin_inset LatexCommand \url[ERCIM]{http://www.ercim.org} \end_inset , \begin_inset LatexCommand \url[Keio]{http://www.keio.ac.jp} \end_inset ), All Rights Reserved. Used with permission according to \begin_inset LatexCommand \url[W3C document licence]{http://www.w3.org/Consortium/Legal/copyright-documents} \end_inset . \layout Standard The examples for admonition in the Conventions Section ( \begin_inset LatexCommand \ref{conventions} \end_inset ) were taken from the \begin_inset LatexCommand \url[Section on admonitions of the DocBook Guide]{http://newbiedoc.sourceforge.net/tutorials/docbook-guide/admon-docbook-guide.html.en} \end_inset of the \begin_inset LatexCommand \url[Debian Newbiedoc Project]{http://newbiedoc.sourceforge.net} \end_inset . \layout Standard The \begin_inset LatexCommand \url[CSS file for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset that is used in this document , \begin_inset LatexCommand \url[ck-style.css]{ck-style.css} \end_inset , uses \begin_inset LatexCommand \url[QBullets]{http://www.matterform.com/qbullets/index.php} \end_inset in links. See \begin_inset LatexCommand \url[Explain CSS]{http://www.karakas-online.de/mySGML/explain-css.html} \end_inset on how to do this. Thanks to Matterform Media for providing QBullets for free. If you plan to use them on your website, \begin_inset LatexCommand \index{website} \end_inset please observe the \begin_inset LatexCommand \url[QBullets usage terms]{http://www.matterform.com/qbullets/usage.html} \end_inset . \layout Standard The CSS also got important elements from the \begin_inset LatexCommand \url[Newbiedoc CSS file for DocBook]{http://newbiedoc.sourceforge.net/nd-style.css} \end_inset and Mark Pilgrim's influential \begin_inset LatexCommand \url[dive into Accessibility]{http://diveintoaccessibility.org} \end_inset . The CSS font size controlling code and its explanation are taken from \begin_inset LatexCommand \url[Using relative font sizes]{http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html} \end_inset . \layout Section Aknowledgements \begin_inset LatexCommand \label{aknowledgements} \end_inset \layout Standard Claudio said in the first version (1.x) of this document: \layout Standard The following people contribute, directly or indirectly to this project \begin_inset LatexCommand \index{project} \end_inset and their help is hereby kindly aknowledged: \layout Itemize \begin_inset LatexCommand \url[Francisco Burzi]{http://phpnuke.org} \end_inset with all the introductory scripts, found in the files of installation of PHP-Nuke \layout Itemize Vasco Clergy and his daughter Valentina of Lug Rieti for the translations \begin_inset LatexCommand \index{ations} \end_inset of the modules of the handbook \layout Itemize Micaela Bechini, \begin_inset LatexCommand \index{Bechini} \end_inset for the daily translations of \begin_inset LatexCommand \url[phpnuke.org]{http://phpnuke.oeg} \end_inset from English. \begin_inset LatexCommand \index{English} \end_inset \layout Itemize The communities of \begin_inset LatexCommand \url[Splatt.it]{http://www.splatt.it} \end_inset , \begin_inset LatexCommand \url[Nukeitalia.com]{http://www.nukeitalia.com} \end_inset , \begin_inset LatexCommand \url[PHPnuke.it]{http://www.phpnuke.it} \end_inset (and its Mailing List), \begin_inset LatexCommand \url[Postnuke.it]{http://www.postnuke.it} \end_inset , \begin_inset LatexCommand \url[envolution.it]{http://www.envolution.it} \end_inset , \begin_inset LatexCommand \url[xoops.it]{http://www.xoops.it} \end_inset and obviously the 1500 registered users of \begin_inset LatexCommand \url[spaghettibrain]{www.spaghettibrain.com} \end_inset . \layout Itemize Aemmenet, \begin_inset LatexCommand \index{Aemmenet} \end_inset in the person of Mark Atzori that has granted us free use of the server on which \begin_inset LatexCommand \url[spaghettibrain]{www.spaghettibrain.com} \end_inset is accommodated. \layout Itemize Roberto Scano of IWA Italy and Patrizia Bertini of \begin_inset LatexCommand \url[Webaccessibile.org]{http://www.webaccessibile.org} \end_inset for the contributions on usability, \begin_inset LatexCommand \index{usability} \end_inset accessibility and \begin_inset LatexCommand \url[W3C]{http://www.w3c.org} \end_inset validation. \begin_inset LatexCommand \index{validation} \end_inset \layout Itemize Marcello Tansini of \begin_inset LatexCommand \url[webmasterpoint.org]{http://www.webmasterpoint.org} \end_inset for the support given to the project in terms of visibility. \begin_inset LatexCommand \index{visibility} \end_inset \layout Itemize Andrea Birgahi, the best PHP-Nuke Theme Maker of the world for the diagram \begin_inset LatexCommand \index{diagram} \end_inset of \begin_inset LatexCommand \url[spaghettibrain]{www.spaghettibrain.com} \end_inset , for the logo of the book and a lot more. \layout Itemize My girl Sara for all... \layout Itemize My mother Lella, my sister Cora, my dog Grey and the newly arrived baby \begin_inset LatexCommand \index{baby} \end_inset dog Maya. \layout Quotation \series bold This book I dedicate it to my Papà Antonio. Hello Pà. \begin_inset LatexCommand \index{Pà.} \end_inset \layout Standard For this second version (2.x), Claudio wishes to thank: \layout Itemize Francisco Burzi, the daddy of PHPNuke, \begin_inset LatexCommand \index{PHPNuke} \end_inset who has chosen this book as the official PHP-Nuke handbook! \layout Itemize The translator and the manager team of the PHP-Nuke HOWTO: \begin_inset LatexCommand \index{HOWTO} \end_inset \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset , \begin_inset LatexCommand \url[Andre Purfield]{http://www.os-solutions.net} \end_inset , Fortunato Matarrazzo. \begin_inset LatexCommand \index{Matarrazzo} \end_inset \layout Itemize Umberto Zaccarini of \begin_inset LatexCommand \url[WMG Italia]{http://www.wmgitalia.it} \end_inset . \layout Itemize Euro Gala of \begin_inset LatexCommand \url[Eticoweb]{http://www.eticoweb.it} \end_inset , for the operative and ethical support. \layout Itemize Florence University, \begin_inset LatexCommand \index{University} \end_inset because after reading my book they called me to give a course of CMS at \begin_inset LatexCommand \url[Multimedia Master]{http://www.mastermultimedia.unifi.it} \end_inset ; in particular D.ssa Barbara Iraci, Dott. Diego Mencarelli and Dott. Del Bimbo. Thanks to every master student, too. \layout Itemize My team, the Crew Spaghetti, Andrea Biraghi, Federico Campoli, \begin_inset LatexCommand \index{Campoli} \end_inset Fabio Pirovano, Claudio Demarinis and the casual externals Alex Zollia, Micaela Bechini, \begin_inset LatexCommand \index{Bechini} \end_inset VirtualDarkness. \begin_inset LatexCommand \index{VirtualDarkness} \end_inset \layout Itemize \begin_inset LatexCommand \url[Michel "Ziobudda" Morelli]{http://www.ziobudda.net} \end_inset , Fabio Farnesi ( \begin_inset LatexCommand \url[programmiamo.net]{http://www.programmiamo.net} \end_inset ), Giovanni Tummarello ( \begin_inset LatexCommand \url[wup.it]{http://www.wup.it} \end_inset ), Roberto Scano (IWA Italia), Anna Bruno ( \begin_inset LatexCommand \url[fullpress.it]{http://www.fullpress.it} \end_inset ), Alessandro Del Rosso and the De Andreis brothers ( \begin_inset LatexCommand \url[punto-informatico.it]{http://www.punto-informatico.it} \end_inset ), for the mediatic space they give me every time. \layout Itemize My mother Lella, my sister Cora, my dogs Maia and Grey. \layout Itemize My Sara for everything. \layout Standard Chris wishes to thank: \layout Itemize \begin_inset LatexCommand \url[Francisco Burzi]{http://phpnuke.org} \end_inset , for writing PHP-Nuke and publishing it under the \begin_inset LatexCommand \url[GNU General Public License]{http://www.gnu.org/copyleft/gpl.html} \end_inset . \layout Itemize \begin_inset LatexCommand \url[Claudio Erba]{http://www.spaghettibrain.com} \end_inset for bringing the ball in rolling. \layout Itemize \begin_inset LatexCommand \url[Andre Purfield]{http://www.os-solutions.net} \end_inset for starting this wonderful project in the \begin_inset LatexCommand \url[PHP-Nuke book translation thread]{http://www.nukeforums.com/forums/viewtopic.php?topic=11210&forum=23} \end_inset at nukeforums.com. \begin_inset LatexCommand \index{nukeforums.com} \end_inset \layout Itemize All software developers, whose software is used in the preparation of this document (see \begin_inset LatexCommand \ref{book-behind-book} \end_inset ): \begin_deeper \layout Itemize \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[TeX]{http://www.ctan.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[LaTeX]{http://www.latex-project.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[pdfTeX]{http://www.tug.org/applications/pdftex/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[hyperref]{http://www.tug.org/applications/hyperref/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[openjade]{http://openjade.sourceforge.net} \end_inset , \layout Itemize \begin_inset LatexCommand \url[pdfjadetex]{http://www.fifi.org/cgi-bin/man2html/usr/share/man/man1/pdfjadetex.1.gz} \end_inset , \layout Itemize \begin_inset LatexCommand \url[thumbpdf]{http://www.ctan.org/tex-archive/help/Catalogue/entries/thumbpdf.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[DocBook DSSSL stylesheets]{http://docbook.sourceforge.net/projects/dsssl/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[collateindex]{http://docbook.sourceforge.net/release/dsssl/current/doc/indexing.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset , \layout Itemize \begin_inset LatexCommand \url[HTML tidy]{http://tidy.sourceforge.net} \end_inset , \layout Itemize \begin_inset LatexCommand \url[HTML split]{http://hvdkooij.xs4all.nl/docs-docbook.en.cms} \end_inset , \layout Itemize \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[runsed]{runsed} \end_inset , \layout Itemize \begin_inset LatexCommand \url[awk]{http://www.gnu.org/software/gawk/manual/gawk.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[dvips]{http://www.radicaleye.com/dvips.html} \end_inset , \layout Itemize and all the standard software used in a \begin_inset LatexCommand \url[GNU/Linux]{http://www.gnu.org} \end_inset system. \begin_inset LatexCommand \index{system} \end_inset \end_deeper \layout Itemize \begin_inset LatexCommand \url[nukeforums]{http://www.nukeforums.com} \end_inset for providing a Forum for the initial stages of this project (see the \begin_inset LatexCommand \url[PHP-Nuke book translation thread]{http://www.nukeforums.com/forums/viewtopic.php?topic=11210&forum=23} \end_inset ), as well as all its numerous readers for their questions and answers - who have influenced many solutions presented in this document. Special thanks go to its most active members \begin_inset LatexCommand \index{members} \end_inset \begin_deeper \layout Itemize \begin_inset LatexCommand \url[Humpa]{http://www.humpa.com} \end_inset , \layout Itemize \begin_inset LatexCommand \url[Chatserv]{http://www.nukeresources.com} \end_inset , \layout Itemize \begin_inset LatexCommand \url[Chris-au]{http://www.sengers-au.com} \end_inset , \layout Standard for all the useful advice. I've learned a lot from you! \end_deeper \layout Itemize Paul S. Owen for his contribution in \begin_inset LatexCommand \ref{session-management} \end_inset on session management. \begin_inset LatexCommand \index{management} \end_inset \layout Itemize Mark Pilgrim for writing \begin_inset LatexCommand \url[Dive into Accessibility]{http://diveintoaccessibility.org/table_of_contents.html} \end_inset and publishing it under the \begin_inset LatexCommand \url[GNU Free Documentation License]{http://www.gnu.org/copyleft/fdl.html} \end_inset . \layout Itemize All authors of documentation used in various places (see \begin_inset LatexCommand \ref{credits} \end_inset ): \begin_deeper \layout Itemize \begin_inset LatexCommand \url[PHP-Nuke]{http://phpnuke.oeg} \end_inset , \layout Itemize \begin_inset LatexCommand \url[PHP manual]{http://www.php.net/manual/en/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[MySQL manual]{http://www.mysql.com/documentation/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[A Brief Introduction to Regular Expressions]{http://www.tldp.org/LDP/abs/html/x12265.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[Apache Documentation of mod_rewrite]{http://httpd.apache.org/docs/mod/mod_rewrite.html} \end_inset , \layout Itemize \begin_inset LatexCommand \url[CSS3 Paged Media Module]{http://www.w3.org/TR/2003/WD-css3-page-20031218/} \end_inset , \layout Itemize \begin_inset LatexCommand \url[Debian Newbiedoc Project]{http://newbiedoc.sourceforge.net} \end_inset . \end_deeper \layout Itemize Matterform Media for providing \begin_inset LatexCommand \url[QBullets]{http://www.matterform.com/qbullets/index.php} \end_inset for free. \layout Itemize Didi for \begin_inset LatexCommand \ref{fig-optimize-php} \end_inset . \layout Itemize Martin Kaspar for inspirating discussions on PHP-Nuke documentation. \begin_inset LatexCommand \index{documentation} \end_inset \layout Itemize All visitors of the \begin_inset LatexCommand \url[Karakas Online PHP-Nuke Forum]{http://www.karakas-online.de/phpnuke.html} \end_inset for their kind remarks and suggestions for the improvement of the document, especially: nikits72, \layout Itemize Last, but not least, Gloomy for all the moral support during the hard times. \layout Standard The translators would like to thank the \begin_inset LatexCommand \url[Linux Documentation Project (TLDP)]{http://www.tldp.org} \end_inset and its reviewers, especially Tabatha Marshall and Greg Ferguson for their comments and efforts to make this document available from TLDP's plattform \begin_inset LatexCommand \index{plattform} \end_inset to a wider audience. \layout Section Conventions \begin_inset LatexCommand \label{conventions} \end_inset \layout Description admonitions Admonitions are little pictures used to emphasize something of importance to the reader. The four types used are: \begin_deeper \layout SGML \layout SGML Note \layout SGML \layout SGML Using a hammer to put together your computer is bad. \layout SGML \layout SGML \layout SGML \layout SGML Tip \layout SGML \layout SGML Do not hit your thumb with the hammer, it hurts! \layout SGML \layout SGML \layout SGML \layout SGML Important \layout SGML \layout SGML Watch where you're swinging that hammer! \layout SGML \layout SGML \layout SGML \layout SGML Caution \layout SGML \layout SGML Hitting your thumb with a hammer may lead to an unwanted trip to the hospital! \layout SGML \layout SGML \layout SGML \layout SGML Warning \layout SGML \layout SGML Do not, under any circumstances, admit that you hit your own thumb with a hammer. The ridicule you will face is astounding! \layout SGML \layout SGML \end_deeper \layout Description Access\SpecialChar ~ keys Access keys enable navigation through the document, without relying on a mouse. The following keys have been given special meaning in this document: \begin_deeper \layout Description P Previous page. \layout Description N Next page. \layout Description H Home of the document (Table of Contents). \layout Description U Up (takes you one level up the section hierarchy). \layout Standard If you also happen to be reading the document from its original location, then the following access keys can also be used: \layout Description S Start (takes you to the author's start page). \layout Description T The current ( \begin_inset Quotes eld \end_inset This \begin_inset Quotes erd \end_inset ) page, without the Sitemenu on the left. \layout Description M The current page in a frameset, where the left frame contains a Menu. \end_deeper \layout SGML \layout SGML To use the access keys, you have to simultaneously press a modifier key, which may vary from browser to browser. For example in NN6+/Mozilla, the modifier key is ALT, so you have to use \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML to go to the next page, and \layout SGML \layout SGML ALT \layout SGML P \layout SGML \layout SGML to come back. In other browsers such as IE6, the access keys just give focus to the associate d link, so the sequence becomes \layout SGML \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML Enter \layout SGML \layout SGML . Try it, you'll like it! ]]> ]]> ]]> ]]> Inline graphic \layout Section The book behind the book \begin_inset LatexCommand \label{book-behind-book} \end_inset \layout Standard Do you want to create professionally formatted documents? Tired of always having to change the font settings, to insert or delete pagebreaks, \begin_inset LatexCommand \index{pagebreaks} \end_inset to format your text for printing, \begin_inset LatexCommand \index{printing} \end_inset monitor, or web view? Do you find yourself spending hours of your life into formatting issues that you wish you never had to be conftonted with? Did you, during your editing efforts, ever get the uncomforting feeling that you are inventing the wheel for th 39th time? \layout Standard Well, in fact you are! You can use the power of Open Source tools like \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset and \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset to create the documents you've dreamed of, while, as a nice side effect, concentrating on what deserves most of your attention: Content, \begin_inset LatexCommand \index{Content} \end_inset not Formatting! In \begin_inset LatexCommand \url[Document processing with LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset , \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset describes a method by which all you have to do is to write your document in LyX, then run the \SpecialChar \@. lyx file through a script that will produce the SGML \begin_inset LatexCommand \index{SGML} \end_inset source and, from it, the HTML, \begin_inset LatexCommand \index{HTML} \end_inset TXT, RTF, PDF and PS formatted documents (as in \begin_inset LatexCommand \ref{formats} \end_inset ), complete with table of contents, embedded pictures, fonts, thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset (for PDF) and other goodies - just as in the document you are reading right now! \layout SGML That is, to learn how to produce a book like this one, you have to read \begin_inset LatexCommand \url[the book behind the book]{http://www.karakas-online.de/mySGML/} \end_inset . ]]> ]]> ]]> ]]> Inline graphic \layout Subsection The general idea \begin_inset LatexCommand \label{book-behind-book-general-idea} \end_inset \layout Standard When writing LyX documents, formatting should be the last thing on your mind. Concentrate on writing a clear and c oncise document. The sgml parser will take care of the formatting.We've all heard of WYSIWYG. \begin_inset LatexCommand \index{WYSIWYG} \end_inset \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset is WYGIWYM. \begin_inset LatexCommand \index{WYGIWYM} \end_inset WYGIWYM stands for "What You Get Is What You Mean". This means if you mean for text to represent source code you assign it a source code environment (Lyxese for style), and it formats the way you meant it to. You needn't worry about formatting during the writing of your document. If you don't like the way it looks upon finishing and printing it out, you can change the way styles map to formatting, and those styles will consistently change throughout the document. \layout Subsection Line of attack \begin_inset LatexCommand \label{book-behind-book-line-of-attack} \end_inset \layout Standard The method described in \begin_inset LatexCommand \url[Document processing with LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset follows a line of attack defined by the following: \layout Itemize We put everything in a shell script. We don't want to bother about anything else. We want to ponder comfortably upon the meaning of life while drinking some coffee or tea, watching our computer do the work for us - personally, a very rewarding experience :-) \layout Itemize We use \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset to correct LyX' SGML output. The more we are able to correct, the more SGML features we get out of our plain vanilla LyX. \begin_inset LatexCommand \index{LyX} \end_inset \layout Itemize We use the \begin_inset LatexCommand \url[sgmltools]{http://www.sgmltools.org} \end_inset package which hides a lot of details from the end user, giving nonetheless all the power of the involved tools. \begin_inset Foot collapsed false \layout Standard The current version of the \begin_inset LatexCommand \url[lyxtox]{lyxtox} \end_inset script make less use of sgmltools, due to the need of processing intermediate results for the integration of Mathematics, Bibliography etc. The originally used calls to sgmltools are nonetheless included in the comments of that script to demonstrate alternative ways of achieving the same result. \end_inset \layout Itemize We will adapt the \begin_inset LatexCommand \url[DocBook DSSSL stylesheets]{http://docbook.sourceforge.net/projects/dsssl/} \end_inset to our personal needs and taste. \begin_inset LatexCommand \index{taste} \end_inset . \layout Itemize The end product shall be a directory ready to upload to our web server with all files, links, images and formats necessary. \layout SGML So you got appetite and want to delve into the gory details? Read the book behind this book: \begin_inset LatexCommand \url[Document processing with LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset ! ]]> ]]> ]]> ]]> Inline graphic \layout Section How to translate this HOWTO \begin_inset LatexCommand \label{translate-php-nuke-howto} \end_inset \layout Standard The \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset started also as a translation. \begin_inset LatexCommand \index{translation} \end_inset You can read how it all started in \begin_inset LatexCommand \url[PHP-Nuke book translation thread]{http://www.nukeforums.com/forums/viewtopic.php?topic=11210&forum=23} \end_inset at nukeforums.com. \begin_inset LatexCommand \index{nukeforums.com} \end_inset \layout SGML The best way to do the translation would be to install the \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset . Chris still uses an old version (1.2.0) of it, but you could try the newest one and we will see if his \begin_inset LatexCommand \url[document processing scripts]{http://www.karakas-online.de/mySGML/} \end_inset still work. ]]> ]]> ]]> ]]> Inline graphic \layout Standard The process is the following (see, for example, \begin_inset LatexCommand \url[Greek Translation of Php-Nuke HOWTO]{http://www.karakas-online.de/forum/viewtopic.php?t=180} \end_inset and \begin_inset LatexCommand \url[New language translation howto]{http://www.karakas-online.de/forum/viewtopic.php?t=151} \end_inset ): \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset You take the LyX version of the book from the Formats section ( \begin_inset LatexCommand \ref{formats} \end_inset ), you do the translation in LyX, \begin_inset LatexCommand \index{LyX} \end_inset then send it to \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset (chris at karakas-online dot de). \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Chris will use his scripts ( \begin_inset LatexCommand \ref{book-behind-book} \end_inset ) to export the LyX document to SGML, \begin_inset LatexCommand \index{SGML} \end_inset correct the SGML that comes out of LyX, then produce all other formats, \begin_inset LatexCommand \index{formats} \end_inset as in \begin_inset LatexCommand \ref{formats} \end_inset ). \layout Standard The advantage of this method is that you only need to translate the words, \begin_inset LatexCommand \index{words} \end_inset leaving everything else (like "environments", SGML tags etc.) untouched. This way paragraphs, admonitions (see \begin_inset LatexCommand \ref{conventions} \end_inset ), callouts (those small numbers in circles that you see in some code examples, as in \begin_inset LatexCommand \ref{config-php-file} \end_inset ), code environments etc., all remain intact - and you don't need to recreate them. \layout Standard We are in search of available volunteers to translate this book in as many languages as possible. In the case you are interested in translating this book, write to chris at karakas-online dot de, or \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/forum/viewtopic.php?t=144} \end_inset . Be prepared for months of hard work, as this is 500 pages of printed material! \layout Chapter Introduction to PHP-Nuke \begin_inset LatexCommand \label{introduction} \end_inset \layout Section Purpose \begin_inset LatexCommand \label{purpose} \end_inset \layout Standard There has always been the necessity to have a definitive guide on PHP-Nuke. Due to time constraints, \begin_inset LatexCommand \index{constraints} \end_inset nobody has ever had the will to carry out this operation. \begin_inset LatexCommand \index{operation} \end_inset \layout Standard Not any more! With this book, PHP-Nuke now posesses the most comprehensive guide on the subject, \begin_inset LatexCommand \index{subject} \end_inset suitable for newbies and advanced users alike! \layout Section What Is PHP-Nuke \begin_inset LatexCommand \label{whatis-phpnuke} \end_inset \layout Standard PHP-Nuke is free software, released under the \begin_inset LatexCommand \url[GNU License]{http://www.gnu.org/licenses/licenses.html} \end_inset . \layout Standard It is a CMS (Content Managment System) that integrates in its inside all the instruments that are used to create, in a broad sense, an information \begin_inset LatexCommand \index{information} \end_inset portal ( \begin_inset LatexCommand \ref{fig-php-nuke} \end_inset ). Given the immense number of present functions in the installation and in an even greater quantity of modules developed from third parties, the system \begin_inset LatexCommand \index{system} \end_inset is also adept to the management of \layout Itemize Intranet business, \begin_inset LatexCommand \index{business} \end_inset \layout Itemize e-commerce systems, \layout Itemize corporate portals , \layout Itemize public agencies, \layout Itemize news agencies, \layout Itemize online companies, \layout Itemize information sites, \layout Itemize e-learning systems \layout Itemize and so on... \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename php-nuke.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-php-nuke} \end_inset phpnuke.org, the official PHP-Nuke site. \end_inset \layout Standard PHP-Nuke utilizes as hinge of its own structure the duo \begin_inset LatexCommand \url[PHP]{http://www.php.net} \end_inset + \begin_inset LatexCommand \url[MySQL]{http://www.mysql.org} \end_inset , very often being accompanied by the \begin_inset LatexCommand \url[Apache]{http://www.apache.org} \end_inset web server. \begin_inset LatexCommand \index{server} \end_inset Many modules have integrated many other languages, such as Javascript, \begin_inset LatexCommand \index{Javascript} \end_inset Java, \begin_inset LatexCommand \index{Java} \end_inset Flash and also even systems that serve, through the portal, sounds and films in streaming mode (Online Radio, \begin_inset LatexCommand \index{Radio} \end_inset TV Online, Images, Files...). From version 6.x onwards, the compatibility has been extended to include other databases as well, in order to extend the user base even more vastly. \layout Standard PHP-Nuke is developed with a particular eye to the suggestions of the \begin_inset LatexCommand \url[W3C]{http://www.w3c.org} \end_inset , in its origin, \begin_inset LatexCommand \index{origin} \end_inset the code is in fact W3C compliant and one has validated both the code and the style sheets. \begin_inset LatexCommand \index{style sheets} \end_inset It is then up to the user who intends to create a portal to adhere to these standards during the modification of the graphics or the intrinsic characterist ics of the system. \begin_inset LatexCommand \index{system} \end_inset \layout Standard The personalisation either of the graphical, or of the programming part has only a single limit, the fantasy and capability of the programmer and web designer. \begin_inset LatexCommand \index{designer} \end_inset The presence of many PHP-Nuke sites similar to each other is due mainly to the lack of time of those who created them or the fear that the phase of personalisation is too difficult on a technical level. In fact, it suffices to let oneself be inspired by the available themes, \begin_inset LatexCommand \index{themes} \end_inset in order to realize how easy it is to sew a new dress to one's portal. \begin_inset LatexCommand \index{portal} \end_inset \layout Standard Francisco Burzi, \begin_inset LatexCommand \index{Burzi} \end_inset father and mother of PHP-Nuke, describes his creation as follows: \layout Quotation PHP-Nuke is a Web Portal System, storytelling software, News system, \begin_inset LatexCommand \index{system} \end_inset online community or whatever you want to call it. The goal of PHP-Nuke is to have an automated web site to distribute news \begin_inset LatexCommand \index{news} \end_inset and articles with users system. \begin_inset LatexCommand \index{system} \end_inset Each user can submit comments to discuss the articles, just similar to Slashdot and many others. \layout Quotation Main features include: web based admin, \begin_inset LatexCommand \index{admin} \end_inset surveys, top page, access stats page with counter, \begin_inset LatexCommand \index{counter} \end_inset user customizable box, themes manager for registered users, friendly administra tion GUI with graphic topic manager, \begin_inset LatexCommand \index{manager} \end_inset option to edit or delete stories, option to delete comments, moderation system, \begin_inset LatexCommand \index{system} \end_inset Referers page to know who link us, sections manager, \begin_inset LatexCommand \index{manager} \end_inset customizable HTML blocks, user and authors edit, an integrated Banners Ads system, \begin_inset LatexCommand \index{system} \end_inset search engine, backend/headlines generation (RSS/RDF format), and many, many more friendly functions. \layout Quotation PHP-Nuke is written 100% in PHP and requires Apache Web server, \begin_inset LatexCommand \index{server} \end_inset PHP and a SQL (MySQL, mSQL, PostgreSQL, ODBC, ODBC_Adabas, \begin_inset LatexCommand \index{ODBC_Adabas} \end_inset Sybase or Interbase). Support for 25 languages, Yahoo like search engine, \begin_inset LatexCommand \index{engine} \end_inset Comments option in Polls, lot of themes, Ephemerids manager, File Manager, Headlines, download \begin_inset LatexCommand \index{download} \end_inset manager, faq manager, advanced blocks systems, reviews system, newsletter, \begin_inset LatexCommand \index{newsletter} \end_inset categorized articles, multilanguage content management and a lot more. \layout Section Short history of PHP-Nuke \begin_inset LatexCommand \label{history} \end_inset \layout Standard Francisco Burzi, \begin_inset LatexCommand \index{Burzi} \end_inset describes the history of PHP-Nuke as follows: \layout Quotation PHP-Nuke is a free software, released under the \begin_inset LatexCommand \url[GNU GPL License]{http://www.gnu.org/licenses/licenses.html} \end_inset , version 2.0. PHP-Nuke is the result of many years administrating a news site called \begin_inset LatexCommand \url[Linux Preview]{http://linuxpreview.org} \end_inset . First, around August 1998, I wrote my own code in Perl called NUKE and used it for about 1 year, then my site grew big, so I needed a more powerfull system and decided to use Slash, \begin_inset LatexCommand \index{Slash} \end_inset the same used in the \begin_inset LatexCommand \url[Slashdot]{http://www.slashdot.org} \end_inset site. It's good, but you realy need to know Perl to modify it, need too many modules, \begin_inset LatexCommand \index{modules} \end_inset need to load a damn daemon that sucks all your CPU power. My Pentium III just appeared to be a 386 each minute the daemon made its work. \layout Quotation Well, then I discovered Thatware, \begin_inset LatexCommand \index{Thatware} \end_inset a good project to have a news site under PHP. \begin_inset LatexCommand \index{PHP} \end_inset I learned PHP in less than a week and began modifying it. There are too many mods to mention, it was practicaly a rewrite. \begin_inset LatexCommand \index{rewrite} \end_inset I added some cool stuff, deleted some others and after more than 380 hours \begin_inset LatexCommand \index{hours} \end_inset of hard work in 3 weeks! PHP-Nuke was born. \layout Quotation On August 17, 2000 I sold LinuxPreview. \begin_inset LatexCommand \index{Preview} \end_inset org to LinuxAlianza.com and now I have all the time to dedicate to the developmen t of PHP-Nuke. \layout Quotation From January 2001 to January 2002, PHP-Nuke has been financially supported by MandrakeSoft, the folks that made Mandrake Linux. \begin_inset LatexCommand \index{Linux} \end_inset This gave me and PHP-Nuke a lot of oxygen and made possible a lot of stuff. \layout Quotation Now, I'm alone with this killer project. \begin_inset LatexCommand \index{project} \end_inset There is a lot of help from the people that use and develop modules and themes. \begin_inset LatexCommand \index{themes} \end_inset Now, \begin_inset LatexCommand \url[phpnuke.org]{http://phpnuke.oeg} \end_inset is a big site with a lot of users and helpful information for any user around the world. There are also strong users community sites in almost any language you can imagine. Just go to \begin_inset LatexCommand \url[phpnuke.org]{http://phpnuke.oeg} \end_inset and enjoy this great community! \layout Section The PHP-Nuke Communities \begin_inset LatexCommand \label{communities} \end_inset \layout Standard A careful look is due to the true value of PHP-Nuke, that is the communities \begin_inset LatexCommand \index{communities} \end_inset that you will find all around. Thanks to the voluntary job of these persons, of these sites, PHP-Nuke has become a well-known system and it is always thanks to them that PHP-Nuke is a multilanguage system that supports more than 25 languages. \layout Standard Even the modules have been created mostly from developers in external communitie s and have, in second round, been included in new distributions of PHP-Nuke. \layout Standard There are communities out there who are solely devoted to the creation of new graphical themes of PHP-Nuke, to technical support, file mirroring as well as a real lot of multilingual communities that take care of their members informing them in their local language, thus creating new personal ties and more focused projects. \layout Itemize \begin_inset LatexCommand \url[Nukeforums.com]{http://www.nukeforums.com} \end_inset : Technical support to PHP-Nuke. \layout Itemize \begin_inset LatexCommand \url[Nukecops]{http://www.nukecops.com} \end_inset : Official PHP-Nuke development team. \layout Itemize \begin_inset LatexCommand \url[Karakas-Online PHP-Nuke Forum]{http://www.karakas-online.de/forum/phpnuke.html} \end_inset : Chris' PHP-Nuke Forum. \begin_inset LatexCommand \index{Forum} \end_inset \layout Itemize \begin_inset LatexCommand \url[Nukedownloads.com]{http://www.nukedownloads.com} \end_inset : File mirror for downloads. \begin_inset LatexCommand \index{ads} \end_inset \layout Itemize \begin_inset LatexCommand \url[nukeresources.com]{http://www.nukeresources.com} \end_inset : Downloads \begin_inset LatexCommand \index{ads} \end_inset \layout Itemize \begin_inset LatexCommand \url[nukefixes.com]{http://www.nukefixes.com} \end_inset : Fixes for PHP-Nuke bugs. \begin_inset LatexCommand \index{bugs} \end_inset \layout Itemize \begin_inset LatexCommand \url[nukesecurity.com]{http://www.nukesecurity.com} \end_inset : PHP-Nuke security. \begin_inset LatexCommand \index{security} \end_inset \layout Itemize \begin_inset LatexCommand \url[Somara.com]{http://www.somara.com} \end_inset : Themes and graphics. \begin_inset LatexCommand \index{graphics} \end_inset \layout Itemize \begin_inset LatexCommand \url[Nukethemes.com]{http://www.nukethemes.com} \end_inset : Themes and graphics. \begin_inset LatexCommand \index{graphics} \end_inset \layout Itemize \begin_inset LatexCommand \url[Ecomjunk.com]{http://www.ecomjunk.com} \end_inset : Addons and modules. \begin_inset LatexCommand \index{modules} \end_inset \layout Itemize \begin_inset LatexCommand \url[Nukeaddn.com]{http://www.nukeaddn.com} \end_inset : Addons and modules. \begin_inset LatexCommand \index{modules} \end_inset \layout Standard Communities in Italian language: \layout Itemize \begin_inset LatexCommand \url[Spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[Claudiodemarinis.it]{http://www.claudiodemarinis.it} \end_inset \layout Itemize \begin_inset LatexCommand \url[PHPnuke.it]{http://www.phpnuke.it} \end_inset \layout Itemize \begin_inset LatexCommand \url[Splatt.it]{http://www.splatt.it} \end_inset \layout Itemize \begin_inset LatexCommand \url[Nukeitalia.com]{http://www.nukeitalia.com} \end_inset \layout Standard Thanks to the work of these portals and single persons we have more than 500 different modules and blocks that may be used to personalize our portal, \begin_inset LatexCommand \index{portal} \end_inset in areas varying from the weather ( \begin_inset LatexCommand \ref{PHP-Nuke-Meteosat-block} \end_inset ) to e-commerce ( \begin_inset LatexCommand \ref{PHP-Nuke-eCommerce-module} \end_inset ), from gallery ( \begin_inset LatexCommand \ref{PHP-Nuke-Gallery-module} \end_inset ) to chat realized in flash and videogames in Java, \begin_inset LatexCommand \index{Java} \end_inset all included in the layout of PHP-Nuke. \layout Section Why use PHP-Nuke and not static HTML pages \begin_inset LatexCommand \label{whyphpnuke} \end_inset \layout Itemize Because managing large sites with only static HTML pages is dangerous for your health. \layout Itemize Because through the dynamic pages, users can interact (Forum, \begin_inset LatexCommand \index{Forum} \end_inset chat) \layout Itemize Because through the dynamic pages we can offer value added services (restricted areas, various services based on user classification. \begin_inset LatexCommand \index{classification} \end_inset ..) \layout Itemize Because the information is more easily catalogued. \layout Itemize Because with a few PHP pages we recall a lot of information. \begin_inset LatexCommand \index{information} \end_inset \layout Itemize Because keeping the contents up-to-date does not demand particular technical expertise and can be managed by anyone (by Davis Batistes). \layout Itemize It is the simplest way to to pull over a complete portal, \begin_inset LatexCommand \index{portal} \end_inset thanks to its open source engine, \begin_inset LatexCommand \index{engine} \end_inset it allows anyone to implement new modules or to modify and to personalize existing modules. \begin_inset LatexCommand \index{modules} \end_inset (by Micione, \begin_inset LatexCommand \index{Micione} \end_inset \begin_inset LatexCommand \url[www.vizzani.net]{http://www.vizzani.net} \end_inset ) \layout Itemize It is very intuitive and easy to learn (by Anonymous) \layout Itemize It is easy to modify by those who intend to personalize the program (By Arus) \layout Itemize It is easy to use by the lesser experts among us. \layout Section The PHP-Nuke forks \begin_inset LatexCommand \label{PHP-Nuke-forks} \end_inset \layout Standard There are several CMS systems, which are PHPNuke forks; \begin_inset LatexCommand \index{forks} \end_inset among the most famous, we can mention \begin_inset LatexCommand \url[Post-Nuke]{http://www.postnuke.com} \end_inset , \begin_inset LatexCommand \url[Envolution]{http://sourceforge.net/projects/envolution} \end_inset , \begin_inset LatexCommand \url[MyPHPNuke]{http://sourceforge.net/projects/myphpnuke} \end_inset and \begin_inset LatexCommand \url[Xoops]{http://www.xoops.org} \end_inset . \layout Subsection PHP-Nuke vs. Post-Nuke \begin_inset LatexCommand \label{PHP-Nuke-vs-Post-Nuke} \end_inset \layout Standard Post-Nuke is another Content Management System (CMS) similar to PHP-Nuke. Whilst PostNuke is a fork of PHP-Nuke, the entire core of the product has been replaced, with the aim of making it more secure and stable, and able to work in high-volume environments with ease. \layout Standard Some of the highlights of PostNuke are, according to its developers (in \begin_inset LatexCommand \url[Post-Nuke Modules]{http://developing.postnukemodules.com} \end_inset ): \layout Itemize Customisation of all aspects of the website's appearance through themes, \begin_inset LatexCommand \index{themes} \end_inset including CSS support. \layout Itemize The ability to specify items as being suitable for either a single or all languages. \layout Itemize The best guarantee of displaying your webpages on all browsers due to HTML \begin_inset LatexCommand \index{HTML} \end_inset 4.01 transitional compliance. \begin_inset LatexCommand \index{compliance} \end_inset \layout Itemize A standard API and extensive documentation to allow for easy creation of extended functionality through modules and blocks. \layout SGML The merits of Post-Nuke, as compared to those of PHP-Nuke, have been subject of controversial discussion among fans of both CMSs. We cannot give an objective opinion, since we are biased towards PHP-Nuke. ]]> ]]> ]]> ]]> Inline graphic However, we will try to give you an idea: \layout Standard Even its critics will agree that, for a portal whose purpose is to make information publicly accessible, \begin_inset LatexCommand \index{accessible} \end_inset PHP-Nuke is a very good solution. In comparison to Post-Nuke, \begin_inset LatexCommand \index{Post-Nuke} \end_inset most people will also find that PHP-Nuke has many more modules available. However, some will argue that most of them seem geared toward the average end user and not a business or corporate environment. \layout SGML On the plus side, PostNuke has a very detailed strict user permissions system allowing you to limit access to every module and area of your site to a general group or a specific user. The permissions system allows you to create groups and users with special permissions. You can add a user to one or many of these groups to give a variety of complex permissions easily. This is handy if you need moderators, sub admins, and other people helping manage a commercial site and wish to limit admin access. This may make PostNuke more appealing to a professional site - but see the Your Account Tweak module ( \begin_inset LatexCommand \ref{NSN-Your-Account-Tweak-module} \end_inset ), the Approve Membership module ( \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset ), the eCommerce modules ( \begin_inset LatexCommand \ref{PHP-Nuke-eCommerce-module} \end_inset ) or the Project Management WorkBoard module ( \begin_inset LatexCommand \ref{PHP-Nuke-WorkBoard-module} \end_inset ) before you draw premature conclusions. ]]> ]]> ]]> ]]> Inline graphic \layout Standard Here are some PostNuke modules that are popular among business end users: \layout Itemize \begin_inset LatexCommand \url[Xanthia Theme Engine]{http://pnapi.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[ContentExpess Content management]{http://pn.arising.net/ce} \end_inset \layout Itemize \begin_inset LatexCommand \url[Static Content Management]{http://postnuke.wunderlin.net} \end_inset \layout Itemize \begin_inset LatexCommand \url[PostCalendar]{http://postcalendar.tv} \end_inset \layout Itemize \begin_inset LatexCommand \url[FormExpress Forms Generator]{http://www.stutchbury.net} \end_inset \layout Itemize \begin_inset LatexCommand \url[pnAddressBook (Palm Style)]{http://smiatek.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[LDAP]{http://www.olos.nl} \end_inset \layout Itemize \begin_inset LatexCommand \url[NukeOWL]{http://www.sitescandinavia.net} \end_inset \layout Itemize \begin_inset LatexCommand \url[PNphpBB2]{http://www.itsallbutstraw.com} \end_inset \layout Standard However, PostNuke seems to be caught prisoner of its own development impetus: \begin_inset LatexCommand \index{impetus} \end_inset it changed so fast, so often, and made code break backward compatibility \begin_inset LatexCommand \index{compatibility} \end_inset in newer versions so often, that it became difficult even for seasoned webmasters to follow it. Lack of compatibility even between adjacent versions and rumours on its development being suspended, has robbed the nerve of quite a few people, who then turned back to PHP-Nuke for its great community, \begin_inset LatexCommand \index{community} \end_inset support, continuing, smooth development and vast collection of modules. \begin_inset LatexCommand \index{modules} \end_inset The following quote, \begin_inset LatexCommand \index{quote} \end_inset taken from \begin_inset LatexCommand \url[History of PHP-Nuke and Post-Nuke]{http://www.nukecops.com/article65.html} \end_inset , reflects this situation: \layout Quotation I spent a month trying to customize Post-Nuke for a client, and then I gave up. It was too hard and the support was non-existent. Although you'll find many people in the community who want to help you, you'll find no one who has experience with the particular version you've got. \layout SGML \layout SGML \layout SGML Is Post-Nuke more secure than PHP-Nuke? \layout SGML \layout SGML \layout SGML The security argument is often heard in favour of Post-Nuke. However, a commited cracker will probably not encounter considerably more difficulties in cracking Post-Nuke, than PHP-Nuke, as the following testimonia l, taken from the discussion in \begin_inset LatexCommand \url[History of PHP-Nuke and Post-Nuke]{http://www.nukecops.com/article65.html} \end_inset , illustrates: \layout SGML \layout SGML
\layout SGML I have a fair few associates who are still hackers, and they can crack into any Post-Nuke site in 20 seconds flat - I've timed them - and they've had full - note: FULL access to the administration section when they have. The fastest I've seen them hack the least secure PHP-Nuke over the past year, is 30 seconds approx. (32 seconds to be precise). That doesn't sound like PHP-Nuke is less secure to me. \layout SGML \layout SGML \layout SGML The latest version of PHP-Nuke (6.5) prior to it's RC1 with the new security procedures in it, it took them 5 minutes to hack into it. \layout SGML \layout SGML
\layout SGML
\layout Standard Of course, 5 minutes will not make you sleep any more quiet than with Post-Nuke, \begin_inset LatexCommand \index{Post-Nuke} \end_inset but the Web is a dangerous place by construction and and the point is of relative, not absolute nature. \begin_inset LatexCommand \index{nature} \end_inset PHP-Nuke has improved its security even more since then. For more details on PHP-Nuke security, \begin_inset LatexCommand \index{security} \end_inset we refer you to \begin_inset LatexCommand \ref{how-secure-is-php-nuke} \end_inset , where we will talk about PHP-Nuke's past security vulnerabilities, \begin_inset LatexCommand \index{vulnerabilities} \end_inset its new security procedures and what you can do to enhance its security even further. \layout SGML We cannot go into more details on PostNuke, since they would easily fill another book. Perhaps the best test is to visit the homepages of both projects, \begin_inset LatexCommand \url[PHP-Nuke]{http://phpnuke.org} \end_inset and \begin_inset LatexCommand \url[PostNuke]{http://www.postnuke.com} \end_inset - and decide for yourself which one you like best. ]]> ]]> ]]> ]]> Inline graphic \layout Subsection PHP-Nuke vs. XOOPS \begin_inset LatexCommand \label{PHP-Nuke-vs-XOOPS} \end_inset \layout Standard \begin_inset LatexCommand \url[XOOPS]{http://www.xoops.org} \end_inset is a dynamic OO (Object Oriented) based open source portal script written in PHP. \begin_inset LatexCommand \index{PHP} \end_inset According to its developers, XOOPS is the \begin_inset Quotes eld \end_inset ideal tool for developing small to large dynamic community websites, intra-compa ny portals, \begin_inset LatexCommand \index{portals} \end_inset corporate portals, \begin_inset LatexCommand \index{portals} \end_inset weblogs and much more \begin_inset Quotes erd \end_inset (see \begin_inset LatexCommand \url[About XOOPS]{http://www.xoops.org/general/index.php} \end_inset ). The developers also tell the following about their goals: \layout Quotation The goal of the XOOPS team is to create a Content Management System (CMS) for users and developers that installs out of the box offering unparalleled ease of use, support and management. \begin_inset LatexCommand \index{management} \end_inset The XOOPS CMS will be extendable by the use of modules installable through a unified admin interface. \begin_inset LatexCommand \index{interface} \end_inset The ultimate goal of the XOOPS team is to take the best features of current CMS's and roll them into an Open Source CMS that's easy to use, extendable and unparalleled in the Free/Open Source Community. \layout Standard XOOPS is (see \begin_inset LatexCommand \url[XOOPS Features List]{http://www.xoops.org/general/features.php} \end_inset ): \layout Itemize Database-driven: XOOPS uses relational databases (currently MySQL) to store data required for running a web-based content management system (compare with \begin_inset LatexCommand \ref{whatis-phpnuke} \end_inset ). \layout Itemize Fully Modularized: Modules can be installed/uninstalled/ativated/deactivated \begin_inset LatexCommand \index{activated} \end_inset with a click using the XOOPS module administration system (compare with \begin_inset LatexCommand \ref{module-management} \end_inset ). \layout Itemize Personalization: Registered users can edit their profiles, select site themes, \begin_inset LatexCommand \index{themes} \end_inset upload custom avatars, \begin_inset LatexCommand \index{avatars} \end_inset and much more (compare with \begin_inset LatexCommand \ref{frontend} \end_inset )! \layout Itemize User Management: The ability to search for users by various criteria, \begin_inset LatexCommand \index{criteria} \end_inset send email and private messages to users through a template-based messaging system (compare with \begin_inset LatexCommand \ref{fig-private-messages} \end_inset ). \layout Itemize Supported World-wide: \begin_inset LatexCommand \index{World-wide} \end_inset The XOOPS community has more than dozen official support sites around the world for support of non-English speaking users (compare with \begin_inset LatexCommand \ref{communities} \end_inset ). \layout Itemize Multi-byte Language Support: Fully supports multi-byte languages, including Japanese, \begin_inset LatexCommand \index{Japanese} \end_inset Simplified and Traditional Chinese, Korean, etc (compare with \begin_inset LatexCommand \ref{modifying-PHP-Nuke-texts} \end_inset ). \layout Itemize Versatile Group Permissions System: Powerful and user-friendly permissions \begin_inset LatexCommand \index{permissions} \end_inset system which enables administrators to set permissions by group (compare with \begin_inset LatexCommand \ref{NSN-Your-Account-Tweak-module} \end_inset ). \layout Itemize Theme-based skinnable interface: XOOPS is driven by a powerful theme system. \begin_inset LatexCommand \index{system} \end_inset Both admins and users can change the look of the entire web site with just a click of a mouse. There are also over 60 themes available for download (compare with \begin_inset LatexCommand \ref{customization} \end_inset )! \layout Standard The OO (Object Oriented) approach of XOOPS to Web Content Management is innovative, but also controversial. Franzisco Burzi writes in \begin_inset LatexCommand \url[History of PHP-Nuke and Post-Nuke]{http://www.nukecops.com/article65.html} \end_inset : \layout Quotation About saying that OOP (Object Oriented Programming) is a good stuff and makes stuff more stable, modular, or whatever else you want... False. OOP is good for very big projects, which is not the case of PHP-Nuke (I mean VERY BIG projects) with a lot of reusable code. BUT... any good PHP programmer knows that the use (or worse, the intense use) of objects/classes in a PHP script isn't good. PHP is not efficient managing objects/classes. At least it's less efficient than managing custom user created functions. Any decent PHP 4 book will say this to you: If you can manage to have your software working without using OOP, \begin_inset LatexCommand \index{OOP} \end_inset there isn't any reason to use objects, because of performance issues. \layout Subsection XOOPS vs. Post-Nuke \begin_inset LatexCommand \label{XOOPS-vs-Post-Nuke} \end_inset \layout Standard We cannot go into the details of a comparison between XOOPS and Post-Nuke, \begin_inset LatexCommand \index{Post-Nuke} \end_inset as this would be rather off-topic here. For a discussion of XOOPS vs. Post-Nuke, \begin_inset LatexCommand \index{Post-Nuke} \end_inset see \begin_inset LatexCommand \url[XOOPS vs. Post-Nuke]{http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=14536&forum=3} \end_inset . There, among lists of pros and contras, you will read this: \layout SGML
\layout SGML \layout SGML I'm an architect. My teacher always told me that there are no "bad tools". There are only "bad craftsmen". \layout SGML \layout SGML \layout SGML Find your own way to work - it's not a race, not a competition, you don't need to have the better machine to win. The best sites won't flash with decorations, tons of blocks and gifs. They are made with the same basic tools, CLEAR AND WISE IDEA, and lots of custom made details. \layout SGML \layout SGML \layout SGML Innovate - not imitate. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML
\layout Chapter How to install PHP-Nuke \begin_inset LatexCommand \label{installation} \end_inset \layout Standard The screenshots regarding the installation procedure, \begin_inset LatexCommand \index{procedure} \end_inset contrary to those of the other chapters, refer to the Windows platform. This is so in an effort to reduce the number of misunderstandings and ulterior \begin_inset LatexCommand \index{ulterior} \end_inset help requests from the Windows community. \begin_inset LatexCommand \index{community} \end_inset (Judging from the feedback we receive, the Linux and FreeBSD community \begin_inset LatexCommand \index{community} \end_inset seem to be more able to deal with installation problems in this respect). \layout Standard For the installation of \begin_inset LatexCommand \url[PHP]{http://www.php.net} \end_inset + \begin_inset LatexCommand \url[MySQL]{http://www.mysql.org} \end_inset + \begin_inset LatexCommand \url[Apache]{http://www.apache.org} \end_inset , \begin_inset LatexCommand \url[PHPMyAdmin]{http://www.phpmyadmin.net/} \end_inset etc\SpecialChar \@. refer to \begin_inset LatexCommand \ref{tools} \end_inset where you will find notes and links to useful tools in order to emulate \begin_inset LatexCommand \index{emulate} \end_inset PHP-Nuke on your client. \layout Standard These instructions are valid for all PHP-Nuke versions from 6.0 onwards. \layout Section Prerequisites \begin_inset LatexCommand \label{prerequisites} \end_inset \layout Standard In the INSTALL file of PHP-Nuke, we read the following about its requirements: \begin_inset LatexCommand \index{requirements} \end_inset \layout Quotation In order to setup PHP-Nuke the folowing prerequisits are necessary. \begin_deeper \layout Itemize \begin_inset LatexCommand \url[Linux]{http://www.linux.com} \end_inset , installed and working properly. \layout Itemize \begin_inset LatexCommand \url[Apache Web Server]{http://www.apache.org} \end_inset . \layout Itemize \begin_inset LatexCommand \url[PHP]{http://www.php.net} \end_inset version 4.1.x or better (mod_php) Apache module. \begin_inset LatexCommand \index{module} \end_inset \layout Itemize \begin_inset LatexCommand \url[MySQL database server]{http://www.mysql.com} \end_inset \end_deeper \layout Quotation ...The above doesn't mean it will not work with other configurations, \begin_inset LatexCommand \index{configurations} \end_inset OS's, DB's, etc, but we only provide INSTALL instructions for the above configuration. \begin_inset LatexCommand \index{configuration} \end_inset In fact PHP-Nuke works under Windows (all), FreeBSD, OS/2, MacOS, \begin_inset LatexCommand \index{MacOS} \end_inset etc. \layout SGML \layout SGML \layout SGML PHP 4.1.0 or later needed! \layout SGML \layout SGML \layout SGML From the INSTALL file, we see that you must have at least PHP 4.1.0 to use PHP-Nuke 6.5 and later. This is an important piece of information that you should ckeck before proceeding. See \begin_inset LatexCommand \url[Warning: Invalid argument supplied for foreach()]{http://www.karakas-online.de/forum/viewtopic.php?t=36} \end_inset . \layout SGML \layout SGML \layout SGML You see, it is always a good idea to read the INSTALL file that comes with a software package. ]]> ]]> ]]> ]]> Inline graphic \layout Standard To see the PHP version you are running and do also a small test on your configuration, \begin_inset LatexCommand \index{configuration} \end_inset you can run the test.php file as described in \begin_inset LatexCommand \ref{test-php} \end_inset . \layout SGML \layout SGML \layout SGML PHP-Nuke and databases other than MySQL \layout SGML \layout SGML \layout SGML From PHP-Nuke version 5.3, Francisco added a new SQL abstraction layer. It enables PHP-Nuke to support databases other than MySQL, like mSQL, PostgreSQ L, PostgreSQL_local, ODBC, ODBC_Adabas, Sybase and Interbase. \layout SGML \layout SGML \layout Standard For the Microsoft Internet Informaion Server (IIS), some tests we have done were positive, some others indicated that a special configuration was needed. \layout Section Installation process \begin_inset LatexCommand \label{installation-process} \end_inset \layout Subsection Download \begin_inset LatexCommand \label{download} \end_inset \layout Standard Well\SpecialChar \@. \SpecialChar \@. \SpecialChar \@. there is little to say here, it suffices to go to a site that holds the files and download them. There is only a small remark to make: if you use Windows and download a version comprised of a file with the ending \series bold tar\SpecialChar \@. gz \series default , do not worry, your \begin_inset LatexCommand \url[Winzip]{http://www.winzip.com} \end_inset supports it without problems. Once downloaded, extract it and \begin_inset Quotes eld \end_inset throw \begin_inset Quotes erd \end_inset all its contents in a folder you created for this purpose and you call \begin_inset Quotes eld \end_inset Nuke6 \begin_inset LatexCommand \index{Nuke6} \end_inset \begin_inset Quotes erd \end_inset or whatever ( sites from which you can download PHP-Nuke are: \begin_inset LatexCommand \url[phpnuke.org]{http://phpnuke.org} \end_inset , \begin_inset LatexCommand \url[www.spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset etc\SpecialChar \@. ). \layout Subsection Upload through FTP \begin_inset LatexCommand \label{upload} \end_inset \layout Standard Well, now what remains is just to upload the files to the interior of our main server directory that resides on our provider. \begin_inset LatexCommand \index{provider} \end_inset \layout SGML \layout SGML \layout SGML Attention! \layout SGML \layout SGML \layout SGML It is highly recommended, prior to any installation steps, to verify that your provider supports \begin_inset LatexCommand \url[PHP]{http://www.php.net} \end_inset and \begin_inset LatexCommand \url[MySQL]{http://www.mysql.org} \end_inset . \layout SGML \layout SGML \layout Standard Your ISP has already given you: \layout Itemize An FTP user and password: \begin_inset LatexCommand \index{password} \end_inset you need these for the file transfers. \layout Itemize A database user and password, as well as the name of the database server \begin_inset LatexCommand \index{server} \end_inset to connect to: you need them to connect your applications (like PHP-Nuke) to the database and to be able to access the administration panel of phpMyAdmin \begin_inset LatexCommand \index{Admin} \end_inset ( \begin_inset LatexCommand \ref{phpmyadmin} \end_inset ). \layout Standard For FTP in the Windows plattform, \begin_inset LatexCommand \index{plattform} \end_inset we recommend using the \begin_inset LatexCommand \url[WS_FTP]{http://www.ftpplanet.com/ftpresources/ftpmain.htm} \end_inset application. \begin_inset LatexCommand \index{application} \end_inset It is free for personal use and you can download it from download. \begin_inset LatexCommand \index{download} \end_inset com by entering the search key \begin_inset Quotes eld \end_inset ws_ftp \begin_inset LatexCommand \index{ws_ftp} \end_inset \begin_inset Quotes erd \end_inset . For the Linux plattform instead, we recommend GFTP (free for all and preinstall \begin_inset LatexCommand \index{preinstall} \end_inset ed in all distributions), which can be run from the command line by simply typing \begin_inset Quotes eld \end_inset gftp \begin_inset LatexCommand \index{gftp} \end_inset \begin_inset Quotes erd \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename ws_ftp-general.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-ws_ftp-general} \end_inset WS_FTP: General connection parameters. \end_inset \layout Standard The use of an FTP program is very simple - we will follow the procedure \begin_inset LatexCommand \index{procedure} \end_inset through 4 screens that enable us to: \layout Itemize Connect ( \begin_inset LatexCommand \ref{fig-ws_ftp-general} \end_inset ) \layout Itemize Transfer files ( \begin_inset LatexCommand \ref{fig-ws_ftp-local-remote} \end_inset ) \layout Itemize Set up the permissions (see also \begin_inset LatexCommand \ref{permissions} \end_inset ) \layout Itemize (Eventually) edit the uploaded files \layout Standard \begin_inset LatexCommand \ref{fig-ws_ftp-general} \end_inset shows the WS_FTP General Connection Parameters screen. \begin_inset LatexCommand \index{screen} \end_inset Entering the right values in the fields of that screen will enable you to conncet to the server where you want to upload the files. \layout SGML \layout SGML \layout SGML Attention! \layout SGML \layout SGML \layout SGML If you are installing PHP-Nuke locally, it is not necessary to use FTP! In this case, it suffices to copy the files into the right directory. In case you are working under Linux, it may be necessary to set the right file permissions. See \begin_inset LatexCommand \ref{permissions} \end_inset on how to do this. \layout SGML \layout SGML \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename ws_ftp-local-remote.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-ws_ftp-local-remote} \end_inset WS_FTP: Main screen with local and remote windows. \end_inset \layout Standard Once connected, the next operation is to upload the files on the remote server. \begin_inset LatexCommand \index{server} \end_inset With WS_FTP, \begin_inset LatexCommand \index{WS_FTP} \end_inset as well as woth the majority of the other FTP clients, the window that contains the local files is located to the left, while the remote files are displayed in a window to the right ( \begin_inset LatexCommand \ref{fig-ws_ftp-local-remote} \end_inset ). You have to position your cursor on the directory that contains the files to be uploaded to the left and the directory tha has to receive them on the remote host to the right. You can do this through the graphical interface of WS_FTP. \begin_inset LatexCommand \index{WS_FTP} \end_inset \layout Standard As you can see in \begin_inset LatexCommand \ref{fig-ws_ftp-local-remote} \end_inset , there are also some function buttons there: the two arrows are used to upload / download files to / from the server, \begin_inset LatexCommand \index{server} \end_inset the other two buttons that are functionally important are \begin_inset Quotes eld \end_inset MkDir \begin_inset Quotes erd \end_inset , which creates a new directory, and \begin_inset Quotes eld \end_inset Refresh \begin_inset LatexCommand \index{Refresh} \end_inset \begin_inset Quotes erd \end_inset , which updates the view of data contained in a window. \layout Standard Don't upload all extracted files. After extraction, \begin_inset LatexCommand \index{extraction} \end_inset you will find a structure similar to the one depicted in \begin_inset LatexCommand \ref{fig-file-structure} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename snapshot12.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-file-structure} \end_inset PHP-Nuke 6.0 file structure \end_inset \layout Standard You don't need to upload all the files from the folder, in the main directory of your web presence you will \series bold only need to upload the contents of the html folder \series default (so just do a doubleclick on the html folder and upload everything that is inside it). But in order to populate the database with the PHP-Nuke tables, \begin_inset LatexCommand \index{tables} \end_inset you will also need to upload the sql folder too. After the database creation (see \begin_inset LatexCommand \ref{database-creation} \end_inset ), you should delete this folder though - for security reasons. \layout Standard An operation that may be useful in cases of emergency is \begin_inset Quotes eld \end_inset Edit \begin_inset LatexCommand \index{Edit} \end_inset \begin_inset Quotes erd \end_inset , which is accessible from the context menu after a right click with the mouse on the desired file. \begin_inset Quotes eld \end_inset Edit \begin_inset LatexCommand \index{Edit} \end_inset \begin_inset Quotes erd \end_inset will allow a direct modification of the file, without the intermediate step of downloading it to your computer. \layout Subsection File permissions \begin_inset LatexCommand \label{permissions} \end_inset \layout SGML \layout SGML Important \layout SGML \layout SGML This process only really applies if your PHP-Nuke will be installed on a Linux/Unix server, if instead you will install it on Windows operating systems you don't have to do anything. \layout SGML \layout SGML \layout Description Permissions: Each file or directory \begin_inset Foot collapsed true \layout Standard directories are just special files in Linux \end_inset has 3 groups of permissions associated with it: one set of Read, Write or Execute permissions for the owner (also called \begin_inset Quotes eld \end_inset user \begin_inset Quotes erd \end_inset in this context), a group and "others" respectively. The owner in our case should be the user name of your web server. \begin_inset LatexCommand \index{server} \end_inset The group is a user group the web server is a member of. And \begin_inset Quotes eld \end_inset others \begin_inset Quotes erd \end_inset are just \begin_inset Quotes eld \end_inset the rest \begin_inset Quotes erd \end_inset . \layout Standard File permissions are usually grouped together in groups of three, like this: (rwx)(rwx)(rwx). The first group are the user permissions, the second one the group permissions \begin_inset LatexCommand \index{permissions} \end_inset and the third one the permissions for \begin_inset Quotes eld \end_inset others \begin_inset Quotes erd \end_inset . A good mnemonic for this grouping is UGO (User, \begin_inset LatexCommand \index{User} \end_inset Group, Others). Inside each permissions group, a certain permission may or may not be present. Thus, the user (owner) of the file will usually have read and write permissions \begin_inset LatexCommand \index{permissions} \end_inset (and execute permission too, if the file is executable), but the group permissions may only allow read access and \begin_inset Quotes eld \end_inset others \begin_inset Quotes erd \end_inset may not be allowed to access the file at all, neither for reading, nor for writing or execution. \layout Standard If you imagine that the existence of a permission is denoted by a 1, while its absence by a 0, then you end up with a representation like (111)(111)(111), where all permissions are present for all, or (000)(000)(000), where they are absent for all. Of course, any other combination is possible, for example (111)(110)100), which denotes read, write and execute permissions for the user (all 1s are present in the first grouping: (111)), read and write permissions for the group (only the first and second 1s are there in the second grouping (110)) and read permission for others (since only the first 1 is there, while the rest are 0s in the third grouping (100)). \layout Standard Writing down a sequence of nine 0s and 1s is not very practical, so one came with the idea to interprete each one of the three groupings as a binary number. A (111) would thus mean a 7, a (110) a 6, a (100) a 4. Taken together, the sequence (111)(110)100) of the example above would be represented by the number 764. \begin_inset LatexCommand \index{764} \end_inset That's compact and widely used. \layout Standard Unfortunately, it is also very cryptic, \begin_inset LatexCommand \index{cryptic} \end_inset since most people didn't have much exposure to the binary number system at school, not to mention everyday life. How is one going to understand instructions like \begin_inset Quotes eld \end_inset set file permissions to 644 \begin_inset LatexCommand \index{644} \end_inset \begin_inset Quotes erd \end_inset then? \layout SGML Luckily, there exists an easy mnemonic for this: \begin_inset Quotes eld \end_inset 4,2,1 \begin_inset Quotes erd \end_inset , that is the first 1 counts as a 4, the second as a 2 and the third one as 1 - a 0 is always a 0, by the way, even in the binary system. ]]> ]]> ]]> ]]> Inline graphic \layout Standard Whenever you see a 1 in the first position of a permissions triple, you add a 4, whenever you see one in the second, you add a 2 and if you see it in the third, you add 1. You do this for UGO, that is for User, \begin_inset LatexCommand \index{User} \end_inset Group and Others and you end up with a three digit number that represents the permissions of the file. \layout Standard Most of the time, however, you will be busy deciphering permissions, \begin_inset LatexCommand \index{permissions} \end_inset rather than formulating them yourself in this cryptic manner. So how do you go about interpreting a permissions representation like 764 \begin_inset LatexCommand \index{764} \end_inset that was given to you in a document like the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset ? \layout Standard For this, you will need to develop a \begin_inset Quotes eld \end_inset feeling \begin_inset Quotes erd \end_inset of how each of the three numbers (7, 6 and 4 in this example) can be written a a unique sum of 4s, 2s and 1s. For example 7 is 4+2+1, 6 is 4+2 and 4 is just 4. A 4 in the sum represents a 1 in the leftmost position. If a 4 is not present in the sum, the leftmost position is a 0. A 2 in the sum reperesents a 1 in the middle position - if there is no 2 in the sum, you just write a 0 there. Finally, a 1 in the sum represents a 1 in the rightmost position, while if there is no 1 in the sum, you write a 0 there. \layout Standard Now if you remember that the leftmost 1 or 0 in a pattern like (111) denotes \begin_inset LatexCommand \index{notes} \end_inset a \series bold read \series default permission or the absence or it, a 1 or a 0 in the middle position denotes \begin_inset LatexCommand \index{notes} \end_inset a \series bold write \series default permission or its absence and a 1 or 0 in the leftmost position denotes \begin_inset LatexCommand \index{notes} \end_inset an \series bold execute \series default permission or its absence, then you can take a permissions represenation like 764 above, see that 7=4+2+1 and realize that it means (111), see that 6=4+2 (or 4+2+0, if you like) and realize that it means (110), finally see that 4=4 (or 4+0+0) and realize that it stands for (100), and you can see that 764 is equivalent to (111)(110)(100), meaning read, write and execute permissions for the user (owner), read and write permissions for the group and only read permissions for others. \newline \layout SGML Easy after all, isn't it? ]]> ]]> ]]> ]]> Inline graphic \layout Standard For more information on permissions, \begin_inset LatexCommand \index{permissions} \end_inset see: \layout Itemize \begin_inset LatexCommand \url[Setting Unix Permissions For Web Pages]{http://www.washington.edu/computing/web/publishing/permissions.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[An Introduction to Unix Permissions]{http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html} \end_inset \layout Itemize \begin_inset LatexCommand \url[Understanding UNIX permissions and chmod]{http://www.perlfect.com/articles/chmod.shtml} \end_inset \layout Itemize \begin_inset LatexCommand \url[Tutorial: UNIX Permissions]{http://www.nyu.edu/webguide/permissions.html} \end_inset \layout Standard Setting up permissions on files serves the purpose of having them execute only certain operations (write, execute etc\SpecialChar \@. ) when called. Setting them up correctly is important for PHP-Nuke to operate in its full functionality. \begin_inset LatexCommand \index{functionality} \end_inset \layout Standard The right permissions for PHP-Nuke are the following (for the base permissions, \begin_inset LatexCommand \index{permissions} \end_inset see \begin_inset LatexCommand \ref{permissions2} \end_inset in the context of security): \layout Itemize Files: 644 \begin_inset LatexCommand \index{644} \end_inset \layout Itemize Directories: \begin_inset LatexCommand \index{Directories} \end_inset 755 \layout Standard Only directories that require upload access (like the forum's avatar folder, if you allow avatar upload) should be set to 777 and files that get data \begin_inset LatexCommand \index{data} \end_inset written to them by the program should be set to 666. \begin_inset LatexCommand \index{666} \end_inset \layout Standard With \begin_inset LatexCommand \url[WS_FTP]{http://www.ftpplanet.com/ftpresources/ftpmain.htm} \end_inset you must select the files or folders on which you want to impose the permission \begin_inset LatexCommand \index{permission} \end_inset s and, with the right mouse key, \begin_inset LatexCommand \index{key} \end_inset to select the option \begin_inset Quotes eld \end_inset chmod (UNIX) \begin_inset Quotes erd \end_inset (see \begin_inset LatexCommand \ref{fig-ws_ftp-chmod-1} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename ws_ftp-chmod-1.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-ws_ftp-chmod-1} \end_inset WS_FTP context menu on right mouse click: chmod (UNIX) \end_inset \layout Standard The window \begin_inset Quotes eld \end_inset Remote file permissions \begin_inset LatexCommand \index{permissions} \end_inset \begin_inset Quotes erd \end_inset will appear (see \begin_inset LatexCommand \ref{fig-ws_ftp-chmod-2} \end_inset ). To change the permissions on a directory as required to 755, \begin_inset LatexCommand \index{755} \end_inset for example, check the boxes as shown in \begin_inset LatexCommand \ref{fig-ws_ftp-chmod-2} \end_inset and press \begin_inset Quotes eld \end_inset OK \begin_inset Quotes erd \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename ws_ftp-chmod-2.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-ws_ftp-chmod-2} \end_inset WS_FTP Remote file permissions window \end_inset \layout Standard This procedure will cost you some time, but it is very important to carry out. Moreover, you will have to do it every time you insert a new file or module \begin_inset LatexCommand \index{module} \end_inset to your PHP-Nuke. \layout Subsection Database creation \begin_inset LatexCommand \label{database-creation} \end_inset \layout Standard Create a database that will contain the PHP-Nuke tables. \begin_inset LatexCommand \index{tables} \end_inset The name of the database should be the same name as the one you entered in config. \begin_inset LatexCommand \index{config} \end_inset php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ): \layout Code mysqladmin create nuke \layout Standard To populate the database, \begin_inset LatexCommand \index{base} \end_inset you have to run the nuke.sql file \begin_inset Quotes eld \end_inset through \begin_inset Quotes erd \end_inset mysql. Change to the sql directory and do from the command line: \layout Code mysql -h dbhost -u dbuname -p dbname < nuke.sql \layout Standard where dbhost, \begin_inset LatexCommand \index{dbhost} \end_inset dbuname and dbname are the database host, database username and database name, exactly as entered in config.php. \begin_inset LatexCommand \index{config.php} \end_inset Just as you import nuke.sql, \begin_inset LatexCommand \index{nuke.sql} \end_inset you can import any other MySQL dump file (see also \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-SQL} \end_inset ). \layout Section How to install PHP-Nuke through phpMyAdmin \begin_inset LatexCommand \label{phpmyadmin} \end_inset \layout Standard To be able to create a database, \begin_inset LatexCommand \index{base} \end_inset you must be able to administer it. A perfect instrument for doing this via a browser is phpMyAdmin. \begin_inset LatexCommand \index{Admin} \end_inset \layout Subsection What Is PHPMyadmin \begin_inset LatexCommand \label{whatis-phpmyadmin} \end_inset \layout Standard \begin_inset LatexCommand \url[PHPMyAdmin]{http://www.phpmyadmin.net/} \end_inset is a visual system for the management of a \begin_inset LatexCommand \url[MySQL]{http://www.mysql.org} \end_inset database (see \begin_inset LatexCommand \ref{fig-phpmyadmin-start} \end_inset ). It is written in \begin_inset LatexCommand \url[PHP]{http://www.php.net} \end_inset and serves to display the contents of the databases on the server (or client) on which MySQL is installed. Through this interface you can create new databases, \begin_inset LatexCommand \index{databases} \end_inset modify existing ones and modify the contents of single fields. \layout Subsection How to install phpMyAdmin \begin_inset LatexCommand \label{install-phpMyAdmin} \end_inset \layout Standard Local installation under Windows is very simple: you only need to extract \begin_inset LatexCommand \index{extract} \end_inset the files from the archive you downloaded from the \begin_inset LatexCommand \url[official phpBB site]{http://www.phpbb.com} \end_inset and point your browser to the address \begin_inset LatexCommand \url[http://localhost/phpmyadmin]{http://localhost/phpmyadmin} \end_inset . You will then see a screen as in \begin_inset LatexCommand \ref{fig-phpmyadmin-start} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-start.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-start} \end_inset PHPMyAdmin start screen. \end_inset \layout Standard If you are working locally, don't worry about any warnings you might get. In case you have to install phpMyAdmin on your server, \begin_inset LatexCommand \index{server} \end_inset e.g. when your ISP does not offer a preinstalled administration panel for the database, \begin_inset LatexCommand \index{base} \end_inset you must configure the config.inc.php file that comes with it: \layout Standard Supposing that your data are: \layout Itemize IP of the database server: \begin_inset LatexCommand \index{server} \end_inset 156.123.22.34 \layout Itemize User: Pippo \begin_inset LatexCommand \index{Pippo} \end_inset \layout Itemize Password: Topolino \begin_inset LatexCommand \index{Topolino} \end_inset \layout Itemize Database name: Minnie \begin_inset LatexCommand \index{Minnie} \end_inset \layout Standard then the necessary entries in config. \begin_inset LatexCommand \index{config} \end_inset inc.php look like this: \layout Code $cfgServers[1]["host"] = "156.123.22.34"; // MySQL hostname \layout Code $cfgServers[1]["port"] = ""; // MySQL port - leave blank for default port \layout Code $cfgServers[1]["adv_auth"] = false; // Use advanced authentication? \layout Code $cfgServers[1]["stduser"] = ""; // MySQL standard user (only needed with advanced auth) \layout Code $cfgServers[1]["stdpass"] = ""; // MySQL standard password (only needed with advanced auth) \layout Code $cfgServers[1]["user"] = "Pippo"; // MySQL user (only needed with basic auth) \layout Code $cfgServers[1]["password"] = "Topolino"; // MySQL password (only needed with basic auth) \layout Code $cfgServers[1]["only_db"] = "Minnie"; // If set to a db-name, only this db is accessible \layout Code $cfgServers[1]["verbose"] = ""; // Verbose name for this host - leave blank to show the hostname \layout Code $cfgServers[1]["bookmarkdb"] = ""; // Bookmark db - leave blank for no bookmark support \layout Code $cfgServers[1]["bookmarktable"] = ""; // Bookmark table - leave blank for no bookmark support \layout Code \layout Standard In the config. \begin_inset LatexCommand \index{config} \end_inset inc.php you will find more configuration parameters that are repeated. They serve to manage DBs in various hosts with the same interface. \begin_inset LatexCommand \index{interface} \end_inset \layout Section phpMyAdmin: How to administer MySQL via Web \begin_inset LatexCommand \label{phpmyadmin2} \end_inset \layout Standard Once you have opened your phpMyAdmin (to do this, if you are working locally, you would have to open \begin_inset LatexCommand \url[http://localhost/phpmyadmin]{http://localhost/phpmyadmin} \end_inset with your browser), you will get a screen that offers you the possibilities of \layout Itemize Select a database through a drop-down list. \layout Itemize Create a new database \begin_inset LatexCommand \index{base} \end_inset \layout Standard as in \begin_inset LatexCommand \ref{fig-phpmyadmin-select-database} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-select-database.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-select-database} \end_inset phpMyAdmin: Select database. \end_inset \layout Standard Once you have chosen the desired operation, \begin_inset LatexCommand \index{operation} \end_inset you arrive at the administration interface of your phpMyAdmin. \begin_inset LatexCommand \index{Admin} \end_inset Newer versions contain a navigation bar, located at the top ( \begin_inset LatexCommand \ref{fig-phpmyadmin-navigation-bar} \end_inset ), offering the following options: \layout Itemize Structure: See the database structure. \begin_inset LatexCommand \index{structure} \end_inset \layout Itemize SQL: \begin_inset LatexCommand \index{SQL} \end_inset Execute SQL operations (e.g. load an existing database). \layout Itemize Export: Make a backup of the database. \begin_inset LatexCommand \index{base} \end_inset \layout Itemize Search: Search for data. \begin_inset LatexCommand \index{data} \end_inset \layout Itemize Query: \begin_inset LatexCommand \index{Query} \end_inset Display the structure of an SQL query (useful for programmers). \layout Itemize Drop: Delete a database (be careful!). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-navigation-bar.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-navigation-bar} \end_inset phpMyAdmin: Navigation bar. \end_inset \layout Standard As far as we are concerned here, we only need to explain the first 3 items: \layout Subsection phpMyAdmin navigation bar: Structure \begin_inset LatexCommand \label{phpMyAdmin-navigation-bar-Structure} \end_inset \layout Standard \begin_inset Quotes eld \end_inset Structure \begin_inset Quotes erd \end_inset presents a list of the available tables in the database, \begin_inset LatexCommand \index{base} \end_inset with the follwing accompanying options: \layout Itemize Browse: \begin_inset LatexCommand \index{Browse} \end_inset shows the content of the table. \layout Itemize Select: is used to make SQL queries to the table. \layout Itemize Insert: is used to insert new data into the table. \layout Itemize Properties: displays the structure of the table, ie. its fields, their type, length etc. \layout Itemize Drop: deletes the table (be careful!). \layout Itemize Empty: empties the content of the table, but does not delete the table itself, it leaves it empty (be careful again!). \layout Standard The most frequently asked questions in this context are: \layout Description How\SpecialChar ~ do\SpecialChar ~ I\SpecialChar ~ delete\SpecialChar ~ a\SpecialChar ~ single\SpecialChar ~ record\SpecialChar ~ of\SpecialChar ~ the\SpecialChar ~ table? Select the table, click on \begin_inset Quotes eld \end_inset Browse \begin_inset LatexCommand \index{Browse} \end_inset \begin_inset Quotes erd \end_inset and select \begin_inset Quotes eld \end_inset Delete \begin_inset Quotes erd \end_inset for the record in question. \layout Description If\SpecialChar ~ the\SpecialChar ~ password\SpecialChar ~ is\SpecialChar ~ stored\SpecialChar ~ encrypted\SpecialChar ~ with\SpecialChar ~ MD5,\SpecialChar ~ how\SpecialChar ~ do\SpecialChar ~ I\SpecialChar ~ change\SpecialChar ~ it? Select the table, click on \begin_inset Quotes eld \end_inset Browse \begin_inset LatexCommand \index{Browse} \end_inset \begin_inset Quotes erd \end_inset , then on \begin_inset Quotes eld \end_inset Edit \begin_inset LatexCommand \index{Edit} \end_inset \begin_inset Quotes erd \end_inset and enter, in clear text, the desired password. \begin_inset LatexCommand \index{password} \end_inset Select from the drop-down \begin_inset Quotes eld \end_inset Function \begin_inset Quotes erd \end_inset menu besides the field the desired function, \begin_inset LatexCommand \index{function} \end_inset in our case \begin_inset Quotes eld \end_inset MD5 \begin_inset LatexCommand \index{MD5} \end_inset \begin_inset Quotes erd \end_inset (see \begin_inset LatexCommand \ref{fig-phpmyadmin-field-functions} \end_inset ). See also \begin_inset LatexCommand \ref{administrator-password-lost} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-field-functions.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-field-functions} \end_inset phpMyAdmin: field functions. \end_inset \layout Subsection phpMyAdmin navigation bar: SQL \begin_inset LatexCommand \label{phpMyAdmin-navigation-bar-SQL} \end_inset \layout Standard \begin_inset Quotes eld \end_inset SQL \begin_inset LatexCommand \index{SQL} \end_inset \begin_inset Quotes erd \end_inset serves the purpose of \begin_inset Quotes eld \end_inset loading \begin_inset Quotes erd \end_inset whole datasets or already existing databases with one action. The datasets (or the database) are presumed to be already available in a MySQL \begin_inset Quotes eld \end_inset dump file \begin_inset Quotes erd \end_inset . This is a text file containing all the necessary SQL queries that must be sent to the database server, \begin_inset LatexCommand \index{server} \end_inset in order for the datasets or database to be created. An example of such a dump file is the nuke.sql file that comes with PHP-Nuke and contains all the database instructions for the tables to be created during installation (see \begin_inset LatexCommand \ref{install-db} \end_inset ). \layout Standard The use of this function is very simple: just search your system for the dump file you want to load, \begin_inset LatexCommand \index{load} \end_inset by hitting the \begin_inset Quotes eld \end_inset Browse \begin_inset LatexCommand \index{Browse} \end_inset \begin_inset Quotes erd \end_inset button ( \begin_inset LatexCommand \ref{fig-phpmyadmin-SQL} \end_inset ). MySQL dump files usually come with the \begin_inset Quotes eld \end_inset .sql \begin_inset Quotes erd \end_inset ending, but \begin_inset Quotes eld \end_inset .sql.php \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset .txt \begin_inset Quotes erd \end_inset or even \begin_inset Quotes eld \end_inset .php \begin_inset Quotes erd \end_inset are also in use. Whether the file is a MySQL dump file or not, can only be told by inspection: open it with a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ) and if the first lines look like \layout Code # MySQL dump 6.6 \layout Code # \layout Code ... \layout Code # \layout Code # Table structure for table 'xxxxx' \layout Code # \layout Code CREATE TABLE xxxxx ... \layout Code ... \layout Code # \layout Code # Dumping data for table 'xxxxx' \layout Code # \layout Code INSERT INTO xxxxx ... \layout Standard i.e. if it contains CREATE and/or INSERT SQL statements, \begin_inset LatexCommand \index{statements} \end_inset then it is a dump file (see also \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-Export} \end_inset ). \layout Standard This function is useful when you want to create whole databases and fill them with data in one step, but it is also very useful when you want to add data to an existing database. \begin_inset LatexCommand \index{base} \end_inset However, this does not mean that it will always succeed: especially if the dump files are very large, this operation my exceed the PHP CPU limit (usually set to 30 sec. by the ISPs). (see, for example, \begin_inset LatexCommand \ref{backup-mysql-using-browser} \end_inset ) \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-SQL.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-SQL} \end_inset phpMyAdmin: SQL function. \end_inset \layout SGML \layout SGML Beware of long .sql files! \layout SGML \layout SGML You can of course use phpMyAdmin to comfortably import any MySQL dump file, i.e. from a previous backup of an existing installation with thousands of forums posts. In this case, the import may take longer than the limit on the execution time of PHP scripts that most ISPs set (usually 30 sec.). You will end up with a half-filled database! \layout SGML \layout SGML \layout SGML In this case, either cut the file up into smaller chucks and use phpMyAdmin to load the smaller files, or insert the text piecewise for execution in the text area field of phpMyAdmin that is there for this purpose, or, as a last resort, do it from the command line, as shown in \begin_inset LatexCommand \ref{database-creation} \end_inset . \layout SGML \layout SGML \layout SGML See also \begin_inset LatexCommand \url[how to import a '.sql' (>3M) file to mysql database with phpmyadmin?]{http://forums.devshed.com/archive/4/2001/07/2/17971} \end_inset , \begin_inset LatexCommand \url[Importing .sql files into an existing database in phpmyadmin]{http://www.nukeforums.com/forums/viewtopic.php?t=16590} \end_inset . \layout SGML \layout SGML \layout Subsection phpMyAdmin navigation bar: Export \begin_inset LatexCommand \label{phpMyAdmin-navigation-bar-Export} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-database-dump.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-database-dump} \end_inset phpMyAdmin: database dump. \end_inset \layout Standard The \begin_inset Quotes eld \end_inset Export \begin_inset Quotes erd \end_inset function is useful for obtaining backups of our database (we recall that this is also possible to do from the administration panel of PHP-Nuke, see \begin_inset LatexCommand \ref{administration-functions} \end_inset ). The management console we get for this function is quite detailed ( \begin_inset LatexCommand \ref{fig-phpmyadmin-database-dump} \end_inset ): \layout Standard In the central area, we have a list of the database tables, \begin_inset LatexCommand \index{tables} \end_inset while to the right we have the backup options: \layout Itemize Structure only: backs up the structure of the database (tables, \begin_inset LatexCommand \index{tables} \end_inset their fields and their properties), but not the data it contains (i.e. the tables are left empty). \layout Itemize Structure and data: \begin_inset LatexCommand \index{data} \end_inset will save not only the structure, as above, but the data in the tables as well. \layout Itemize Data only: will save only the data, \begin_inset LatexCommand \index{data} \end_inset but not the structure. \layout Itemize XML: saves the database in an XML format. \begin_inset LatexCommand \index{format} \end_inset \layout Standard The options that appear in the lower part of the screen have to do with the extra features the created backup file should have: \layout Itemize Add 'Drop Table': Prepends an instruction to destroy any existing table with that name to the instructions that create that table. For example, if we already have a table \begin_inset Quotes eld \end_inset nuke_authors \begin_inset LatexCommand \index{nuke_authors} \end_inset \begin_inset Quotes erd \end_inset in our database, \begin_inset LatexCommand \index{base} \end_inset this option will take care of removing it, before it loads the structure and/or data for a table with the same name. Otherwise, attempting to import a file that contains structure and/or data \begin_inset LatexCommand \index{data} \end_inset for nuke_authors will result in an error, since the table will already exist. You should check this option if you are reinstalling PHP-Nuke over a previous unsuccessful instalation and you think you might already have some tables \begin_inset LatexCommand \index{tables} \end_inset there. \layout Itemize Save as file: will save the backup as a file (which will be compressed according ly, with either ZIP or GZIP, \begin_inset LatexCommand \index{GZIP} \end_inset if the \begin_inset Quotes eld \end_inset zipped \begin_inset LatexCommand \index{zipped} \end_inset \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset gzipped \begin_inset LatexCommand \index{zipped} \end_inset \begin_inset Quotes erd \end_inset boxes are checked - other versions of phpMyAdmin may only offer a \begin_inset Quotes eld \end_inset bzip \begin_inset LatexCommand \index{zip} \end_inset \begin_inset Quotes erd \end_inset compression). \layout Standard If we don't select any table from the table list, phpMyAdmin will deduce that we want to save all tables. \begin_inset LatexCommand \index{tables} \end_inset In case you want to select only some of them, just click on the ones you want with the left mouse button, keeping the CTRL button pressed. \layout Standard To export a database from the command-line, \begin_inset LatexCommand \index{command-line} \end_inset without the use of the graphical tool of phpMyAdmin, \begin_inset LatexCommand \index{Admin} \end_inset you just do: \layout Code mysqldump -u dbuser -h dbhost -p dbname > dbdump.sql \layout Standard where dbuser, \begin_inset LatexCommand \index{dbuser} \end_inset dbhost and dbname are the database user, host and name respectively, exactly as entered in config. \begin_inset LatexCommand \index{config} \end_inset php ( \begin_inset LatexCommand \ref{config-php-file} \end_inset ). \layout Subsection phpMyAdmin: other commands \begin_inset LatexCommand \label{phpMyAdmin-other-commands} \end_inset \layout Standard Yet another couple of instructions: In order to see the structure of a table, you only need to click on the one that is marked in the left bar and you will see all its fields and modification options appear in the central part ( \begin_inset LatexCommand \ref{fig-forum_topics} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename snapshot19.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum_topics} \end_inset phpMyAdmin: table forum_topics. \end_inset \layout SGML \layout SGML \layout SGML ATTENTION! \layout SGML \layout SGML \layout SGML The DROP command eliminates all the contents of the DB, the table or the single field, use it with caution. \layout SGML \layout SGML \layout Standard To learn more about the possibilities that phpMyAdmin offers you in administerin g your databases, \begin_inset LatexCommand \index{databases} \end_inset see \begin_inset LatexCommand \url[Doing More With phpMyAdmin (Part 1)]{http://www.devshed.com/Server_Side/PHP/Doing_More_phpMyAdmin/page1.html} \end_inset and \begin_inset LatexCommand \url[Doing More With phpMyAdmin (Part 2)]{http://www.devshed.com/Server_Side/PHP/Doing_More_phpMyAdmin_part2/page1.html} \end_inset . The first part explains how to obtain the software, install and configure it for secure access, \begin_inset LatexCommand \index{access} \end_inset and use it for tasks such as managing multiple servers, manipulating user privileges, \begin_inset LatexCommand \index{privileges} \end_inset viewing reports on server activity, and exporting MySQL records into different formats. \begin_inset LatexCommand \index{formats} \end_inset The second part explains the more advanced aspects of the application, \begin_inset LatexCommand \index{application} \end_inset including using it for transformations, \begin_inset LatexCommand \index{ations} \end_inset maintaining a history of all the SQL queries executed in the phpMyAdmin session, \begin_inset LatexCommand \index{session} \end_inset defining relations between tables to create JOINs automatically, creating E-R diagrams in PDF format, \begin_inset LatexCommand \index{format} \end_inset and bookmarking important queries for future reference. \layout Subsection How to install the DB of PHP-Nuke with PHPMyadmin \begin_inset LatexCommand \label{install-db} \end_inset \layout Standard Create a database that will contain the PHP-Nuke tables (see \begin_inset LatexCommand \ref{fig-phpmyadmin-create-database} \end_inset ). The name of the database should be the same name as the one you entered in config. \begin_inset LatexCommand \index{config} \end_inset php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-create-database.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-create-database} \end_inset phpMyAdmin: Create database. \end_inset \layout Standard To populate the database, \begin_inset LatexCommand \index{base} \end_inset you have to import the nuke.sql file, exactly as we showed in \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-SQL} \end_inset for general database dump files. Clicking on the left bar, depending on the database you selected, you will see a list menu coming up, showing the structure of the database (and, on the same time, the central page will show the enlarged structure of the database), with a series of options, all of them in the bottom of the page (see \begin_inset LatexCommand \ref{fig-phpmyadmin-table-structure} \end_inset ). It is these options we are interested in when installing PHP-Nuke. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-table-structure.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-table-structure} \end_inset phpMyAdmin: table structure and selection. \end_inset \layout Standard What you have to do now, is to click on \begin_inset Quotes eld \end_inset browse \begin_inset Quotes erd \end_inset and go search for the \SpecialChar \@. sql file that contains the instructions that build the structure of the PHP-Nuke database (see \begin_inset LatexCommand \ref{fig-phpmyadmin-sql-query} \end_inset ). Once found, it suffices to click on \begin_inset Quotes eld \end_inset Go \begin_inset Quotes erd \end_inset and the database will be installed. Of course, if there are errors, they will be reported at the end of the installation procedure. \begin_inset LatexCommand \index{procedure} \end_inset And of course, the same holds for the message \begin_inset Quotes eld \end_inset operation succeeded \begin_inset Quotes erd \end_inset . \layout SGML \layout SGML Don't delete the whole database on the ISP! \layout SGML \layout SGML If you have bought some hosting space on your ISP's servers, you may not be able to create databases at your will, but be constrained to use only the one that your ISP created for you. In this case, you can create, delete and modify its tables and their contents, but not the database itself! Don't drop the whole database, as you may not be allowed to recreate it! \layout SGML \layout SGML \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-sql-query.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-sql-query} \end_inset phpMyAdmin: SQL query. \end_inset \layout Standard You can verify that the tables were populated with data by browsing their contents ( \begin_inset LatexCommand \ref{fig-phpmyadmin-table-data} \end_inset ) - click on the small icons besides their names in the left frame for this (if you click on their names, you will only see their structure). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-table-data.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-table-data} \end_inset phpMyAdmin: table data. \end_inset \layout Standard Other options of PHPMyAdmin that are not relative to the installation \begin_inset LatexCommand \index{installation} \end_inset of PHP-Nuke, but still useful for the administration of the database, \begin_inset LatexCommand \index{base} \end_inset can be found in \begin_inset LatexCommand \ref{phpmyadmin} \end_inset . \layout Section How to install PHP-Nuke using nukesql.php \begin_inset LatexCommand \label{install-PHP-Nuke-nukesql} \end_inset \layout Standard If fiddling with the database from the MySQL command line does not make you feel comfortable, you can use one of the \begin_inset LatexCommand \url[Web Installers for PHP-Nuke]{http://www.nukeresources.com/modules.php?name=Downloads&d_op=search&query=nukesql} \end_inset available for your version, in the form of the nukesql.php script. This file will install all required database tables for a fresh installation \begin_inset LatexCommand \index{installation} \end_inset of PHP-Nuke. It works a follows: \layout Standard Simply enter your database login information in config. \begin_inset LatexCommand \index{config} \end_inset php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ), upload all PHP-Nuke files ( \begin_inset LatexCommand \ref{upload} \end_inset ), then upload this file to PHP-Nuke's root directory and point your browser to it (e.g. http://yoursite.com/nukesql.php). \layout Standard nukesql.php proceeds in an interactive way to populate the database tables \begin_inset LatexCommand \index{tables} \end_inset and test your settings in config.php. \begin_inset LatexCommand \index{config.php} \end_inset \layout Standard Some of its features: \begin_inset LatexCommand \index{features} \end_inset \layout Itemize Checks that you are not using the default $sitekey ( \begin_inset LatexCommand \ref{fig-analyze-warning-sitekey} \end_inset ). \layout Itemize Lists existing database tables if any. \layout Itemize Installs tables on a empty database. \begin_inset LatexCommand \index{base} \end_inset \layout Itemize Replaces existing tables with new ones. \layout Itemize Creates duplicate tables for a second nuke site using one database by using a different prefix in config. \begin_inset LatexCommand \index{config} \end_inset php (see also \begin_inset LatexCommand \ref{more-than-one-php-nuke-sites} \end_inset ). \layout Itemize Will help you troubleshoot installation by testing connection to the MySQL \begin_inset LatexCommand \index{MySQL} \end_inset server and selection of database (see also \begin_inset LatexCommand \ref{test-scripts} \end_inset ). \layout Section How to install PHP-Nuke locally \begin_inset LatexCommand \label{install-PHP-Nuke-locally} \end_inset \layout Standard A PHP-Nuke installation on your own computer will give you the opportunity to test the whole spectrum of functionalities offered, as if you were online and your system were hosted in your ISP. \begin_inset LatexCommand \index{ISP} \end_inset But in order to start working on PHP-Nuke locally, you must have a web server installed on your box. In this section we will cover the necessary steps towards a working PHP-Nuke environment (Apache + PHP + MySQL ) under Windows and Linux. \begin_inset LatexCommand \index{Linux} \end_inset \layout Standard For Windows, \begin_inset LatexCommand \index{Windows} \end_inset there are various packages you can choose from - they will install Apache, PHP and even MySQL for you and will provide a ready-to-use \begin_inset LatexCommand \index{ready-to-use} \end_inset environment for the installation of PHP-Nuke. Among them, there are easyPHP ( \begin_inset LatexCommand \ref{easyPHP} \end_inset ), XAMPP ( \begin_inset LatexCommand \ref{XAMPP} \end_inset ) and Apache2Triad ( \begin_inset LatexCommand \ref{Apache2Triad} \end_inset ). \layout Subsection easyPHP \begin_inset LatexCommand \label{easyPHP} \end_inset \layout Standard After the \begin_inset LatexCommand \url[download of easyPHP]{http://www.easyphp.org/telechargements.php3} \end_inset (version 1.6 or later), istallation is really easy: just click the setup \begin_inset LatexCommand \index{setup} \end_inset icon to start it. You will be asked a few questions in the processes and that's all. The first screen is a welcome message and you only have to click on \begin_inset Quotes eld \end_inset next \begin_inset Quotes erd \end_inset ( \begin_inset Quotes eld \end_inset suivant \begin_inset Quotes erd \end_inset ). You will then be presented with screens like licence etc. and you can continue clicking on \begin_inset Quotes eld \end_inset next \begin_inset Quotes erd \end_inset ( \begin_inset Quotes eld \end_inset suivant \begin_inset Quotes erd \end_inset ), until you reach the screen that asks you where you want to install easyPHP \begin_inset LatexCommand \index{easyPHP} \end_inset ( \begin_inset LatexCommand \ref{fig-easyphp} \end_inset ), in which case you just choose the right path (if you have doubts about the right path, you can leave it to the default just as well). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename easyphp.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-easyphp} \end_inset easyPHP: Installation screen. \end_inset \layout Standard Continue clicking on \begin_inset Quotes eld \end_inset suivant \begin_inset Quotes erd \end_inset until the end of the installation, \begin_inset LatexCommand \index{installation} \end_inset when you have to click on \begin_inset Quotes eld \end_inset terminer \begin_inset Quotes erd \end_inset to end it. easyPHP is now installed. \layout Standard But where should you install PHP-Nuke in a system with easyPHP installed? Suppose you installed easyPHP in a folder like c: \backslash easyphp. \begin_inset LatexCommand \index{easyphp} \end_inset Open that folder and you will find various subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset The one that is important is www. It is under the www folder that the local copy of Apache will expect the files to process - and it is exactly there where you should install PHP-NukeI in the c: \backslash easyphp \begin_inset LatexCommand \index{easyphp} \end_inset \backslash www folder. \layout Standard We must still explain a couple of elements of easyPHP's functioning. Once you start the easyPHP application, \begin_inset LatexCommand \index{application} \end_inset you will find an icon in the bottom bar, to the right of your screen, \begin_inset LatexCommand \index{screen} \end_inset that resembles an \begin_inset Quotes eld \end_inset e \begin_inset Quotes erd \end_inset with a small red point ( \begin_inset LatexCommand \ref{fig-easyphp2} \end_inset ). If the red point is lighting, the server is active, if it is dimmed out, the server is shut down. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename easyphp2.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-easyphp2} \end_inset easyPHP icon in the bottom bar. \end_inset \layout Standard To administrate easyPHP, \begin_inset LatexCommand \index{easyPHP} \end_inset you only have to click on that black \begin_inset Quotes eld \end_inset e \begin_inset Quotes erd \end_inset . A right click with the mouse will offer a menu with all commands available for the server administration, \begin_inset LatexCommand \index{administration} \end_inset a double click with the left mouse button will instead offer an information screen. \begin_inset LatexCommand \index{screen} \end_inset \layout Subsubsection How to check a successful installation \begin_inset LatexCommand \label{easyPHP-check-successful-installation} \end_inset \layout Standard To make sure that Apache and PHP have been installed correctly on our system, \begin_inset LatexCommand \index{system} \end_inset we will use the phpinfo() function of PHP, \begin_inset LatexCommand \index{PHP} \end_inset which asks the server to give information about the PHP configuration. \begin_inset LatexCommand \index{configuration} \end_inset If we get a screen like the one of \begin_inset LatexCommand \ref{fig-phpinfo-php-Windows} \end_inset , then everything is working correctly. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpinfo-php.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpinfo-php-Windows} \end_inset phpinfo: PHP screen for a Windows system. \end_inset \layout Standard To construct a file that uses the phpinfo() function, \begin_inset LatexCommand \index{function} \end_inset you can either use the text.php script of \begin_inset LatexCommand \ref{test-php} \end_inset , or, even more simply, create a text file (with a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset , see also \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ) that contains only the line \layout Code \layout Standard Save the file under the name, say, info. \begin_inset LatexCommand \index{info} \end_inset php and move it to the www folder of the easyPHP directory (we talked about it above). Then enter the URL \begin_inset LatexCommand \index{URL} \end_inset \layout Code http://localhost/info.php \layout Standard in the address bar of your browser and you should get (among other information) the screen of \begin_inset LatexCommand \ref{fig-phpinfo-php-Windows} \end_inset . \layout Subsection XAMPP \begin_inset LatexCommand \label{XAMPP} \end_inset \layout Standard \begin_inset LatexCommand \url[XAMPP]{http://www.apachefriends.org/xampp-en.html} \end_inset is an easy to install Apache distribution containing MySQL, \begin_inset LatexCommand \index{MySQL} \end_inset PHP and Perl. XAMPP is really very easy to install and to use - just download, \begin_inset LatexCommand \index{download} \end_inset extract and start. \layout Standard The distribution for Linux system (tested for SuSE, RedHat, \begin_inset LatexCommand \index{RedHat} \end_inset Mandrake and Debian) contains: Apache, MySQL, PHP & PEAR, \begin_inset LatexCommand \index{PEAR} \end_inset Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, \begin_inset LatexCommand \index{zlib} \end_inset expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, \begin_inset LatexCommand \index{mod_perl} \end_inset FreeTDS, gettext, mcrypt, \begin_inset LatexCommand \index{mcrypt} \end_inset mhash, Turck MMCache, SQLite and IMAP C-Client. \layout Standard The distribution for Windows 98, NT, 2000 and XP contains: Apache, MySQL, \begin_inset LatexCommand \index{MySQL} \end_inset PHP + PEAR, Perl, mod_php, \begin_inset LatexCommand \index{mod_php} \end_inset mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, JpGraph, \begin_inset LatexCommand \index{JpGraph} \end_inset FileZilla FTP Server, mcrypt, Turck MMCache, SQLite, and WEB-DAV + mod_auth_mys \begin_inset LatexCommand \index{mod_auth_mys} \end_inset ql. The versions of the programs included in the latest version for Windows \begin_inset LatexCommand \index{Windows} \end_inset are: \layout Itemize Apache 2.0.48 \layout Itemize MySQL 4.0.16 \layout Itemize PHP 4.3.4 \layout Itemize Openssl 0.9.7c \layout Itemize SQLite 2.8.6 \layout Itemize mod_php 4.3.4 + mod_perl 1.99_10 + mod_ssl 2.0.48 \layout Standard To install XAMPP you only need to download and extract XAMPP, \begin_inset LatexCommand \index{XAMPP} \end_inset that's all. There are no changes to the Windows registry and it's not necessary to edit any configuration files. It couldn't be easier! \layout Standard To check that XAMPP is working some sample programs are included, there is a small CD collection program (written in PHP using MySQL) and a small guest book software (written in Perl) and several other utilities. \layout Standard If you decide that XAMPP isn't needed any more just delete the XAMPP directory and it's completely removed from your system. \begin_inset LatexCommand \index{system} \end_inset \layout SGML \layout SGML On the press: Call for donations \layout SGML \layout SGML On December 19, 2003, someone applied to the German Patent and Trademark Office for the rights to the "XAMPP" name. This person was not one of the XAMPP developers, but someone totally unknown to them. \layout SGML \layout SGML \layout SGML The trademark application is a danger for the project's future, since the applicant could - if no legal measures are taken - forbid that the XAMPP developers use that name for their software or do business taking advantage of the name's popularity. \layout SGML \layout SGML \layout SGML The XAMPP developers call on the project's website for donations to help counter this threat with legal means. Whether you are a new XAMPP user, a friend of Apache Friends, or just someone who would like to help, please take the time and \begin_inset LatexCommand \url[make a donation to the XAMPP project]{http://www.apachefriends.org/genugistgenug.html} \end_inset . \layout SGML \layout SGML \layout Subsection Apache2Triad \begin_inset LatexCommand \label{Apache2Triad} \end_inset \layout Standard \begin_inset LatexCommand \url[Apache2Triad]{http://www.hotscripts.com/Detailed/23555.html} \end_inset offers the following goodies, \begin_inset LatexCommand \index{goodies} \end_inset according to the Description: \layout Quotation Apache 2.0.47 , MySQL 4.0.13 , OpenSSL 0.9.7b PHP 4.3.3 , Perl 5.8.0 , Tcl 8.4.2 , Python \begin_inset LatexCommand \index{Python} \end_inset 2.2.2 plus PHP-Nuke 6.8 , PHPmyadmin 2.5.2 , AWStats 5.7 plus Stunnel 4.04 , SSLCert \begin_inset LatexCommand \index{SSLCert} \end_inset 1.0 plus Xmail 1.1.6 and SlimFTPd 3.13 plus UebiMiau 2.7.2 and PHPXmail 0.33 all configured and easy to install and easy to customize as it has the cleanest layout and structure there is and is updated for every new release of the software it contains plus The Apache2triad Control Pannel suite of tools plus Full documentations plus Unparalelled Installer. \layout Standard The homepage of the program is \begin_inset LatexCommand \url[Apache2Triad]{http://apache2triad.org/} \end_inset . Apache2Triad is not free for commercial usage: if your company wants to use Apache2Triad you must purchase it for 15$, which is certainly worth the money if you only think at the frustration it saves you by installing all the above packages for you. \layout Subsection Apache, PHP and MySQL on Mandrake Linux \begin_inset LatexCommand \label{Mandrake-Linux-Apache-PHP-MySQL} \end_inset \layout Standard We will describe how to get a functioning, local installation of the Apache-PHP- MySQL trio on a Linux system - we chose Mandrake Linux for this purpose, but the process is similar with other distributions. We will use visual tools for our purposes, making the assumption that, whoever is capable of compiling the binaries from the source code himself, will not need our guidance. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename apache-package.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-apache-package} \end_inset RPMdrake: selecting the Apache package(s) for installation. \end_inset \layout Standard The most simple thing to do to get Apache, \begin_inset LatexCommand \index{Apache} \end_inset PHP and MySQL installed under Linux, \begin_inset LatexCommand \index{Linux} \end_inset is to install the appropriate packages from the CD. For this, we will use the software application tool called RPMdrake; \begin_inset LatexCommand \index{RPMdrake} \end_inset upon execution, it will ask for the root password; \begin_inset LatexCommand \index{password} \end_inset after we enter it, we will be presented a screen that asks us what we want to install. We enter \begin_inset Quotes eld \end_inset Apache \begin_inset LatexCommand \index{Apache} \end_inset \begin_inset Quotes erd \end_inset in the aproppriate field and in the sequence we choose the main Apache \begin_inset LatexCommand \index{Apache} \end_inset package ( \begin_inset LatexCommand \ref{fig-apache-package} \end_inset ). RPMdrake will ask us if we also want to install the packages of the \begin_inset Quotes eld \end_inset dependencies \begin_inset LatexCommand \index{dependencies} \end_inset \begin_inset Quotes erd \end_inset (i.e. packages which the main package we selected depends on). It is important to answer with \begin_inset Quotes eld \end_inset yes \begin_inset Quotes erd \end_inset here. \layout Standard We then click on \begin_inset Quotes eld \end_inset install \begin_inset Quotes erd \end_inset and we are asked to insert the CD (or the CDs) containing the RPM packages. \begin_inset LatexCommand \index{packages} \end_inset Once Apache has been installed, we open the Mandrake Control Center and click on \begin_inset Quotes eld \end_inset Start \begin_inset Quotes erd \end_inset for the httpd service ( \begin_inset LatexCommand \ref{fig-mandrake-control-center} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename mandrake-control-center.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-mandrake-control-center} \end_inset Mandrake Control Center. \end_inset \layout Standard The last control step is to open our browser and instruct it to open http://loca lhost/. If the browser's response is Apache's Welcome Page, we are done. \layout Standard We have to repeat the above operations in the same identical way for the PHP and MySQL packages. \begin_inset LatexCommand \index{packages} \end_inset In order to make the MySQL database service available, we have again to go to Mandrake Control Center and click on \begin_inset Quotes eld \end_inset Start \begin_inset Quotes erd \end_inset for the mysql service - PHP does not need this step, it is available immediatel y after installation. \begin_inset LatexCommand \index{installation} \end_inset \layout Standard But where is the folder for the HTML files and our PHP-Nuke? It turns out that this is under /var/www/html and we should use phpMyAdmin ( \begin_inset LatexCommand \ref{phpmyadmin} \end_inset ) to give this folder the permissions of 777 (for more on file permissions, \begin_inset LatexCommand \index{permissions} \end_inset see \begin_inset LatexCommand \ref{permissions} \end_inset ). This way all users will be able to add, modify and delete files there, not only root. \begin_inset LatexCommand \index{root} \end_inset \layout Standard To verify that everything has gone well, we use the info. \begin_inset LatexCommand \index{info} \end_inset php file of \begin_inset LatexCommand \ref{easyPHP-check-successful-installation} \end_inset . If we get a screen similar to that of \begin_inset LatexCommand \ref{fig-phpinfo-php-Windows} \end_inset , then everything is fine. \layout Subsection Apache, PHP and MySQL on Red Hat Linux \begin_inset LatexCommand \label{Red-Hat-Linux-Apache-PHP-MySQL} \end_inset \layout Standard For some obscure reason, Red Hat 8.0 does not connect the PHP package to that of MySQL and we have to resort to some tricks to make them work together. Thus, for Red Hat, you have to proceed as follows: \layout Standard If Apache, \begin_inset LatexCommand \index{Apache} \end_inset PHP and MySQL are not already installed, install the appropriate packages. \begin_inset LatexCommand \index{packages} \end_inset For Red Hat 8.0, choose the \begin_inset Quotes eld \end_inset Packages \begin_inset Quotes erd \end_inset menu entry as shown in \begin_inset LatexCommand \ref{fig-red-hat-menu-packages} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename red-hat-menu-packages.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-red-hat-menu-packages} \end_inset Red Hat Menu: Packages. \end_inset \layout Standard Once you have entered the system (as root), you can choose the three necessary pieces (Apache, \begin_inset LatexCommand \index{Apache} \end_inset PHP and MySQL): \layout Itemize Apache is found under \begin_inset Quotes eld \end_inset Web Server \begin_inset Quotes erd \end_inset . \layout Itemize PHP is found under \begin_inset Quotes eld \end_inset Web Server \begin_inset Quotes erd \end_inset . \layout Itemize MySQL is found under \begin_inset Quotes eld \end_inset SQL database Server \begin_inset Quotes erd \end_inset . \layout Standard To see what is contained in each section, click on the \begin_inset Quotes eld \end_inset Details \begin_inset Quotes erd \end_inset link ( \begin_inset LatexCommand \ref{fig-red-hat-package-sections} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename red-hat-package-sections.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-red-hat-package-sections} \end_inset Red Hat: Package Sections. \end_inset \layout Standard After the selection of packages, \begin_inset LatexCommand \index{packages} \end_inset you must click on \begin_inset Quotes eld \end_inset Update \begin_inset LatexCommand \index{date} \end_inset \begin_inset Quotes erd \end_inset and Red Hat will go on to install them, after it has checked their dependencies. \begin_inset LatexCommand \index{dependencies} \end_inset \layout Standard Now, Apache, \begin_inset LatexCommand \index{Apache} \end_inset PHP and MySQL are installed, but unfortunately, we are not yet done: we must ensure that PHP will talk to MySQL. \begin_inset LatexCommand \index{MySQL} \end_inset To this end, we must do 2 things: \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Edit the php.ini file, so that PHP supports also files that start with \begin_inset Quotes eld \end_inset Terminal) \layout Itemize Login as root (command \begin_inset Quotes eld \end_inset su \begin_inset Quotes erd \end_inset , then enter the password) \layout Itemize Start our preferred text editor (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ). The editor will start with root privileges, \begin_inset LatexCommand \index{privileges} \end_inset so you can edit the php.ini file, usually located under /etc, and set the short_open_tag parameter \begin_inset LatexCommand \index{parameter} \end_inset to ON: \begin_deeper \layout Code ; Allow the tags are recognized. \layout Code short_open_tag = On \end_deeper \layout Itemize For your local experiments, it is comfortable to also set safe_mode to OFF and register_globals to ON (but see \begin_inset LatexCommand \ref{security-measures} \end_inset for the security related point of view on this). \layout Itemize Save everything and you are done with operation 1 above. \layout Itemize Operation 2 is simple: just copy the mysql.so file brutally into /usr/lib/php4/. You should do this with root permissions. \begin_inset LatexCommand \index{permissions} \end_inset \layout Standard The only thing that remains now, is to restart the services. \begin_inset LatexCommand \index{services} \end_inset We can do this from the command-line of a terminal window and also through a graphical tool. For the novice user, we will describe the graphical way - again, an advanced user will know how to do this from the command-line (see \begin_inset LatexCommand \url[GNU/Linux Command-Line Tools Summary]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset for a compact summary of command-line tools in Linux). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename red-hat-service-configuration.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-red-hat-service-configuration} \end_inset Red Hat: Service Configuration Panel. \end_inset \layout Standard The activation or restart of the service we are interested in takes place by selecting the appropriate entry for that service in the Service Configuratio n Panel (httpd is the service for Apache, \begin_inset LatexCommand \index{Apache} \end_inset while mysqld is the service for MySQL), then click on \begin_inset Quotes eld \end_inset activate \begin_inset LatexCommand \index{activate} \end_inset \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset restart \begin_inset LatexCommand \index{restart} \end_inset \begin_inset Quotes erd \end_inset respectively ( \begin_inset LatexCommand \ref{fig-red-hat-service-configuration} \end_inset ). \layout Standard Note that in order for our changes in PHP to take effect, we will have to restart Apache. \begin_inset LatexCommand \index{Apache} \end_inset \layout Standard Now you can connect to your server by pointing your browser to http://localhost or to http://127. \begin_inset LatexCommand \index{127} \end_inset 0.0.1. \layout SGML \layout SGML Apache and the hosts file \layout SGML \layout SGML If the Apache service does not start, it may be because it cannot resolve "localhost" correctly. This name for the local computer is given the IP address 127.0.0.1 in the hosts file (usually under /etc). You can try to change \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML in /etc/hosts to: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout Standard The folder that is expected to hold the HTML files is again /var/www/html. Note that, again, in order for the normal user to be able to modify the HTML files, you will have to change the permissions of that folder to 777 \begin_inset LatexCommand \index{777} \end_inset (see \begin_inset LatexCommand \ref{permissions} \end_inset ). \layout Standard It is also comfortable to create a link to that folder on the client's desktop, so that he does not have to click his way through the path each time. \layout Section The config.php file \begin_inset LatexCommand \label{config-php-file} \end_inset \layout Standard The last thing that remains to do before starting with the management of your site, is to configure the file config. \begin_inset LatexCommand \index{config} \end_inset php This is important because it sets up a connection between the PHP files of PHP-Nuke and the MySQL \begin_inset LatexCommand \index{MySQL} \end_inset database that manages it. \layout SGML \layout SGML Important: Use a decent text editor! \layout SGML \layout SGML Do NOT use Notepad or Wordpad to edit the config.php file! These "text" editors don't deserve this name - they introduce extra invisible characters in the file, causing spurious errors with the PHP interpreter. Everything will look O.K., but you will spend many hours trying to find out why your PHP tells you there is an error there. \layout SGML \layout SGML \layout SGML Recommended text editors are UltraEdit (excellent, but not freeware), Crimson Editor , WinSyntax (both good for PHP and Freeware, Crimson Editor has some feature more than WinSyntax) and HTMLkit (free for personal use). \layout SGML \layout SGML \layout SGML Various text editors and their functionalities for PHP are discussed in this decent text editor thread. \layout SGML \layout SGML \layout Standard You need to enter a database username and a password in the config. \begin_inset LatexCommand \index{config} \end_inset php file. This user must have administration rights on the PHP-Nuke MySQL database \begin_inset LatexCommand \index{base} \end_inset (whose name you also entered in the config. \begin_inset LatexCommand \index{config} \end_inset php file). You configure this user to have administration rights on the PHP-Nuke database \begin_inset LatexCommand \index{base} \end_inset by either phpMyAdmin, \begin_inset LatexCommand \index{Admin} \end_inset or from the command line: \layout Code grant all privileges on db.* to dbuser@localhost identified by 'dbpasswd'; \layout SGML \layout SGML Please note \layout SGML \layout SGML This is the \series bold database \series default user account, on whose behalf everything is done from the database point of view. That is, no matter which user is doing something in PHP-Nuke, when he presses [Enter], the command will be forwarded to the database client, who will connect to the database server with that username and password you entered in the config.php. If that username and password were wrong, or that user did not have "all privileges" on the PHP-Nuke database (the database whose name you entered in the config.php), then the client will not be able to connect and you will get an error (one of these exactly-speaking but nothing-communicating "...was not a valid resource" errors ). \layout SGML \layout SGML \layout Standard Let's have a closer look at the configuration process. Compared to the 5.6 version, the config. \begin_inset LatexCommand \index{config} \end_inset php file has undergone a radical diet, leaving it with only a few lines. The rest has been moved to the nuke_config table ( \begin_inset LatexCommand \ref{database-tables} \end_inset ). This has created problems with the Splatt Forum ( \begin_inset LatexCommand \ref{administration-functions} \end_inset ), which also used a table with that name. When you open the file \begin_inset Quotes eld \end_inset config.php \begin_inset LatexCommand \index{config.php} \end_inset \begin_inset Quotes erd \end_inset you will see the following near the top: \layout SGML \layout SGML $dbhost = "localhost"; \layout SGML $dbuname = "root"; \layout SGML $dbpass = ""; \layout SGML $dbname = "nuke"; \layout SGML $prefix = "nuke"; \layout SGML $user_prefix = "nuke"; \layout SGML $dbtype = "MySQL"; \layout SGML $sitekey = "SdFk*fa28367-dm56w69.3a2fDS+e9"; \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In place of "localhost" you will have to put the host/server that the database is installed on. If this is your own computer, the "localhost" is O.K., otherwise you will have to ask your ISP. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In place of "root" you must put the username of the database user that PHP-Nuke will have to use in order to connect to the database and execute the necessary database operations. This user must have been grented all privileges to the PHP-Nuke database as discussed above. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML You will have to insert the password of the database user here. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In place of "nuke" you will have to insert the name of your database here. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML I recommend this to be left to its default value, "nuke", is the prefix that goes in front of the name of every database table. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This is the prefix that goes in front of the name of every database \series bold user \series default table. The idea here is that you can have one prefix, i.e. one PHP-Nuke database, but many user prefixes, i.e. different user tables for different sites. The user tables will have a different user_prefix in their names, but the rest of the tables will still use prefix, thus sharing the same nuke database among different user bases from different sites. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Leave this to "MySQL", if you have a MySQL database (which will be true in most situations). This is case sensitive, so "mysql" or "Mysql" will not do, it has to be exactly "MySQL". \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML You should change this key to be a unique key that identifies your site. Ideally, no two sites should have the same key.The site key is used to create the random number for the security image () in the Your Account module and the administration section and is an important but often overlooked security feature of PHP-Nuke. See also \begin_inset LatexCommand \ref{security-measures} \end_inset for software that can help you create a truly random site key. \layout SGML \layout SGML \layout SGML \layout Standard Let's do an example: \layout Itemize Host DB: 212\SpecialChar \@. 110\SpecialChar \@. 12\SpecialChar \@. 297 \layout Itemize User DB: Pippo \layout Itemize Password DB: Topolino \layout Itemize Database Name: Orazio \layout Itemize Operating System Used: Linux (what else!!! :-) ) \layout Standard The file config. \begin_inset LatexCommand \index{config} \end_inset php should then look like: \layout Code $dbhost = "212.110.12.297"; \layout Code $dbuname = "Pippo"; \layout Code $dbpass = "Topolino"; \layout Code $dbname = "Orazio"; \layout Code $system = 0; \layout Code $prefix = "nuke"; \layout Code $sitekey = "SdFk*jkjbkuuz-dm98769.4b67DS+e4"; \layout SGML \layout SGML Attention! \layout SGML \layout SGML This is case sensitive! Remember to use The Capital Letters!!! On Linux systems, if you write a user name or a password without taking care of letter case, the system will not allow you to log in. \layout SGML \layout SGML \layout Standard You must distinguish between the database user (and password), which you enter in the config.php file, and the administrator "God" \begin_inset LatexCommand \index{God} \end_inset account. The database user is only known to the database. \begin_inset LatexCommand \index{base} \end_inset The administrator "God" \begin_inset LatexCommand \index{God} \end_inset account (there are also other administrator levels), on the other side, is created by PHP-Nuke automatically for you. This account, as well as the users accounts, exist only in the PHP-Nuke database, \begin_inset LatexCommand \index{base} \end_inset not in the MySQL server's configuration. \layout Standard How is this PHP-Nuke administrator created? If you go to the "Home" link of PHP-Nuke., you will then see a message telling you the following - just do what it tells you: \layout Quotation Welcome to PHP-Nuke! \layout Quotation Congratulations! You have now a web portal installed!. You can edit or change this message from the Administration page. \layout Quotation For security reasons the best idea is to create the Super User right NOW by clicking HERE \layout Standard Click on that link and it will create the PHP-Nuke administrator account for you. \layout SGML \layout SGML A superuser is NOT a registered User \layout SGML \layout SGML A superuser is an administrator with all admin powers. One should call it superadmin, because everyone gets confused at first. It is fine (and normal) to have a superuser admin and a registered user that have the same name. Be careful with side effects when you are logged in as both, see \begin_inset LatexCommand \url[Login Block on Left doesn't go away]{http://www.nukeforums.com/forums/viewtopic.php?t=14784} \end_inset . \layout SGML \layout SGML \layout Standard We are done, the only thing that remains to do is to enter the administration \begin_inset LatexCommand \index{administration} \end_inset section (www.yoursite.com/admin. \begin_inset LatexCommand \index{admin} \end_inset php). The very first time you will log in using \begin_inset Quotes eld \end_inset God \begin_inset LatexCommand \index{God} \end_inset \begin_inset Quotes erd \end_inset as username and \begin_inset Quotes eld \end_inset Password \begin_inset Quotes erd \end_inset as password. \begin_inset LatexCommand \index{password} \end_inset I recommend you to change these as soon as possible. Immediately after that, you should take some security measures, see \begin_inset LatexCommand \ref{security-measures} \end_inset . \layout Standard The config. \begin_inset LatexCommand \index{config} \end_inset php file also defines two arrays, the $AllowableHTML and $CensorList array. As its name says, $AllowableHTML is an associative array containing entries for all HTML tags that are to be allowed on your site: \layout Code $AllowableHTML = array("b"=>1, \layout Code "i"=>1, \layout Code "a"=>2, \layout Code "em"=>1, \layout Code "br"=>1, \layout Code "strong"=>1, \layout Code "blockquote"=>1, \layout Code "tt"=>1, \layout Code "li"=>1, \layout Code "ol"=>1, \layout Code "H1"=>1, \layout Code "H2"=>1, \layout Code "H3"=>1, \layout Code "H4"=>1, \layout Code "center"=>1, \layout Code "img"=>2, \layout Code "alt"=>1, \layout Code "table"=>2, \layout Code "tr"=>2, \layout Code "td"=>2, \layout Code "p"=>2, \layout Code "div"=>2, \layout Code "font"=>2, \layout Code "p"=>1, \layout Code "p"=>1, \layout Code "ul"=>1); \layout Standard The meaning of "1" and "2" is whether the tag accepts attributes or not. For example, if you want the

tag to NOT accept attributes (i.e. you accept

but you don't accept

) the you put "1", otherwise (i.e., if attributes like "align" etc. are accepted) you put "2". That this is indeed so, can be seen from the check_html() function of mainfile.p hp (see also \begin_inset LatexCommand \ref{allow-special-HTML-tags} \end_inset ): \layout Code if ($a = $AllowableHTML[$tag]) \layout Code if ($reg[1][0] == "/") $tag = ""; \layout Code elseif (($a == 1) || ($reg[2] == "")) $tag = "<$tag>"; \layout Code else { \layout Code # Place here the double quote fix function. \layout Code $attrb_list=delQuotes($reg[2]); \layout Code // A VER \layout Code $attrb_list = ereg_replace("&","&",$attrb_list); \layout Code $tag = "<$tag" . $attrb_list . ">"; \layout Code } # Attribs in tag allowed \layout Code else $tag = ""; \layout Standard The code checks if the associated value to the given tag ($tag) in the $Allowabl eHTML array is \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset or empty. If this is the case, \begin_inset LatexCommand \index{case} \end_inset the value of $tag is only \begin_inset Quotes eld \end_inset <$tag> \begin_inset Quotes erd \end_inset . Otherwise a set of replacements takes place on the attribute list: \layout Itemize The delQuotes() function deletes duplicate space and adds escaped quotes \begin_inset LatexCommand \index{quotes} \end_inset around each attribute value. \layout Itemize The ereg_replace() function replaces the ampersand (&) with its HTML entity \begin_inset LatexCommand \index{entity} \end_inset \begin_inset Quotes eld \end_inset & \begin_inset Quotes erd \end_inset . \layout Standard If the tag is not in the $AllowableHTML array, the line in the code above shows that it is replaced by the empty string, i.e. it is not echoed at all. Thus, if there is an HTML tag that you are missing, you should enter it in the $AllowableHTML array and take care to enter correctly a \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset or a \begin_inset Quotes eld \end_inset 2 \begin_inset Quotes erd \end_inset according to your needs. See for example \begin_inset LatexCommand \url[Smilies in news]{http://www.karakas-online.de/forum/viewtopic.php?t=94} \end_inset . \layout Standard The $CensorList array contains a list of words that you don't want to see in texts of articles on your site. \layout Subsection More than one PHP-Nuke sites \begin_inset LatexCommand \label{more-than-one-php-nuke-sites} \end_inset \layout Standard The variables in the config. \begin_inset LatexCommand \index{config} \end_inset php file allow for quite some flexibility when it comes to installing more than one PHP-Nuke sites that have to be related in one or the other way: \layout Subsubsection Different PHP-Nuke sites from the same database \begin_inset LatexCommand \label{common-database} \end_inset \layout Standard If you have two (or more) PHP-Nuke sites, located in different Web URLs (or different local directories), that you want to operate from the same database, \begin_inset LatexCommand \index{base} \end_inset you have some handwork to do, but it is not difficult. From the point of view of the database server, \begin_inset LatexCommand \index{server} \end_inset what differentiates one PHP-Nuke site from another, is the name of the table(s) used. In PHP-Nuke, all tables come with a prefix: \begin_inset LatexCommand \index{prefix} \end_inset the users table uses the $user_prefix prefix from the config. \begin_inset LatexCommand \index{config} \end_inset php file( \begin_inset LatexCommand \ref{config-php-file} \end_inset ), while all other tables use $prefix. \begin_inset LatexCommand \index{prefix} \end_inset \layout Standard Thus, you don't need a second database to operate a second PHP-Nuke site. A different database helps keep the installations separate by providing a kind of \begin_inset Quotes eld \end_inset container \begin_inset Quotes erd \end_inset to put each installation's tables in, but apart from this, there is nothing special to it. To use only one database for two PHP-Nuke installations, \begin_inset LatexCommand \index{ations} \end_inset proceed as follows: \layout Itemize Use separate $prefix and $user_prefix values in each site's config.php, \begin_inset LatexCommand \index{config.php} \end_inset e.g. \begin_deeper \layout Code $prefix = "nuke1"; \layout Code $user_prefix = "nuke1"; \layout Standard in config. \begin_inset LatexCommand \index{config} \end_inset php for site 1 and \layout Code $prefix = "nuke2"; \layout Code $user_prefix = "nuke2"; \layout Standard in config. \begin_inset LatexCommand \index{config} \end_inset php for site 2. All other values should stay identical in the config. \begin_inset LatexCommand \index{config} \end_inset php files of both sites. \end_deeper \layout Itemize Edit the nuke.sql file (located under the sql directory of the PHP-Nuke package) for each site. Change every occurence of \begin_inset Quotes eld \end_inset nuke_ \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset nuke1_ \begin_inset Quotes erd \end_inset for site 1 and to \begin_inset Quotes eld \end_inset nuke2_ \begin_inset Quotes erd \end_inset for site 2, then proceed with the installation as described in \begin_inset LatexCommand \ref{database-creation} \end_inset . If you use nukesql.php ( \begin_inset LatexCommand \ref{install-PHP-Nuke-nukesql} \end_inset ) for the installation, \begin_inset LatexCommand \index{installation} \end_inset see the tip at the end of this section. \layout Subsubsection Different PHP-Nuke sites with the same user base \begin_inset LatexCommand \label{common-user-base} \end_inset \layout Standard There are situations that you might want to share users among your PHP-Nuke sites. For example, if you have a site about cars and another one about car insurance, \begin_inset LatexCommand \index{insurance} \end_inset your users will probably be interested in both. But requiring them to enter two different logins and passwords is not going to make them happy - that's where $user_prefix comes into play. \layout Standard The idea behind a separate prefix for the users table in PHP-Nuke is to enable you to keep all other tables separate, but use the same users table across different PHP-Nuke installations. \begin_inset LatexCommand \index{ations} \end_inset By using a different $prefix for each site, but the same $user_prefix for both, your users will require only one login and password - and will be recognized by the second site, while logged in in the first one and vice versa. \layout Standard To use the same user base in two separate PHP-Nuke sites, proceed as follows: \layout Itemize Use the same database as descibed in \begin_inset LatexCommand \ref{common-database} \end_inset . \layout Itemize Use separate $prefix values, but the same $user_prefix for both config.php \begin_inset LatexCommand \index{config.php} \end_inset files, e.g. \begin_deeper \layout Code $prefix = "nuke1"; \layout Code $user_prefix = "nuke-common"; \layout Standard in config. \begin_inset LatexCommand \index{config} \end_inset php for site 1 and \layout Code $prefix = "nuke2"; \layout Code $user_prefix = "nuke-common"; \layout Standard in config. \begin_inset LatexCommand \index{config} \end_inset php for site 2. All other values should stay identical in the config. \begin_inset LatexCommand \index{config} \end_inset php files of both sites. \end_deeper \layout Itemize Edit the nuke.sql file (located under the sql directory of the PHP-Nuke package) for each site. Change every occurence of \begin_inset Quotes eld \end_inset nuke_ \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset nuke1_ \begin_inset Quotes erd \end_inset for site 1 and to \begin_inset Quotes eld \end_inset nuke2_ \begin_inset Quotes erd \end_inset for site 2, \emph on except the ones for the nuke_users table \emph default , which you should change to \begin_inset Quotes eld \end_inset nuke-common \begin_inset LatexCommand \index{nuke-common} \end_inset \begin_inset Quotes erd \end_inset . The full name of the users table should thus be \begin_inset Quotes eld \end_inset nuke-common_users \begin_inset LatexCommand \index{nuke-common_users} \end_inset \begin_inset Quotes erd \end_inset in both nuke.sql files. Then proceed with the installation as described in \begin_inset LatexCommand \ref{database-creation} \end_inset . \layout SGML \layout SGML Using nukesql.php \layout SGML \layout SGML If you use nukesql.php ( \begin_inset LatexCommand \ref{install-PHP-Nuke-nukesql} \end_inset ) for the installation, you should change the prefixes as above and point your browser to each instance of nukesql.php (one for each installation, located in the respective PHP-Nuke root directory). It will then create the tables with the right prefixes for you. \layout SGML \layout SGML \layout Section Resources \begin_inset LatexCommand \label{resources} \end_inset \layout Standard Claudio says: if you are looking for PHP-Nuke hosting, \begin_inset LatexCommand \index{hosting} \end_inset \begin_inset LatexCommand \url[Spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset has custom offers for you\SpecialChar \ldots{} give us a visit! \begin_inset LatexCommand \url[Spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset is the italian support site for PHP-Nuke, there you will find modules, \begin_inset LatexCommand \index{modules} \end_inset security patches, support forums and a lot more. Come for a tour soon. \layout Standard Other specialized PHP-Nuke hosters: \begin_inset LatexCommand \index{hosters} \end_inset \layout Itemize \begin_inset LatexCommand \url[Nukezone]{http://www.nukezone.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[Raven Web Hosting]{http://ravenphpscripts.ravenwebhosting.com/index.php} \end_inset \layout Section Common installation problems \begin_inset LatexCommand \label{common-installation-problems} \end_inset \layout Standard Some of the most common installation problems of PHP-Nuke are discussed in the following subsections. In identifying the most common sources of problems and frustration, \begin_inset LatexCommand \index{frustration} \end_inset we hope to eliminate a good portion of the Help! posts in the various forums of the community. \begin_inset LatexCommand \index{community} \end_inset Feel free to post your own favourite to Chris' \begin_inset LatexCommand \url[PHP-Nuke Forum]{http://www.karakas-online.de/forum/phpnuke.html} \end_inset for inclusion in the next version of this HOWTO. \begin_inset LatexCommand \index{HOWTO} \end_inset \layout Subsection Test scripts \begin_inset LatexCommand \label{test-scripts} \end_inset \layout Standard Before you start the ambitious undertaking of debugging your PHP-Nuke installati on, you should download and run some tools that may shorten the search path and save you some headaches: \begin_inset LatexCommand \index{headaches} \end_inset \layout Itemize test. \begin_inset LatexCommand \index{test} \end_inset php \layout Itemize ConnectTest.php and \layout Itemize analyze. \begin_inset LatexCommand \index{analyze} \end_inset php \layout Subsubsection test.php \begin_inset LatexCommand \label{test-php} \end_inset \layout Standard test. \begin_inset LatexCommand \index{test} \end_inset php is a \begin_inset Quotes eld \end_inset quick'n dirty \begin_inset Quotes erd \end_inset script to help you find out if you could connect to the database and how your PHP configuration looks like. Put the following lines in a file, name it test. \begin_inset LatexCommand \index{test} \end_inset php, upload it in the same directory where you have your config. \begin_inset LatexCommand \index{config} \end_inset php and tell your browser to open it (see \begin_inset LatexCommand \url[Warning: Invalid argument supplied for foreach()]{http://www.karakas-online.de/forum/viewtopic.php?t=36} \end_inset ): \layout Code \layout Standard If everything is right, you will only see the PHP info. \begin_inset LatexCommand \index{info} \end_inset Otherwise, you will see a descriptive message of the error first (in the first line) and also the PHP info. \begin_inset LatexCommand \index{info} \end_inset You can use the output to determine various parameters of your PHP configuratio n, like version numbers, libraries, \begin_inset LatexCommand \index{libraries} \end_inset paths and variables. Whenever you ask yourself if you have feature X enabled, remember to run this small script and search its output for a string that describes the feature. You will most probably find the answer there. Conversely, if you don't find the answer in the output of test. \begin_inset LatexCommand \index{test} \end_inset php (i.e. the output of the phpinfo() function), you will probably not find it easily. \layout Subsubsection ConnectTest.php \begin_inset LatexCommand \label{ConnectTest-php} \end_inset \layout Standard The \begin_inset LatexCommand \url[ConnectTest.php]{http://humpa.com/news/ConnectTest.txt} \end_inset script from \begin_inset LatexCommand \url[Humpa]{http://www.humpa.com} \end_inset is a more elaborate test script that you can help with database connection \begin_inset LatexCommand \index{connection} \end_inset problems. Download and save it with a .php ending (it comes with a .txt ending to prevent \begin_inset LatexCommand \index{event} \end_inset the web server from interpreting the PHP code in it). You should put the ConnectTest.php file in the PHP-Nuke root directory, i.e. in the same directory where also config. \begin_inset LatexCommand \index{config} \end_inset php is located. Then you just tell your browser to open it. \layout Code The Connection Test Script was unable to connect \layout Code to the MySQL server!
One or more of these variables are wrong in \layout Code your config.php:
\backslash $dbhost= \backslash "$dbhost \backslash ", \layout Code \backslash $dbuname= \backslash "$dbuname \backslash ", and/or \backslash $dbpass= \backslash "*hidden* \backslash " \layout Code
"; \layout Code echo "
Now, please don't say that you are using the \layout Code correct values - say it to your mysql server, because that is who(what?) \layout Code is stopping you. : )
"; \layout Code echo "Email your web host and ask them what to use for a mysql \layout Code username and password.
"; \layout Code echo "PHP Manual, function: \layout Code mysql_connect
"; \layout Code echo "If you are the server, perhaps you just need to create \layout Code a mysql user instead of using your root user.
"; \layout Code die("
\layout Code phpinfo"); \layout Code }else{ \layout Code echo " \layout Code phpinfo

"; \layout Code echo "If everything looks good, but you \layout Code still have problems, get the "; \layout Code echo " \layout Code analyzer from NukeCops

"; \layout Code echo "Connection Test Script connected to your MySQL server \layout Code successfully!
"; \layout Code echo "
\backslash $dbuname = \backslash "$dbuname \backslash ";
\backslash $dbtype = \backslash "$dbtype \backslash "; \layout Code
\backslash $prefix = \backslash "$prefix \backslash ";
\backslash $user_prefix = \backslash "$user_prefix \backslash ";
"; \layout Code if (mysql_select_db($dbname)) { \layout Code echo "
Connection to your database \backslash " \layout Code $dbname \backslash " was also successful.
"; \layout Code $result = mysql_list_tables($dbname); \layout Code if (!$result) { \layout Code print "DB Error, could not list tables \backslash n"; \layout Code print 'MySQL Error: ' . mysql_error(); \layout Code die(); \layout Code } \layout Code $i=0; \layout Code $stufftoprint = ""; \layout Code while ($row = mysql_fetch_row($result)) { \layout Code $tablename = $row[0]; \layout Code if($tablename == "".$prefix."_authors") { \layout Code $result4 = mysql_query("select aid from $tablename"); \layout Code while(list($admin_name) = mysql_fetch_row($result4)) { \layout Code $admin_names .= "$admin_name,  "; \layout Code } \layout Code } \layout Code $result3 = mysql_query("select * from $tablename"); \layout Code $numFields = mysql_num_fields($result3); \layout Code $numRows = mysql_num_rows($result3); \layout Code $rows = "rows"; \layout Code $fields = "fields"; \layout Code if($numFields == 1) {$fields = "field";} \layout Code if($numRows == 1) {$rows = "row";} \layout Code $stufftoprint .= "Table: $tablename \layout Code  ($numFields $fields / $numRows $rows) \backslash n
"; \layout Code $i++; \layout Code } \layout Code if($dbtype != "MySQL" AND eregi("mysql",$dbtype)) { \layout Code echo "
But, you need to set \layout Code \backslash $dbtype = \backslash "MySQL \backslash "; "; \layout Code echo "    in your config.php!!!!!!!!
"; \layout Code } \layout Code echo "
There are $i tables in your \backslash " \layout Code $dbname \backslash " database
"; \layout Code echo "(by default, there are 89 fields in phpnuke 6.5 and 76 fields \layout Code in phpnuke 6.0)
"; \layout Code if($i<66) { \layout Code echo "
You don't seem to have all the \layout Code tables installed.
Get the "; \layout Code echo "Web Installer for your version of \layout Code phpnuke

"; \layout Code } \layout Code echo "
These are the admin names (aid) in your nuke_authors \layout Code table:  $admin_names
"; \layout Code echo "
Now check this list of tables with your nuke.sql file:

$ stufftoprint
"; \layout Code }else { \layout Code if(mysql_query("CREATE DATABASE $dbname")) { \layout Code echo "
Your database \backslash "$dbname \backslash " did not exist, \layout Code but this script just created it sucessfully
"; \layout Code echo "Now, you need to get the appropriate \layout Code "; \layout Code echo "Web Installer from nukeresources.com"; \layout Code die(); \layout Code } \layout Code echo "
However, the \backslash "$dbname \backslash " database does not exist. \layout Code If that is not the correct name, then put in the correct "; \layout Code echo "name for
\layout Code \backslash $dbname = \backslash "$dbname \backslash ";   (in your config.php) \layout Code
If you have not created the database yet, then "; \layout Code echo "create it. If you are not the server, then ask your \layout Code web host to create it for you.
"; \layout Code echo "
Then, get the appropriate \layout Code "; \layout Code echo "Web Installer from nukeresources.com"; \layout Code } \layout Code } \layout Code ?> \layout Code \layout Subsubsection analyze.php \begin_inset LatexCommand \label{analyze-php} \end_inset \layout Standard The \begin_inset LatexCommand \url[analyze.php]{http://nukecops.com/downloads-file-13-details-Analyzer.html} \end_inset script from Paul Laudanski (a.k.a. \begin_inset LatexCommand \url[Zhen-Xjell]{http://zhen-xjell.com} \end_inset ) is the most elaborate from all the three script presented here. Rename the file to "analyze. \begin_inset LatexCommand \index{analyze} \end_inset php", transfer it to the same place that your config. \begin_inset LatexCommand \index{config} \end_inset php file is found and call it from your browser. For a preview of what it reports, \begin_inset LatexCommand \url[run analyze.php for the nukecops site]{http://nukecops.com/analyze.php} \end_inset . The code has been successfully tested for Nuke versions 6.5B6, 6.5B5, \begin_inset LatexCommand \index{6.5B5} \end_inset 6.0, 5.6. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename analyze-mysql-connection.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-analyze-mysql-connection} \end_inset analyze.php: MySQL connection transcript. \end_inset \layout Standard The script not only tests your MySQL database connection (see \begin_inset LatexCommand \ref{fig-analyze-mysql-connection} \end_inset ), but also displays information on: \layout Itemize config. \begin_inset LatexCommand \index{config} \end_inset php settings \layout Itemize SMTP (mail server) settings \begin_inset LatexCommand \index{settings} \end_inset \layout Itemize GD (graphics) library settings \begin_inset LatexCommand \index{settings} \end_inset \layout Itemize Databases \layout Itemize Modules \begin_inset LatexCommand \index{Modules} \end_inset \layout Itemize Blocks \begin_inset LatexCommand \index{Blocks} \end_inset \layout Itemize Notices \layout Itemize Ranks \begin_inset LatexCommand \index{Ranks} \end_inset \layout Itemize Administrators and Moderators \layout Itemize php,ini settings \begin_inset LatexCommand \index{settings} \end_inset \layout Itemize Security code \layout Itemize Recursive file listing along with resource permissions \begin_inset LatexCommand \index{permissions} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename analyze-warning-mysql.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-analyze-warning-mysql} \end_inset analyze.php: MySQL security warning. \end_inset \layout Standard It also checks for MySQL (see \begin_inset LatexCommand \ref{fig-analyze-warning-mysql} \end_inset ) and PHP (see \begin_inset LatexCommand \ref{fig-analyze-warning-php} \end_inset ) vulnerabilities and reports them to you if they need to be patched. \layout Subsection Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource \begin_inset LatexCommand \label{Warning-mysql_fetch_row-supplied-argument} \end_inset \layout Standard You get this \layout Code Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result \layout Code resource in html/includes/sql_layer.php on line 286 \layout Standard This is a very general error. Most of the time it just means that you could not connect to the database \begin_inset LatexCommand \index{base} \end_inset (for whatever reason) and thus the result set you tried to fetch was not a \begin_inset Quotes eld \end_inset valid MySQL result resource \begin_inset Quotes erd \end_inset . You should try first to get a more descriptive error message. For this purpose, you must edit the "case" lines in the sql_layer. \begin_inset LatexCommand \index{layer} \end_inset php file. \layout Standard Example:This is the "case" that starts at line 286 in the nuke 6.5 sql_layer. \begin_inset LatexCommand \index{layer} \end_inset php (for the line 286 error), at line 300 in the nuke 6.0 sql_layer. \begin_inset LatexCommand \index{layer} \end_inset php (for the line 301 error message) - or line 285 in nuke 5.6 (for the line 286 error message): \layout Code case "MySQL": \layout Code $row = mysql_fetch_row($res); \layout Code return $row; \layout Code break;; \layout Standard Edit it like this: \layout Code case "MySQL": \layout Code if ($row = mysql_fetch_row($res)) { \layout Code return $row; \layout Code } else { \layout Code print (mysql_error()); \layout Code } \layout Code break;; \layout SGML \layout SGML Please note: \layout SGML \layout SGML This will NOT fix your problem. But it will give a more descriptive message as to what the error cause is. \layout SGML \layout SGML \layout Standard See \begin_inset LatexCommand \url[Warning: mysql fetch row: supplied argument is not a valid MySQL result resource]{http://www.karakas-online.de/forum/viewtopic.php?t=37} \end_inset and \begin_inset LatexCommand \url[submit news problem]{http://www.nukeforums.com/forums/viewtopic.php?t=14121} \end_inset . \layout Subsection Call to undefined function: message_die() in db.php line 88 \begin_inset LatexCommand \label{call-to-undefined-function} \end_inset \layout Standard This is the most \begin_inset Quotes eld \end_inset popular \begin_inset Quotes erd \end_inset error. It basically means that it couldn't connect to the database. \begin_inset LatexCommand \index{base} \end_inset You may get this error even if you did everything right, depending on the version you are using. The reasons are multiple: \layout Itemize Are you sure you downloaded *all* the files? Maybe some file is missing. Perhaps you wanted to save some bandwidth and omitted some crucial file or directory, or subdirectory. \begin_inset LatexCommand \index{subdirectory} \end_inset \layout Itemize You didn't enter "MySQL" \begin_inset LatexCommand \index{MySQL} \end_inset as the dbtype in config.php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ). It must be exactly with a Capital M, a small y, and capital S, Q and L. \layout Itemize The code tries to select the database, \begin_inset LatexCommand \index{base} \end_inset but the database is not there. Create the database and populate it with tables (see \begin_inset LatexCommand \ref{database-creation} \end_inset ). \layout Itemize You have some error in the config. \begin_inset LatexCommand \index{config} \end_inset php file (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ). Double check that the username and password are correct. Don't forget, the " and ; \emph on are \emph default important. And DON'T remove the $ in front of the variables! If you used an editor \begin_inset LatexCommand \index{editor} \end_inset like Notepad, Wordpad, \begin_inset LatexCommand \index{Wordpad} \end_inset or some editor that you are not 100% sure that works correctly, delete the config. \begin_inset LatexCommand \index{config} \end_inset php file, get a fresh copy and edit it with a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ). \layout Subsection Error: Failed opening 'language/lang-.php' for inclusion \begin_inset LatexCommand \label{failed-opening-lang-php} \end_inset \layout Standard You either \layout Itemize didn't install the language files lang-xxx.php (like language/lang-english.php), or \layout Itemize you cannot connect to the database, \begin_inset LatexCommand \index{base} \end_inset so that the value of the default language could not be set and is empty (and that's why you get an error about lang-.php, \begin_inset LatexCommand \index{lang-.php} \end_inset instead of lang-english.php, or lang-french. \begin_inset LatexCommand \index{french} \end_inset php etc.). Try the small test script (see \begin_inset LatexCommand \url[Call to undefined function: message die in db.php line 88]{http://www.karakas-online.de/forum/viewtopic.php?p=72} \end_inset ): \begin_deeper \layout Code \layout Standard (see also \begin_inset LatexCommand \ref{test-scripts} \end_inset ), or \end_deeper \layout Itemize your include path information is missing some paths (like ".", the current directory), see \begin_inset LatexCommand \ref{Include-path} \end_inset . \layout Subsection Fatal error: Failed opening required 'includes/sql_layer.php' \begin_inset LatexCommand \label{failed-opening-sql-layer-php} \end_inset \layout Standard Your web server could not open includes/sql_layer. \begin_inset LatexCommand \index{layer} \end_inset php. There are many reasons for this ( \begin_inset LatexCommand \url[Fatal error: Failed opening required includes/sql layer.php]{http://www.karakas-online.de/forum/viewtopic.php?t=17} \end_inset ): \layout Itemize The file is really not there, something went wrong with the installation \begin_inset LatexCommand \index{installation} \end_inset - reinstall (see \begin_inset LatexCommand \ref{installation} \end_inset ). \layout Itemize The file is there but the web server does not have the right to open it - check permissions (see \begin_inset LatexCommand \ref{permissions} \end_inset ). \layout Itemize There is a .htaccess file somewhere in the directory hierarchy that denies access to you. \layout Itemize There is something wrong with the include path of the PHP interpreter (see \begin_inset LatexCommand \ref{Include-path} \end_inset ). \layout Standard You might see more information on the cause of your problem if you have access to the web server access and error logs. \layout Subsection Sorry, such file doesn't exist... \begin_inset LatexCommand \label{sorry-such-file-doesnt-exist} \end_inset \layout Standard Whenever you try to access a module (or simply your site), you ge the error (see, for example: \begin_inset LatexCommand \url[Humpa Chess Install]{http://www.karakas-online.de/forum/viewtopic.php?t=143} \end_inset and \begin_inset LatexCommand \url[http://www.karakas-online.de/forum/viewtopic.php?t=348]{Fehler: Sorry, such file doesn't exist} \end_inset ): \layout Code Sorry, such file doesn't exist... \layout SGML Of course, following a classic attitude to error handling, it doesn't tell you which file does not exist... ]]> ]]> ]]> ]]> Inline graphic We thus have to search the code to see what is happening: \layout Standard The error \layout Code Sorry, such file doesn't exist... \layout Standard comes from mainfile.php. \begin_inset LatexCommand \index{mainfile.php} \end_inset There are exactly three occurences of it in the code. In all three the pattern is the same (see \begin_inset LatexCommand \url[Sorry, such file doesn't exist...]{http://www.karakas-online.de/forum/viewtopic.php?t=353} \end_inset ): \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset First it is tested if you are a normal user, an administrator, \begin_inset LatexCommand \index{administrator} \end_inset if the module is active etc., depending on the circumstances. \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Then, a test is made on the existence of $modpath. Upon its failure, \begin_inset LatexCommand \index{failure} \end_inset you get the error above: \layout Code $modpath .= "modules/$name/$file.php"; \layout Code if (file_exists($modpath)) { \layout Code include($modpath); \layout Code } else { \layout Code die ("Sorry, such file doesn't exist..."); \layout Code } \layout Standard $modpath, in turn, is the path to the module in question. As you can see in the code snippet yourself, it depends on the value of $name, which is the name of the module, \begin_inset LatexCommand \index{module} \end_inset and $file, which is...well, for this you have to scroll up to the start of mainfile.php. \begin_inset LatexCommand \index{mainfile.php} \end_inset There, we read \layout Code if (!isset($file)) { $file="index"; } \layout Standard which in plain english says "if the variable $file is NOT set, set it to 'index'". \layout Standard Putting all the puzzle pieces together, we arrive to the conclusion that the file \layout Code modules/YourModule/index.php \layout Standard is not there. \layout Standard There are various things you should check and all have to do with trying to find out why your web server cannot find the index file of the module \begin_inset LatexCommand \index{module} \end_inset you are trying to access: \begin_inset LatexCommand \index{access} \end_inset \layout Itemize Is the index. \begin_inset LatexCommand \index{index} \end_inset php file really there in the modules/YourModule folder? \layout Itemize Did you set up the permissions ( \begin_inset LatexCommand \ref{permissions} \end_inset , \begin_inset LatexCommand \ref{permissions2} \end_inset ) correctly? Does your web server have read access to that folder and file? \layout Itemize Is there a (hidden) .htaccess file ( \begin_inset LatexCommand \ref{htaccess-file} \end_inset ) somewhere in your document tree that prevents the web browser from accessing that file? \layout Itemize Did you install all files? You have to dive in the docs of that module to see if you are missing anything. \layout Itemize Check if \begin_deeper \layout Code http://www.yoursite.com/modules/YourModule/index.php \layout Standard returns an error. Substitute YourModule with the name of the module that is giving you the headaches. \begin_inset LatexCommand \index{headaches} \end_inset \end_deeper \layout Itemize If this is a module you downloaded and installed yourself (as opposed to a preinstalled one, see \begin_inset LatexCommand \ref{preinstalled-modules} \end_inset ): Did you really follow the instructions? Did you download the right file? Did you extract it in the modules folder? \layout Itemize Did you see the module in the list of modules and did you activate it ( \begin_inset LatexCommand \ref{administration-functions} \end_inset and \begin_inset LatexCommand \ref{fig-modules-admin-2} \end_inset )? \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename modules-admin.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-modules-admin-2} \end_inset Modules administration panel. \end_inset \layout Subsection Warning: setlocale(): Passing locale category name as string is deprecated \begin_inset LatexCommand \label{warning-setlocale} \end_inset \layout Standard All of a sudden, you get tons of warnings like this one: \layout Code Warning: setlocale(): Passing locale category name as string is deprecated. \layout Code Use the LC_* -constants instead. \layout Code in /home/chris/public_html/nuke/mainfile.php on line 565 \layout SGML The problem comes suddenly after your ISP has upgraded to a newer version of PHP (without telling you, of course! ]]> ]]> ]]> ]]> Inline graphic \layout Standard To fix this, remove the quotes that are around "LC_TIME" \begin_inset LatexCommand \index{LC_TIME} \end_inset in the line/file mentioned in the error message displayed (see \begin_inset LatexCommand \url[Warning: setlocale(): Passing locale category name as string is deprecated]{http://www.karakas-online.de/forum/viewtopic.php?t=21} \end_inset and \begin_inset LatexCommand \url[News article: Warning: setlocale(): Passing locale category name as string is deprecated.]{} \end_inset ). \layout SGML \layout SGML Attention: repetitious error! \layout SGML \layout SGML You may get this error again and again. You will have to do the above change in *all* occurences of the LC_something constants! I once counted 17 of them, scattered all around the PHP-Nuke files... \layout SGML \layout SGML \layout Subsection Security code is not showing up \begin_inset LatexCommand \label{security-code} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename security-code.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-security-code} \end_inset Security code in the User Login screen. \end_inset \layout SGML You just installed PHP-Nuke for the first time, created a super user, and you can't log in because the security code graphic (see ) is coming up as a dead image. ]]> ]]> ]]> ]]> Inline graphic \layout Standard This is a frequent error, but it seems that the reasons (and cures) may be multiple (see \begin_inset LatexCommand \url[Security code graphic not showing up]{http://www.karakas-online.de/forum/viewtopic.php?t=22} \end_inset , \begin_inset LatexCommand \url[security image stopped working]{http://www.nukeforums.com/forums/viewtopic.php?t=14758} \end_inset ): \layout Itemize You changed something in the language files and put comments - remove the comments. \begin_inset LatexCommand \index{comments} \end_inset \layout Itemize You (or your ISP) don't have the GD library loaded. To find out if you have the GD library loaded, run a test script like test. \begin_inset LatexCommand \index{test} \end_inset php (see \begin_inset LatexCommand \ref{test-php} \end_inset ), ConnectTest.php (see \begin_inset LatexCommand \ref{ConnectTest-php} \end_inset ) or analyze. \begin_inset LatexCommand \index{analyze} \end_inset php (see \begin_inset LatexCommand \ref{analyze-php} \end_inset ). The first two display the output of the PHP phpinfo() function directly ( \begin_inset LatexCommand \ref{fig-phpinfo-gd} \end_inset ), analyze. \begin_inset LatexCommand \index{analyze} \end_inset php will display an only slightly different information box on GD ( \begin_inset LatexCommand \ref{fig-analyze-gd} \end_inset ). If you are on Windows 2000, read \begin_inset LatexCommand \url[how to install GD on a Win2K box]{http://forums.devshed.com/archive/5/2002/08/3/41595} \end_inset . \layout Itemize The gfx function in admin. \begin_inset LatexCommand \index{admin} \end_inset php is not always working fine. You could try to put it in a separate file and change the call from admin.php \begin_inset LatexCommand \index{admin.php} \end_inset to the new file. See Humpa's posting in \begin_inset LatexCommand \url[Admin Security login jpeg not showing]{http://www.nukeforums.com/forums/viewtopic.php?t=14550} \end_inset for an example. \layout Itemize Activate (or reactivate) the Your Account module. \begin_inset LatexCommand \index{module} \end_inset If your Admin's security code works, but the others don't (showing an read X mark for others), then you may want to set the Your Account module as viewable by \emph on all \emph default visitors (see \begin_inset LatexCommand \url[PhpNuke 6.5 Security Code Problem]{http://www.karakas-online.de/forum/viewtopic.php?t=299} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpinfo-gd.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpinfo-gd} \end_inset phpinfo(): GD library information. \end_inset \layout Standard For more thoughts on this problem, read \begin_inset LatexCommand \url[Humpa's PHP-Nuke FAQ on the security code]{http://www.humpa.com/HelpMeHumpa/index.php?humpa_id=3#h3} \end_inset . \layout Standard If you want to use a PNG or GIF image for the security code, consult the solution in \begin_inset LatexCommand \url[Using a png or gif for security code image]{http://www.nukefixes.com/postlite44-0.html} \end_inset . If you want to display the security code as text, rather than an image, see \begin_inset LatexCommand \url[security code in plain text format]{http://www.nukefixes.com/postlite76-0.html} \end_inset - but then there is no point to it (the idea is to display an image that makes automatic number recognition difficult to robots), then you can disable it just as well. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename analyze-gd.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-analyze-gd} \end_inset analyze.php: GD library information. \end_inset \layout Subsubsection How to bypass the security code \begin_inset LatexCommand \label{bypass-security-code} \end_inset \layout Standard Another approach could be to bypass the security code altogether. This is probably the only option you have (unless you are willing to display it as plain text - see the links at the end of this section for this), if your ISP refuses to load the GD library: \begin_inset LatexCommand \index{library} \end_inset without GD, no security code image - without security code image, you cannot enter anything in the security \begin_inset LatexCommand \index{security} \end_inset code field, and you get an \begin_inset Quotes eld \end_inset Access denied \begin_inset Quotes erd \end_inset error. \layout Standard Here is how you disable the security code: \layout Standard Find the 7 occurences of: \layout Code extension_loaded("gd") \layout Standard For the Admin login, \begin_inset LatexCommand \index{login} \end_inset there is one in the admin.php, and one in the auth.php. For Users, there will be five in the modules/Your_Account/index. \begin_inset LatexCommand \index{index} \end_inset php (and there might be one in the block-Login.php, \begin_inset LatexCommand \index{block-Login.php} \end_inset and/or one in the block-User_Info.php, if they are modified). Replace all of the occurances with this: \layout Code $user == "whatever" \layout Standard Follow the above instruction exactly. \layout SGML \layout SGML Be careful not to introduce syntax errors! \layout SGML \layout SGML Changes like the last one (bypassing the security code) require extreme caution on your part. All too big is the risk of introducing new errors, while trying to correct old ones! If you get an error, it does't mean the solution ceased to work for you. Check for syntax errors that you might have introduced with your editing. Most probably, you will find something. \layout SGML ]]> ]]> ]]> ]]> Inline graphic \layout SGML See \begin_inset LatexCommand \url[syntax error, security images removed]{http://www.nukeforums.com/forums/viewtopic.php?t=18076} \end_inset for a real world example. \layout SGML \layout SGML \layout Standard If you have one of the later versions of PHP-Nuke, you can try a trick: edit the config. \begin_inset LatexCommand \index{config} \end_inset php file and if you find a line there, like this one: \layout Code $gfx_chk = 7; \layout Standard and change it to (see \begin_inset LatexCommand \url[How to disable the security code]{http://www.karakas-online.de/forum/viewtopic.php?t=266} \end_inset ): \layout Code $gfx_chk = 0; \layout Subsection Warning: Invalid argument supplied for foreach() in mainfile.php \begin_inset LatexCommand \label{warning-invalid-argument-supplied} \end_inset \layout Standard You get errors and warnings like: \layout Code Warning: Invalid argument supplied for foreach() in ...mainfile.php on line 42 \layout Code Warning: Invalid argument supplied for foreach() in ...mainfile.php on line 57 \layout Code Warning: Cannot add header information - headers already sent by \layout Code (output started at ...mainfile.php:42) in ...mainfile.php on line 165 \layout Code \layout Standard You must have at least PHP v. 4.1.0 to run PHP-Nuke 6.5 and later. See \begin_inset LatexCommand \ref{prerequisites} \end_inset and \begin_inset LatexCommand \url[Warning: Invalid argument supplied for foreach()]{http://www.karakas-online.de/forum/viewtopic.php?t=36} \end_inset . \layout Subsection Include path is wrong \begin_inset LatexCommand \label{Include-path} \end_inset \layout Standard If the include path happens to be wrong (you can see your include path in the output of test. \begin_inset LatexCommand \index{test} \end_inset php, see \begin_inset LatexCommand \ref{test-scripts} \end_inset ), you could try the following: \layout Standard Suppose your nuke files are in /usr/local/httpd/htdocs/nuke/html (just an example ). Suppose that this is the directory that contains \layout Standard the includes directory beneath it. Then create a .htaccess file ( \begin_inset LatexCommand \ref{htaccess-file} \end_inset ) that contains the line \layout Code php_value include_path .:/usr/local/httpd/htdocs/nuke/html/includes \layout Standard (no equal signs, just copy it in the .htaccess file). In most cases the include path will be correctly configured. In the few ones that it's not, the most probable cause of errors will be a missing \begin_inset Quotes eld \end_inset current directory \begin_inset Quotes erd \end_inset (a missing dot in the include path). \layout Standard If you have access to the php.ini file, you can do the same there. Find the line where include_path is defined and add the dot in the list, e.g.: \layout Standard include_path = \begin_inset Quotes eld \end_inset .:/usr/local/httpd/htdocs/nuke/html/includes \begin_inset LatexCommand \index{includes} \end_inset \begin_inset Quotes erd \end_inset \layout Standard See also \begin_inset LatexCommand \url[Warning: main(/db/db.php): failed to open stream]{http://www.karakas-online.de/forum/viewtopic.php?t=381} \end_inset and \begin_inset LatexCommand \url[Fatal error: Failed opening required 'includes/sql_layer.php"]{http://www.karakas-online.de/forum/viewtopic.php?t=17} \end_inset . \layout Subsection Users don't receive any confirmation mails \begin_inset LatexCommand \label{mail-problems} \end_inset \layout Standard This is not a PHP-Nuke error. PHP-Nuke uses PHP's mail() function and this, in turn, uses the mail server \begin_inset LatexCommand \index{server} \end_inset that is found on the web server. \begin_inset LatexCommand \index{server} \end_inset If that mail server is configured incorrectly, you will get problems with mail. The best way to solve them is to talk to your ISP and try to find out which configuration is used for your case. \begin_inset LatexCommand \index{case} \end_inset We have seen cases of ISPs that would configure the mail server to deliver mail only to local domains, \begin_inset LatexCommand \index{domains} \end_inset thus making communication between PHP-Nuke and users of other domains impossibl e (see \begin_inset LatexCommand \url[E-mail problems]{http://www.karakas-online.de/forum/viewtopic.php?t=137} \end_inset , \begin_inset LatexCommand \url[my nuke only sends mail to my domain]{http://www.nukeforums.com/forums/viewtopic.php?p=56082} \end_inset ). \layout Standard Now, what do you do after you have fixed your mail server? \begin_inset LatexCommand \index{server} \end_inset Those e-mails with the activation links have already been sent once, and since they never reached their destinations. \begin_inset LatexCommand \index{ations} \end_inset .. You are losing users because you cannot resend them! \layout Standard If you ever needed to resend an activation email, or just wanted to delete one that was awaiting activation, \begin_inset LatexCommand \index{activation} \end_inset then you will appreciate the \begin_inset LatexCommand \url[Resend module]{http://ravenphpscripts.com/download-file-59.html} \end_inset . It will help you manage the temp_users table. \layout Standard If you want users to be registered directly, without confirmation mails, see \begin_inset LatexCommand \ref{register-users-immediately} \end_inset . If you want to disable registration, \begin_inset LatexCommand \index{registration} \end_inset see \begin_inset LatexCommand \ref{disable-registration} \end_inset . If you want to approve every user who applied for registration, \begin_inset LatexCommand \index{registration} \end_inset you can use the Approve Membership module (see \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset and \begin_inset LatexCommand \url[Authorize accounts]{http://www.karakas-online.de/forum/viewtopic.php?t=83} \end_inset ). \layout Subsection Login loop \begin_inset LatexCommand \label{login-loop} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename security-code.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-login-screen} \end_inset User Login screen. \end_inset \layout Standard You login without problems, but whenever you try to access a function or links of the PHP-Nuke site, you are returned to the login screen and are asked to enter your user name and password again - a very annoying procedure! \layout Standard The first thing you should check, is if you have cookies enabled in your browser. PHP-Nuke uses cookies to store authentication information on your computer (in the cookies file, see also \begin_inset LatexCommand \ref{cookies} \end_inset ), in order to be able to recognize you on your next page request (remember, HTTP is a stateless protocol, \begin_inset LatexCommand \index{protocol} \end_inset meaning that, whenever the web server serves you a page you requested, it forgets about it, so the next page request is seen as being completely unrelated to the previous one). Thus, you must have cookies enabled to use PHP-Nuke. \layout Standard If enabling cookies does not make the problem disappear, it might be a permissio ns problem (see \begin_inset LatexCommand \ref{permissions} \end_inset ), in which case you should contact the administrator of the site. \layout SGML \layout SGML \layout SGML 3rd party cookies \layout SGML \layout SGML \layout SGML If you are experimenting with frames, you will find out that the cookie will be set fine, as long as the frame and the parent page are on the same site. If the frame is a different site than the parent, then you will have to allow 3rd party cookies (a lower security setting), see \begin_inset LatexCommand \url[Why do users have to put security to "low" to be able to log]{http://www.nukeforums.com/forums/viewtopic.php?t=13433} \end_inset . \layout SGML \layout SGML \layout Subsection You have an error in your SQL syntax near '------------- \begin_inset LatexCommand \label{SQL-syntax-error} \end_inset \layout Standard When you try to create the database tables with the nuke.sql file (see \begin_inset LatexCommand \ref{database-creation} \end_inset ), you get an error: \layout Code -- \layout Code --------------------------------------------------------- \layout Code -- \layout Code -- \layout Code CREATE TABLE confirm ( \layout Code confirm_id char(32) NOT NULL default ", \layout Code session_id char(32) NOT NULL default ", \layout Code code char(6) NOT NULL default ", \layout Code PRIMARY KEY (session_id,confirm_id) \layout Code ) TYPE=MyISAM \layout Code MySQL said: \layout Code You have an error in your SQL syntax near '------------------------------------- -------------------- \layout Code -- \layout Code -- \layout Code CREATE TABLE co' at line 2 \layout Standard This is because your nuke.sql file came with nice, useless long lines containing dashes, \begin_inset LatexCommand \index{dashes} \end_inset like these ones: \layout Code --------------------------------------------------------- \layout Standard Just use a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ) and delete that long line, or put a # in front of it. If that doesn't help, put a # in front of every line that starts with a dash, making it a comment. SQL accepts \begin_inset Quotes eld \end_inset -- \begin_inset Quotes erd \end_inset as the string that starts a comment, but it seems that MySQL does not like the rest of the dashes (after the first two ones) as a comment. \layout Subsection Error: Couldn't update private forum permissions \begin_inset LatexCommand \label{error-update-private-forum-permissions} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename forum.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum-3} \end_inset Administration panel: Forums. \end_inset \layout Standard You get the following error everytime you try to make a particular user (or a site administrator) a moderator in PHP-Nuke 6.5-7.0: \begin_inset LatexCommand \index{7.0} \end_inset \layout Code Couldn't update private forum permissions \layout Code DEBUG MODE \layout Code SQL Error : 1064 You have an error in your SQL syntax near ' 1)' at line 2 \layout Code INSERT INTO nuke_bbauth_access (forum_id, group_id, auth_mod) VALUES (3, , 1) \layout Code Line : 385 \layout Code FIle: xxxx/modules/Forums/admin/admin_ug_auth.php \layout Standard This is a bug modules/Forums/admin/admin_ug_auth.php - the INSERT statement is missing a string value in the VALUES clause. \begin_inset LatexCommand \index{clause} \end_inset Try this \begin_inset LatexCommand \url[admin_ug_auth.php]{http://www.nukeresources.com/files/admin_ug_auth.zip} \end_inset instead. See \begin_inset LatexCommand \url[Couldn't update private forum permissions]{http://www.nukeforums.com/forums/viewtopic.php?t=16633} \end_inset and \begin_inset LatexCommand \url[Site Admin & Moderator]{http://www.nukecops.com/postp77425.html} \end_inset for more details. \layout Subsection Invalid session in forums \begin_inset LatexCommand \label{invalid-session-in-forums} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename forum.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum-4} \end_inset Administration panel: Forums. \end_inset \layout Standard You installed the PHP-Nuke Forum (which is the phpBB forum starting v.6.5 \begin_inset LatexCommand \index{6.5} \end_inset of PHP-Nuke, see \begin_inset LatexCommand \ref{phpBB-Forum-administration} \end_inset ), but now, when you try to access it you get the error: \layout Code Invalid session. \layout Standard Solution: In the forum configuration, \begin_inset LatexCommand \index{configuration} \end_inset go to the Cookies section and change the name of the cookie file from "phpbb2my sql " to something more original or unique, like "phpbb2mysql2" \begin_inset LatexCommand \index{phpbb2mysql2} \end_inset . You also need to have the right cookie domain, \begin_inset LatexCommand \index{domain} \end_inset i.e. if you have installed the forum under http://yoursite.com/nuke/html, the cookie domain should be http://yoursite.com/nuke/html too. \layout Standard \begin_inset Quotes eld \end_inset What is this session id anyway? \begin_inset Quotes erd \end_inset , you may ask. This is quite a technical matter and is covered in detail in \begin_inset LatexCommand \ref{session-management} \end_inset . \layout Subsection You cannot create the administrator account \begin_inset LatexCommand \label{cannot-create-administrator-account} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename authors.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-edit-admins-2} \end_inset Administration panel: Edit Admins. \end_inset \layout Standard Everything looks fine with your newly created PHP-Nuke site, then you are told by the system that there is no administrator yet and you should create one: \layout Code There are no Administrators Accounts yet, proceeed to create the Super User: \layout Standard You do what you are told and create that Super User, \begin_inset LatexCommand \index{User} \end_inset but the next time you get the same message. It seems that you cannot create the administrator account! \layout Standard The message that asks you to create the Super User is the _NOADMINYET message whose translation you can find in the various language files (see \begin_inset LatexCommand \ref{General-PHP-Nuke-texts} \end_inset ) in the admin/language folder. For example, in admin/language/lang-english.php, \begin_inset LatexCommand \index{lang-english.php} \end_inset we read: \layout Standard define("_NOADMINYET" \begin_inset LatexCommand \index{_NOADMINYET} \end_inset ,"There are no Administrators Accounts yet, proceeed to create the Super User: \begin_inset LatexCommand \index{User} \end_inset "); \layout Standard The _NOADMINYET message is output in admin.php: \begin_inset LatexCommand \index{admin.php} \end_inset \layout Code $the_first = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_authors")) ; \layout Code if ($the_first == 0) { \layout Code if (!$name) { \layout Code include("header.php"); \layout Code title("$sitename: "._ADMINISTRATION.""); \layout Code OpenTable(); \layout Code echo "

"._NOADMINYET."


" \layout Standard From the code we see that it is echoed only if $the_first is 0, meaning no entries in the $prefix_authors table. Thus, for some reason, the nuke_authors table (assuming your $prefix is "nuke" in config. \begin_inset LatexCommand \index{config} \end_inset php), is not filled. You can do the following (see \begin_inset LatexCommand \url[I cant make my Admin acount work]{http://www.karakas-online.de/forum/viewtopic.php?t=289} \end_inset ): \layout Standard You should check the entries in nuke_authors. \begin_inset LatexCommand \index{nuke_authors} \end_inset You can do this either from the MySQL prompt with \layout Code select aid, name, email, pwd from nuke_authors; \layout Standard or with the "browse" function of phpMyAdmin ( \begin_inset LatexCommand \ref{phpmyadmin2} \end_inset ). \layout SGML If your Super Admin is there, then it is weird... ]]> ]]> ]]> ]]> Inline graphic \layout Standard If the Super Admin is not there, then you can't write to the database. \begin_inset LatexCommand \index{base} \end_inset To check this possibility, find the function create_first() in admin.php. \begin_inset LatexCommand \index{admin.php} \end_inset There, you will see two lines with a call to sql_query. \begin_inset LatexCommand \index{query} \end_inset They are both identical: \layout Code $db->sql_query($sql); \layout Standard Insert the line: \layout Code echo mysql_error(); \layout SGML after each one. This will echo a more descriptive error message (see \begin_inset LatexCommand \ref{descriptive-error-message} \end_inset ) and may lead you to the solution. But, as experience shows (see \begin_inset LatexCommand \url[I cant make my Admin acount work]{http://www.karakas-online.de/forum/viewtopic.php?t=289} \end_inset ), you most probably have set the wrong values in your config.php ( \begin_inset LatexCommand \ref{config-php-file} \end_inset ). ]]> ]]> ]]> ]]> Inline graphic This is a known issue and a solution is presented in . \layout Code \layout Subsection You lost the administrator password, or deleted the admin account \begin_inset LatexCommand \label{administrator-password-lost} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename authors.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-edit-admins-3} \end_inset Administration panel: Edit Admins. \end_inset \layout SGML You did a Very Big Mistake - you erased your PHP-Nuke Super Admin! Now you cannot do anything on your website! Your powers are those of a normal member... ]]> ]]> ]]> ]]> Inline graphic How do you get your Admin back? \layout Standard You can try one of the following two solutions (see \begin_inset LatexCommand \url[I deleted my Super Admin. How do I get him back?]{http://www.karakas-online.de/forum/viewtopic.php?t=11} \end_inset ): \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset You can use phpMyAdmin (or a similar DB administration package, see \begin_inset LatexCommand \ref{phpmyadmin} \end_inset ) and look in (the technical term on the link is \begin_inset Quotes eld \end_inset browse \begin_inset Quotes erd \end_inset ) the nuke_authors table. You can take two approaches: \begin_deeper \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset See if your admin is still there, and you can set a new password (you'll have to choose \begin_inset Quotes eld \end_inset MD5 \begin_inset LatexCommand \index{MD5} \end_inset \begin_inset Quotes erd \end_inset from the dropdown menu on the pass field, see \begin_inset LatexCommand \ref{fig-phpmyadmin-field-functions-2} \end_inset ). If your admin is not there, then just add a new row to the table and put in the missing info. \begin_inset LatexCommand \index{info} \end_inset \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Or you can just delete the line with the administrator name and point your browser to the admin. \begin_inset LatexCommand \index{admin} \end_inset php file - you will then be prompted to enter a new admin name and password. \begin_inset LatexCommand \index{password} \end_inset You may enter whatever new values you like there, but you should not create a user with the same name, even if prompted to. \end_deeper \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Using phpMyAdmin (or directly in MySQL), go to the nuke_authors table and make your password dc647eb65e6711e155375218212b3964 - that will make it Password, then just login and change it. Here we make use of the fact that the MD5 hash of the word \begin_inset Quotes eld \end_inset Password \begin_inset Quotes erd \end_inset is dc647eb65e6711e155375218212b3964. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename phpmyadmin-field-functions.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-phpmyadmin-field-functions-2} \end_inset phpMyAdmin: field functions. \end_inset \layout SGML \layout SGML \layout SGML How to compute the MD5 hash of an arbitrary password using only PHP and your browser \layout SGML \layout SGML \layout SGML If you are curious about the MD5 hash of a certain password, but do not have easy access to a function that computes it, you can make use of the fact that the PHP interpreter of your web server can compute is for you. Substitute XXXX for the password whose MD5 hash you want to compute in the following script: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ]]> \layout SGML \layout SGML \layout SGML and upload it somewhere on your web server. Then point your browser to it and you should see the answer. You can use it to change the password field of the nuke_authors table directly in MySQL. \layout SGML \layout SGML \layout Standard See \begin_inset LatexCommand \url[Admin Password - i've lost it]{http://www.nukeforums.com/forums/viewtopic.php?t=11383} \end_inset , \begin_inset LatexCommand \url[Password help]{http://www.nukeforums.com/forums/viewtopic.php?t=18212} \end_inset for discussions. \layout Subsection You get garbage in some parts of the page \begin_inset LatexCommand \label{garbage-on-page} \end_inset \layout Standard If some parts of your page looks like containing garbage, \begin_inset LatexCommand \index{garbage} \end_inset it may be due to a compressed output from the server. \begin_inset LatexCommand \index{server} \end_inset You could try to disable compression by just commenting the line (see \begin_inset LatexCommand \url[I cant make my Admin acount work]{http://www.karakas-online.de/forum/viewtopic.php?t=289} \end_inset ): \layout Code ob_start('ob_gzhandler'); \layout Standard or setting $do_gzip_compress to FALSE: \layout Code $do_gzip_compress = FALSE; \layout Standard in mainfile.php. \begin_inset LatexCommand \index{mainfile.php} \end_inset The part that controls compression in mainfile.php is: \layout Code $phpver = phpversion(); \layout Code if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) { \layout Code if (extension_loaded('zlib')) { \layout Code ob_end_clean(); \layout Code ob_start('ob_gzhandler'); \layout Code } \layout Code } else if ($phpver > '4.0') { \layout Code if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) { \layout Code if (extension_loaded('zlib')) { \layout Code $do_gzip_compress = TRUE; \layout Code ob_start(); \layout Code ob_implicit_flush(0); \layout Code //header('Content-Encoding: gzip'); \layout Code } \layout Code } \layout Code } \layout Standard You might even have to comment it completely (see \begin_inset LatexCommand \url[PhpNuke wont show in IE or Opera]{http://www.nukeforums.com/forums/viewtopic.php?t=16439} \end_inset ). \layout Subsection Compressed output in forums \begin_inset LatexCommand \label{compressed-output-in-forums} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename forum-gzip-compression.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum-gzip-compression} \end_inset Gzip compression in the Admin Panel of the Forums module. \end_inset \layout Standard You seem to be getting a compressed output in the forums. You are either seeing garbage, or you can see it in IE, but not in Mozilla. \begin_inset LatexCommand \index{Mozilla} \end_inset When you press \begin_inset Quotes eld \end_inset Refresh \begin_inset LatexCommand \index{Refresh} \end_inset \begin_inset Quotes erd \end_inset , Mozilla reacts like you want to download something that is \begin_inset Quotes eld \end_inset encrypted \begin_inset LatexCommand \index{encrypted} \end_inset \begin_inset Quotes erd \end_inset or compressed. \layout Standard All this is a sign that you may be compressing the page twice. If, for example, your Apache has been already configured to send compressed output (with \begin_inset LatexCommand \url[mod_gzip]{http://www.schroepl.net/projekte/mod_gzip/index.htm} \end_inset , or some other technique for \begin_inset LatexCommand \url[Web Content Compression]{http://perl.apache.org/docs/tutorials/client/compression/compression.html} \end_inset ), then you should disable gzip compression in the forums administration \begin_inset LatexCommand \index{administration} \end_inset panel (from \begin_inset Quotes eld \end_inset General Admin, \begin_inset LatexCommand \index{Admin} \end_inset Configuration \begin_inset Quotes erd \end_inset , as in \begin_inset LatexCommand \ref{fig-forum-gzip-compression} \end_inset ). \layout Standard See also \begin_inset LatexCommand \url[Cannot see forum in Mozilla and see in IE]{http://www.nukeforums.com/forums/viewtopic.php?p=58655} \end_inset . \layout Subsection Warning: Cannot add header information...in forums \begin_inset LatexCommand \label{cannot-add-header-information-in-forums} \end_inset \layout Standard You get errors of the form: \layout Code Warning: Cannot modify header information headers already sent \layout Standard when vieweing the forums. There are two solutions (see \begin_inset LatexCommand \url[Warning: Cannot add header information...in forums]{http://www.karakas-online.de/forum/viewtopic.php?t=291} \end_inset ): \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset Near the start of mainfile.php find: \begin_deeper \layout Code 42 = phpversion(); \layout Code if (42 >= '4.0.4pl1' && strstr(Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1),'compatible')) { \layout Code if (extension_loaded('zlib')) { \layout Code ob_end_clean(); \layout Code ob_start('ob_gzhandler'); \layout Code } \layout Code } else if (42 > '4.0') { \layout Standard and change it to: \layout Code 42 = phpversion(); \layout Code if (42 >= '4.0.4pl1') \layout Code { \layout Code ob_start('ob_gzhandler'); \layout Code }else if (42 > '4.0') { \end_deeper \layout Enumerate Add the following line to a .htaccess file (see \begin_inset LatexCommand \ref{htaccess-file} \end_inset ) placed in your root PHP-Nuke directory: \begin_deeper \layout Code PHP_FLAG output_buffering on \layout Standard or if you have access to php.ini, \begin_inset LatexCommand \index{php.ini} \end_inset set: \layout Code output_buffering=on; \end_deeper \layout Standard See also \begin_inset LatexCommand \url[Warning: Cannot modify header information on Forums]{http://www.nukefixes.com/postt36.html} \end_inset and \begin_inset LatexCommand \url[Cannot modify header information]{http://www.nukeforums.com/forums/viewtopic.php?p=56538} \end_inset . To learn more about PHP output buffering, \begin_inset LatexCommand \index{buffering} \end_inset see \begin_inset LatexCommand \url[Output Buffering with PHP]{http://www.devshed.com/Server_Side/PHP/OutputBuffering/} \end_inset and \begin_inset LatexCommand \url[PHP Output Buffering tutorial]{http://jinxidoru.com/tutorials/buffering.html} \end_inset . \layout Code \layout Subsection In Windows, you get an empty page \begin_inset LatexCommand \label{empty-page-in-windows} \end_inset \layout SGML You installed Apache, PHP and MySQL in Windows. It seems to work, but when you try to run PHP-Nuke's index page, the browser starts searching the page without showing anytihg. ]]> ]]> ]]> ]]> Inline graphic How do you get your Admin back? \layout Standard This is too vague an error to trace down to anything specific with certainty, but there are indications (see \begin_inset LatexCommand \url[Problems with header function]{http://www.karakas-online.de/forum/viewtopic.php?t=257} \end_inset ) that it is related to the header() function of PHP and \begin_inset LatexCommand \url[PHP's Bug #16842: header() function doesn`t work]{http://bugs.php.net/bug.php?id=16842} \end_inset . The bug seems to have been fixed in newer versions of PHP, \begin_inset LatexCommand \index{PHP} \end_inset but it might still appear, if you had a previous version that you did not uninstall cleanly (the old problem with DLLs not being correctly managed under Windows, \begin_inset LatexCommand \index{Windows} \end_inset with old versions still lying around even after an uninstall). If you suspect this might be the case with you, uninstall PHP cleanly and reinstall. \begin_inset LatexCommand \index{reinstall} \end_inset \layout Subsection You get a lot of Notice lines in the output of PHP-Nuke \begin_inset LatexCommand \label{lots-of-Notice-lines} \end_inset \layout Standard If you get lots of Notice lines in your PHP-Nuke output like this: \layout Code Notice: No prefix specified in import_request_variables() \layout Code - possible security hazard in \layout Code c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash mainfile.php on line 23 \layout Code \layout Code Notice: Constant _ youhave already defined in \layout Code c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash language \backslash lang-english.php on line 158 \layout Code \layout Code Notice: Use of undefined constant admin - assumed 'admin' \layout Code in c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash admin.php on line 16 \layout Code \layout Code Notice: Use of undefined constant admin - assumed 'admin' \layout Code in c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash mainfile.php on line 88 \layout Code \layout Code Notice: Constant _yes already defined in \layout Code c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash admin \backslash language \backslash lang-english.php on line 24 \layout Code \layout Code Notice: Constant _no already defined in \layout Code c: \backslash program files \backslash apache group \backslash apache \backslash htdocs \backslash html \backslash admin \backslash language \backslash lang-english.php on line 25 \layout Standard then the error level for the reporting is too high (see \begin_inset LatexCommand \url[A lot of Notice lines in the output of PHP-Nuke]{http://www.karakas-online.de/forum/viewtopic.php?t=221} \end_inset ). Set display_errors so that PHP will display all errors, except notices, in your php.ini. \begin_inset LatexCommand \index{php.ini} \end_inset Edit php.ini with a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset (see also \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ) as follows - the important line is the last one, which is the only uncommented one: \layout Code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \layout Code ; Error handling and logging ; \layout Code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; \layout Code ; error_reporting is a bit-field. Or each number up to get desired error \layout Code ; reporting level \layout Code ; E_ALL - All errors and warnings \layout Code ; E_ERROR - fatal run-time errors \layout Code ; E_WARNING - run-time warnings (non-fatal errors) \layout Code ; E_PARSE - compile-time parse errors \layout Code ; E_NOTICE - run-time notices (these are warnings which often result \layout Code ; from a bug in your code, but it's possible that it was \layout Code ; intentional (e.g., using an uninitialized variable and \layout Code ; relying on the fact it's automatically initialized to an \layout Code ; empty string) \layout Code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup \layout Code ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's \layout Code ; initial startup \layout Code ; E_COMPILE_ERROR - fatal compile-time errors \layout Code ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) \layout Code ; E_USER_ERROR - user-generated error message \layout Code ; E_USER_WARNING - user-generated warning message \layout Code ; E_USER_NOTICE - user-generated notice message \layout Code ; \layout Code ; Examples: \layout Code ; \layout Code ; - Show all errors, except for notices \layout Code ; \layout Code ;error_reporting = E_ALL & ~E_NOTICE \layout Code ; \layout Code ; - Show only errors \layout Code ; \layout Code ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR \layout Code ; \layout Code ; - Show all errors except for notices \layout Code ; \layout Code error_reporting = E_ALL & ~E_NOTICE \layout Code \layout Subsection How to get a more descriptive error message \begin_inset LatexCommand \label{descriptive-error-message} \end_inset \layout Standard If you get an error, but you have no idea what is happening, you could try to narrow it down in the code, if you feel comfortable with PHP. \begin_inset LatexCommand \index{PHP} \end_inset Then, after you found the offending line, you should insert the line \layout Code print (mysql_error()); \layout Standard immediately after it. This will give a more descriptive message of the error and hopefully lead you to a solution. We already used this trick in \begin_inset LatexCommand \ref{Warning-mysql_fetch_row-supplied-argument} \end_inset . See also \begin_inset LatexCommand \url[Warning: mysql fetch row: supplied argument is not a valid MySQL result resource]{http://www.karakas-online.de/forum/viewtopic.php?t=37} \end_inset and \begin_inset LatexCommand \url[submit news problem]{http://www.nukeforums.com/forums/viewtopic.php?t=14121} \end_inset . \layout Section Common miscellaneous errors \begin_inset LatexCommand \label{common-miscellaneous-errors} \end_inset \layout Standard Some miscellaneous errors are discussed here. \layout Subsection RSS block Error: There is a current problem with the headlines from this site \begin_inset LatexCommand \label{RSS-block-error} \end_inset \layout Standard If you encounter the error \layout Code There is a current problem with the headlines from this site \layout SGML after some innocent changes in an RSS block, you are not alone. ]]> ]]> ]]> ]]> Inline graphic This is a known issue and a solution is presented in . \layout Subsection MySQL errno: 145: Can't open file nuke_XXXX.MYI \begin_inset LatexCommand \label{MySQL-errno-145} \end_inset \layout Standard If suddenly you get an error like: \layout Code Could not insert new word matches \layout Code DEBUG MODE \layout Code SQL Error : 1016 Can't open file: 'nuke_bbsearch_wordmatch.MYI'. (errno: 145) \layout Code INSERT INTO nuke_bbsearch_wordmatch (post_id, word_id, title_match) \layout Code SELECT 4467, word_id, 0 FROM nuke_bbsearch_wordlist WHERE word_text IN ('testing ') \layout Code Line : 282 \layout Code File : /xxxx/xxxx/public_html/nuke/includes/functions_search.php \layout SGML then you will know that your MySQL database has been corrupted. ]]> ]]> ]]> ]]> Inline graphic In the above example, the nuke_bbsearch_wordmatch table is damaged (see \begin_inset LatexCommand \url[MySQL errno: 145 Can't open file nuke bbsearch wordmatch.MYI]{http://www.karakas-online.de/forum/viewtopic.php?t=332} \end_inset ). \layout Standard Solution: Enter the MySQL prompt from the shell: \begin_inset LatexCommand \index{shell} \end_inset \layout Code mysql -u dbuname -h dbhost -p dbname; \layout Standard where dbuname, \begin_inset LatexCommand \index{dbuname} \end_inset dbhost and dbname are exactly the same as in your config.php ( \begin_inset LatexCommand \ref{config-php-file} \end_inset ) - you will also be prompted for your password, \begin_inset LatexCommand \index{password} \end_inset which must also be the same as in config.php - and try the REPAIR TABLE command: \begin_inset LatexCommand \index{command} \end_inset \layout Code repair table nuke_bbsearch_wordmatch; \layout Standard You can also try from the shell command-line the myisamchl utility: \begin_inset LatexCommand \index{utility} \end_inset \layout Code myisamchk -r nuke_bbsearch_wordmatch \layout Standard See \begin_inset LatexCommand \ref{repair-corrupt-table} \end_inset on how to repair corrupt tables. \begin_inset LatexCommand \index{tables} \end_inset \layout Subsection Modules do not show up and/or disappear \begin_inset LatexCommand \label{modules-disappear} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename modules.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-modules-4} \end_inset Administration panel: Modules. \end_inset \layout Standard In PHP-Nuke version 7 alpha, when adding a module to the modules folder it won't show in admin/modules. \begin_inset LatexCommand \index{modules} \end_inset When renaming a module, \begin_inset LatexCommand \index{module} \end_inset with FTP or similar, the module also disappears (see \begin_inset LatexCommand \url[Modules do not show and/or disappear]{http://www.karakas-online.de/forum/viewtopic.php?t=306} \end_inset ). \layout Standard The problem is that in admin/modules/modules. \begin_inset LatexCommand \index{modules} \end_inset php, of that version, on the line that inserts the modules in the folder modules, \begin_inset LatexCommand \index{modules} \end_inset the number of fields is incorrect. In admin/modules/modules. \begin_inset LatexCommand \index{modules} \end_inset php, the lines with: \layout Code if ($mid == "") { \layout Code sql_query("insert into ".$prefix."_modules \layout Code values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1')", $dbi); \layout Code } \layout Standard should have been: \layout Code if ($mid == "") { \layout Code sql_query("insert into ".$prefix."_modules \layout Code values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1', '0')", $dbi); \layout Code } \layout Standard Notice the \emph on extra \emph default \layout Code ,'0' \layout Standard before the \layout Code )",$dbi); \layout Standard This error seems to affect v. 7 alpha and some of the 7.0 FINAL downloads. \begin_inset LatexCommand \index{ads} \end_inset \layout Standard You should also be aware that there are some third party modules which alter \begin_inset LatexCommand \index{alter} \end_inset the nuke_modules table. All you have to do to determine if this might be a problem for you, is to view your nuke_modules table through phpMyAdmin ( \begin_inset LatexCommand \ref{phpmyadmin} \end_inset ) or a similar tool, count the number of fields and then compare this number with the code in admin/modules. \begin_inset LatexCommand \index{modules} \end_inset php: \layout Code if ($mid == "") { \layout Code sql_query("insert into ".$prefix."_modules \layout Code values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1', '0')", $dbi); \layout Code } \layout Standard The above gives us 7 fields. \layout Subsection Forums Error: Can't create a category without a name \begin_inset LatexCommand \label{forums-cant-create-category-without-name} \end_inset \layout Standard You want to create a category in the Forum (see \begin_inset LatexCommand \ref{phpBB-Forum-administration} \end_inset ), but you get the error: \layout Code General Error \layout Code Can't create a category without a name \layout Standard Your strategy in coping with error messages, in case your error is not obvious or not well explained by the message, is to search the whole code tree for the error text (just as you would search for a link text in \begin_inset LatexCommand \ref{find-all-registration-links} \end_inset ). In this case, \begin_inset LatexCommand \index{case} \end_inset it turns out that there is only one occurence, in modules/Forums/admin/admin_fo rums.php: \layout Code case 'addcat': \layout Code // Create a category in the DB \layout Code if( trim($HTTP_POST_VARS['categoryname']) == '') \layout Code { \layout Code message_die(GENERAL_ERROR, "Can't create a category without a name"); \layout Code } \layout Standard As you can easily see, the error is issued if the category name contains only "white space" \begin_inset Foot collapsed false \layout Standard \begin_inset Quotes eld \end_inset White space \begin_inset LatexCommand \index{space} \end_inset \begin_inset Quotes erd \end_inset , in the setting of the PHP trim(), function can contain only the following characters: \layout Itemize " " (ASCII 32 (0x20)), an ordinary space. \begin_inset LatexCommand \index{space} \end_inset \layout Itemize " \backslash t" (ASCII 9 (0x09)), a tab. \layout Itemize " \backslash n" (ASCII 10 (0x0A)), a new line (line feed). \layout Itemize " \backslash r" (ASCII 13 (0x0D)), a carriage return. \layout Itemize " \backslash 0" (ASCII 0 (0x00)), the NUL-byte. \begin_inset LatexCommand \index{NUL-byte} \end_inset \layout Itemize " \backslash x0B" (ASCII 11 (0x0B)), a vertical tab. \end_inset (which is what the \begin_inset LatexCommand \url[PHP trim function]{http://www.php.net/manual/en/function.trim.php} \end_inset strips from the beginning and end of a string), in simple words: \begin_inset LatexCommand \index{words} \end_inset if you did not enter any name for the category. \begin_inset LatexCommand \index{category} \end_inset Logical, isn't it? \layout Standard But what happens if you swear that you \emph on did \emph default enter a name there? Isn't this error going to drive you nuts then? \layout Standard In such situations, \begin_inset LatexCommand \index{ations} \end_inset you should keep your calmness and try to think further than the obvious: what could be happenning behind the scenes in PHP-Nuke? Here are some possibili ties (see \begin_inset LatexCommand \url[Can't create a category without a name]{http://www.karakas-online.de/forum/viewtopic.php?t=357} \end_inset ): \layout Enumerate You entered an empty name - O.K., you already checked that, but let's include it, just for the sake of completeness. This means that $HTTP_POST_VARS['categoryname'], the value of the POST \begin_inset LatexCommand \index{POST} \end_inset variable that holds the category name, is empty, or contains at most some white space. \begin_inset LatexCommand \index{space} \end_inset \layout Enumerate Your browser does not send POST variables back to the server, \begin_inset LatexCommand \index{server} \end_inset e.g. it does not support forms. Also quite unlikely. \layout Enumerate $HTTP_POST_VARS['categoryname'] was not empty when it arrived at PHP-Nuke, but PHP-Nuke changed it. In fact, PHP-Nuke subjects the POST and GET variables to some sanity checks (see \begin_inset LatexCommand \ref{security-audit} \end_inset for details), to see if they contain malicious code. If your category name contained any \begin_inset Quotes eld \end_inset forbidden \begin_inset Quotes erd \end_inset characters, it may be that some check routine in PHP-Nuke deleted it. Try a name that will not raise suspicions of SQL injection ( \begin_inset LatexCommand \ref{SQL-injection-with-php-nuke} \end_inset ) and similar attacks. \layout Enumerate You are logged in as the administrator \emph on and \emph default as a user. In this case, \begin_inset LatexCommand \index{case} \end_inset you browser has stored two cookies ( \begin_inset LatexCommand \ref{cookies} \end_inset ) on your computer and it is not clear under what ID your action has been evaluated by PHP-Nuke. Try to avoid such situations. \begin_inset LatexCommand \index{ations} \end_inset If you must me logged in as both a user and an administrator at all costs, \begin_inset LatexCommand \index{costs} \end_inset you might try to use two different browsers for each ID (not two instances of the same browser, but two different products). They will store the cookies in different locations and will (hopefully) not mess them up. \layout SGML Of course, YMMV. ]]> ]]> ]]> ]]> Inline graphic \layout Subsection Left and right blocks are missing \begin_inset LatexCommand \label{missing-blocks} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename missing-blocks.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-missing-blocks} \end_inset Missing blocks. \end_inset \layout Standard If your PHP-Nuke site looks like the one in \begin_inset LatexCommand \ref{fig-missing-blocks} \end_inset , i.e. lacking totally the left and right columns with all the blocks in them, then maybe your nuke_blocks table is corrupt (see \begin_inset LatexCommand \url[Missing blocks and modules]{http://www.karakas-online.de/forum/viewtopic.php?t=416} \end_inset , as well as \begin_inset LatexCommand \url[My blocks are gone]{http://www.nukeforums.com/forums/viewtopic.php?t=17061} \end_inset and \begin_inset LatexCommand \url[Blocks have disappeared]{http://www.nukeforums.com/forums/viewtopic.php?t=18204} \end_inset ). See \begin_inset LatexCommand \ref{repair-corrupt-table} \end_inset on how to repair a corrupt table. \layout Chapter How to upgrade PHP-Nuke \begin_inset LatexCommand \label{upgrade-php-nuke} \end_inset \layout Standard The upgrade of your PHP-Nuke system to a new version is done in the following steps: \begin_inset LatexCommand \index{steps} \end_inset \layout Itemize Make a database backup. \begin_inset LatexCommand \index{backup} \end_inset (See \begin_inset LatexCommand \ref{fig-backup-db} \end_inset and \begin_inset LatexCommand \ref{administration-functions} \end_inset , for PHP-Nuke's own backup function, \begin_inset LatexCommand \index{function} \end_inset \begin_inset LatexCommand \ref{phpmyadmin} \end_inset for phpMyAdmin's functionality, which also includes a very good web interface \begin_inset LatexCommand \index{interface} \end_inset to database backups and \begin_inset LatexCommand \ref{backup-mysql-using-browser} \end_inset , for home-made scripts that automate the backup work for you.) \layout Itemize Verify that your current PHP-Nuke version has not been modified (excluding the theme, \begin_inset LatexCommand \index{theme} \end_inset that does not needs an update). In case it has been modified through the addition of modules that required a change in the original PHP-Nuke files, or the database, \begin_inset LatexCommand \index{base} \end_inset proceed manually as outlined in \begin_inset LatexCommand \ref{install-modules-with-database-files-change} \end_inset . \layout Itemize Test the upgrade locally first and not directly on the production site. \layout Itemize If all looks well, transfer the files and the database to the production site. \layout Standard The update to a new version itself, is an operation that consists of two parts, the update of the database and the overwriting of the old files with the new ones. The update of the database is done automatically through appropriate scripts that can be found in the upgrades folder of the PHP-Nuke package. You have to upload the right upgrade script to your PHP-Nuke root directory on the server (where also config. \begin_inset LatexCommand \index{config} \end_inset php is located), then point your browser to it - this will update the database. \begin_inset LatexCommand \index{base} \end_inset See also \begin_inset LatexCommand \url[How to upgrade PHP-Nuke]{http://www.karakas-online.de/forum/viewtopic.php?t=240} \end_inset and \begin_inset LatexCommand \url[PHP-Nuke upgrade]{http://www.karakas-online.de/forum/viewtopic.php?t=258} \end_inset . \layout Standard If you are upgrading from a version that is more than one version apart from the version you are aiming at, then you have to apply all patches sequencially, from the old one, through any intermediate versions, up to the newest one. Thus, for the passage of 6.6 to 6.8, you must apply both upgrade66-67.php \begin_inset LatexCommand \index{upgrade66-67.php} \end_inset and upgrade67-68.php. \begin_inset LatexCommand \index{upgrade67-68.php} \end_inset \layout Standard If you are upgrading from 5.6 to 6.0, you must also overwrite the config.php \begin_inset LatexCommand \index{config.php} \end_inset file with the new one, then edit it again with the right values (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ). \layout Standard The following sections cover some examples in detail. \layout Section From 6.0 to 6.5 \begin_inset LatexCommand \label{upgrade-php-nuke-60-65} \end_inset \layout Standard See \begin_inset LatexCommand \url[phpNuke Upgrade from 6.0 to 6.5]{http://www.nukeforums.com/forums/viewtopic.php?t=15248} \end_inset . \layout Subsection Upgrade instructions for PHP-Nuke 6.0 without Tom's bbtonuke port \begin_inset LatexCommand \label{upgrade-instructions-60-without-bbtonuke} \end_inset \layout Enumerate Make a backup of the database tables and all files. \layout Enumerate Using your current config.php as a guide configure the new config.php's settings, PHP-Nuke 6.5's config.php has a new variable: $sitekey, it is recommended that you change at least some of the letters/numbers in it to make it unique. \layout Enumerate Upload all files and folders included in Nuke's html folder so that they replace your current files. \layout Enumerate Upload upgrade60-65.php to Nuke's main directory (where config.php is) and point your browser to it. Delete it once done. \layout Enumerate If you were using Splatt forum with Nuke 6.0 and wish to transfer its data into the new bbtonuke forum, use NSN_Move \layout Subsection Upgrade instructions for PHP-Nuke 6.0 with Tom's 2.0.6 bbtonuke port \begin_inset LatexCommand \label{upgrade-instructions-60-with-bbtonuke} \end_inset \layout Enumerate Make a backup of the database tables and all files. \layout Enumerate Using your current config.php as a guide configure the new config.php's settings, PHP-Nuke 6.5's config.php has a new variable: $sitekey, it is recommended that you change at least some of the letters/numbers in it to make it unique. \layout Enumerate Upload all files and folders included in Nuke's html folder so that they replace your current files. \layout Enumerate Upload nukebbsql.php to Nuke's main directory (where config.php is) and point your browser to it. Delete it once done. \layout Section From phpBB to PHP-Nuke \begin_inset LatexCommand \label{upgrade-phpbb-php-nuke} \end_inset \layout Standard If you have an existing phpBB Forum and would like to integrate it into one of the newer PHP-Nuke versions that come with phpBB Forums, you should use the \begin_inset LatexCommand \url[phpBB to PHP-Nuke Script]{http://www.ruleit.co.uk/nuke/forums/viewtopic.php?t=524} \end_inset from the PHP-Nuke UK Forums. To install it, put the code into a file, edit the variables at the top and save it as transfer.php, \begin_inset LatexCommand \index{transfer.php} \end_inset for example. Upload the file to the same directory as your PHP-Nuke config. \begin_inset LatexCommand \index{config} \end_inset php and point your browser to it. See also \begin_inset LatexCommand \url[How to integrate new PHP-Nuke with existing phpBB Forum]{http://www.karakas-online.de/forum/viewtopic.php?t=419} \end_inset . \layout SGML \layout SGML Always backup! \layout SGML \layout SGML Backup both your PHP-Nuke database and your phpBB database before running this script. \layout SGML \layout SGML \layout Section PHP-Nuke upgrade scripts \begin_inset LatexCommand \label{PHP-Nuke-upgrade-scripts} \end_inset \layout Standard What's in an upgrade script? Let's take a few representative examples of code and explain what they do, so that you get an idea of what is going on in such a script \begin_inset Foot collapsed false \layout Standard We will assume all prefixes, like $prefix and $user_prefix to be \begin_inset Quotes eld \end_inset nuke \begin_inset Quotes erd \end_inset . \end_inset : \layout Description UPDATE\SpecialChar ~ (Version\SpecialChar ~ number): the PHP-Nuke version is updated in the nuke_config \begin_inset LatexCommand \index{nuke_config} \end_inset table through the UPDATE command: \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code // PHP-Nuke Version Number Update \layout Code $db->sql_query("UPDATE ".$prefix."_config SET Version_Num='6.7'"); \end_deeper \layout Description UPDATE\SpecialChar ~ (Forums): some forum parameters are modified through the UPDATE command. \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code // PHP-Nuke Forums Update \layout Code $db->sql_query("UPDATE ".$prefix."_bbconfig SET config_value='.0.4' where \layout Code config_name='version'"); \layout Code $db->sql_query("UPDATE ".$prefix."_bbconfig SET config_value='3600' where \layout Code config_name='session_length'"); \end_deeper \layout Description INSERT: \begin_inset LatexCommand \index{INSERT} \end_inset some values are inserted into the nuke_bbconfig table through the INSERT command: \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code $db->sql_query("INSERT INTO ".$prefix."_bbconfig VALUES ('config_id','1')"); \end_deeper \layout Description DELETE: a recorde is deleted from the nuke_headlines table through the DELETE \begin_inset LatexCommand \index{DELETE} \end_inset command \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code $db->sql_query("DELETE FROM ".$prefix."_headlines WHERE \layout Code sitename='Linux.com'"); \end_deeper \layout Description DROP\SpecialChar ~ TABLE: the whole table nuke_priv_msgs is deleted from the database through the DROP TABLE command. \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code $db->sql_query("DROP TABLE ".$prefix."_priv_msgs"); \end_deeper \layout Description ALTER\SpecialChar ~ TABLE: the structure of the nuke_users table is modified through the ALTER TABLE command: \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code $db->sql_query("ALTER TABLE ".$user_prefix."_users CHANGE uname username \layout Code VARCHAR(25) NOT NULL"); \end_deeper \layout Description CREATE\SpecialChar ~ TABLE: a new table (nuke_bbforum_prune) is created through the CREATE TABLE command: \begin_inset LatexCommand \index{command} \end_inset \begin_deeper \layout Code $db->sql_query("CREATE TABLE ".$prefix."_bbforum_prune (prune_id mediumint \layout Code (8) unsigned NOT NULL auto_increment, forum_id smallint(5) unsigned NOT NULL \layout Code default '0', prune_days tinyint(4) unsigned NOT NULL default '0', prune_freq tinyint \layout Code (4) unsigned NOT NULL default '0', PRIMARY KEY (prune_id), KEY forum_id \layout Code (forum_id))"); \end_deeper \layout Standard See \begin_inset LatexCommand \ref{sql-syntax} \end_inset for the syntax of SQL code. \layout Chapter How to move PHP-Nuke \begin_inset LatexCommand \label{move-php-nuke} \end_inset \layout Standard We discuss how to move PHP-Nuke from your computer to your ISP ( \begin_inset LatexCommand \ref{transferring-local-installation-to-web} \end_inset ), or from one ISP to another ( \begin_inset LatexCommand \ref{changing-web-hoster} \end_inset ). This is something that you should plan carefully. The following sections will show you how. \layout Section Transferring a local installation to the Web \begin_inset LatexCommand \label{transferring-local-installation-to-web} \end_inset \layout Standard You may prefer to test PHP-Nuke on your local box and acquaint with its features at your own pace, without the need to be constantly online. In this case, when you are done with your evaluation, \begin_inset LatexCommand \index{evaluation} \end_inset you will face the problem of transferring your local installation to your webspace. \begin_inset LatexCommand \index{space} \end_inset A fresh installation on the Web may not be very attractive an option to you, if you did some more or less heavy customization of the code or preference s. \layout Standard For the files, simply upload the content of the html folder to your document root, \begin_inset LatexCommand \index{root} \end_inset or wherever you want it to appear under that. For the database, \begin_inset LatexCommand \index{base} \end_inset use mysqldump or phpMyAdmin (see \begin_inset LatexCommand \ref{phpmyadmin2} \end_inset ) to do a backup of the database and import the data into the MySQL of your web presence. \layout Standard To do a backup from the command line using mysqldump, \begin_inset LatexCommand \index{mysqldump} \end_inset do: \layout Code mysqldump -h dbhost -u dbuname -p dbname > dbbackup.sql \layout Standard where dbhost, \begin_inset LatexCommand \index{dbhost} \end_inset dbuname and dbname are exactly what you entered in config.php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ) for these variables. To import the data using mysql from the command line, do: \layout Code mysql -h dbhost -u dbuname -p dbname < dbbackup.sql \layout Standard If you change your local files and/or tables regularly, you may choose to transfer only the files/tables that changed. In this case, \begin_inset LatexCommand \index{case} \end_inset you should drop the affected tables before you reimport them. phpMyAdmin offers a convenient interface for this (see \begin_inset LatexCommand \ref{phpMyAdmin-navigation-bar-SQL} \end_inset and \begin_inset LatexCommand \ref{restore-single-table} \end_inset ). \layout Standard It is a good idea to announce these measures to your community, \begin_inset LatexCommand \index{community} \end_inset to avoid frustration among your users. \layout Section Changing Web hoster \begin_inset LatexCommand \label{changing-web-hoster} \end_inset \layout SGML Sooner or later in the life of any webmaster, the time comes for a project that most of us wished would never happen: change the hosting company! In this chapter we will take the dread out of moving your nuked site by simply outlining all the necessary steps for this operation to succeed. You will see that, although it may take some planning and foresight, it is a straightforward procedure after all. ]]> ]]> ]]> ]]> Inline graphic \layout Standard During the whole procedure, \begin_inset LatexCommand \index{procedure} \end_inset it is important to remember that in this case, unlike the one in \begin_inset LatexCommand \ref{transferring-local-installation-to-web} \end_inset , you have your users to take care of. Treat them with kindness and inform them of the coming changes, so they are prepared if something does not work as expected. \layout Standard Here is the step-by-step plan to change web hoster for your PHP-Nuke: \layout Enumerate Your current hoster X doesn't fit your needs anymore. You have found a better one, Y, with better conditions. But does the new hoster Y support all the functionality you need? How about \begin_deeper \layout Itemize Apache (version?) and modules (mod_gzip, \begin_inset LatexCommand \index{mod_gzip} \end_inset GD library, mod_auth, mod_rewrite and all the other modules you may be using at hoster X) \layout Itemize PHP (version? how about PHP extensions?) \layout Itemize MySQL (version? how many databases? \begin_inset LatexCommand \index{databases} \end_inset ) \end_deeper \layout Enumerate You obtained the new server or webspace at hoster Y. Set the time frame for your move. A small, amateur site may need only a few days, whereas for a big, commercial \begin_inset LatexCommand \index{commercial} \end_inset one two weeks may be more appropriate. \layout Enumerate Ask hoster X to lower the TTL (time to live) of your domain's zone files to 900 seconds or a similar value. Normally, TTL is set to a much higher value, since DNS information does not change very often. The new, lower TTL value will force DNS servers around the world to update \begin_inset LatexCommand \index{date} \end_inset their records about your domain in a much more frequent pace than usually. This way, changes in your domain's DNS information will propagate much faster through the Internet. \begin_inset LatexCommand \index{Internet} \end_inset \layout Enumerate Make sure the basic \begin_inset Quotes eld \end_inset software infrastructure \begin_inset LatexCommand \index{structure} \end_inset \begin_inset Quotes erd \end_inset is there on your new server (or webspace) and is working: \begin_deeper \layout Itemize Firewall with your custom settings (if any). \layout Itemize E-Mail functionality up and running \layout Itemize Web server configuration correct and adapted to your needs \layout Itemize phpMyAdmin installed and working \end_deeper \layout Enumerate Lock your filesystem on X and move all files from X to Y. You don't move your database on X yet, but you do move all files, even files that control access to your site, like .htaccess, hosts.allow, \begin_inset LatexCommand \index{hosts.allow} \end_inset hosts.deny etc . files. \layout Enumerate Do a first check using the file \begin_deeper \layout Code \layout Standard Put it somewhere on your new webspace, name it test. \begin_inset LatexCommand \index{test} \end_inset php and just point your browser to it. Check that the output (file locations, \begin_inset LatexCommand \index{ations} \end_inset configuration etc.) is what you expected. \end_deeper \layout Enumerate Now it's time to move your PHP-Nuke database. \begin_inset LatexCommand \index{base} \end_inset Do an announcement (see \begin_inset LatexCommand \ref{administration-functions} \end_inset ) that you will be dumping the database, \begin_inset LatexCommand \index{base} \end_inset then use mysqldump to dump it: \begin_deeper \layout Standard From the command line, do: \layout Code mysqldump -h dbhost -u dbuname -p dbname > dbbackup.sql \layout Standard where dbhost, \begin_inset LatexCommand \index{dbhost} \end_inset dbuname and dbname are exactly what you entered in config.php (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ) for these variables. \layout Standard If your database is small, say smaller than 10MB, you could try to use phpMyAdmi n for the backup. \begin_inset LatexCommand \index{backup} \end_inset But since phpMyAdmin is a PHP script like all the others, it is also subject \begin_inset LatexCommand \index{subject} \end_inset to the same CPU time constraints (which you can see in the output of the test. \begin_inset LatexCommand \index{test} \end_inset php file above, if you run it on hoster X). The limit is usually set to 30 seconds, which is not enough for backups \begin_inset LatexCommand \index{backups} \end_inset of large databases. \begin_inset LatexCommand \index{databases} \end_inset You may end up with no backup or, worse, with corrupted data. \begin_inset LatexCommand \index{data} \end_inset But for a small site, one with a small database that is, doing the backup \begin_inset LatexCommand \index{backup} \end_inset with phpMyAdmin is certainly an option. See \begin_inset LatexCommand \ref{backup-mysql-using-browser} \end_inset for backups through the web and \begin_inset LatexCommand \ref{repair-corrupt-table} \end_inset for instructions on how to repair a corrupted table or database. \begin_inset LatexCommand \index{base} \end_inset \end_deeper \layout Enumerate Transfer the dbbackup. \begin_inset LatexCommand \index{backup} \end_inset sql file to your webspace on hoster Y (you may want to compress it before you do this - compression will reduce file size and transfer time dramatically). Import the data into MySQL on Y with the command \begin_deeper \layout Code mysql -h dbhost -u dbuname -p dbname < dbbackup.sql \layout Standard or using phpMyAdmin. \begin_inset LatexCommand \index{Admin} \end_inset \end_deeper \layout Enumerate Test PHP-Nuke on Y to ensure it is working properly. Since your domain still points (through the DNS records on hoster X) to the old webspace on X, you will have to use the IP address in the URL and in the preferences (see \begin_inset LatexCommand \ref{preferences} \end_inset ) for the tests of PHP-Nuke on Y. \layout Enumerate If all looks good on Y, put a .htaccess file (see \begin_inset LatexCommand \ref{htaccess-file} \end_inset ) in the document root on your server at X to redirect any requests to the new server at Y. That is, any requests to your domain will be re-routed to the IP of the server at Y. The following line in your .htaccess file will do this for you: \begin_deeper \layout Code redirectPermanent /oldlocation.html http://www.mynewdomain/folder/newlocation.html \end_deeper \layout Enumerate Update your domain's DNS records to point to the webspace at host Y. The lower TTL setting above will take care for a rapid propagation of the new DNS information throughout the world's name servers. Changes should propagate in a few hours. \layout Enumerate Keep your server at X for a couple of days to ensure that all DNS servers got the updated records, then cancel your services at X at your own leisure. Once you do so, you will no longer need to access Y with the IP address. \layout Standard In case you don't have direct control over the DNS record updates, \begin_inset LatexCommand \index{dates} \end_inset you will have to monitor your Y site closely, especially after receipt of the confirmation mail announcing to you that your application has been approved by both hosters. \begin_inset LatexCommand \index{hosters} \end_inset You may want to write a small cron job that accesses Y by name every 5 minutes and sends you an e-mail on success. As soon as your webspace on Y is accessible by your domain name, you will know that step 11 will be completed in a few hours or, in case you couldn't change TTL, \begin_inset LatexCommand \index{TTL} \end_inset a day. \layout Standard The key idea to the above process is that you put a .htaccess file on X, redirecting from X (still accessed by domain name) to Y (accessed by IP \begin_inset LatexCommand \index{IP} \end_inset address), as soon as you transfer the PHP-Nuke database to Y. See also \begin_inset LatexCommand \url[How to move a PHP-Nuke site]{http://www.nukecops.com/article-357--0-0.html} \end_inset . \layout Chapter Front end structure: user view \begin_inset LatexCommand \label{frontend} \end_inset \layout Standard In this chapter we will occupy ourselves, in detail, with all the functionalitie s implemented in PHP-Nuke, that is what our portal system can do and how. We will do this from the part of the visitor, \begin_inset LatexCommand \index{visitor} \end_inset imagining that we are the one who visits our site and uses its functionality. \begin_inset LatexCommand \index{functionality} \end_inset \layout Standard We will analyze all the preinstalled modules in the PHP-Nuke distribution \begin_inset LatexCommand \index{distribution} \end_inset and will give a look also at some very interesting modules that still have not been included in the official distribution. \begin_inset LatexCommand \index{distribution} \end_inset We will differentiate between the 6.0 version and its successors, since there have been important changes starting from version 6.5 - the \begin_inset LatexCommand \url[Splatt forum]{http://www.splatt.it} \end_inset , for example, has been replaced by the \begin_inset LatexCommand \url[phpBB f.orum]{http://www.phpbb.com} \end_inset , this has created changes in other modules, \begin_inset LatexCommand \index{modules} \end_inset like Your_Account or Private_Messages, that are now interoperating with phpBB. \begin_inset LatexCommand \index{phpBB} \end_inset \layout Standard Before starting, we should spend two words on how PHP-Nuke is structured; this system is structured as a 3 column portal, \begin_inset LatexCommand \index{portal} \end_inset the two lateral ones including the blocks, the central one displaying the function modules. \begin_inset LatexCommand \index{modules} \end_inset This does not mean to say that the structure of our site cannot be modified completely. The initial skeleton is, favorably, the one to start from in order to create a super personalized portal. \begin_inset LatexCommand \index{portal} \end_inset Beyond the 3 columns mentioned we have also a header (top of page) and a footer (bottom of page). \layout Description Blocks: \begin_inset LatexCommand \index{Blocks} \end_inset they are present in the left/right columns of our portal \begin_inset Foot collapsed false \layout Standard In fact, a way exists to personalize the visualization of the blocks based on the page in which they are displayed to us, for example, in module news we see both the left and the right block, in module search instead, we see only the blocks on the left. \end_inset and deliver functions that are repeated in all pages of the site (e\SpecialChar \@. g\SpecialChar \@. the menu, \begin_inset LatexCommand \index{menu} \end_inset banner and login blocks). \layout Description Modules: \begin_inset LatexCommand \index{Modules} \end_inset They are the heart of the page, they appear in the center column and each one has its own function. \begin_inset LatexCommand \index{function} \end_inset For example the news module delivers the articles, the search module makes an internal search of our site - they should be imagined as independent pages. They are the "heart" of the page that we visit (see \begin_inset LatexCommand \ref{fig-homepage} \end_inset ). \begin_deeper \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename homepage.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-homepage} \end_inset PHP-Nuke Homepage \end_inset \end_deeper \layout Section The preinstalled modules \begin_inset LatexCommand \label{preinstalled-modules} \end_inset \layout Description news: \begin_inset LatexCommand \index{news} \end_inset Born as the heart of PHP-Nuke, it was the obligatory Home Page in previous versions. In the last versions it is instead possible to define which modules should appear as the default page. \begin_deeper \layout Standard The News module expands its branches on more pages. The first one we see is a collection of the latest News published (it is possible , from the configuration panel [admin\SpecialChar \menuseparator preferences] to choose the number of latest news to be displayed, say 5, 10, 15, 20, 25, 30). In the main page only a small initial text of the news article is published. If the text is too large, it will be possible to read it whole by pressing the link \begin_inset Quotes eld \end_inset Read more \begin_inset Quotes erd \end_inset . \layout Standard The article module has many elements that distinguish it from other ones. In the first place, the title, \begin_inset LatexCommand \index{title} \end_inset the topic, that is the main category and is usually characterized by an image that, if clicked, brings up a selection of the articles that belong to this topic (starting from version 6.6, \begin_inset LatexCommand \index{6.6} \end_inset it is possible to assign more than one topics to one article). We have a second way to classify the articles, which is to assign them a category they are supposed to belong (see \begin_inset LatexCommand \ref{fig-category} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename category.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-category} \end_inset Classifying articles \end_inset \layout SGML \layout SGML IMPORTANT \layout SGML \layout SGML This category is NOT a subcategory of topics, but rather a cross-sectional category that is completely independent from topics. Probably its most important function is to distinguish between "articles" and other admin-defined classes of news for which it will be possible to NOT be automatically published on the start page. "Articles" will always appear on the start news page. \layout SGML \layout SGML \layout Standard For example, imagine a portal that talks about soccer and it has 3 topics: \begin_inset LatexCommand \index{topics} \end_inset \layout Itemize League A \layout Itemize League B \layout Itemize League C \layout Standard We could think of cross-sectional categories like: \layout Itemize Championship \begin_inset LatexCommand \index{Championship} \end_inset \layout Itemize Champions League \begin_inset LatexCommand \index{League} \end_inset \layout Itemize Soccer player market \layout Standard We can have an article that talks about League A/Championship, \begin_inset LatexCommand \index{Championship} \end_inset or of the Soccer player market League B. Clicking o topic, say League A, we will have a selection of all the articles that talk about League A, clicking on the category, \begin_inset LatexCommand \index{category} \end_inset Soccer player market, will have a selection of the articles that independently talk about soccer market that independently of the League being A, B or C. \layout Standard At the bottom of the article we find more information about the article: \begin_inset LatexCommand \index{article} \end_inset who inserted it, when & how many times it has been read etc. \layout SGML \layout SGML \layout SGML The counter is incremented only if the "Read more" link has been clicked. The counter does not increment unless the user clicks "Read more". \layout SGML \layout SGML \layout Standard It displays how many more bytes are still to be read, if there have been any comments on the article and what score has been given to the article \begin_inset LatexCommand \index{article} \end_inset by the readers. It is also possible to print the article in a printer-friendly format or you can send the link via e-mail to a friend. \layout Standard Clicking on " Read all " brings us to the page that contains the entire article and the comments pertaining to it. In this page the user can read the entire article and interact with it through a multitude of operations. \begin_inset LatexCommand \index{ations} \end_inset \layout Standard He/She can cast a vote for the article, \begin_inset LatexCommand \index{article} \end_inset thus expressing a judgement on its validity, \begin_inset LatexCommand \index{validity} \end_inset can comment on the article or answer to comments inserted from other users, can follow the links associated with this article, \begin_inset LatexCommand \index{article} \end_inset display it in a printer-friendly format and send the link via e-mail to a friend. You can also attach a survey to the article. \begin_inset LatexCommand \index{article} \end_inset \layout Standard In \begin_inset LatexCommand \ref{modifying-PHP-Nuke-News-module} \end_inset we show how to modify the PHP-Nuke News module. \begin_inset LatexCommand \index{module} \end_inset \end_deeper \layout Description AvantGO: \begin_inset LatexCommand \index{AvantGO} \end_inset It is a very simplified version of the news archive, cretated mainly from the need to visit the page via a Palm Pilot. AvantGO is a system for archiving and visualizing the pages on palmtop \begin_inset LatexCommand \index{palmtop} \end_inset screens due to the fact the Palm Pilot has a very small screen and has a low resolution (and even a low bandwidth connection) so they require simplified pages. \layout Description Downloads\SpecialChar ~ Module: \begin_inset LatexCommand \index{Module} \end_inset This module is deeply branched and is used to manage a file archive (present on our own or a third party site). It offers various modes of interaction the user (see \begin_inset LatexCommand \ref{fig-downloads-admin} \end_inset ). \begin_deeper \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename downloads-admin.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-downloads-admin} \end_inset Downloads module \end_inset \layout Standard In the main page it is possible to use an internal search engine that searches for keywords among all the files cataloged. There is also the possibility to add external links to a file (these files will not be added immediately, but put in a waiting list until an administrator \begin_inset LatexCommand \index{administrator} \end_inset will approve them and they become visible). We can also base our selection on which files were downloaded most, or which ones obtained the highest score. \begin_inset LatexCommand \index{score} \end_inset On this page we can have a list of categories that accompany the files (there may exist subcategories but in \begin_inset LatexCommand \ref{fig-downloads-admin} \end_inset there is only 1 category, \begin_inset LatexCommand \index{category} \end_inset \begin_inset Quotes eld \end_inset Linux Downloads \begin_inset LatexCommand \index{ads} \end_inset \begin_inset Quotes erd \end_inset ), the user is recognized when he/she views the downloads section after their first visit so if new downloads have been added since the last visit, the corresponding category will be have a "new" icon beside it. \layout Standard Once we have entered the desired section, we can download the files that interest us, cast a judgment vote, \begin_inset LatexCommand \index{vote} \end_inset report a nonexistent link to the administrator or see more information regarding the author of the file. \layout Standard The file list may be ordered by insertion date, \begin_inset LatexCommand \index{date} \end_inset judgment or popularityy (files downloaded most). \layout Standard Read \begin_inset LatexCommand \ref{enter-thousands-of-download-links} \end_inset if you are looking for a quick way to enter thousands of Downloads links. Further, in \begin_inset LatexCommand \ref{modifying-PHP-Nuke-downloads-module} \end_inset we show how to modify the PHP-Nuke Downloads module. \begin_inset LatexCommand \index{module} \end_inset \end_deeper \layout Description Feedback: \begin_inset LatexCommand \index{Feedback} \end_inset Allows the user to send feedback and contact the webmaster of the site. The user just fills in the appropriate fields which are \begin_inset Quotes eld \end_inset Name \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset E-Mail \begin_inset Quotes erd \end_inset and then the \begin_inset Quotes eld \end_inset Message Text \begin_inset Quotes erd \end_inset . The system will then format an e-mail message that will arrive to the webmaster \begin_inset LatexCommand \index{webmaster} \end_inset of the site. \layout Description Member\SpecialChar ~ \series bold List \series default : It displays all the users registered on the site. It is possible to select the users on the basis of their basic information \begin_inset LatexCommand \index{information} \end_inset fields (name, nickname, \begin_inset LatexCommand \index{nickname} \end_inset personal homepage and e-mail address). It is also possible to obtain a complete list of all the users and to order it by real name, e-mail address or homepage. \begin_inset LatexCommand \index{homepage} \end_inset \layout Description Private\SpecialChar ~ \series bold messages \series default : All the registered users have access to an internal messaging system, \begin_inset LatexCommand \index{system} \end_inset thus being able to exchange messages with each other. In the login box of each user the number of messages that are archived \begin_inset LatexCommand \index{archived} \end_inset for this user will be displayed, and there is a management functionality \begin_inset LatexCommand \index{functionality} \end_inset allowing for replies or deletions (see \begin_inset LatexCommand \ref{fig-private-messages} \end_inset ). \begin_deeper \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename private_messages.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-private-messages} \end_inset Private messages \end_inset \layout Standard The message that we compose has various parts: \layout Itemize The Recipient \layout Itemize The Subject \layout Itemize The animated icon that will accompany the subject of the message \layout Itemize The text that can be equipped with emoticons (emotional icons) and an aid for formatting the message in HTML adding Hyperlinks, emphasized words, \begin_inset LatexCommand \index{words} \end_inset bullet lists etc... \layout Standard In case there are private messages waiting for a user, this will be indicated in the login block. \begin_inset LatexCommand \index{block} \end_inset \layout Standard Starting from version 6.5, \begin_inset LatexCommand \index{6.5} \end_inset the Private Messages module has been changed: it has been integrated to the private messaging functionality of the phpBB \begin_inset LatexCommand \index{phpBB} \end_inset forum. \begin_inset LatexCommand \index{forum} \end_inset Sending functionality has not been changed, but there have been additions in other areas like: \layout Itemize The list of sent messages. \layout Itemize The list of drafts (messages that were written, but not have not yet been sent). \layout Itemize The remaining space in the box containing the list of messages. \layout Standard The module has been integrated in a very strict fashion into the phpBB forum. \begin_inset LatexCommand \index{forum} \end_inset \end_deeper \layout Description Recommend\SpecialChar ~ U \series bold s \series default : This module is so you can send an e-mail to a friend recommending visiting our PHP-Nuke site. The message that will be sent to the friend must be configured by the administr ator. \layout Description Book\SpecialChar ~ R \series bold eviews \begin_inset LatexCommand \index{views} \end_inset \series default : This module serves as an archive of product/services/site reviews. \begin_inset LatexCommand \index{reviews} \end_inset The book review must be inserted by the administrator but also from a user (a book review will need , in this case, \begin_inset LatexCommand \index{case} \end_inset be accepted by the administrator) who, after inserting a short description of the product then may express his judgment assigning a score to it. It is also possible to insert a descriptive image. The book reviews are catalogued in alphabetical order and the selection can be made based on starting letter. \begin_deeper \layout Standard We discuss how to modify the Reviews module in \begin_inset LatexCommand \ref{modifying-php-nuke-module-reviews} \end_inset . \end_deeper \layout Description Search: It is the main search engine for PHP-Nuke, it does full text searches on articles, comments, \begin_inset LatexCommand \index{comments} \end_inset sections, users and book reviews (see \begin_inset LatexCommand \ref{fig-search} \end_inset ). It is possible to make multiple searches (e.g.. an article of a certain category written by a certain author). \begin_deeper \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename search.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-search} \end_inset Search module \end_inset \end_deeper \layout Description Sections: \begin_inset LatexCommand \index{Sections} \end_inset This module is a classification system parallel to the one of the topics. \begin_inset LatexCommand \index{topics} \end_inset The classification of articles in PHP-Nuke does not follow a tree-like \begin_inset LatexCommand \index{tree-like} \end_inset scheme, \begin_inset LatexCommand \index{scheme} \end_inset as in the following example: \begin_deeper \layout Itemize Series A \begin_deeper \layout Itemize Amateur football \begin_inset LatexCommand \index{football} \end_inset \layout Itemize Professional football \begin_inset LatexCommand \index{football} \end_inset \layout Itemize Gossip \begin_inset LatexCommand \index{Gossip} \end_inset \end_deeper \layout Itemize Series B \begin_deeper \layout Itemize Amateur football \begin_inset LatexCommand \index{football} \end_inset \layout Itemize Professional football \begin_inset LatexCommand \index{football} \end_inset \layout Itemize Gossip \begin_inset LatexCommand \index{Gossip} \end_inset \end_deeper \layout Standard Instead, classification is achieved through the use of two transversal criteria, \begin_inset LatexCommand \index{criteria} \end_inset of which one is the \begin_inset Quotes eld \end_inset Section \begin_inset Quotes erd \end_inset and the other one the \begin_inset Quotes eld \end_inset Topic \begin_inset Quotes erd \end_inset , as is better captured by a table, whose two dimensions (rows and columns) cover the two criteria (see \begin_inset LatexCommand \ref{tab-sections} \end_inset ). \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-sections} \end_inset Classification with topics and sections \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard Series A \end_inset \begin_inset Text \layout Standard Series B \end_inset \begin_inset Text \layout Standard Series C \end_inset \begin_inset Text \layout Standard Amateur football \end_inset \begin_inset Text \layout Standard x \end_inset \begin_inset Text \layout Standard x \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard Professional football \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard x \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard Gossip \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard x \end_inset \begin_inset Text \layout Standard x \end_inset \end_inset \end_inset \layout Standard We discuss how to modify the Sections module in \begin_inset LatexCommand \ref{modifying-PHP-Nuke-sections-module} \end_inset . \end_deeper \layout Description Statistics: \begin_inset LatexCommand \index{Statistics} \end_inset The statistics module provides basic statistical information regarding use of the site. The information varies from the total number of displayed pages , to the type of browser and operating system used, up to the number of users that are registered, \begin_inset LatexCommand \index{registered} \end_inset the version of PHP-Nuke used etc.(see \begin_inset LatexCommand \ref{fig-stats} \end_inset ). \begin_deeper \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename stats.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-stats} \end_inset Statistics module \end_inset \end_deeper \layout Description Stories\SpecialChar ~ a \series bold rchive \series default : Archives all the articles by month enabling a chronological consultation. After having chosen the month, the corresponding articles are displayed with small flags besides them, visualizing the language they were written. Also in this plane it is possible to see the article in printable format \begin_inset LatexCommand \index{format} \end_inset and to send it to a friend. An inner search engine is also comprised as well as the display of details regarding the article, \begin_inset LatexCommand \index{article} \end_inset such as: \begin_deeper \layout Itemize number of comments \layout Itemize number of readings \layout Itemize score \begin_inset LatexCommand \index{score} \end_inset \layout Standard We discuss how to modify the Stories Archive module in \begin_inset LatexCommand \ref{modifying-PHP-Nuke-stories-archive} \end_inset . \end_deeper \layout Description Submit\SpecialChar ~ n \series bold ews \series default : The users or the simple visitors of the site can propose to the administrator \begin_inset LatexCommand \index{administrator} \end_inset an article that will then be examined and, if approved, published. The users do not have all the possibility of classification that the administra tor does, in fact they can only decide the article's title, \begin_inset LatexCommand \index{title} \end_inset the topic, the language and the text. They cannot classify it or choose if it should appear in the Home Page or not. And they can neither decide to publish it on a temporary basis. \begin_deeper \layout Standard We discuss how to modify the News module in \begin_inset LatexCommand \ref{modifying-PHP-Nuke-News-module} \end_inset . \end_deeper \layout Description Surveys: \begin_inset LatexCommand \index{Surveys} \end_inset Enables the administrator to create a survey that will later appear in a block ( \begin_inset LatexCommand \ref{fig-surveys-block} \end_inset ) or in the survey list. The users can vote on this survey (not more than once in 24 hours), and possibly leave a comment. Moreover it is possible to display the list of the previous surveys and to consult their final results. \layout Description Top10: \begin_inset LatexCommand \index{Top10} \end_inset It lists the top 10 active elements of our portal: \begin_deeper \layout Itemize 10 most read articles \layout Itemize 10 most commented articles \layout Itemize 10 most active categories \layout Itemize 10 most read articles in the special sections \layout Itemize 10 most voted surveys \begin_inset LatexCommand \index{surveys} \end_inset \layout Itemize 10 most active authors \layout Itemize 10 most read book reviews \begin_inset LatexCommand \index{reviews} \end_inset \layout Itemize 10most downloaded files \layout Itemize 10 most read pages \end_deeper \layout Description Topics: \begin_inset LatexCommand \index{Topics} \end_inset Lists the main categories of PHP-Nuke. Once we have entered this module, \begin_inset LatexCommand \index{module} \end_inset we will be able, by clicking on the corresponding icon of the topic we are interested in, to carry out a selection of articles and in automatic mode, to see all the articles corresponding to this topic. We are also presented with a small search interface to finish our search \begin_inset LatexCommand \index{search} \end_inset in the chosen context. \begin_inset LatexCommand \index{context} \end_inset \layout Description WebLinks: \begin_inset LatexCommand \index{WebLinks} \end_inset It is a collection of web links. This module has the exact same functionality as the Download module so there is no need to explain it any more. \begin_deeper \layout Standard Read \begin_inset LatexCommand \ref{enter-thousands-of-web-links} \end_inset if you are looking for a quick way to enter thousands of Web links. Further, in \begin_inset LatexCommand \ref{modifying-php-nuke-module-web-links} \end_inset we show how to modify the PHP-Nuke Web Links module. \begin_inset LatexCommand \index{module} \end_inset \end_deeper \layout Description Your\SpecialChar ~ \series bold Account \series default : It's the administration console for your \begin_inset Quotes eld \end_inset User Profile \begin_inset Quotes erd \end_inset (It only works for registered users), the implemented functions are (see \begin_inset LatexCommand \ref{fig-your-account} \end_inset ): \begin_deeper \layout Itemize Change your info: \begin_inset LatexCommand \index{info} \end_inset enables management of your profile by changing your E-mail, Where you're from, AIM, ICQ, \begin_inset LatexCommand \index{ICQ} \end_inset Avatar & Fake E-mail etc... \layout Itemize Change your Home: creates a personalized menu (as a block) for navigation, \begin_inset LatexCommand \index{navigation} \end_inset the user can put in there whatever he wants (tests, \begin_inset LatexCommand \index{tests} \end_inset links, images). \layout Itemize Setup comments: \begin_inset LatexCommand \index{comments} \end_inset Configures the display of comments, assigning display criteria. \layout Itemize Theme selection: Changes the theme of the site, allowing you to choose between all available themes. \begin_inset LatexCommand \index{themes} \end_inset \layout Itemize Journal: \begin_inset LatexCommand \index{Journal} \end_inset enables you to write your own diary to be published on the portal. Something like a Weblog in a Weblog, \begin_inset LatexCommand \index{Weblog} \end_inset so to say. ;-) \layout Itemize Webmail: \begin_inset LatexCommand \index{Webmail} \end_inset once configured correctly, this mail application allows you to read all your e-mails from all your e-mail accounts, without the need for any other mail client. \layout Itemize Logout/Exit: It lets us exit from our current user profile, \begin_inset LatexCommand \index{profile} \end_inset cancelling the cookie. \begin_inset LatexCommand \index{cookie} \end_inset \layout Itemize My Headlines: Imports into the the user's private area those news in RDF/RSS \begin_inset LatexCommand \index{RSS} \end_inset format that are published by preselected news sources. \begin_inset LatexCommand \index{sources} \end_inset The user can thus set up together his own personalized newspaper. \begin_inset LatexCommand \index{newspaper} \end_inset An even broader news functionality is offered by the My Headlines module \begin_inset LatexCommand \index{module} \end_inset ( \begin_inset LatexCommand \ref{PHP-Nuke-My-Headlines-module} \end_inset ), whose functionality you can see in action at Chris' \begin_inset LatexCommand \url[News-o-matic]{http://www.karakas-online.de/myHeadlines/} \end_inset page. \layout Itemize Broadcast Message: If the subject is aproppriate and the administrator has allowed it in the Preferences of the administration panel ( \begin_inset LatexCommand \ref{backend} \end_inset ), we can send messages that will be visible to all users on the home page of the site. It is also possible to disable the function, \begin_inset LatexCommand \index{function} \end_inset so that we don't see messages broadcast by other users. \layout Itemize Your private messages: This box displays the user's private messages. \layout Itemize Last 10 articles: Offers a list of the last 10 articles posted by that user. \newline \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename your_account.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-your-account} \end_inset Your account \end_inset \layout Standard We then have a main menu that informs us of how many and which comments \begin_inset LatexCommand \index{comments} \end_inset we have inserted and how many stories we have published. \layout Standard In \begin_inset LatexCommand \ref{modifying-php-nuke-moduke-your-account} \end_inset we show how to modify the PHP-Nuke Your Account module. \begin_inset LatexCommand \index{module} \end_inset If you are looking for a module that extends the possibilities of the standard Your Account module, \begin_inset LatexCommand \index{module} \end_inset have a look at the Your Account Tweak module in \begin_inset LatexCommand \ref{NSN-Your-Account-Tweak-module} \end_inset and the Approve Membership module in \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset . \end_deeper \layout Description Content: \begin_inset LatexCommand \index{Content} \end_inset This is a module that allows you to create your pages just as you prefer: you can insert HTML code (even one created by those very ugly visual editors) and it will be incorporated into the look and feel of your theme \begin_inset LatexCommand \index{theme} \end_inset when the article is displayed. \begin_deeper \layout Standard The Content module posesses a series of fields. Some are displayed only in the first page, some others only in the last one. The \begin_inset Quotes eld \end_inset Page Header \begin_inset LatexCommand \index{Header} \end_inset \begin_inset Quotes erd \end_inset field is the principal one, it is possible to separate the content into subpages, inserting at the aproppriate places in the text the \layout Code \layout Code \layout Code \layout Standard Thus, if you want to delete or change this top navigation bar, you will have to delete or change the above code to reflect your needs (see \begin_inset LatexCommand \url[How to change the top menu (top navigation bar) of PHP-Nuke]{http://www.karakas-online.de/forum/viewtopic.php?t=72} \end_inset and \begin_inset LatexCommand \url[how to remove the search box from the top menu of PHP-Nuke]{http://www.karakas-online.de/forum/viewtopic.php?t=268} \end_inset ). A similar technique is used in the Odyssey theme, \begin_inset LatexCommand \index{theme} \end_inset where one uses the contents of themes/Odyssey/left_center.html, additionally to themes/Odyssey/header. \begin_inset LatexCommand \index{header} \end_inset html. \layout Subsection How to insert a Search Box as in SlashOcean theme \begin_inset LatexCommand \label{PHP-Nuke-header-insert-SlashOcean-search-box} \end_inset \layout Standard The SlashOcean theme contains a Welcome message and a Search box in its header, \begin_inset LatexCommand \index{header} \end_inset as a close inspection of the code in the themeheader() function of themes/Slash Ocean/theme. \begin_inset LatexCommand \index{theme} \end_inset php reveals: \layout Code echo "
\layout Code
\layout Code \layout Code \layout Code "; \layout Code echo "
\layout Code \backslash \layout Code \layout Code
\layout Code \layout Code
  

"; \layout Standard You can use this code if you wish to have a search box besides your logo, \begin_inset LatexCommand \index{logo} \end_inset as in SlashOcean. \begin_inset LatexCommand \index{SlashOcean} \end_inset You will find similar constructs in the other themes, \begin_inset LatexCommand \index{themes} \end_inset e.g. Kaput or Slash. \begin_inset LatexCommand \index{Slash} \end_inset \layout Subsection How to change the PHP-Nuke header depending on some global feature \begin_inset LatexCommand \label{PHP-Nuke-header-change} \end_inset \layout Standard In some cases you may need to change the PHP-Nuke header according to some globally available information about the current user. For example, you may want to display a menu that is differently structured if the user's language is, say, french, \begin_inset LatexCommand \index{french} \end_inset leaving the standard menu structure untouched otherwise. \layout Standard The key to such changes is always to declare the globally available feature as being \begin_inset Quotes eld \end_inset global \begin_inset LatexCommand \index{global} \end_inset \begin_inset Quotes erd \end_inset in the themeheader() function in theme. \begin_inset LatexCommand \index{theme} \end_inset php. Then you can use its value for a simple check that will echo the right HTML incantations if the check succeeds. Let's take for example the above case, \begin_inset LatexCommand \index{case} \end_inset where the globally available feature is nothing else but the current language setting: \layout Code global $currentlang; \layout Code if ($currentlang == "french") { \layout Code echo "" \layout Code ._MESSERVICES." \backslash n"; \layout Code } \layout Code else if ($currentlang == "english") { \layout Code echo "" \layout Code ._DEFAULTLINK." \backslash n"; \layout Code } \layout Standard This code, put in the themeheader() function of theme. \begin_inset LatexCommand \index{theme} \end_inset php in the aproppriate place (depending on where exacly you want it to appear), will display a special menu link if the user's language is french. \begin_inset LatexCommand \index{french} \end_inset Instead of the current language, any user setting that is globally available can be used. The only work you have to do is to find out which variable stores the global \begin_inset LatexCommand \index{global} \end_inset setting you need ($currentlang in the above example). \layout Standard User information is stored in the userinfo array. This array is filled with a call to the getusrinfo() function. \begin_inset LatexCommand \index{function} \end_inset Thus a simple way to arrive at some information that is special to the currently logged-in user, is to write somethink like \layout Code global $user, $userinfo; \layout Code if(is_user($user)) { \layout Code getusrinfo($user); \layout Code } \layout Standard You have then some user-specific settings at your disposal: \begin_inset LatexCommand \index{disposal} \end_inset \layout Code $name = $userinfo['uname']; \layout Code $uid = $userinfo['uid']; \layout Code $email_real = $userinfo['email']; \layout Code $email_fake = $userinfo['femail']; \layout Code $url = $userinfo['url']; \layout Code $avatar = $userinfo['user_avatar']; \layout Code $newsletter = $userinfo['newsletter']; \layout Code $icq = $userinfo['user_icq']; \layout Code $aim = $userinfo['user_aim']; \layout Code $yim = $userinfo['user_yim']; \layout Code $msnm = $userinfo['user_msnm']; \layout Code $location = $userinfo['user_from']; \layout Code $occupation = $userinfo['user_occ']; \layout Code $interests = $userinfo['user_intrest']; \layout Code $signature = $userinfo['user_sig']; \layout Code $biography = $userinfo['user_bio']; \layout Standard and can use them in the same manner as $currentlang above to build a highly customized header. \begin_inset LatexCommand \index{header} \end_inset \layout Code \layout Subsection How to change the logo in the PHP-Nuke header \begin_inset LatexCommand \label{PHP-Nuke-header-change-logo} \end_inset \layout Standard One of the first things you will want to change once your PHP-Nuke is up and running, is the site's logo. \begin_inset LatexCommand \index{logo} \end_inset For this, you only have to replace the logo. \begin_inset LatexCommand \index{logo} \end_inset gif file that came with the theme you are using. Search for themes/YourTheme/logo.gif. \begin_inset LatexCommand \index{logo.gif} \end_inset Whatever graphic you put in logo.gif, \begin_inset LatexCommand \index{logo.gif} \end_inset it will show as the site's logo in the PHP-Nuke header. \begin_inset LatexCommand \index{header} \end_inset \layout Standard If you want to change the way the logo is displayed, perhaps by setting a width and height attribute, or specifying a border, \begin_inset LatexCommand \index{border} \end_inset you will have to change the HTML code that displays it in the theme. \begin_inset LatexCommand \index{theme} \end_inset To do this in a dynamic way, see \begin_inset LatexCommand \ref{PHP-Nuke-header-change-logo-dynamic} \end_inset . Here are the relevant code lines for each one of the standard PHP-Nuke themes: \begin_inset LatexCommand \index{themes} \end_inset \layout Code ./themes/3D-Fantasy/header.html:Welcome to $sitename \layout Code \layout Code ./themes/ExtraLite/theme.php: ."\backslash" \layout Code \layout Code ./themes/Kaput/theme.php: ."\backslash" \layout Code \layout Code ./themes/NukeNews/header.html: \layout Code \layout Code \layout Code ./themes/Odyssey/header.html: \layout Code \layout Code \layout Code ./themes/Slash/theme.php: \layout Code \layout Code \layout Code ./themes/SlashOcean/theme.php: \layout Code \backslash \layout Code \layout Code ./themes/Traditional/theme.php: ." \layout Code \backslash" \layout Code \layout Code ./themes/Anagram/theme.php: ." \layout Code \backslash \backslash n" \layout Code \layout Code ./themes/Karate/theme.php: ." \layout Code \backslash \backslash n" \layout Code \layout Code ./themes/Milo/theme.php: ." \layout Code \backslash \backslash n" \layout Code \layout Code ./themes/Sunset/theme.php:echo " \layout Code \backslash \backslash n"; \layout Code \layout Code ./themes/DeepBlue/theme.php: ."
\layout Code \backslash \layout Code
\backslash n" \layout Standard This is also the place to put your change, if you want a second graphic besides your logo, \begin_inset LatexCommand \index{logo} \end_inset or some other logo customization. \layout Code \layout Subsection How to change the logo's dimensions dynamically \begin_inset LatexCommand \label{PHP-Nuke-header-change-logo-dynamic} \end_inset \layout Standard If you have designed a logo that can be displayed equally well at many resolutio ns and you wish to be able to change its display dimensions dynamically, according to the display resolution of your visitor's monitor, \begin_inset LatexCommand \index{monitor} \end_inset then you have to use Javascript. \begin_inset LatexCommand \index{Javascript} \end_inset This is because PHP is a server-based technology and the web server has no means of knowing the monitor resolution of a client requesting a page. It would have to query that client for the resolution it uses, get an answer, then create the page with the right logo dimensions. But HTTP is a stateless protocol, \begin_inset LatexCommand \index{protocol} \end_inset meaning that, when the server gets an answer, it has no means to relate it to some previous request - not without cookies, \begin_inset LatexCommand \index{cookies} \end_inset URL parameters, sessions and all that extra stuff. This is where Javascript comes into play, obviating the need for a query-and-an swer procedure. \begin_inset LatexCommand \index{procedure} \end_inset \layout Standard Substitute the image logo tag \layout Standard \layout Standard of your theme (see \begin_inset LatexCommand \ref{PHP-Nuke-header-change-logo} \end_inset ) with the following: \layout Code $mod_log = "images/my_logo.gif"; \layout Code echo (" \backslash n"); \layout Standard Change the location of your logo in the $mod_log variable. The code will echo this Javascript in place of the image tag: \layout Code \layout Standard which will be executed on the client's browser (if the client has Javascript \begin_inset LatexCommand \index{Javascript} \end_inset enabled, of course). It will query its resolution (screen width) and write the HTML image tag, with the correct dimensions for the logo image, into the page's HTML code. It may not work though, if the client's security settings do not allow querying the screen's width. See \begin_inset LatexCommand \url[Different themes for different resolutions]{http://www.nukeforums.com/forums/viewtopic.php?t=15307} \end_inset and \begin_inset LatexCommand \url[banner next to logo]{http://www.nukeforums.com/forums/viewtopic.php?t=14147} \end_inset for a discussion of the details. \layout Subsection How to change placement of the banner in the PHP-Nuke header \begin_inset LatexCommand \label{PHP-Nuke-header-change-banner-placement} \end_inset \layout Standard Sometimes the banner will appear at a position that you would feel is unfavourab le for your theme and overall appearence of your site (of course, only if you enabled the banner functionality in the administration panel, \begin_inset LatexCommand \index{panel} \end_inset see \begin_inset LatexCommand \ref{administration-functions} \end_inset ). The code that controls whether the banner will appear or not, is a few lines long: \layout Code if ($banners == 1) { \layout Code include("banners.php"); \layout Code } \layout Standard and is found in the themeheader() function of the theme. \begin_inset LatexCommand \index{theme} \end_inset php file. You don't need to bother about the included file, banners. \begin_inset LatexCommand \index{banners} \end_inset php, that actually does all the job of selecting and displaying the appropriate banner, \begin_inset LatexCommand \index{banner} \end_inset keeping banner statistics up-to-date and all that stuff. All you need is find out where to place those 3 lines in order to achieve the desired banner placement. As this is a highly theme dependent topic, there are no general recipes. \begin_inset LatexCommand \index{recipes} \end_inset Just move the 3-liner around in themeheader() to get a feeling of the various elements and their positions, then experiment a little to find the right one for you. You might, for example, choose to include it in a table layout and echo it directly after the HTML line: \layout Code echo " \backslash n \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ."

\layout Code \backslash
"; \layout Code if ($banners) { \layout Code echo "
"; \layout Code include("banners.php"); \layout Code echo "
"; \layout Code } \layout Standard See \begin_inset LatexCommand \url[Banner placement]{http://www.karakas-online.de/forum/viewtopic.php?t=237} \end_inset and \begin_inset LatexCommand \url[banner next to logo]{http://www.nukeforums.com/forums/viewtopic.php?t=14147} \end_inset for a discussion of banner placement in PHP-Nuke. \layout Subsection How to display a watermark background image \begin_inset LatexCommand \label{PHP-Nuke-header-watermark-background-image} \end_inset \layout SGML It may sound inconsistent (actually, it \emph on is \emph default inconsistent!), but in order to display a static background image (i.e. one that does not scroll down when you scroll), like a watermark, in PHP-Nuke, you must change the theheader() function in the theme.php file of your theme. ]]> ]]> ]]> ]]> eek! \layout Standard The code you will need for this nice effect should be placed in the body part of the page's HTML code (the part delimited by the and HTML tags). The reason we need this in the body part, is that in the header it will produce an error (at least in Mozilla): \layout Code Error: document.body has no properties \layout Standard This is probably because the document body does not exist at the time the header is loading. \layout Standard Our code is a small Javascript, so you might think it belongs to the javascript. \begin_inset LatexCommand \index{javascript} \end_inset php file under the includes folder (see \begin_inset LatexCommand \ref{javascript-php} \end_inset ). Unfortunately, whatever is in that javascript. \begin_inset LatexCommand \index{javascript} \end_inset php file, will be included in the HTML header of the page, i.e. the part of the HTML code delimited by the and tags (see \begin_inset LatexCommand \ref{modifying-php-nuke-html-header} \end_inset ), so this will not serve our purpose. What we actually need is a file for code that belongs to the HTML body and comes preferably immediately after the tag - but such a file does not exist in PHP-Nuke yet. \layout Standard Thus, the next best place to insert our Javascript is in the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of our theme. \begin_inset LatexCommand \index{theme} \end_inset This is because the tag is echoed precisely in this file, as \begin_inset LatexCommand \ref{tab-body-tags} \end_inset demonstrates \begin_inset Foot collapsed false \layout SGML Of course, this also means that our change has to be applied for every theme and after every upgrade anew. ]]> ]]> ]]> ]]> Inline graphic \end_inset . \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-body-tags} \end_inset tags in theme. \begin_inset LatexCommand \index{theme} \end_inset php of various themes \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard theme.php file \end_inset \begin_inset Text \layout Standard PHP code that echoes the tag for the theme \end_inset \begin_inset Text \layout Standard themes/3D-Fantasy/theme.php \end_inset \begin_inset Text \layout Standard echo "
\backslash n \backslash n \backslash n"; \end_inset
\begin_inset Text \layout Standard themes/Anagram/theme.php \end_inset \begin_inset Text \layout Standard echo " \backslash n"; \end_inset \begin_inset Text \layout Standard themes/DeepBlue/theme.php \end_inset \begin_inset Text \layout Standard echo "" \end_inset \begin_inset Text \layout Standard themes/ExtraLite/theme.php \end_inset \begin_inset Text \layout Standard echo "" \end_inset \begin_inset Text \layout Standard themes/Kaput/theme.php \end_inset \begin_inset Text \layout Standard echo " \backslash n" \end_inset \begin_inset Text \layout Standard themes/Karate/theme.php \end_inset \begin_inset Text \layout Standard echo " \backslash n" \end_inset \begin_inset Text \layout Standard themes/Milo/theme.php \end_inset \begin_inset Text \layout Standard echo " \backslash n" \end_inset \begin_inset Text \layout Standard themes/NukeNews/theme.php \end_inset \begin_inset Text \layout Standard echo ""; \end_inset \begin_inset Text \layout Standard themes/Odyssey/theme.php \end_inset \begin_inset Text \layout Standard echo ""; \end_inset \begin_inset Text \layout Standard themes/Sand_Journey/theme.php \end_inset \begin_inset Text \layout Standard echo ""; \end_inset \begin_inset Text \layout Standard themes/Slash/theme.php \end_inset \begin_inset Text \layout Standard echo " \end_inset \begin_inset Text \layout Standard themes/SlashOcean/theme.php \end_inset \begin_inset Text \layout Standard echo " \end_inset \begin_inset Text \layout Standard themes/Sunset/theme.php \end_inset \begin_inset Text \layout Standard echo ""; \end_inset \begin_inset Text \layout Standard themes/Traditional/theme.php \end_inset \begin_inset Text \layout Standard echo "" \end_inset
\end_inset \end_inset \layout Standard Find the line that echoes the tag in your theme. \begin_inset LatexCommand \index{theme} \end_inset php (look for the themeheader() function or consult \begin_inset LatexCommand \ref{tab-body-tags} \end_inset ) and insert the following lines after it (if the line does not contain a semicolon at its end, you have of course to append these lines after the next most close line that contains it, otherwise you will mess up the code and get errors): \layout Code echo " \backslash n"; \layout Code echo " \backslash n"; \layout Standard Adapt the URL in the script (http://www.yoursite.com/images/watermark. \begin_inset LatexCommand \index{watermark} \end_inset gif) to reflect the full URL to your watermark image. That's all, if your theme does not define any background colours for tables! \layout Standard In practice, however, your theme \emph on will \emph default define at least two table background colours, \begin_inset LatexCommand \index{colours} \end_inset those in the OpenTable() and OpenTable2() functions, as shown in this example, taken from the ExtraLite \begin_inset LatexCommand \index{ExtraLite} \end_inset theme: \begin_inset LatexCommand \index{theme} \end_inset \layout Code function OpenTable() { \layout Code global $bgcolor1, $bgcolor2; \layout Code echo "
\backslash n"; \layout Code echo "
\backslash n"; \layout Code } \layout Code \layout Code function OpenTable2() { \layout Code global $bgcolor1, $bgcolor2; \layout Code echo "
\backslash n"; \layout Code echo "
\backslash n"; \layout Code } \layout Standard You must delete those bgcolor attributes completely for this method to work! In fact, this will not be enough: you will have to delete every other table bgcolor attribute that appears in your theme. \begin_inset LatexCommand \index{theme} \end_inset php \begin_inset Foot collapsed true \layout Standard That is at least the way I managed to get it to work with the ExtraLight theme. Since everyt heme is different, you will have to experiment here. \end_inset . Contrary to what is implied in \begin_inset LatexCommand \url[Static Background Image]{http://www.nukeforums.com/forums/viewtopic.php?t=14233} \end_inset , where this method is described in detail, deleting only the bgcolor attributes \begin_inset LatexCommand \index{attributes} \end_inset for the above two OpenTable functions will not be enough. \layout SGML \layout SGML \layout SGML Alternative solution \layout SGML \layout SGML \layout SGML An alternative solution would be to add the background and bgproperties attributes directly in the <body> tags of the lines in \begin_inset LatexCommand \ref{tab-body-tags} \end_inset , as in this example for the ExtraLite theme: \layout SGML \layout SGML \layout SGML \layout SGML "]]> \layout SGML \layout SGML \layout SGML bgproperties will also create a "watermark" on the page, a background image which does not scroll with the rest of the page (see \begin_inset LatexCommand \url[bgproperties attribute]{http://htmlcodetutorial.com/document/_BODY_BGPROPERTIES.html} \end_inset . The only value it can attain is \begin_inset Quotes eld \end_inset fixed \begin_inset Quotes erd \end_inset and it must be used in conjunction with the background attribute. It is an MSIE extension, so use it, but don't rely on it. You will again have to delete all background colour attributes of the tables in theme.php. Contrary to the first method, however, there is no way to specify a no-repeat property, so that if your image does not fill the whole background space available (which depends on the client's monitor resolution), it will be repeated horizontally as well as vertically. \layout SGML \layout SGML \layout Subsection How to display a Flash object in the PHP-Nuke header \begin_inset LatexCommand \label{PHP-Nuke-header-display-flash-object} \end_inset \layout Standard To show Flash in the PHP-Nuke header, \begin_inset LatexCommand \index{header} \end_inset you simply have to echo the appropriate HTML code. Since the HTML code for a Flash object is something like \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard the PHP-Nuke header code should contain something like \layout Code echo " " \layout Code ." " \layout Code ." " \layout Code ."" \layout Code .""; \layout Standard You can put the above code in the themes/YourTheme/theme. \begin_inset LatexCommand \index{theme} \end_inset php file, in the themeheader() function, \begin_inset LatexCommand \index{function} \end_inset after the call to the banners code: \layout Code if ($banners == 1) { \layout Code include("banners.php"); \layout Code } \layout Code ...put Flash code ("echo") here... \layout Standard The Flash object will be displayed after the banner, \begin_inset LatexCommand \index{banner} \end_inset if you have one. See \begin_inset LatexCommand \ref{flash-php-nuke-blocks} \end_inset on how to show Flash in a PHP-Nuke block. \begin_inset LatexCommand \index{block} \end_inset \layout Subsection How to hide the left blocks \begin_inset LatexCommand \label{hide-left-blocks} \end_inset \layout Standard For some esoteric reason, you may want to hide the column with the \emph on left \emph default blocks, although it contains some crucial blocks, like the modules block \begin_inset LatexCommand \index{block} \end_inset ( \begin_inset LatexCommand \ref{fig-modules-block} \end_inset ), for example. To accomplish this, you have to edit the themeheader() function in the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of your theme (in the themes/YourTheme folder) and replace the line: \layout Code blocks(left); \layout Standard with \layout Code if ($name=='Forums') { \layout Code /* Don't display it. */ \layout Code } \layout Code else { \layout Code blocks(left); \layout Code } \layout Standard Here, we check if the module is the Forums module and suppress the call to blocks(left) if it is. This will hide the left column blocks in the Forums. It is easy to include more modules, \begin_inset LatexCommand \index{modules} \end_inset as in the following example (see \begin_inset LatexCommand \url[Hide left blocks when viewing Forum or ANY module]{http://www.nukecops.com/postx69-0-0.html} \end_inset , \begin_inset LatexCommand \url[Como eliminar los bloques de la izquierda]{http://www.desarrollonuke.org/modules.php?name=Content&pa=showpage&pid=16} \end_inset , \begin_inset LatexCommand \url[Left Blocks on Index Page only]{http://www.nukeforums.com/forums/viewtopic.php?t=18282} \end_inset ): \layout Code if ($name=='Forums' || $name=='Members_List' || $name=='Private_Messages') { \layout Code /* Don't display it. */ \layout Code } else { \layout Code blocks(left); \layout Code } \layout Standard Don't forget to add $name to the list of global variables in themeheader(): \layout Code global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi, $name; \layout SGML Of course, if you don't find the call to blocks(left), your theme already suppresses the left column of blocks. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout SGML How to hide the right blocks \layout SGML \layout SGML \layout SGML Most of the time, if you want to hide any blocks, they will be the blocks in the right column, not the blocks in the left. See \begin_inset LatexCommand \ref{hide-right-blocks} \end_inset on how to hide the right blocks. \layout SGML \layout SGML \layout Standard From a theme design point of view, the above solution does not look satisfactory : you have to hardcode the names of the modules that should not display the left blocks into the code of the theme. \begin_inset LatexCommand \index{theme} \end_inset Since you don't know in advance which ones these are, you create a dependency \begin_inset LatexCommand \index{dependency} \end_inset relation to all existing and future modules. \begin_inset LatexCommand \index{modules} \end_inset \layout Standard A cleaner, alternative way is to declare the global $hideleft variable in themeheader() and check its value instead: \layout Code global $hideleft; \layout Code ... \layout Code if($hideleft == 1){ \layout Code /* Don't display it. */ \layout Code } else { \layout Code blocks(left); \layout Code } \layout Standard Now, for every module that you want to hide the left blocks, insert the lines \layout Code global $hideleft; \layout Code $hideleft =1; \layout Standard at the beginning of its code. As you see, with this method, the selection of the modules that hide the left blocks has become the job the modules' authors. The theme code can work with any module, \begin_inset LatexCommand \index{module} \end_inset present or future one, without changes - as any theme should. \layout SGML \layout SGML \layout SGML More flexibility with the Block Modificator \layout SGML \layout SGML \layout SGML With Chris Sengers' \begin_inset LatexCommand \url[Simple Blocks Manipulator for left blocks]{http://www.sengers-au.com/Portal/main/modules.php?name=Downloads&d_op=viewdownload&cid=5} \end_inset you can put any block left or right differently with any module. You can even use inactive blocks and also change the theme according to the module (we show how to do this yourself in \begin_inset LatexCommand \ref{change-php-nuke-theme-depending-on-module} \end_inset ). \layout SGML \layout SGML \layout Section Modifying the PHP-Nuke theme body \begin_inset LatexCommand \label{php-nuke-theme-modifying-body} \end_inset \layout Standard In this section we continue our study of PHP-Nuke themes - this time with the body of a theme! We cover topics like: \layout Itemize How to get multipage News articles ( \begin_inset LatexCommand \ref{multipage-news-articles} \end_inset ). \layout Itemize How to change the background colour ( \begin_inset LatexCommand \ref{change-background-colour} \end_inset ). \layout Subsection How to get multipage News articles \begin_inset LatexCommand \label{multipage-news-articles} \end_inset \layout Standard It appears that while Reviews, \begin_inset LatexCommand \index{Reviews} \end_inset Section, and Content areas allow multipage bodies, the general News article does not. Contrary to what one would think, if you want to add such functionality \begin_inset LatexCommand \index{functionality} \end_inset in the News module, \begin_inset LatexCommand \index{module} \end_inset the code under modules/News/ is \emph on not \emph default the right place. The right place is the themearticle() in the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of your theme! \layout Standard This is so, because it is the themearticle() function that outputs the article \begin_inset LatexCommand \index{article} \end_inset text, through a call to the FormatStory() function (which is also defined in theme. \begin_inset LatexCommand \index{theme} \end_inset php): \layout Code FormatStory($thetext, $notes="", $aid, $informant); \layout Standard Thus, all we have to do is format $thetext accordingly, before it is passed to FormatStory. Just add the following code to the begining of the themearticle() function \begin_inset LatexCommand \index{function} \end_inset in theme. \begin_inset LatexCommand \index{theme} \end_inset php, like this \begin_inset Foot collapsed false \layout Standard Notice that we have added $page to the global variable list - other than that ,the first two lines are included here only for your orientation. \end_inset (see \begin_inset LatexCommand \url[Multipage articles]{http://www.nukeforums.com/forums/viewtopic.php?topic=12114&forum=42} \end_inset , \begin_inset LatexCommand \url[Pagebreaks in articles]{http://www.nukeforums.com/forums/viewtopic.php?topic=9390&forum=26} \end_inset ): \layout Code function themearticle ($aid, $informant, $datetime, $title, $thetext, \layout Code $topic, $topicname, $topicimage, $topictext) { \layout Code global $admin, $sid, $tipath, $page; \layout Code $contentpages = explode( "", $thetext ); \layout Code $pageno = count($contentpages); \layout Code if ( $page=="" || $page < 1 ) \layout Code $page = 1; \layout Code if ( $page > $pageno ) \layout Code $page = $pageno; \layout Code $arrayelement = (int)$page; \layout Code $arrayelement --; \layout Code if ($pageno > 1) { \layout Code $thetextNew .= "Page: $page/$pageno
"; \layout Code } \layout Code $thetextNew .= "

$contentpages[$arrayelement]

"; \layout Code if($page >= $pageno) { \layout Code $next_page = ""; \layout Code } else { \layout Code $next_pagenumber = $page + 1; \layout Code if ($page != 1) { \layout Code $next_page .= "- "; \layout Code } \layout Code $next_page .= ""._NEXT." ($next_pagenumber/$pageno) \layout Code \layout Code \backslash"; \layout Code } \layout Code if ($page == $pageno) { \layout Code $thetextNew .= "

".nl2br($mypage[page_footer])."



"; \layout Code } \layout Code if($page <= 1) { \layout Code $previous_page = ""; \layout Code } else { \layout Code $previous_pagenumber = $page - 1; \layout Code $previous_page = " \layout Code \backslash \layout Code "._PREVIOUS." ($previous_pagenumber/$pageno)"; \layout Code } \layout Code $thetextNew .= "


$previous_page $next_page


"; \layout Code $thetext = $thetextNew; \layout Standard Now you can use in your News stories, and the code above will split the text at the and create the \begin_inset Quotes eld \end_inset previous \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset next \begin_inset Quotes erd \end_inset hyperlinks for you (don't forget to define _NEXT and _PREVIOUS in your language file, as shown in \begin_inset LatexCommand \ref{modifying-PHP-Nuke-texts} \end_inset ). \layout Subsection How to change background colour \begin_inset LatexCommand \label{change-background-colour} \end_inset \layout Standard A well-constructed theme will offer you a simple way to change the various colours (see \begin_inset LatexCommand \url[How to change the background colour]{http://www.karakas-online.de/forum/viewtopic.php?t=311} \end_inset ): in the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of the NukeNews theme, for example, you can read: \layout Code /************************************************************/ \layout Code /* Theme Colors Definition */ \layout Code /* */ \layout Code /* Define colors for your web site. $bgcolor2 is generaly */ \layout Code /* used for the tables border as you can see on OpenTable() */ \layout Code /* function, $bgcolor1 is for the table background and the */ \layout Code /* other two bgcolor variables follows the same criteria. */ \layout Code /* $texcolor1 and 2 are for tables internal texts */ \layout Code /************************************************************/ \layout Standard and immediately after that: \layout Code $bgcolor1 = "#efefef"; \layout Code $bgcolor2 = "#cfcfbb"; \layout Code $bgcolor3 = "#efefef"; \layout Code $bgcolor4 = "#cfcfbb"; \layout Code $textcolor1 = "#000000"; \layout Code $textcolor2 = "#000000"; \layout Standard The strings to the right side of the above assignments are hexadecimal represent ations of colours. \begin_inset LatexCommand \index{colours} \end_inset They begin with a # and contain six hexadecimal digits, two for each colour \begin_inset LatexCommand \index{colour} \end_inset of the basic ones, red, green and blue. Thus, the string "#cfcfbb" fot $bgcolor4 means cf for red, cf for green and bb for blue. Each one of the three hexadecimal two-digit numbers has a range from 00 to FF (just as each hexadecimal digit goes from 0 to F: 0, 1, 2, 3..., 8, 9, a, b, c, d, e, f, where a means 10, b means 11, c means 12 ... and f means 15 in the hexadecimal system). This means a range from 0 to 255 - that's 256 different values for each colour. \begin_inset LatexCommand \index{colour} \end_inset \layout SGML \layout SGML \layout SGML Colour wheels \layout SGML \layout SGML \layout SGML A useful tool in exploring the visible spectrum in HTML is the \begin_inset LatexCommand \url[colour wheel]{http://www.karakas-online.de/myServices/colorwheel.html} \end_inset . Just hover over the wheel with your mouse to view 4096 colors in their web safe, web smart and unsafe versions. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout SGML You can also use the \begin_inset LatexCommand \url[colour popups of the Tag-o-matic]{http://www.karakas-online.de/popups/} \end_inset to show all 216 web-safe colours in a virtual colour card. \layout SGML \layout SGML \layout Standard But what do you do if your theme does not follow this scheme and does not offer you this possibility? In such a case, we need to applly our knowledge \begin_inset LatexCommand \index{knowledge} \end_inset on the structure of a theme (see \begin_inset LatexCommand \ref{topic-structure} \end_inset ). We have seen that each theme comes with its own definition of the OpenTable() and CloseTable() functions. A brief look at the code of tables. \begin_inset LatexCommand \index{tables} \end_inset php in modules/NukeNews reveals the place where $bgcolor1 and $bgcolor2 are used in the Nuke News theme: \begin_inset LatexCommand \index{theme} \end_inset in the definitions of OpenTable() and CloseTable()! This is for example the OpenTable() function for the NukeNews theme (see modules/NukeNews/tables. \begin_inset LatexCommand \index{tables} \end_inset php): \layout Code function OpenTable() { \layout Code global $bgcolor1, $bgcolor2; \layout Code echo "
\backslash n"; \layout Code echo ""; \layout Code } \layout Standard Thus, by deleting all other themes you will get a theme count of only 1 and the theme change functionality will not be available to the user. \end_deeper \layout Enumerate Why get to all the trouble and delete whole theme directories? From what we said above, it should suffice just as well to replace the line \begin_deeper \layout Code if ($thmcount > 1) { \layout Standard with \layout Code if ($thmcount > 1000) { \layout Standard Unless you really installed more than a thousand themes, \begin_inset LatexCommand \index{themes} \end_inset your users are not going to get the chance to change the default one! \end_deeper \layout SGML Choose the first solution, if you don't want to touch the code, choose the second one, if you are lazy. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout SGML Don't delete themes if you already have registered users! \layout SGML \layout SGML \layout SGML Do the above changes before you go online and start getting registered users. Why? Because if you already have some, you don't know if the theme they chose in the User Preferences was the one you want to be the default. If it is not, and you apply either solution above, then those users will not be able to get into your site! Either the theme they specified will not be there, or they will not be able to change it. \layout SGML \layout SGML \layout SGML The first solution has the extra disadvantage that if you choose to change the default theme, you will need to move it under the themes folder. Thus, even for a very short period of time, you will end up having two themes available. You never know if a user just chose the theme you wanted to remove as her default theme. That user will be denied access to your site the next time she tries, because the theme will not be there anymore! \layout SGML \layout SGML \layout SGML In cases you do have registered users, you are thus advised to run the following SQL statement, either from the MySQL prompt, or through a graphical frontend, like phpMyAdmin: \layout SGML \layout SGML \layout SGML \layout SGML This will set the theme to blank for all users, making it for them possible to change it to the default one afterwards, see \begin_inset LatexCommand \url[disabling themes]{http://www.nukeforums.com/forums/viewtopic.php?t=14853} \end_inset and also \begin_inset LatexCommand \url[Where is the themeheader function located?]{http://www.nukeforums.com/forums/viewtopic.php?t=18836} \end_inset . \layout SGML \layout SGML \layout Section How to change the PHP-Nuke theme depending on the module \begin_inset LatexCommand \label{change-php-nuke-theme-depending-on-module} \end_inset \layout Standard For some web designs, it is desirable to always use the same theme for a few modules, \begin_inset LatexCommand \index{modules} \end_inset while letting the user choose his own theme for the rest. Let's say you want to use the NukeNews theme for the News and Sections \begin_inset LatexCommand \index{Sections} \end_inset modules, but let the user's personal theme be applied to the other modules \begin_inset LatexCommand \index{modules} \end_inset of your site. \layout Standard The theme is set in the get_theme function of mainfile.php. \begin_inset LatexCommand \index{mainfile.php} \end_inset Thus, all you have to do is declare the $name variable to be global in that function, \begin_inset LatexCommand \index{function} \end_inset then check its value before the selected theme is returned (i.e. immediately before the return statement) and, if it is, say "News", or "Sections" \begin_inset LatexCommand \index{Sections} \end_inset , to choose the NukeNews theme (see \begin_inset LatexCommand \url[Truly Global Variables]{http://www.nukeforums.com/forums/viewtopic.php?t=18245} \end_inset ): \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Declare $name to be global. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Check if the module name, $name, is News or Sections. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Set the selected theme to NukeNews. \layout SGML \layout SGML \layout SGML \layout Standard Of course, there is nothing magic about $name. You could take just any other variable and make the theme selection be dependent on it. You would only have to declare it global in the get_theme() function and in the modules that you would like to se t it. \layout Section How to change the font size in PHP-Nuke \begin_inset LatexCommand \label{change-font-size-php-nuke} \end_inset \layout Standard Since every theme comes with a CSS (style.css, \begin_inset LatexCommand \index{style.css} \end_inset see also \begin_inset LatexCommand \ref{CSS-syntax} \end_inset and \begin_inset LatexCommand \ref{make-dynamic-CSS} \end_inset ) in the styles folder of the theme itself (see \begin_inset LatexCommand \ref{topic-structure} \end_inset ), it is very easy to apply global formatting changes to our PHP-Nuke site: we just edit the CSS file. For example, to change the font size for all documents, we don't have to chase tags in the PHP code - we only need to edit the style.css of our theme. \begin_inset LatexCommand \index{theme} \end_inset \layout SGML \layout SGML </font> is deprecated in HTML 4.x \layout SGML \layout SGML </font> tags are deprecated in the HTML standard, starting from version 4.0, see \begin_inset LatexCommand \url[Font modifier elements: FONT and BASEFONT]{http://www.w3.org/TR/REC-html40/present/graphics.html#h-15.2.2} \end_inset . \layout SGML \layout SGML \layout Standard Typically, in style.css there will be one or more lines specifying the font size, like: \layout Code FONT {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 11px} \layout Code TD {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 11px} \layout Code BODY {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 11px} \layout Code P {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 11px} \layout Code DIV {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 11px} \layout Standard or \layout Code .title {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 13px; \layout Code FONT-WEIGHT: bold; FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none} \layout Code .content {BACKGROUND: none; COLOR: #000000; FONT-SIZE: 11px; \layout Code FONT-FAMILY: Verdana, Helvetica} \layout Code .storytitle {BACKGROUND: none; COLOR: #363636; FONT-SIZE: 14px; \layout Code FONT-WEIGHT: bold; FONT-FAMILY: Verdana, Helvetica; TEXT-DECORATION: none} \layout Standard Font size is usually specified in pixels (px), but other units are also possible (see \begin_inset LatexCommand \url[CSS Font-Size]{http://www.bigbaer.com/css_tutorials/css_font_size.htm} \end_inset ): \layout Itemize Relative units - they specify a length relative to another length. \begin_deeper \layout Itemize em: the 'font-size' of the relevant font. \layout Itemize ex: the 'x-height' of the relevant font. \layout Itemize px: pixels, \begin_inset LatexCommand \index{pixels} \end_inset relative to the viewing device. \layout Standard Thus, the 'em' unit is equal to the \emph on computed \emph default value of the 'font-size' property of the element on which it is used. The exception is when 'em' occurs in the value of the 'font-size' property itself, in which case it refers to the font size of the \emph on parent \begin_inset LatexCommand \index{parent} \end_inset \emph default element. That's what the following joke refers to: \layout SGML What did one .em say to the other .em? Who's your Daddy? ]]> ]]> ]]> ]]> Inline graphic \end_deeper \layout Itemize Absolute units: \begin_deeper \layout Itemize in: inches -- 1 inch is equal to 2.54 centimeters. \begin_inset LatexCommand \index{centimeters} \end_inset \layout Itemize cm: centimeters \begin_inset LatexCommand \index{centimeters} \end_inset \layout Itemize mm: millimeters \begin_inset LatexCommand \index{millimeters} \end_inset \layout Itemize pt: points -- the points used by CSS2 are equal to 1/72th of an inch. \layout Itemize pc: picas -- 1 pica is equal to 12 points. \end_deeper \layout Standard Depending on where you make the font size change, it may apply only to the title, \begin_inset LatexCommand \index{title} \end_inset the content or even the wholy body. Inheritance in the HTML document tree is applied by the browser to decide which properties can be passed on from the \begin_inset Quotes eld \end_inset parent \begin_inset LatexCommand \index{parent} \end_inset \begin_inset Quotes erd \end_inset elements to the \begin_inset Quotes eld \end_inset children \begin_inset Quotes erd \end_inset or the \begin_inset Quotes eld \end_inset descendants \begin_inset LatexCommand \index{descendants} \end_inset \begin_inset Quotes erd \end_inset . This is called \begin_inset Quotes eld \end_inset cascading \begin_inset LatexCommand \index{cascading} \end_inset \begin_inset Quotes erd \end_inset and is responsible for the first \begin_inset Quotes eld \end_inset C \begin_inset Quotes erd \end_inset in \begin_inset Quotes eld \end_inset CSS \begin_inset LatexCommand \index{CSS} \end_inset \begin_inset Quotes erd \end_inset . You need to understand cascading to use the full potential of CSS, \begin_inset LatexCommand \index{CSS} \end_inset but for simple changes like this one, you can just experiment and get the idea (see \begin_inset LatexCommand \ref{CSS-syntax} \end_inset for a short discussion of CSS syntax). \layout Standard However, it is better, from the "Accessibility" point of view, to let your users decide themselves what font size they like, by setting it in up in their browsers (see \begin_inset LatexCommand \url[How to change font size]{http://www.karakas-online.de/forum/viewtopic.php?t=383} \end_inset ). Read \begin_inset LatexCommand \url[Using relative font sizes]{http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html} \end_inset for the background on this. Using the advice given in that article, \begin_inset LatexCommand \index{article} \end_inset Chris has the following in the \begin_inset LatexCommand \url[CSS file for DocBook]{http://www.karakas-online.de/myLinuxTips/css-for-docbook.html} \end_inset that controls the appearence of the \begin_inset LatexCommand \url[PHP-Nuke HOWTO]{http://www.karakas-online.de/EN-Book/} \end_inset (and actually, all other documents on his site): \layout Code P { \layout Code font-size: 12px; \layout Code } \layout Code /*/*/A{} \layout Code BODY P { \layout Code font-size: x-small; \layout Code voice-family: " \backslash "} \backslash ""; \layout Code voice-family: inherit; \layout Code font-size: small; \layout Code } \layout Code HTML>BODY P { \layout Code font-size: small; \layout Code } \layout Code /* */ \layout Standard There's a lot going on here, and it's all important, so pay attention (taken from \begin_inset LatexCommand \url[Using relative font sizes]{http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html} \end_inset ): \layout Enumerate First, we're defining an absolute size (12px) for every

. All browsers apply this style, including Netscape 4. \layout Enumerate Then we include the odd-looking comment "/*/*/". Due to bugs in Netscape 4, everything between this comment and the following one will be ignored. That's right, all the following styles will only be applied in non-Netscape-4 \begin_inset LatexCommand \index{non-Netscape-4} \end_inset browsers. \layout Enumerate Immediately after the odd-looking comment, we include an empty rule "a {}". Opera 5 for Mac is buggy and ignores this rule (and only this rule). It applies everything else. \layout Enumerate We have now carved out a realm where we can define rules that are applied in all browsers except Netscape 4. Now we can start defining relative font sizes (which Netscape 4 can't handle). The first thing we do is use a "body p" selector to redefine the behaviour of the p tag. Due to the way CSS works, this will override our previous p selector. \begin_inset LatexCommand \index{selector} \end_inset (In technical terms, \begin_inset LatexCommand \index{terms} \end_inset "body p" is a more specific selector than "p".) \layout Enumerate We redefine the font size of all

tags to be x-small. This is a font size keyword which, at default settings, Internet Explorer \begin_inset LatexCommand \index{Explorer} \end_inset 5 for Windows will translate into 12px. \begin_inset LatexCommand \index{12px} \end_inset However, if the user changes their "Text Size" (under the View menu), this text will scale larger or smaller, depending on the user's setting. This is what we want. (Note: we've now defined font-size twice for IE5/Win, but that's okay, because the more specific selector always wins, and the previous selector \begin_inset LatexCommand \index{selector} \end_inset is simply ignored.) \layout Enumerate Unfortunately, IE5/Win an off-by-1 bug with its font size keywords; \begin_inset LatexCommand \index{words} \end_inset every other browser in the world (IE5/Mac, Netscape 6, Mozilla, \begin_inset LatexCommand \index{Mozilla} \end_inset IE6/Win) will translate x-small to 10px, \begin_inset LatexCommand \index{10px} \end_inset not 12px. Luckily for us, IE5/Win has its own parsing bug that we can exploit: \begin_inset LatexCommand \index{exploit} \end_inset it looks at that odd-looking voice-family and mistakenly thinks that this entire "body p" selector is over, so it ignores all the lines until the "}". \layout Enumerate Now we have carved out a smaller realm where we can define rules that are applied in all browsers except IE5/Win (and Netscape 4, which is still blissfully ignoring all of this). So we redefine font-size to small, which modern non-IE5/Win browsers (the only ones still listening) correctly interpret as 12px (at default settings). Again, if the user sets their "text size" to larger, this text will scale larger, which is what we want. \layout Enumerate But wait! Opera 5 has the same parsing bug that IE5/Win has, so it was also confused by the voice-family hack, \begin_inset LatexCommand \index{hack} \end_inset but it correctly interprets font size keywords, \begin_inset LatexCommand \index{words} \end_inset so now our text will look too small in Opera 5. Luckily, Opera 5 supports a third type of selector, \begin_inset LatexCommand \index{selector} \end_inset "html>body p". (Again, this is "more specific" than "body p", so it takes precedence over the previous selector. \begin_inset LatexCommand \index{selector} \end_inset ) IE5/Win does not support this type of selector, so it will just ignore it, which is what we want (since we've already compensated for it's off-by-1 bug and don't want to go mucking that up now). IE6/Win also does not support it, but that's OK, because we caught it with the "font-size: \begin_inset LatexCommand \index{font-size} \end_inset small" after the "voice-family: inherit" hack in the "body p" selector. \begin_inset LatexCommand \index{selector} \end_inset All other browsers support "html>body" selectors, so for them we end up defining font-size four times. Again, that's not a problem, because the most specific selector always wins, and the rest are simply ignored. \layout Enumerate Finally, we have a set of empty comments: \begin_inset LatexCommand \index{comments} \end_inset /* */. This triggers Netscape 4's parser to start listening again. If we defined any further rules after these empty comments, \begin_inset LatexCommand \index{comments} \end_inset all browsers (including Netscape 4) would apply them. \layout Standard To recap: \layout Enumerate Netscape 4 displays

text at 12px, \begin_inset LatexCommand \index{12px} \end_inset regardless of user setting. \layout Enumerate Internet Explorer 5 for Windows displays

text at x-small, which works out to be 12px at the default setting, but would scale larger if the user set their "Text Size" setting larger in the View menu. \begin_inset LatexCommand \index{menu} \end_inset \layout Enumerate Internet Explorer 6 for Windows displays

text at small, because of the "font-size: \begin_inset LatexCommand \index{font-size} \end_inset small" rule in the "body p" selector. This works out to 12px at the default setting, but would scale larger if the user set their "Text Size" setting larger. \layout Enumerate Internet Explorer 5 for Mac, Opera, Netscape 6, Mozilla, \begin_inset LatexCommand \index{Mozilla} \end_inset and (hopefully) all future browsers will display

text at small, because of the "font-size: \begin_inset LatexCommand \index{font-size} \end_inset small" rule in the "html>body p" selector. \begin_inset LatexCommand \index{selector} \end_inset This works out to 12px at the default setting, but would scale larger if the user used the "Text Zoom" feature. \layout SGML \layout SGML \layout SGML Dive into Accessibility! \layout SGML \layout SGML \layout SGML By the way, the whole \begin_inset LatexCommand \url[Dive into Accessibility]{http://diveintoaccessibility.org/table_of_contents.html} \end_inset document by Mark Pilgrim is highly recommended reading for everyone. It will open your eays to a different world - that also uses the Internet! \layout SGML \layout SGML \layout Chapter Modifying the PHP-Nuke HTML header \begin_inset LatexCommand \label{modifying-php-nuke-html-header} \end_inset \layout Standard The PHP-Nuke HTML header (i.e. everything that goes between the and tags in the HTML code of the generated page) is fully customizable through the includes/my_header. \begin_inset LatexCommand \index{header} \end_inset php file. This file contains whatever custom stuff you need to include in your site when the header loads. \begin_inset LatexCommand \index{ads} \end_inset This can be used for third party banners, \begin_inset LatexCommand \index{banners} \end_inset custom javascript, popup windows, etc. With this file you don't need to edit system code each time you upgrade to a new version. Just remember, in case you add code here to not overwrite this file when updating! Whatever you put here will be between and tags. \layout Standard Here are some example customizations of the PHP-Nuke HTML header: \begin_inset LatexCommand \index{header} \end_inset \layout Section How to implement a favourites icon (favicon.ico) \begin_inset LatexCommand \label{favourites-icon-favicon-ico} \end_inset \layout Standard Would you like to use a custom icon to appear in the URL address field at the top of the IE window when people are at your site? This is a \begin_inset Quotes eld \end_inset favicon \begin_inset LatexCommand \index{favicon} \end_inset \begin_inset Quotes erd \end_inset , a favourites icon, that small icon that you see besides the URL when you visit some cool sites. This \begin_inset Quotes eld \end_inset functionality \begin_inset LatexCommand \index{functionality} \end_inset \begin_inset Quotes erd \end_inset was introduced by the Internet Explorer. \begin_inset LatexCommand \index{Explorer} \end_inset When you add a site to your Favourites list, Internet Explorer (version 5 and above) asks the server if it has a file called favicon. \begin_inset LatexCommand \index{favicon} \end_inset ico. If present, this file will be used to provide an icon that is displayed next to the bookmark text. It is not visible in the old browsers, but newer ones, like Mozilla and Konqueror, \begin_inset LatexCommand \index{Konqueror} \end_inset will also display it. \layout Standard To display a favicon, \begin_inset LatexCommand \index{favicon} \end_inset you have first to create one. The icon has to be in the ICO format which, contrary to common belief, is NOT the same as GIF, or PNG. \begin_inset LatexCommand \index{PNG} \end_inset You have to transform your GIF or PNG file to ICO format. \begin_inset LatexCommand \index{format} \end_inset For Windows, \begin_inset LatexCommand \index{Windows} \end_inset you can use one of the numerous icon tools ( \begin_inset LatexCommand \ref{php-nuke-theme-modifying-icons} \end_inset ). For Linux, \begin_inset LatexCommand \index{Linux} \end_inset simply create a 16x16 PNG file and convert it to an icon resource with \begin_inset LatexCommand \url[png2ico]{http://www.winterdrache.de/freeware/png2ico} \end_inset . \layout Standard Upload the ICO file to, say, images/favicon. \begin_inset LatexCommand \index{favicon} \end_inset ico. Then add the following lines in the includes/my_header. \begin_inset LatexCommand \index{header} \end_inset php file, somewhere between the \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset tags: \layout Code echo ""; \layout Code echo \begin_inset Quotes eld \end_inset \begin_inset Quotes erd \end_inset ; \layout SGML \layout SGML \layout SGML Note: \layout SGML \layout SGML \layout SGML If you did the above and your browser still does not show the icon, remember that it may be using an old cache. Empty the cache and remember that even with a new cache, the browser may be using some old information, so you will have to be patient, or check it with a browser that did not visit that URL before. \layout SGML \layout SGML \layout Standard For more information on how to create and use a favicon, \begin_inset LatexCommand \index{favicon} \end_inset see \begin_inset LatexCommand \url[How To Create And Install A favicon.ico]{http://www.winterdrache.de/freeware/png2ico/favicon.html} \end_inset . \layout Section How to prevent the statistics module from gathering hits from certain hosts \begin_inset LatexCommand \label{prevent-statistics-module-gathering-hits} \end_inset \layout SGML If you are still in the phase of editing and tweaking your PHP-Nuke site while it is already online, you may find out that your frequent visits are counted just as every other visit to your site by the statistics module. During a very productive phase, this can skew the statistics of your site quite a bit! ]]> ]]> ]]> ]]> Inline graphic \layout Standard Contrary to what you might have expected, to prevent the statistics module \begin_inset LatexCommand \index{module} \end_inset from gathering hits from certain hosts, like your own one, you have to edit the header. \begin_inset LatexCommand \index{header} \end_inset php file, not any other file from the modules folder. \layout SGML \layout SGML \layout SGML header.php and includes/my_header.php \layout SGML \layout SGML \layout SGML Do not confuse header.php, a file located in the PHP-Nuke root directory, with the my_header.php file, located under the includes directory. The former contains standard PHP-Nuke functions for the PHP-Nuke header, the latter is there for your own, personal additions to the header. \layout SGML \layout SGML \layout Standard In your header. \begin_inset LatexCommand \index{header} \end_inset php file, find the code: \layout Code include("includes/counter.php"); \layout Standard and replace it with \begin_inset Foot collapsed false \layout Standard See \begin_inset LatexCommand \url[Block hosts from total hits in statistics module]{http://www.nukeforums.com/forums/viewtopic.php?topic=12839&forum=42} \end_inset . \end_inset : \layout Code global $admin; \layout Code if(!is_array($admin)) { \layout Code $admin_name = base64_decode($admin); \layout Code $admin_name = explode(":", $admin_name); \layout Code $admin_name = "$admin_name[0]"; \layout Code } else { \layout Code $admin_name = "$admin[0]"; \layout Code } \layout Code if($admin_name != "PutYourAdminNameHere") { \layout Code include("includes/counter.php"); \layout Code } \layout SGML Put your administrator name in place of the "PutYourAdminNameHere" string in the above code and visits by that administrator will not increase your statistics counter any more. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout SGML How to block all administrators from the statistics counter \layout SGML \layout SGML \layout SGML A simpler fix, which will block all administrators from the statistics counter, is: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout Chapter Modifying mainfile.php \begin_inset LatexCommand \label{modifying-mainfile-php} \end_inset \layout Standard The mainfile.php file in the root directory of PHP-Nuke contains all commonly used functions and plays a crucial role in PHP-Nuke. We devote this chapter to a closer investigation of this central file. We show: \layout Itemize How to allow special HTML tags ( \begin_inset LatexCommand \ref{allow-special-HTML-tags} \end_inset ). \layout Itemize How to change the order of messages ( \begin_inset LatexCommand \ref{change-order-of-messages} \end_inset ). \layout SGML \layout SGML \layout SGML Warning \layout SGML \layout SGML \layout SGML Most of the changes discussed in this chapter have direct or indirect security implications (see \begin_inset LatexCommand \ref{security} \end_inset ). No line in mainfile.php was put there without some reason, the reason being often security-related. Whenever you comment a line that seems to do a too restrictive check on user input, for example, bear in mind that in the worst of all cases you may run the risk of being hacked because of the absence of exactly a check like that. \layout SGML \layout SGML \layout Section How to allow special HTML tags \begin_inset LatexCommand \label{allow-special-HTML-tags} \end_inset \layout Standard User input is checked and filtered automatically by PHP-Nuke. For this purpose the functions filter_text and check_html are used. filter_text checks and replaces bad words, then calls check_html, \begin_inset LatexCommand \index{check_html} \end_inset which in turn checks for HTML tags and strips them completely off, if the second parameter is \begin_inset Quotes eld \end_inset nohtml \begin_inset LatexCommand \index{nohtml} \end_inset \begin_inset Quotes erd \end_inset . \layout Standard \begin_inset LatexCommand \ref{tab-filter_text} \end_inset shows all modules that call filter_text, \begin_inset LatexCommand \index{filter_text} \end_inset together with the line the call is made on. You can see that filter_text is used to filter \begin_inset LatexCommand \index{filter} \end_inset \layout Itemize the text of a mail response in the WebMail module \begin_inset LatexCommand \index{module} \end_inset \layout Itemize the comments in the News module \begin_inset LatexCommand \index{module} \end_inset \layout Itemize the comments in the Reviews module \begin_inset LatexCommand \index{module} \end_inset \layout Itemize the subject, \begin_inset LatexCommand \index{subject} \end_inset story and extended story text in the Submit_News module \layout Itemize the subject and comments in the Surveys module \begin_inset LatexCommand \index{module} \end_inset \layout Itemize the username and message in the Your_Account module \begin_inset LatexCommand \index{module} \end_inset \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-filter_text} \end_inset Calls to filter_text from PHP-Nuke modules (v.6.8) \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard Module \end_inset \begin_inset Text \layout Standard Line with call to filter_text \end_inset \begin_inset Text \layout Standard modules/WebMail/readmail.php \end_inset \begin_inset Text \layout Standard $res = filter_text($res); // Security fix by Ulf Harnhammar 2002 \end_inset \begin_inset Text \layout Standard modules/News/comments.php \end_inset \begin_inset Text \layout Standard $comment = FixQuotes(nl2br(filter_text($comment))); \end_inset \begin_inset Text \layout Standard modules/News/comments.php \end_inset \begin_inset Text \layout Standard $subject = FixQuotes(filter_text($subject, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/News/comments.php \end_inset \begin_inset Text \layout Standard $comment = FixQuotes(filter_text($comment)); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $comments = FixQuotes(nl2br(filter_text($comments))); \end_inset \begin_inset Text \layout Standard modules/Submit_News/index.php \end_inset \begin_inset Text \layout Standard $subject = FixQuotes(filter_text($subject, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/Submit_News/index.php \end_inset \begin_inset Text \layout Standard $story = FixQuotes(nl2br(filter_text($story))); \end_inset \begin_inset Text \layout Standard modules/Submit_News/index.php \end_inset \begin_inset Text \layout Standard $storyext = FixQuotes(nl2br(filter_text($storyext))); \end_inset \begin_inset Text \layout Standard modules/Submit_News/index.php \end_inset \begin_inset Text \layout Standard $story = FixQuotes(filter_text($story)); \end_inset \begin_inset Text \layout Standard modules/Submit_News/index.php \end_inset \begin_inset Text \layout Standard $storyext = FixQuotes(filter_text($storyext)); \end_inset \begin_inset Text \layout Standard modules/Surveys/comments.php \end_inset \begin_inset Text \layout Standard $subject = FixQuotes(filter_text($subject, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/Surveys/comments.php \end_inset \begin_inset Text \layout Standard $comment = FixQuotes(nl2br(filter_text($comment))); \end_inset \begin_inset Text \layout Standard modules/Surveys/comments.php \end_inset \begin_inset Text \layout Standard $comment = FixQuotes(filter_text($comment)); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard filter_text($username); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard if ($bio) { filter_text($bio); $bio = $EditedMessage; $bio = FixQuotes($bio); } \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $the_message = FixQuotes(filter_text($the_message, "nohtml")); \end_inset \end_inset \end_inset \layout Standard check_html, \begin_inset LatexCommand \index{check_html} \end_inset in turn, is not only called from filter_text, but also in its own right. \begin_inset LatexCommand \ref{tab-check-html} \end_inset shows all modules that call check_html and the line it is called on. You can see that check_html is called to check the HTML input in \layout Itemize the query string in the Downloads, \begin_inset LatexCommand \index{ads} \end_inset Encyclopedia, Web Links and Search sections \layout Itemize the title, \begin_inset LatexCommand \index{title} \end_inset text, reviewer, URL text and comments in the Reviews module \layout Itemize user name, e-mail, \begin_inset LatexCommand \index{e-mail} \end_inset various user info fields in the Your Account module \layout Itemize bodytext and comments in the Journal module \begin_inset LatexCommand \index{module} \end_inset \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-check-html} \end_inset Calls to check_html from PHP-Nuke modules (v.6.8) \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard Module \end_inset \begin_inset Text \layout Standard Line with call to filter_text \end_inset \begin_inset Text \layout Standard modules/Downloads/index.php \end_inset \begin_inset Text \layout Standard $query = check_html($query, nohtml); \end_inset \begin_inset Text \layout Standard modules/Encyclopedia/search.php \end_inset \begin_inset Text \layout Standard $query = check_html($query, nohtml); \end_inset \begin_inset Text \layout Standard modules/Encyclopedia/search.php \end_inset \begin_inset Text \layout Standard $query = check_html($query, nohtml); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $title = stripslashes(check_html($title, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $text = stripslashes(check_html($text, "")); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $reviewer = stripslashes(check_html($reviewer, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $url_title = stripslashes(check_html($url_title, "nohtml")); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $title = stripslashes(FixQuotes(check_html($title, "nohtml"))); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $text = stripslashes(Fixquotes(urldecode(check_html($text, "")))); \end_inset \begin_inset Text \layout Standard modules/Reviews/index.php \end_inset \begin_inset Text \layout Standard $comments = stripslashes(FixQuotes(check_html($comments))); \end_inset \begin_inset Text \layout Standard modules/Search/index.php \end_inset \begin_inset Text \layout Standard $query = stripslashes(check_html($query, nohtml)); \end_inset \begin_inset Text \layout Standard modules/Web_Links/index.php \end_inset \begin_inset Text \layout Standard $query = check_html($query, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $username = check_html($username, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_email = check_html($user_email, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_email = check_html($user_email, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $femail = check_html($femail, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_website = check_html($user_website, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $bio = check_html($bio, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_avatar = check_html($user_avatar, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_icq = check_html($user_icq, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_aim = check_html($user_aim, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_yim = check_html($user_yim, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_msnm = check_html($user_msnm, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_occ = check_html($user_occ, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_from = check_html($user_from, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $user_interests = check_html($user_interests, nohtml); \end_inset \begin_inset Text \layout Standard modules/Your_Account/index.php \end_inset \begin_inset Text \layout Standard $realname = check_html($realname, nohtml); \end_inset \begin_inset Text \layout Standard modules/Journal/display.php \end_inset \begin_inset Text \layout Standard $row[bodytext]=check_html($row[bodytext], $strip); \end_inset \begin_inset Text \layout Standard modules/Journal/display.php \end_inset \begin_inset Text \layout Standard $row[comment]=check_html($row[comment], $strip); \end_inset \end_inset \end_inset \layout Standard check_html uses the $AllowableHTML array that is defined in config.php. \begin_inset LatexCommand \index{config.php} \end_inset The idea is that only the tags that are included in the $AllowableHTML \begin_inset LatexCommand \index{AllowableHTML} \end_inset array should be allowed. However, even if you explicitly allow the img tag in $AllowableHTML, \begin_inset LatexCommand \index{AllowableHTML} \end_inset it will be stripped away by check_html (and by filter_text, \begin_inset LatexCommand \index{filter_text} \end_inset which also calls it). The line that does this is \layout Code $str = eregi_replace("<[[:space:]]* img[[:space:]]*([^>]*)[[:space:]]*>", ", $str); \layout Standard You can comment out that line - though it is certainly a security issue (allowing people to post harmful code in img tags). \layout Standard You can also comment out the line that eliminates all anchor attributes \begin_inset LatexCommand \index{attributes} \end_inset exept href in the tag: \layout Code $str = eregi_replace("]*href[[:space:]]*=[[:space:]]* \backslash "?[[:space:]]*([^ \backslash " >]*)[[:space:]]* \backslash "?[^>]*>", '', $str); # " \layout Standard These changes will affect the checks done at all places shown in both \begin_inset LatexCommand \ref{tab-filter_text} \end_inset and \begin_inset LatexCommand \ref{tab-check-html} \end_inset , so again, be careful with security issues. You have to trust your users to give them this comfort. \layout Standard Put the tags you want to allow in the $AllowableHTML array in the config.php \begin_inset LatexCommand \index{config.php} \end_inset file. Here is a (quite liberal) example: \layout Code $AllowableHTML = array("b"=>1, \layout Code "i"=>1, \layout Code "a"=>2, \layout Code "em"=>1, \layout Code "br"=>1, \layout Code "strong"=>1, \layout Code "blockquote"=>1, \layout Code "tt"=>1, \layout Code "li"=>1, \layout Code "ol"=>1, \layout Code "H1"=>1, \layout Code "H2"=>1, \layout Code "H3"=>1, \layout Code "H4"=>1, \layout Code "center"=>1, \layout Code "img"=>2, \layout Code "alt"=>1, \layout Code "table"=>2, \layout Code "tr"=>2, \layout Code "td"=>2, \layout Code "p"=>2, \layout Code "div"=>2, \layout Code "font"=>2, \layout Code "p"=>1, \layout Code "p"=>1, \layout Code "ul"=>1); \layout Standard The numbers that appear next to each tag have the following meaning: \layout Itemize a 1 means the tag does not accept any attributes \begin_inset LatexCommand \index{attributes} \end_inset \layout Itemize a 2 indicates that the tag may also contain attributes \begin_inset LatexCommand \index{attributes} \end_inset \layout Standard See also \begin_inset LatexCommand \ref{config-php-file} \end_inset . \layout Section How to change the order of messages \begin_inset LatexCommand \label{change-order-of-messages} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename messages.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-messages-2} \end_inset Administration panel: Messages. \end_inset \layout Standard The default for PHP-Nuke is to display messages in ascending order of mid \begin_inset LatexCommand \index{mid} \end_inset (the id number for each message). You can use Add Story ( \begin_inset LatexCommand \ref{fig-stories} \end_inset ) to post articles on your site and these will appear in reverse order, i.e. last posted at the top (see also \begin_inset LatexCommand \ref{order-articles-in-sections} \end_inset , on how to order articles in Sections and \begin_inset LatexCommand \ref{order-articles-in-stories-archive} \end_inset , on how to order articles in the Stories Archive). Thus you could have a main \begin_inset Quotes eld \end_inset Welcome Message \begin_inset Quotes erd \end_inset at the top which will always be there as a home page, followed by a series \begin_inset LatexCommand \index{series} \end_inset of announcements appearing in reverse order below the Welcome Message. But what happens if you don't use \begin_inset Quotes eld \end_inset Add Story \begin_inset Quotes erd \end_inset to add articles, but would rather like to use Messages ( \begin_inset LatexCommand \ref{fig-messages} \end_inset ) for communicating your news? \begin_inset LatexCommand \index{news} \end_inset \layout Standard If you really want to use Messages and have them appear in reverse order (last one at the top), you need to edit mainfile.php using a decent editor \begin_inset LatexCommand \index{editor} \end_inset (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ). \layout Standard At around line 334 in mainfile.php, \begin_inset LatexCommand \index{mainfile.php} \end_inset in function message_box(), change \layout Code $sql = "SELECT mid, title, content, date, expire, view \layout Code FROM ".$prefix."_message WHERE active='1' $querylang"; \layout Standard to \layout Code $sql = "SELECT mid, title, content, date, expire, view \layout Code FROM ".$prefix."_message WHERE active='1' $querylang ORDER by mid DESC"; \layout Standard and this will display your messages in reverse order (last one at the top). See also \begin_inset LatexCommand \url[How to reverse the order of Messages in the Homepage]{http://www.karakas-online.de/forum/viewtopic.php?t=339} \end_inset . \layout Section How to change the duration of a public broadcast message \begin_inset LatexCommand \label{change-duration-of-public-broadcast-message} \end_inset \layout Standard So you want the public broadcast message to show for a longer/shorter period? There is a simple solution (see \begin_inset LatexCommand \url[How to change the duration of a public broadcast message]{http://www.karakas-online.de/forum/viewtopic.php?t=126} \end_inset ): \layout Standard You can increase the time the message will be displayed by editing the following lines in mainfile.php: \begin_inset LatexCommand \index{mainfile.php} \end_inset \layout Code $ref_date = $tdate+600; \layout Standard and \layout Code setcookie("p_msg",$mid,time()+600); \layout Standard Adjust the 600 to a value that matches the time you want the message displayed. \layout Chapter Modifying PHP-Nuke blocks \begin_inset LatexCommand \label{modifying-php-nuke-blocks} \end_inset \layout Standard In this chapter we show how to \emph on modify \emph default PHP-Nuke blocks. If you are interested in \emph on creating \emph default PHP-Nuke blocks, read \begin_inset LatexCommand \ref{block-creation} \end_inset . We cover the topics: \begin_inset LatexCommand \index{topics} \end_inset \layout Itemize How to change a buggy block ( \begin_inset LatexCommand \ref{change-buggy-block} \end_inset ), \layout Itemize How to build custom module blocks ( \begin_inset LatexCommand \ref{build-custom-module-blocks} \end_inset ), \layout Itemize How to build RSS blocks with variable number of news items ( \begin_inset LatexCommand \ref{build-rss-blocks-with-variable-news-number} \end_inset ), \layout Itemize How to get scrolling headlines in blocks ( \begin_inset LatexCommand \ref{scrolling-headlines-in-blocks} \end_inset ). \layout Section How to change a buggy block \begin_inset LatexCommand \label{change-buggy-block} \end_inset \layout SGML You activated a buggy PHP-Nuke block. Now, your site is broken and you get a blank page, or you only see errors and the administration panel is unreachable because the block breaks your page's design... ]]> ]]> ]]> ]]> Inline graphic \layout Standard There is a very simple solution to this very annoying problem (see \begin_inset LatexCommand \url[Site crashed when block was created]{http://www.nukeforums.com/forums/viewtopic.php?t=17559} \end_inset ): just replace the broken block, \begin_inset LatexCommand \index{block} \end_inset say block-Broken.php, with a script that does not contain anything but the following line: \layout Code \layout Standard Then, the administration panel should be reachable and you can deactivate \begin_inset LatexCommand \index{activate} \end_inset the offending block. \begin_inset LatexCommand \index{block} \end_inset \layout Section How to build custom module blocks \begin_inset LatexCommand \label{build-custom-module-blocks} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename modules-block.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-modules-block} \end_inset The standard Modules block \end_inset \layout Standard A module block is a block that displays links to all available modules of a PHP-Nuke site ( \begin_inset LatexCommand \ref{fig-modules-block} \end_inset ). It is the block that appears at the top of the left column, with the standard title \begin_inset Quotes eld \end_inset Modules \begin_inset LatexCommand \index{Modules} \end_inset \begin_inset Quotes erd \end_inset . The module block is a standard PHP-Nuke block, \begin_inset LatexCommand \index{block} \end_inset for its construction you have to follow the same rules as for any other block (see \begin_inset LatexCommand \ref{block-creation} \end_inset ). It is thus fairly easy to construct your own module block, \begin_inset LatexCommand \index{block} \end_inset if you are not satisfied with the standard one. Below are some examples: \layout Itemize Simple module block ( \begin_inset LatexCommand \ref{simple-module-block} \end_inset ), \layout Itemize Treemenu block ( \begin_inset LatexCommand \ref{treemenu-block} \end_inset ). \layout Subsection Simple module block \begin_inset LatexCommand \label{simple-module-block} \end_inset \layout Standard The links that are inside the standard PHP-Nuke module block are constructed dynamically, using information that is available about the modules in the database. \begin_inset LatexCommand \index{base} \end_inset For example, to present only active modules in the links, the block (located in blocks/block-Modules. \begin_inset LatexCommand \index{Modules} \end_inset php) checks the \begin_inset Quotes eld \end_inset active \begin_inset Quotes erd \end_inset field of the $prefix_modules table (which is table nuke_modules, \begin_inset LatexCommand \index{modules} \end_inset if $prefix is left to the standard \begin_inset Quotes eld \end_inset nuke \begin_inset Quotes erd \end_inset in config.php, \begin_inset LatexCommand \index{config.php} \end_inset see \begin_inset LatexCommand \ref{config-php-file} \end_inset ): \layout Code $sql = "SELECT title, custom_title FROM ".$prefix."_modules \layout Code WHERE active='1' AND inmenu='0' ORDER BY title ASC"; \layout Standard As we can easily read in the SELECT query above, only modules with the \begin_inset Quotes eld \end_inset active \begin_inset Quotes erd \end_inset bit set to 1 are selected. But we also see that the order in which they are selected is the standard ascending lexicographic order of the modules' title (ORDER BY title ASC). If we wish a different ordering, we are left with only a few possibilities: \layout Itemize Change the order from ascending (ASC) to descending (DESC): \begin_deeper \layout Code $sql = "SELECT title, custom_title FROM ".$prefix."_modules \layout Code WHERE active='1' AND inmenu='0' ORDER BY title DESC"; \end_deeper \layout Itemize Change the field on which the ORDER BY clause is applied, e.g. use custom_title instead of title: \begin_inset LatexCommand \index{title} \end_inset \begin_deeper \layout Code $sql = "SELECT title, custom_title FROM ".$prefix."_modules \layout Code WHERE active='1' AND inmenu='0' ORDER BY custom_title ASC"; \end_deeper \layout Itemize Add an extra field to the $prefix_modules table, populate it with custom \begin_inset LatexCommand \index{custom} \end_inset values (e.g. \begin_inset Quotes eld \end_inset 1 \begin_inset Quotes erd \end_inset for the module we want to be the first in the list, , \begin_inset Quotes eld \end_inset 2 \begin_inset Quotes erd \end_inset for the second, \begin_inset Quotes eld \end_inset 3 \begin_inset Quotes erd \end_inset for the third etc. if we decided to use a numeric field ) for each module, and sort in ascending \begin_inset LatexCommand \index{ascending} \end_inset order of this new field: \begin_deeper \layout Code $sql = "SELECT title, custom_title FROM ".$prefix."_modules \layout Code WHERE active='1' AND inmenu='0' ORDER BY new_field ASC"; \end_deeper \layout Standard But if we wish a custom grouping of the modules links, we will have to write our own modules block. \begin_inset LatexCommand \index{block} \end_inset You can use the following code as a starting point for your own creations. \begin_inset LatexCommand \index{ations} \end_inset This script will display certain links only when an admin or user is logged in. Just name it block-menuSample.php and put in the blocks folder, deactivate \begin_inset LatexCommand \index{activate} \end_inset the block-Modules. \begin_inset LatexCommand \index{Modules} \end_inset php and activate this one (see \begin_inset LatexCommand \url[Different links - some for registered users only]{http://www.nukeforums.com/forums/viewtopic.php?t=10792} \end_inset and \begin_inset LatexCommand \url[How would I add a clickable link in a Modules Block?]{http://www.nukeforums.com/forums/viewtopic.php?t=14816} \end_inset ): \layout Code \layout Code Navigation \layout Code
\layout Code · \layout Code
Start Page

\layout Code Information
\layout Code · \layout Code News
\layout Code · \layout Code About us
\layout Code · \layout Code Entry with Some word
\layout Code
\layout Code Other things \layout Code
\layout Code · \layout Code Links
\layout Code · \layout Code All sorts of Pictures
\layout Code · \layout Code Reviews
\layout Code
\layout Code Interact \layout Code
\layout Code · \layout Code Guestbook
\layout Code · \layout Code Feedback
\layout Code · \layout Code Recommend Us
\layout Code
\layout Code Misc. \layout Code
\layout Code · \layout Code Links
\layout Code · \layout Code FAQ
\layout Code · \layout Code Add A Link
\layout Code · \layout Code Downloads
\layout Code · \layout Code Site Statistics
\layout Code · \layout Code News Headlines
\layout Code
\layout Code //****************************************** \layout Code //Below is for users and admins ONLY!!! \layout Code //****************************************** \layout Code User Control Panel \layout Code
"; \layout Code if (!IsSet($user)) \layout Code {; \layout Code $content .= " \layout Code · \layout Code Reg. Users Login.
"; \layout Code } \layout Code if ((IsSet($user)) or (IsSet($admin))) \layout Code {; \layout Code $content .= " \layout Code · \layout Code Your Account
\layout Code · \layout Code Edit Profile
\layout Code · \layout Code Members Photo upload
\layout Code · \layout Code View Member List
\layout Code · \layout Code logout
\layout Code
\layout Code Private Messages \layout Code
\layout Code · \layout Code View Messages
\layout Code · \layout Code Compose A Message
\layout Code "; \layout Code }; \layout Code //*************************************** \layout Code //ENDS HERE \layout Code //*************************************** \layout Code $content .= " \layout Code
\layout Code Send Content \layout Code
\layout Code · \layout Code Submit News
\layout Code · \layout Code Write A Review
\layout Code · \layout Code Add A Link
\layout Code · \layout Code Add images to the Gallery
\layout Code
\layout Code
\layout Code \layout Code


\layout Code "; \layout Code ?> \layout Subsection Treemenu block \begin_inset LatexCommand \label{treemenu-block} \end_inset \layout Standard A commonly asked question in \begin_inset LatexCommand \url[PHPNuke]{http://phpnuke.org} \end_inset forums (see for example \begin_inset LatexCommand \url[Menu Hack Needed (show different menu or block depending on the category)]{http://www.nukeforums.com/forums/viewtopic.php?mode=viewtopic&t=11926} \end_inset ), is if there exists some Module block out there that displays a dynamic \begin_inset LatexCommand \index{dynamic} \end_inset view of the available modules. \begin_inset LatexCommand \index{modules} \end_inset The webmaster needs a functionality that will allow for the display of only certain module links, depending on, say, the interests, access level, \begin_inset LatexCommand \index{access level} \end_inset or preferences of the viewer. \layout Standard A typical Module block, \begin_inset LatexCommand \index{block} \end_inset as shipped with the standard PHPNuke package, looks as in \begin_inset LatexCommand \ref{fig-modules-block-2} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename modules-block.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-modules-block-2} \end_inset The standard Modules block. \end_inset \layout Standard What we need instead is a module block that displays some links (to modules, \begin_inset LatexCommand \index{modules} \end_inset or generally, to pages) when a certain condition is met (say, when \begin_inset LatexCommand \url[Category]{http://www.karakas-online.de/EN-Book/preinstalled-modules.html} \end_inset A was previously chosen) and some other ones when a different condition \begin_inset LatexCommand \index{condition} \end_inset is true (e\SpecialChar \@. g\SpecialChar \@. when Category B was chosen). \layout Subsubsection The general idea \begin_inset LatexCommand \label{general-idea} \end_inset \layout Standard To met the above requirements, \begin_inset LatexCommand \index{requirements} \end_inset the \begin_inset LatexCommand \url[Treemenu block for PHP-Nuke]{http://www.karakas-online.de/myTreemenu/} \end_inset adapts the well-known \begin_inset LatexCommand \url[Treemenu]{http://www.bitbuddha.com/php/treemenu/} \end_inset concept to a PHPNuke Block and creates a PHPNuke block containing a Treemenu \begin_inset LatexCommand \index{menu} \end_inset which looks as in \begin_inset LatexCommand \ref{fig-treemenu} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename treemenu.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-treemenu} \end_inset Treemenu Block. \end_inset \layout Standard When the user clicks on an item like \begin_inset Quotes eld \end_inset Links \begin_inset Quotes erd \end_inset , the subtree under this item is unfolded ( \begin_inset LatexCommand \ref{fig-treemenu1} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename treemenu1.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-treemenu1} \end_inset Treemenu Block with \begin_inset Quotes eld \end_inset Links \begin_inset Quotes erd \end_inset expanded. \end_inset \layout Standard A further click on the subcategory \begin_inset Quotes eld \end_inset My work \begin_inset Quotes erd \end_inset will reveal another level of groups ( \begin_inset LatexCommand \ref{fig-treemenu2} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename treemenu2.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-treemenu2} \end_inset Treemenu Block with \begin_inset Quotes eld \end_inset My work \begin_inset Quotes erd \end_inset expanded. \end_inset \layout Standard Finally, a click on a subsubcategory like \begin_inset Quotes eld \end_inset Linux \begin_inset LatexCommand \index{Linux} \end_inset \begin_inset Quotes erd \end_inset will unfold the \begin_inset Quotes eld \end_inset leaves \begin_inset LatexCommand \index{leaves} \end_inset \begin_inset Quotes erd \end_inset of the Treemenu ( \begin_inset LatexCommand \ref{fig-treemenu3} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename treemenu3.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-treemenu3} \end_inset Treemenu Block with \begin_inset Quotes eld \end_inset Linux \begin_inset Quotes erd \end_inset expanded. \end_inset \layout Standard Of course, the naming and nesting of categories and/or items is fully arbitrary. The above functionality can easily be adapted to suit more advanced needs too (see \begin_inset LatexCommand \url[refinements of the PHP-Nuke Treemenu]{http://www.karakas-online.de/myTreemenu/refinements.html} \end_inset ). \layout Subsubsection What is Treemenu \begin_inset LatexCommand \label{what-is-Treemenu} \end_inset \layout Standard The Treemenu block makes use of a Treemenu in a PHPNuke Block. \begin_inset LatexCommand \index{lock} \end_inset Treemenu is a PHP class created by Bjorge Dijkstra (original script to be found \begin_inset LatexCommand \url[Treemenu Class from Bjorge]{http://www.hotscripts.com/Detailed/3704.html} \end_inset ) and adapted by Denny Shimkoski (his version to be found in \begin_inset LatexCommand \url[Treemenu from Denny]{http://www.bitbuddha.com/php/treemenu/} \end_inset ). Chris have fixed some bugs in the latter one and integrated it into a \begin_inset LatexCommand \url[Treemenu block for PHP-Nuke]{http://www.karakas-online.de/phpnuke/block-Treemenu.tgz} \end_inset . \layout Standard There are two ways you can use the Treemenu class - Chris uses the one that takes as input a \begin_inset LatexCommand \url[simple text file]{./sitemap.txt} \end_inset and creates a tree menu, \begin_inset LatexCommand \index{menu} \end_inset in a style that most users are familiar with from a graphical file manager (see \begin_inset LatexCommand \ref{fig-treemenu} \end_inset ). Navigation through such a tree is done intuitively by expanding and collapsing \begin_inset LatexCommand \index{collapsing} \end_inset the various tree levels by clicking on the node icons (the icons are discussed in \begin_inset LatexCommand \url[custom node icons for the PHP-Nuke Treemenu]{http://www.karakas-online.de/myTreemenu/refinements.html} \end_inset ). \layout Standard To create a Treemenu, \begin_inset LatexCommand \index{menu} \end_inset once you have written the input text file with your favorite text editor (see \begin_inset LatexCommand \url[input file method for the Treemenu]{http://www.karakas-online.de/myTreemenu/what-is-treemenu.html#INPUT-FILE-METHOD} \end_inset ) or used the \begin_inset LatexCommand \url[alternative method to fill the nodes and leaves of the Treemenu]{http://www.karakas-online.de/myTreemenu/what-is-treemenu.html#ALTERNATIVE-METHOD} \end_inset , you just have to write this 3-liner to get it up and running: \layout Code include("blocks/treemenu/treemenu.inc"); \layout Code $tree = new TreeMenu("a", "blocks/treemenu/sitemap.txt"); \layout Code $tree->show(); \layout SGML \layout SGML \layout SGML Note \layout SGML \layout SGML \layout SGML In order to be able to display the output of the above code in a PHPNuke Block, we have to capture it in an output buffer with the ob_start(), ob_get_co ntents() and ob_end_clean() mechanism: \layout Code ob_start(); \layout Code include("blocks/treemenu/treemenu.inc"); \layout Code $tree = new TreeMenu("a", "blocks/treemenu/sitemap.txt"); \layout Code $tree->show(); \layout Code $output = ob_get_contents(); \layout Code ob_end_clean(); \layout Code $content = $output; \layout SGML \layout SGML \layout Standard See \begin_inset LatexCommand \url[Treemenu block for PHP-Nuke]{http://www.karakas-online.de/myTreemenu/} \end_inset for more information of how to use the Treemenu block as a module block \begin_inset LatexCommand \index{block} \end_inset for PHP-Nuke. \layout Section How to build RSS blocks with variable number of news items \begin_inset LatexCommand \label{build-rss-blocks-with-variable-news-number} \end_inset \layout Standard If you have created an RSS block from the block administration fuction of the administration panel, \begin_inset LatexCommand \index{panel} \end_inset you may have noticed that, notably after some change on a previously working RSS block (for example, in the title, \begin_inset LatexCommand \index{title} \end_inset or the refresh time), or even from the very start, you get the error: \layout Code Currently there is a problem with headlines from this site \layout Standard This is not always due to some error on your part - it is a bug too. Often, the only solution would be to delete the block and add it anew. \layout Standard The problem is in the file admin/modules/blocks.php. There, the problematic code is \layout Code for ($i=0;$i<10;$i++) { \layout Code $link = ereg_replace(".*","",$items[$i]); \layout Code $link = ereg_replace(".*","",$link); \layout Code $title2 = ereg_replace(".*","",$items[$i]); \layout Code $title2 = ereg_replace(".*","",$title2); \layout Code if ($items[$i] == "" AND $cont != 1) { \layout Code $content = ""; \layout Code } else { \layout Code if (strcmp($link,$title2) AND $items[$i] != "") { \layout Code $cont = 1; \layout Code $content .= "· $title2
\backslash n"; \layout Code } \layout Code } \layout Code } \layout Standard which has the number of news items (10) hardcoded into it. The problem is caused by the fact that, if there aren't that many headlines \begin_inset LatexCommand \index{headlines} \end_inset being returned, and in many unlucky cases, there aren't, you will either get an array out of bounds error, or nothing will be returned, and the content of the block will be set to equal nothing. \layout Standard You could fix that by changing the \begin_inset Quotes eld \end_inset 10 \begin_inset Quotes erd \end_inset in the code above to \begin_inset Quotes eld \end_inset 5 \begin_inset Quotes erd \end_inset , for example. However, that fix wouldn't work for a site that had only three headlines \begin_inset LatexCommand \index{headlines} \end_inset in their RSS file. What needs to happen is to modify the \layout Code $content = ""; \layout Code to \layout Code $content += ""; \layout Standard For a modification of the mainfile.php and admin/modules/blocks.php files that also allows for a variable number of items to be chosen from the administr ation panel individually for each RSS block, \begin_inset LatexCommand \index{block} \end_inset see \begin_inset LatexCommand \url[Digital Nick Downloads]{http://www.nickpadley.com/modules.php?name=Downloads&d_op=getit&li d=17} \end_inset , for a discussion thread on this bug, \begin_inset LatexCommand \index{bug} \end_inset see \begin_inset LatexCommand \url[Problems when saving RSS block]{http://www.nukeforums.com/forums/viewtopic.php?t=13495} \end_inset . \layout Section How to get scrolling headlines in blocks \begin_inset LatexCommand \label{scrolling-headlines-in-blocks} \end_inset \layout Standard You may have noticed those scrolling headlines in blocks of some sites. Perhaps you abhor them, because they distract you from reading the context, \begin_inset LatexCommand \index{context} \end_inset or because the scrolling effect is not supported by all browsers. But if you are fascinated by this effect and wondering how to achieve it in your own PHP-Nuke RSS blocks, here's how: \layout Standard In mainfile.php, \begin_inset LatexCommand \index{mainfile.php} \end_inset find the code for the headlines() function: \layout Code function headlines($bid, $cenbox=0) \layout Standard There, near the end, replace the lines \layout Code if ($cenbox == 0) { \layout Code themesidebox($title, $content); \layout Code } else { \layout Code themecenterbox($title, $content); \layout Code } \layout Standard with the lines \layout Code if ($cenbox == 0) { \layout Code $content = "$content"; \layout Code themesidebox($title, $content); \layout Code } else { \layout Code $content = "$content"; \layout Code themecenterbox($title, $content); \layout Code } \layout Standard Enclosing the old $content variable in the marquee code and assigning it to the $content variable again before the call to the themesidebox or themecent erbox functions, gives the desired scrolling effect for our RSS headlines. \begin_inset LatexCommand \index{headlines} \end_inset \layout Chapter Modifying PHP-Nuke modules \begin_inset LatexCommand \label{modifying-php-nuke-modules} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename modules.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-modules-5} \end_inset Administration panel: Modules. \end_inset \layout Standard In this chapter we will talk about \emph on modifying \emph default PHP-Nuke modules. \begin_inset LatexCommand \index{modules} \end_inset If you are interested in creating PHP-Nuke modules, \begin_inset LatexCommand \index{modules} \end_inset read \begin_inset LatexCommand \ref{creating-modules} \end_inset . We will talk about: \layout Itemize Modifying any PHP-Nuke module ( \begin_inset LatexCommand \ref{modifying-any-PHP-Nuke-module} \end_inset ), \layout Itemize Modifying the PHP-Nuke Homepage ( \begin_inset LatexCommand \ref{modifying-php-nuke-homepage} \end_inset ), \layout Itemize Modifying the PHP-Nuke FAQ module ( \begin_inset LatexCommand \ref{modifying-php-nuke-module-faq} \end_inset ), \layout Itemize Modifying the PHP-Nuke Reviews module ( \begin_inset LatexCommand \ref{modifying-php-nuke-module-reviews} \end_inset ), \layout Itemize Modifying the PHP-Nuke Web_Links module ( \begin_inset LatexCommand \ref{modifying-php-nuke-module-web-links} \end_inset ), \layout Itemize Modifying the PHP-Nuke Your_Account module ( \begin_inset LatexCommand \ref{modifying-php-nuke-moduke-your-account} \end_inset ), \layout Itemize Modifying the PHP-Nuke News module ( \begin_inset LatexCommand \ref{modifying-PHP-Nuke-News-module} \end_inset ), \layout Itemize Modifying the PHP-Nuke Submit News module ( \begin_inset LatexCommand \ref{modifying-PHP-Nuke-submit-news-module} \end_inset ), \layout Itemize Modifying the PHP-Nuke Sections module ( \begin_inset LatexCommand \ref{modifying-PHP-Nuke-sections-module} \end_inset ), \layout Itemize Modifying the PHP-Nuke Downloads module ( \begin_inset LatexCommand \ref{modifying-PHP-Nuke-downloads-module} \end_inset ), \layout Itemize Modifying the PHP-Nuke Stories Archive module ( \begin_inset LatexCommand \ref{modifying-PHP-Nuke-stories-archive} \end_inset ). \layout Section Modifying any PHP-Nuke module \begin_inset LatexCommand \label{modifying-any-PHP-Nuke-module} \end_inset \layout Standard Talking about modifying any PHP-Nuke module in general, we will show: \layout Itemize How to hide the right blocks ( \begin_inset LatexCommand \ref{hide-right-blocks} \end_inset ), \layout Itemize How to change a buggy module ( \begin_inset LatexCommand \ref{change-buggy-module} \end_inset ). \layout Subsection How to hide the right blocks \begin_inset LatexCommand \label{hide-right-blocks} \end_inset \layout Standard If your module needs more space than is available in the central column of the PHP-Nuke layout, \begin_inset LatexCommand \index{layout} \end_inset you may want to hide the right column of blocks. This is accomplished very easily from within the code of any module: \begin_inset LatexCommand \index{module} \end_inset find the line \layout Code $index = 1; \layout Standard and change it to: \layout Code $index = 0; // 0 : do not show right blocks - 1:show right blocks \layout SGML Of course, if the line is not there, then $index is already 0, so your module already hides the right blocks. ]]> ]]> ]]> ]]> Inline graphic \layout SGML \layout SGML \layout SGML How to hide the left blocks \layout SGML \layout SGML \layout SGML If you want to hide the left blocks, you have to modify the theme header. See \begin_inset LatexCommand \ref{hide-left-blocks} \end_inset . \layout SGML \layout SGML \layout Subsection How to change a buggy module \begin_inset LatexCommand \label{change-buggy-module} \end_inset \layout SGML You activated a buggy PHP-Nuke module. Now, your site is broken and you get a blank page, or you only see errors and the administration panel is unreachable... ]]> ]]> ]]> ]]> Inline graphic \layout Standard Connect to the MySQL database and change the value of the "active" field in the $prefix_modules table to 0 for that module's entry. Example (see \begin_inset LatexCommand \url[Site crashed when block was created]{http://www.nukeforums.com/forums/viewtopic.php?t=17559} \end_inset and \begin_inset LatexCommand \url[logout-Fehler]{http://www.karakas-online.de/forum/viewtopic.php?t=375} \end_inset ): suppose the broken module is Mod_Broken, \begin_inset LatexCommand \index{Mod_Broken} \end_inset your $prefix is "nuke" and the value of the module id, "mid" \begin_inset LatexCommand \index{mid} \end_inset , field for the Mod_Broken module is "7"): \layout Code UPDATE nuke_modules SET active = '0' WHERE mid = '7'; \layout Standard or (if you prefer to select by title and not by module id) \layout Code UPDATE nuke_modules SET active = '0' WHERE title = 'Mod_Broken'; \layout Section Modifying the PHP-Nuke Homepage \begin_inset LatexCommand \label{modifying-php-nuke-homepage} \end_inset \layout Standard The PHP-Nuke Homepage is the \begin_inset Quotes eld \end_inset Home \begin_inset Quotes erd \end_inset module. \begin_inset LatexCommand \index{module} \end_inset The Home module is chosen in the modules administration panel. \begin_inset LatexCommand \index{panel} \end_inset We show: \layout Itemize How to redirect users to the Login page ( \begin_inset LatexCommand \ref{redirect-users-to-login-page} \end_inset ), \layout Itemize How to restrict the Homepage only to registered users ( \begin_inset LatexCommand \ref{restrict-homepage-to-registered-users} \end_inset ). \layout Subsection How to redirect users to the Login page \begin_inset LatexCommand \label{redirect-users-to-login-page} \end_inset \layout Standard If you want your users to be redirected straight to the Login page, rather than the Homepage, do the following: \layout Standard Right at the begining of the index. \begin_inset LatexCommand \index{index} \end_inset php file , add this code after the 'require_once( \begin_inset Quotes eld \end_inset mainfile.php \begin_inset LatexCommand \index{mainfile.php} \end_inset \begin_inset Quotes erd \end_inset );' line, like this: \layout Code require_once("mainfile.php"); \layout Code global $user; \layout Code if(!is_user($user)) { \layout Code header("Location: modules.php?name=Your_Account"); \layout Code } \layout SGML This will send anyone who is not logged in (or registered) to the Your Account (Login) page. See \begin_inset LatexCommand \ref{redirect-users-to-homepage} \end_inset for the inverse procedure — but don't try both. ]]> ]]> ]]> ]]> Inline graphic \layout Standard See \begin_inset LatexCommand \url[how to redirect from forms in a PHP-Nuke block]{http://www.karakas-online.de/forum/viewtopic.php?t=82} \end_inset for redirection from other places, like blocks. \layout Subsection How to restrict the Homepage only to registered users \begin_inset LatexCommand \label{restrict-homepage-to-registered-users} \end_inset \layout Standard Suppose that you have set up the News module as the \begin_inset Quotes eld \end_inset Homepage module \begin_inset LatexCommand \index{module} \end_inset \begin_inset Quotes erd \end_inset of your PHP-Nuke, but you want the news articles to be visible only to registered users. Can this be done? \layout Standard Well, not exactly. Since you want the News module to be visible only to registered users, you cannot have it in the "Home". This means you must put a different module in Home (see \begin_inset LatexCommand \url[hide articles from logged out users]{http://www.karakas-online.de/forum/viewtopic.php?t=377} \end_inset ). You can do this from the "Put in Home" link in the modules table shown in the modules administration panel ( \begin_inset LatexCommand \ref{administration-functions} \end_inset , \begin_inset LatexCommand \ref{fig-modules-admin} \end_inset ). \layout Standard Once the News module is not in Home anymore, you can edit it and choose that it be visible only by the registered users. \layout SGML \layout SGML \layout SGML The "Who can View This?" selection box is not available, as long as the module remains the "Home" module of your P HP-Nuke installation. That's why you can't restrict the visibility of the Home module, no matter which module this is. T he reason for this is that it makes little sense to have a Home module and restrict its availability only to registered users, unless you want your site to be generally available only to registered members. \layout SGML \layout SGML \layout Section Modifying the PHP-Nuke FAQ module \begin_inset LatexCommand \label{modifying-php-nuke-module-faq} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename faq.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-faq-3} \end_inset Administration panel: FAQ. \end_inset \layout Standard In this section we modify the PHP-Nuke FAQ module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to add more than 127 FAQ answers ( \begin_inset LatexCommand \ref{more-than-127-faq-answers} \end_inset ). \layout Subsection How to add more than 127 FAQ answers \begin_inset LatexCommand \label{more-than-127-faq-answers} \end_inset \layout Standard You have 127 Q&A. You cannot add more, if you delete one, you can add one. \layout Standard \series bold Cause \series default : Looking at the sql/nuke.sql script that creates the PHP-Nuke tables on installation, \begin_inset LatexCommand \index{installation} \end_inset we see the following for the structure of the nuke_faqAnswer table: \layout Code # \layout Code # Table structure for table `nuke_faqAnswer` \layout Code # \layout Code \layout Code CREATE TABLE nuke_faqAnswer ( \layout Code id tinyint(4) NOT NULL auto_increment, \layout Code id_cat tinyint(4) NOT NULL default '0', \layout Code question varchar(255) default ", \layout Code answer text, \layout Code PRIMARY KEY (id), \layout Code KEY id (id), \layout Code KEY id_cat (id_cat) \layout Code ) TYPE=MyISAM; \layout Standard From the \begin_inset LatexCommand \url[MySQL manual on column types]{http://www.mysql.com/doc/en/Column_types.html} \end_inset , we see: \layout Quotation TINYINT[(M)] [UNSIGNED] [ZEROFILL] \layout Quotation A very small integer. \begin_inset LatexCommand \index{integer} \end_inset The signed range is -128 to 127. \begin_inset LatexCommand \index{127} \end_inset The unsigned range is 0 to 255. \layout Standard so that tinyint is a very small integer indeed in this case. \begin_inset LatexCommand \index{case} \end_inset \layout Standard \series bold Solution \series default : Change the length of id and id_cat of nuke_faqAnswer. \begin_inset LatexCommand \index{nuke_faqAnswer} \end_inset You can do this with phpMyAdmin, \begin_inset LatexCommand \index{Admin} \end_inset or by logging into MySQL from the console and, after choosing the PHP-Nuke database ("use xxxx;"), by typing: \layout Code alter table nuke_faqAnswer modify id SMALLINT unsigned; \layout Code alter table nuke_faqAnswer modify id_cat SMALLINT unsigned; \layout Standard See also \begin_inset LatexCommand \url[FAQ problem]{http://www.nukeforums.com/forums/viewtopic.php?t=13841} \end_inset . \layout Section Modifying the PHP-Nuke Reviews module \begin_inset LatexCommand \label{modifying-php-nuke-module-reviews} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename reviews.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-reviews-2} \end_inset Administration panel: Reviews. \end_inset \layout Standard In this section we modify the PHP-Nuke Reviews module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to allow only registered users to enter a review ( \begin_inset LatexCommand \ref{allow-only-registered-users-to-review} \end_inset ), \layout Itemize How to choose images from a dropdown list ( \begin_inset LatexCommand \ref{choose-images-from-dropdown-list} \end_inset ). \layout Subsection How to allow only registered users to enter a review \begin_inset LatexCommand \label{allow-only-registered-users-to-review} \end_inset \layout Standard If you want only your registered users to be able to enter a review, you can achieve it with the following simple change: \layout Standard Edit the modules/Reviews/index. \begin_inset LatexCommand \index{index} \end_inset php file and find the write_review() function: \layout Code function write_review() { \layout Code global $admin, $sitename, $user, $cookie, $prefix, $user_prefix, \layout Code $currentlang, $multilingual, $dbi, $module_name; \layout Code include ('header.php'); \layout Code OpenTable(); \layout Standard Add the following check after the call to OpenTable(): \layout Code if (!is_user($user)) { \layout Code echo "You need to be \layout Code logged in or \layout Code become a member \layout Code to submit reviews."; \layout Code } else { \layout Standard This check will only allow registered users to continue with a review, while pointing others to the login or register page. Of course, the IF statement has to be closed - just put a } at the end of the function, \begin_inset LatexCommand \index{function} \end_inset as shown below: \layout Code CloseTable(); \layout Code include ("footer.php"); \layout Code } \layout Code } \layout Standard Unregistered users will be able to view reviews, \begin_inset LatexCommand \index{reviews} \end_inset but only site members will be able to submit new ones. \layout SGML \layout SGML \layout SGML Tip \layout SGML \layout SGML \layout SGML This simple check can be used to restrict access to registered users in any module that does not offer this functionality, not only in Reviews. \layout SGML \layout SGML \layout Subsection How to choose images from a dropdown list \begin_inset LatexCommand \label{choose-images-from-dropdown-list} \end_inset \layout SGML Isn't it more comfortable being able to choose the image for your review (if you are an administrator) from a dropdown list that offers the names of all available images in your image directory, rather than having to enter the full URL to the image each time? You could easily incorporate this functionality if you just cut and pasted the code from the admin/modules/t opics.php file. The functionality is in the Topics module already - you don't need to write full URLs to the topics icons, do you? ]]> ]]> ]]> ]]> Inline graphic \layout Standard The relevant part in the Reviews to introduce the code from the Topics module \begin_inset LatexCommand \index{module} \end_inset is the following code in modules/Reviews/index.php: \begin_inset LatexCommand \index{index.php} \end_inset \layout Code if(is_admin($admin)) { \layout Code echo " \layout Code "._RIMAGEFILE.":
\layout Code
\layout Code "._RIMAGEFILEREQ."

\layout Code "; \layout Code } \layout Code Replace it with: \layout Code if(is_admin($admin)) { \layout Code echo " \layout Code "._RIMAGEFILE.":
\layout Code \layout Code echo "
"; \layout Code \layout Code echo ""._RIMAGEFILEREQ."

\layout Code "; \layout Code } \layout Standard The part of code that was stolen from the Topics module (from the admin/modules/ topics. \begin_inset LatexCommand \index{topics} \end_inset php file) is between the blank lines in the above code. It will offer you a dropdown list of all images in the images/reviews folder. Just like with the topics images, \begin_inset LatexCommand \index{images} \end_inset you must use all small letters and no underscores or other special characters. See \begin_inset LatexCommand \url[choose image for review]{http://www.nukeforums.com/forums/viewtopic.php?t=12983} \end_inset . \layout Section Modifying the PHP-Nuke Web_Links module \begin_inset LatexCommand \label{modifying-php-nuke-module-web-links} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename weblinks.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-weblinks-4} \end_inset Administration panel: Web Links. \end_inset \layout Standard In this section we modify the PHP-Nuke Web Links module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to display Web Links in the same window ( \begin_inset LatexCommand \ref{display-web-links-in-the-same-window} \end_inset ), \layout Itemize How to change the number of Web Links per page ( \begin_inset LatexCommand \ref{change-number-of-web-links-per-page} \end_inset ). \layout Subsection How to display Web Links in the same window \begin_inset LatexCommand \label{display-web-links-in-the-same-window} \end_inset \layout Standard The Web_Links module will display each web link in a separate window. To change this behaviour and make it display the link in the same window, you have to change each occurence of \layout Code target= \backslash "new \backslash " \layout Standard to \layout Code target= \backslash "_self \backslash " \layout Standard in the modules/Web_Links/index. \begin_inset LatexCommand \index{index} \end_inset php file. This is a straightforward search and replace procedure. \begin_inset LatexCommand \index{procedure} \end_inset In vi, you would do \layout Code 1,$s/target= \backslash \backslash "new \backslash \backslash "/target= \backslash \backslash "_self \backslash \backslash "/g \layout Subsection How to change the number of Web Links per page \begin_inset LatexCommand \label{change-number-of-web-links-per-page} \end_inset \layout SGML You can change the number of Web Links that are displayed per page very easily - no programming necessary! ]]> ]]> ]]> ]]> Inline graphic \layout Standard Just change the value of $perpage in modules/Web_Links/l_config.php: \begin_inset LatexCommand \index{l_config.php} \end_inset \layout Code $perpage = 10; \layout SGML \layout SGML \layout SGML Make use of the module configuration files! \layout SGML \layout SGML \layout SGML It definitely pays off to have a look at the configuration files of the various modules! The l_config.php file, for example, located in the Web_Links folder under the modules directory, offers many variables that can be used to achieve the desired appearence of the Web Links module: \layout SGML \layout SGML \layout SGML $perpage: How many links to show on each page? \layout SGML $popular: How many hits need a link to be listed as popular? \layout SGML $newlinks: How many links to display in the New Links Page? \layout SGML $toplinks: How many links to display in The Best Links Page? (Most Popular) \layout SGML $linksresults: How many links to display on each search result page? \layout SGML $links_anonaddlinklock: Lock Unregistered users from Suggesting New Links? (0=Yes 1=No) \layout SGML $anonwaitdays: Number of days anonymous users need to wait to vote on a link \layout SGML $outsidewaitdays: Number of days outside users need to wait to vote on a link (checks IP) \layout SGML $useoutsidevoting: Allow Webmasters to put vote links on their site (1=Yes 0=No) \layout SGML $anonweight: How many Unregistered User vote per 1 Registered User Vote? \layout SGML $outsideweight: How many Outside User vote per 1 Registered User Vote? \layout SGML $detailvotedecimal: Let Detailed Vote Summary Decimal out to N places. (no max) \layout SGML $mainvotedecimal: Let Main Vote Summary Decimal show out to N places. (max 4) \layout SGML $toplinkspercentrigger: 1 to Show Top Links as a Percentag e (else # of links) \layout SGML $toplinks: Either # of links OR percentage to show (percentage as whole number. #/100) \layout SGML $mostpoplinkspercentrigger: 1 to Show Most Popular Links as a Percentage (else # of links) \layout SGML $mostpoplinks: Either # of links OR percentage to show (percentage as whole number. #/100) \layout SGML $featurebox: 1 to Show Feature Link Box on links Main Page? (1=Yes 0=No) \layout SGML $linkvotemin: Number votes needed to make the 'top 10' list \layout SGML $blockunregmodify: Block unregistered users from suggesting links changes? (1=Yes 0=No) \layout SGML \layout SGML \layout Section Modifying the PHP-Nuke Your_Account module \begin_inset LatexCommand \label{modifying-php-nuke-moduke-your-account} \end_inset \layout Standard In this section we modify the PHP-Nuke Your Account module, \begin_inset LatexCommand \index{module} \end_inset one of the most central modules of PHP-Nuke. We show: \layout Itemize How to redirect users to the Homepage ( \begin_inset LatexCommand \ref{redirect-users-to-homepage} \end_inset ), \layout Itemize How to redirect Your Info to the Forums user profile ( \begin_inset LatexCommand \ref{redirect-your-info-to-forums-user-profile} \end_inset ), \layout Itemize How to redirect users to Login and back ( \begin_inset LatexCommand \ref{redirect-users-to-login-and-back} \end_inset ), \layout Itemize How to disable registration ( \begin_inset LatexCommand \ref{disable-registration} \end_inset ), \layout Itemize How to let users register immediately ( \begin_inset LatexCommand \ref{register-users-immediately} \end_inset ), \layout Itemize How to approve users before registration ( \begin_inset LatexCommand \ref{approve-users} \end_inset ), \layout Itemize How to register users through iBill ( \begin_inset LatexCommand \ref{register-users-through-iBill} \end_inset ), \layout Itemize How to change the maximum allowed length for user names ( \begin_inset LatexCommand \ref{change-maximum-username-length} \end_inset ). \layout Subsection How to redirect users to the Homepage \begin_inset LatexCommand \label{redirect-users-to-homepage} \end_inset \layout Standard Are you looking for a way to redirect a user to Home rather than Your Account \begin_inset LatexCommand \index{Your Account} \end_inset when they login? \begin_inset LatexCommand \index{login} \end_inset Would you rather prefer them to go to Your Account only when they choose to and be automatically redirected to Home when they login? \begin_inset LatexCommand \index{login} \end_inset There is a simple way to accomplish this (see \begin_inset LatexCommand \url[How to redirect users to the Homepage]{http://www.karakas-online.de/forum/viewtopic.php?t=333} \end_inset and \begin_inset LatexCommand \url[Redirect login to home]{http://www.nukeforums.com/forums/viewtopic.php?t=13776} \end_inset ): \layout Standard Find the following lines in function login() in the modules/Your_Account/index. \begin_inset LatexCommand \index{index} \end_inset php: \layout Code Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$us ername"); \layout Standard Change it to this: \layout Code Header("Location: index.php"); \layout SGML See \begin_inset LatexCommand \ref{redirect-users-to-login-page} \end_inset for the inverse procedure — but don't try both. ]]> ]]> ]]> ]]> Inline graphic \layout Subsection How to redirect Your Info to the Forums user profile \begin_inset LatexCommand \label{redirect-your-info-to-forums-user-profile} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename your-info-profile-link.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-your-info-profile-link} \end_inset Your Info link in the User Preferences panel. \end_inset \layout Standard With the advent of \begin_inset LatexCommand \url[phpBB]{http://www.phpbb.com} \end_inset forums in PHP-Nuke (starting from somewhere around v. 6.5), you not only have to cope with two administration panels, one for PHP-Nuke in general and one for the Forums in particular, your users can maintain their profile in two places too, from the Your Info link in the User Preference panel ( \begin_inset LatexCommand \ref{fig-your-info-profile-link} \end_inset ), as well as the Forums profile link in the Forums module ( \begin_inset LatexCommand \ref{fig-forum-profile-link} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename forum-profile-link.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum-profile-link} \end_inset Forum Profile link in the Forums module. \end_inset \layout Standard The Your Info link has the URL \begin_inset LatexCommand \index{URL} \end_inset \layout Code modules.php?name=Your_Account&op=edituser \layout Standard and leads to a panel similar to the one of \begin_inset LatexCommand \ref{fig-your-info-profile} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename your-info-profile.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-your-info-profile} \end_inset User profile in Your Info. \end_inset \layout Standard The Profile link in the Forums module, on the other hand, has the URL \begin_inset LatexCommand \index{URL} \end_inset \layout Code modules.php?name=Forums&file=profile&mode=editprofile \layout Standard (optionally with the session ID parameter, sid, \begin_inset LatexCommand \index{sid} \end_inset which is not shown here) and leads to the panel shown in \begin_inset LatexCommand \ref{fig-forum-profile} \end_inset . \layout Standard Both panels use the same database tables in the background, \begin_inset LatexCommand \index{background} \end_inset so it doesn't matter which one you use. This may be confortable for some, but also confusing for other users. \layout Standard If your users find it confusing to use two different entry points for their personal information, \begin_inset LatexCommand \index{information} \end_inset you can modify the Your_Account module to redirect them to the Forum profile ( \begin_inset LatexCommand \ref{fig-forum-profile} \end_inset ), even when they click on the Your Info link ( \begin_inset LatexCommand \ref{fig-your-info-profile-link} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename forum-profile.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-forum-profile} \end_inset User profile in the Forums. \end_inset \layout Standard The Your Info link is output ( \begin_inset Quotes eld \end_inset echoed \begin_inset Quotes erd \end_inset ) in modules/Your_Account/navbar.php, in the following code block: \begin_inset LatexCommand \index{block} \end_inset \layout Code echo "" \layout Code ."
\layout Code \backslash
" \layout Code ."" \layout Code ._CHANGEYOURINFO."" \layout Code ."
"; \layout Standard To redirect the users to the Forum profile ( \begin_inset LatexCommand \ref{fig-forum-profile} \end_inset ), you can change the above block to: \layout Code echo "" \layout Code ."
\layout Code \backslash
" \layout Code ."" \layout Code ._CHANGEYOURINFO."" \layout Code ."
"; \layout Standard As you can easily see, we have changed only the two links (one for the image and one for the text), the other lines are for your reference only. \layout SGML \layout SGML \layout SGML It is not necessary to compute the user's numeric ID and pass it on the URL through the u parameter - the mode=editprofile parameter on the URL will find the user automatically (but mode=viewprofile will not!). \layout SGML \layout SGML \layout Standard But wait a minute! Is this really all we have to change? Is the Your Info link ( \begin_inset LatexCommand \ref{fig-your-info-profile-link} \end_inset ) the only one that leads a user to the profile screen of the Your_Info \begin_inset LatexCommand \index{Your_Info} \end_inset module ( \begin_inset LatexCommand \ref{fig-your-info-profile} \end_inset )? How about the user name links in other modules, \begin_inset LatexCommand \index{modules} \end_inset for example? Search for the string \begin_inset Quotes eld \end_inset op=edituser \begin_inset LatexCommand \index{edituser} \end_inset \begin_inset Quotes erd \end_inset and you will already find a ton of those links in various places (Newsletter, \begin_inset LatexCommand \index{Newsletter} \end_inset language files, Reviews. \begin_inset LatexCommand \index{Reviews} \end_inset ..) And how about a new user? Will the new user registration screen be the one of Your_Account or the one of Forums? \layout Standard Instead of chasing links in the code, there is a more elegant solution that will eliminate any attempt to bring a user to the Your Info profile at its very beginning! It is also a very good example of what type of control \begin_inset LatexCommand \index{control} \end_inset you can achieve over your PHP-Nuke, if you put your knowledge about the way a module works (see \begin_inset LatexCommand \ref{creating-modules} \end_inset ) into practice: \layout Standard In modules/Your_Account/index. \begin_inset LatexCommand \index{index} \end_inset php find the lines: \layout Code case "edituser": \layout Code edituser(); \layout Code break; \layout Standard and replace them with: \layout Code case "edituser": \layout Code Header("Refresh: 0; url=modules.php?name=Forums&file=profile&mode=editprofile"); \layout Code break; \layout Standard This will take care of the \begin_inset Quotes eld \end_inset edit user \begin_inset Quotes erd \end_inset case. \begin_inset LatexCommand \index{case} \end_inset We need to do the same for the \begin_inset Quotes eld \end_inset new user \begin_inset Quotes erd \end_inset case too. Just replace \layout Code case "new_user": \layout Code new_user(); \layout Code break; \layout Standard with: \layout Code case "new_user": \layout Code Header("Refresh: 0; url=modules.php?name=Forums&file=profile&mode=register"); \layout Code break; \layout Standard The idea here is the following: instead of searching all code of all modules \begin_inset LatexCommand \index{modules} \end_inset for links that point to the Your Info profile, \begin_inset LatexCommand \index{profile} \end_inset we look at the parameters that such a link passes on the URL. \begin_inset LatexCommand \index{URL} \end_inset A typical Your Info profile link is of the form: \layout Code modules.php?name=Your_Account&op=edituser \layout Standard so the parameters it passes to the modules. \begin_inset LatexCommand \index{modules} \end_inset php script are: \layout Itemize name: the name of the module to execute (Your_Account) \layout Itemize op: the operation to execute (edituser) \layout Standard The second URL parameter, \begin_inset LatexCommand \index{parameter} \end_inset op, is checked at one single place in the code, in the switch statement of modules/Your_Account/index.php: \begin_inset LatexCommand \index{index.php} \end_inset \layout Code switch($op) { \layout Code case "logout": \layout Code logout(); \layout Code break; \layout Code \layout Code ...many other cases checked here, among them "edituser" and "new_user" \layout Code \layout Code default: \layout Code main($user); \layout Code break; \layout Code } \layout SGML This is the one and only point of control for the actions taken by the Your_Account module. We make use of this fact and change the actions that are to be taken for the operations "edituser" and "new_user". We don't change the links, we change the actions that follow when the links are clicked. ]]> ]]> ]]> ]]> Inline graphic \layout Standard This will make the Your Info profile practically inaccessible in your system \begin_inset LatexCommand \index{system} \end_inset and will present the Forums profile instead. \layout SGML \layout SGML \layout SGML Missing functionality in the Forums profile! \layout SGML \layout SGML \layout SGML Bear in mind that, depending on the versions of PHP-Nuke and Forums, you may be missing some functionality in the Forums profile, that was present in the profile that was accessible through the Your Info link. This may include changing the fake email address, changing the subscription to the newsletter, or changing the extra info (). However, this is planned to be corrected in the future. \layout SGML \layout SGML \layout Subsection How to redirect users to Login and back \begin_inset LatexCommand \label{redirect-users-to-login-and-back} \end_inset \layout Standard We have already seen how to redirect users to the Login page ( \begin_inset LatexCommand \ref{redirect-users-to-login-page} \end_inset ), to the Homepage ( \begin_inset LatexCommand \ref{redirect-users-to-homepage} \end_inset ) and to the Forum profile from the Your Info profile ( \begin_inset LatexCommand \ref{redirect-your-info-to-forums-user-profile} \end_inset ). Finally, it is time that we consider the general redirection problem: \layout Standard You are using some module, \begin_inset LatexCommand \index{module} \end_inset say an eCommerce module like the Emporium Shopping Cart ( \begin_inset LatexCommand \ref{PHP-Nuke-eCommerce-module} \end_inset ), and at some point you need to ask the user to login (if not already done) to finish off the order. You would like to redirect the user to the Login screen ( \begin_inset LatexCommand \ref{fig-security-code} \end_inset ), then bring him back where he was to continue. \layout Standard This is already implemented in PHP-Nuke at some places, like the Private Messages part of the Your Account module: \begin_inset LatexCommand \index{module} \end_inset in the forums for example, if you aren't logged in, you see the link 'Log in to check your private messages', which when clicked on it, takes you to Your Account (address line becomes : http://www.yoursite.com/modules. \begin_inset LatexCommand \index{modules} \end_inset php?name=Your_Account&redirect=privmsg&folder=inbox), and upon login in, you get taken back to PMs. \layout Standard To accomplish this from an arbitrary module, \begin_inset LatexCommand \index{module} \end_inset that serves as the starting point for the redirection, \begin_inset LatexCommand \index{redirection} \end_inset open that module's code and find the place where the redirection has to happen. Initiate the redirection with the following two lines: \layout Code $redirect = $module_name; \layout Code CLICK HERE TO LOGIN \layout Standard The value of $redirect is what you will key off in the next step. In this example we use the module name as the key that will point the way back, but you can use anything, as long as you know how to use it later, to trace your way back with the right link. \layout Standard Now go to modules/Your_Account/index. \begin_inset LatexCommand \index{index} \end_inset php and look for the following code in the login() function: \begin_inset LatexCommand \index{function} \end_inset \layout Code if ($pm_login != "") { \layout Code Header("Location: modules.php?name=Private_Messages&file=index&folder =inbox"); \layout Code exit; \layout Code } \layout Standard Add the following after it: \layout Code if ($redirect == "XXXXXXXXX"){ \layout Code Header("Location: modules.php?name=YYYYYYYYY"); \layout Code exit; \layout Code } \layout Standard where XXXXXXXXX is the value of $redirect from the first step and YYYYYYYY is the name of the module you want them dumped into after login. \begin_inset LatexCommand \index{login} \end_inset \layout Standard You might think that we are done by now, but there is a caveat: the above will work as long as they log in correctly on the first try. If they make a mistake and have to try a second or more times, they will get dumped in Your Account, \begin_inset LatexCommand \index{Your Account} \end_inset after they log in successfully, not in the module they came from. This is also true for the Private Messages example above. \layout Standard To fix this, find the following code in Your_Account \begin_inset LatexCommand \index{Your_Account} \end_inset \backslash index. \begin_inset LatexCommand \index{index} \end_inset php at the bottom of the login function. \layout Code } else { \layout Code Header("Location: modules.php?name=$module_name&stop=1"); \layout Code } \layout Standard and change it to: \layout Code } else { \layout Code Header("Location: modules.php?name=$module_name&stop=1&redirect=$redirect"); \layout Code } \layout Standard Then it will redirect even if they log in incorrectly the first time. See \begin_inset LatexCommand \url[How to redirect]{http://www.nukeforums.com/forums/viewtopic.php?t=17779} \end_inset . \layout Subsection How to disable registration \begin_inset LatexCommand \label{disable-registration} \end_inset \layout Standard If you want to make registration of users impossible, you can apply a variation of the solution in \begin_inset LatexCommand \ref{redirect-your-info-to-forums-user-profile} \end_inset : you can redirect the users to the main page (index. \begin_inset LatexCommand \index{index} \end_inset php) whenever they try to register (e.g. by clicking on some registration link). Note that just by deleting the registration links from the code (see \begin_inset LatexCommand \ref{find-all-registration-links} \end_inset on how to find them), you still can't prevent a determined user from entering \layout Code http://www.yourdomain.com/modules.php?name=Your_Account&op=new_user \layout Standard in the URL box of his browser by hand, thus triggering the \begin_inset Quotes eld \end_inset operation new_user \begin_inset LatexCommand \index{new_user} \end_inset \begin_inset Quotes erd \end_inset in PHP-Nuke. By this, it becomes clear that a real solution must at least change the behaviour of PHP-Nuke for the value \begin_inset Quotes eld \end_inset new_user \begin_inset LatexCommand \index{new_user} \end_inset \begin_inset Quotes erd \end_inset of the op URL parameter. \begin_inset LatexCommand \index{parameter} \end_inset \layout Standard Again, instead of chasing links in the code, there is a more elegant solution: \layout Standard In modules/Your_Account/index. \begin_inset LatexCommand \index{index} \end_inset php find the lines: \layout Code case "new_user": \layout Code new_user(); \layout Code break; \layout Standard and replace them with with: \layout Code case "new_user": \layout Code Header("Refresh: 0; url=index.php"); \layout Code break; \layout Standard This will only disable registration from the Your Account module (more accuratel y: it will redirect every registration attempt to the main index. \begin_inset LatexCommand \index{index} \end_inset php page). \layout Standard To disable it in the Forums too, edit modules/Forums/profile. \begin_inset LatexCommand \index{profile} \end_inset php. Find \layout Code else if ( $mode == 'editprofile' || $mode == 'register' ) \layout Code { \layout Code if ( !$userdata['session_logged_in'] && $mode == 'editprofile' ) \layout Code { \layout Code $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", \layout Code $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: "; \layout Code header($header_location . \layout Code append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile" , \layout Code true)); \layout Code exit; \layout Code } \layout Code include("includes/usercp_register.php"); \layout Code exit; \layout Code } \layout Standard and change it to something like: \layout Code else if ( $mode == 'editprofile' || $mode == 'register' ) \layout Code { \layout Code Header("Refresh: 0; url=index.php"); \layout Code exit; \layout Code } \layout Standard i.e. we again redirect the user to the index. \begin_inset LatexCommand \index{index} \end_inset php page. See also \begin_inset LatexCommand \url[How to disable registration]{http://www.nukeforums.com/forums/viewtopic.php?t=18403} \end_inset . \layout SGML \layout SGML \layout SGML It's also possible without programming! \layout SGML \layout SGML \layout SGML As so often in life, it all depends on what you want. You can of course achieve a similar effect, without any programming, if you make the Your Account module accessible to admins only, from the modules administration, in the administration panel. \layout SGML \layout SGML \layout Standard If you want users to be registered directly, without confirmation mails, see \begin_inset LatexCommand \ref{register-users-immediately} \end_inset . If you want to approve every user who applied for registration, \begin_inset LatexCommand \index{registration} \end_inset you can use the Approve Membership module (see \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset ). \layout Subsection How to let users register immediately \begin_inset LatexCommand \label{register-users-immediately} \end_inset \layout Standard When new users register, you may want them to be able to do so immediately, without having to wait for an email notification with an activation link. \layout SGML \layout SGML \layout SGML Do you trust your users? \layout SGML \layout SGML \layout SGML If you let everyone post without being registered, you will not have *any* data as to who wrote that inflammatory, libellous, pornographic or whatever post in your forum that caught FBI's attention. Thus you should really trust your users not to abuse your system, if you plan to bypass email notification on registration. \layout SGML \layout SGML \layout SGML You have two options, if you are not in the mood of programming it yourself ]]> ]]> ]]> ]]> Inline graphic : \layout Enumerate From the administration panel, Preferences, just choose that non-registered users are allowed to post. Then, from the modules and blocks administration panels, for each module or block you use, choose that all users are allowed to see it. That should come very close to what you want - that all users be able to use all parts of your site without registration. \layout Enumerate A module that allows the administrator to bypass email activation is \begin_inset LatexCommand \url[NSN Your Account Tweak 650 3.0.2]{http://www.nukefixes.com/article6.html} \end_inset . According to the description, administrators can choose to bypass email activation. But the module offers a lot of other useful features around user management, see \begin_inset LatexCommand \ref{NSN-Your-Account-Tweak-module} \end_inset . \layout Standard See also \begin_inset LatexCommand \url[Authorization and avatars]{http://www.karakas-online.de/forum/viewtopic.php?t=288} \end_inset . \layout SGML \layout SGML \layout SGML Download the right NSN Your Account Tweak version! \layout SGML \layout SGML \layout SGML Be careful with the version you download from this module! The number 650, for example, indicates that it is only for PHP-Nuke 6.5. Use only the version that is in accordance with your installed PHP-Nuke version, otherwise you are guaranteed to mess up your installation completely. \layout SGML \layout SGML \layout Standard See also the \begin_inset LatexCommand \url[New User Auto Activation Hack]{http://ravenphpscripts.com/download-file-58.html} \end_inset and the \begin_inset LatexCommand \url[Auto Registration Activation For Nuke v7.0]{http://ravenphpscripts.com/download-file-83.html} \end_inset . If you want to disable registration, \begin_inset LatexCommand \index{registration} \end_inset see \begin_inset LatexCommand \ref{disable-registration} \end_inset . If you want to approve every user who applied for registration, \begin_inset LatexCommand \index{registration} \end_inset you can use the Approve Membership module (see \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset ). \layout Subsection How to approve users before registration \begin_inset LatexCommand \label{approve-users} \end_inset \layout Standard If you want to enforce the opposite of what is described in \begin_inset LatexCommand \ref{register-users-immediately} \end_inset , i.e. be able to approve each and every user before he is allowed to register, then you should have a look at the Approve Membership module. \begin_inset LatexCommand \index{module} \end_inset See \begin_inset LatexCommand \ref{PHP-Nuke-Approve-Membership-module} \end_inset and \begin_inset LatexCommand \url[Authorize accounts]{http://www.karakas-online.de/forum/viewtopic.php?t=83} \end_inset for more details. \layout Standard If you want users to be registered directly, without confirmation mails, see \begin_inset LatexCommand \ref{register-users-immediately} \end_inset . If you want to disable registration, \begin_inset LatexCommand \index{registration} \end_inset see \begin_inset LatexCommand \ref{disable-registration} \end_inset . \layout Subsection How to register users through iBill \begin_inset LatexCommand \label{register-users-through-iBill} \end_inset \layout Standard Theoretically, you could modify the Your Account module easily to accomodate \begin_inset LatexCommand \index{date} \end_inset for a registration through the \begin_inset LatexCommand \url[iBill]{http://www.ibill.com} \end_inset credit card option. You could proceed along the following lines (see \begin_inset LatexCommand \url[Replacing registration with iBill credit card option]{http://www.nukeforums.com/forums/viewtopic.php?t=10200} \end_inset ): \layout Standard The iBill system essentially works by users entering information into the iBill script. The script would then connect to the web server and create an account in an .htaccess file ( \begin_inset LatexCommand \ref{htaccess-file} \end_inset ) in the PHP-Nuke root directory. When a paid user account would expire, \begin_inset LatexCommand \index{expire} \end_inset iBill's server could then remove the user account from the .htaccess file. \layout Standard With iBill controlling the .htaccess file, there would be no need for a Registrat ion option in PHP-Nuke. The only thing that would be needed would be to change the code in block-Login.p hp, perhaps replacing the Register link with a link to a static html page, where the iBill sign up scripts would do the trick. Or you could just put the iBill code in a block and remove the Register option. \layout Standard There is no ready-made solution for this scenario yet, but the procedure \begin_inset LatexCommand \index{procedure} \end_inset outlined above points to the right direction. \layout Subsection How to change the maximum allowed length for user names \begin_inset LatexCommand \label{change-maximum-username-length} \end_inset \layout Standard The standard maximum length for user names is 25 characters. If your users really pick up such long nicknames, they may break your blocks' layout, \begin_inset LatexCommand \index{layout} \end_inset depending on your theme and resolution. This is because they may appear as authors of news articles etc. in headlines that appear in various blocks. \layout Standard To prevent your users from using long user names, you must change the maximum allowed length in modules/Your_Account/index.php, \begin_inset LatexCommand \index{index.php} \end_inset in the function userCheck(). Find the line: \layout Code if (strlen($username) > 25) $stop = "
"._NICK2LONG."
"; \layout Standard and change the 25 to a lower length. A better programming style would be to define a constant for this and do the check against the constant. \layout Section Modifying the PHP-Nuke News module \begin_inset LatexCommand \label{modifying-PHP-Nuke-News-module} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename stories.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-stories-2} \end_inset Administration panel: Add story. \end_inset \layout Standard In this section we modify the PHP-Nuke News module, \begin_inset LatexCommand \index{module} \end_inset which is also one of the most important ones: \layout Itemize How to get rid of the need to use
for new lines ( \begin_inset LatexCommand \ref{get-rid-of-br-in-news} \end_inset ). \layout Subsection How to get rid of the need to use
for new lines \begin_inset LatexCommand \label{get-rid-of-br-in-news} \end_inset \layout Standard It is one of the most annoying requirements for users who want to submit a News article to your site: they have to write the text either in BBcode, \begin_inset LatexCommand \index{BBcode} \end_inset or in HTML. \begin_inset LatexCommand \index{HTML} \end_inset While BBcode is easy to learn and use, HTML can be a real pain for the average Jo user. Worse yet, for sites that have disabled BBcode, \begin_inset LatexCommand \index{BBcode} \end_inset HTML is the only available language for the aspiring journalist. Thus, a lot of people find themselves forced to write their articles with the editor of their choice, then export that document to HTML with the editor's own export function. \begin_inset LatexCommand \index{function} \end_inset Although this scenario will not alleviate the need for a subsequent scrutiny \begin_inset LatexCommand \index{scrutiny} \end_inset of the HTML code thus produced, for the purpose of locating and eliminating the HTML tags that are not allowed by the PHP-Nuke site (see \begin_inset LatexCommand \ref{allow-special-HTML-tags} \end_inset ), it definitely has its merits, especially for long text. \layout Standard Those users however, who will rather opt for a quick entering of the text directly in the form fields, will most often be reminded the hard way, by a text totally lacking paragraph structure, \begin_inset LatexCommand \index{structure} \end_inset that something is missing from their text: two break tags (

) for the insertion of a blank line, something that is used intuitively to separate paragraphs. Even seasoned HTML coders will find themselves routinely omitting the obligator y
tags, so a way to avoid the need for them is great help for both beginners and specialists alike. \layout Standard To eliminate the
plague once for all, you only have to enter a 2-liner in the modules/news/index. \begin_inset LatexCommand \index{index} \end_inset php file. Find the lines: \layout Code getTopics($s_sid); \layout Code formatTimestamp($time); \layout Code $subject = stripslashes($subject); \layout Code $hometext = stripslashes($hometext); \layout Code $notes = stripslashes($notes); \layout Code $introcount = strlen($hometext); \layout Code $fullcount = strlen($bodytext); \layout Code $totalcount = $introcount + $fullcount; \layout Code $c_count = $comments; \layout Code $r_options = ""; \layout Standard and append the following two ones to them: \layout Code $hometext=nl2br("$hometext"); \layout Code $bodytext=nl2br("$bodytext"); \layout Standard Then, in the modules/News/article. \begin_inset LatexCommand \index{article} \end_inset php, find the lines \layout Code if ($notes != "") { \layout Code $notes = "

"._NOTE."$notes"; \layout Code } else { \layout Code $notes = ""; \layout Code } \layout Code if($bodytext == "") { \layout Code $bodytext = "$hometext$notes"; \layout Code } else { \layout Code $bodytext = "$hometext

$bodytext$notes"; \layout Code } \layout Standard and add in 2 more lines, like this: \layout Code $hometext = nl2br($hometext); \layout Code $bodytext = nl2br($bodytext); \layout Standard The \begin_inset LatexCommand \url[nl2br PHP function]{http://www.php.net/manual/en/function.nl2br.php} \end_inset (newline to break) will automatically insert HTML
tags (breaks) before every newline in the short ($hometext) and extended text ($bodytext) of the news article (see also \begin_inset LatexCommand \url[How do I stop using the br tag]{http://www.nukeforums.com/forums/viewtopic.php?t=18099} \end_inset , \begin_inset LatexCommand \url[Linebreaks when entering text]{http://www.nukeforums.com/forums/viewtopic.php?t=11513} \end_inset ). \layout Section Modifying the PHP-Nuke Submit News module \begin_inset LatexCommand \label{modifying-PHP-Nuke-submit-news-module} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename submissions.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-submissions-2} \end_inset Administration panel: Submissions. \end_inset \layout Standard In this section we modify the PHP-Nuke Submit News module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to bypass article approval ( \begin_inset LatexCommand \ref{bypass-article-approval} \end_inset ). \layout Subsection How to bypass article approval \begin_inset LatexCommand \label{bypass-article-approval} \end_inset \layout Standard The standard workflow for a news article is that the user writes it, submits it for approval by the administrator, \begin_inset LatexCommand \index{administrator} \end_inset the administrator reads it, approves and publishes it on the site. This has some advantages: \layout Itemize Everybody can post, even anonymous users. \layout Itemize Since the posts are checked, there is no risk of getting flooded with garbage \begin_inset LatexCommand \index{garbage} \end_inset posts. \begin_inset LatexCommand \index{posts} \end_inset \layout Standard But it also has some disadvantages too: \layout Itemize Users have to wait to see their post published. This may not be what they expect, if actuality of content is highly important for the topics of your site. \layout Itemize The administrators have to spend time on approving news articles. Waiting content ( \begin_inset LatexCommand \ref{fig-waiting-content-block} \end_inset ) can be quite an administrative headache, \begin_inset LatexCommand \index{headache} \end_inset if the site receives many user submissions a day (see, for example phpnuke.org, \begin_inset LatexCommand \index{phpnuke.org} \end_inset where there are dozens of submissions awaiting approval at any given time). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename waiting-content-block.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-waiting-content-block} \end_inset Waiting Content block. \end_inset \layout Standard Fortunately, to bypass article approval, \begin_inset LatexCommand \index{approval} \end_inset the solution is relatively simple (see \begin_inset LatexCommand \url[Automatic Article Posting]{http://www.karakas-online.de/forum/viewtopic.php?t=270} \end_inset ): \layout Itemize For versions before PHP-Nuke 6.5: \begin_inset LatexCommand \index{6.5} \end_inset \begin_deeper \layout Standard In the modules/Submit_News, in the function submitStory(), find this \layout Code $result = sql_query("insert into ".$prefix."_queue \layout Code values (NULL, '$uid', '$name', '$subject', '$story', \layout Code '$storyext', now(), '$topic', '$catid', '$alanguage')", $dbi); \layout Standard Change it to this: \layout Code $result = sql_query("insert into ".$prefix."_stories \layout Code values (NULL, '$catid', '$name', '$subject', now(), '$story', \layout Code '$storyext', '0', '0', '$topic', '$name', ", '0', '$alanguage', \layout Code '0','0', '0', '0', '0')", $dbi); \layout Standard The story will get posted immediately, so you will want to make the Submit_News module only available to Users. Also, you will notice that it will now say \begin_inset Quotes eld \end_inset Posted By Some_user \begin_inset Quotes erd \end_inset , and it will no longer show in italics. \end_deeper \layout Itemize For PHP-Nuke 6.5 and later, the solution is slightly different. Replace this: \begin_deeper \layout Code $sql = "INSERT INTO ".$prefix."_queue VALUES (NULL, '$uid', '$name', '$subject', \layout Code '$story', '$storyext', now(), '$topic', '$alanguage')"; \layout Standard with this: \layout Code $sql = "insert into ".$prefix."_stories values (NULL, '$catid', '$name', '$subject ', \layout Code now(), '$story', '$storyext', '0', '0', '$topic', '$name', ", '0', '$alanguage', '0', '0', '0', '0','0', ")"; \end_deeper \layout Standard You will also want to change the language file "defines", or edit these lines in the function submitStory (this is what is displayed when the submissio n is sent. \layout Code echo "
"._SUBSENT."

" \layout Code .""._THANKSSUB."

" \layout Code .""._SUBTEXT."" \layout Code ."
"._WEHAVESUB." $waiting "._WAITING.""; \layout Subsubsection The formatAidHeader() function \begin_inset LatexCommand \label{formatAidHeader-function} \end_inset \layout Standard If you want to make the \begin_inset Quotes eld \end_inset Posted By Some_user \begin_inset Quotes erd \end_inset also be a link to the User's profile, \begin_inset LatexCommand \index{profile} \end_inset then you can edit the function formatAidHeader in your mainfile.php. \begin_inset LatexCommand \index{mainfile.php} \end_inset The following refers to PHP-Nuke 6.5 and above. \layout Standard The function is simple: it takes an argument, the author id $aid, searches the nuke_authors table for that author id and, if found, it prints a link to the web page of the author. Only if the web page link fiels of nuke_authors is empty for that author, it prints a link to the author's e-mail (which is always there): \layout Code function formatAidHeader($aid) { \layout Code global $prefix, $db; \layout Code $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'"; \layout Code $result = $db->sql_query($sql); \layout Code $row = $db->sql_fetchrow($result); \layout Code $url = $row[url]; \layout Code $email = $row[email]; \layout Code if (isset($url)) { \layout Code $aid = "$aid"; \layout Code } elseif (isset($email)) { \layout Code $aid = "$aid"; \layout Code } else { \layout Code $aid = $aid; \layout Code } \layout Code echo "$aid"; \layout Code } \layout Standard You could easily change this behaviour. For example, you could take out the check against the $url and leave only the e-mail part, if you wanted the \begin_inset Quotes eld \end_inset Posted By Some_user \begin_inset Quotes erd \end_inset to be an e-mail link, rather than a link to a web page (see \begin_inset LatexCommand \url[Change Posted by... Name (Website) to Name (Email)]{http://www.karakas-online.de/forum/viewtopic.php?t=351} \end_inset ): \layout Code function formatAidHeader($aid) { \layout Code global $prefix, $db; \layout Code $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'"; \layout Code $result = $db->sql_query($sql); \layout Code $row = $db->sql_fetchrow($result); \layout Code $url = $row[url]; \layout Code $email = $row[email]; \layout Code if (isset($email)) { \layout Code $aid = "$aid"; \layout Code } else { \layout Code $aid = $aid; \layout Code } \layout Code echo "$aid"; \layout Code } \layout Standard You could make it even more sophisticated, \begin_inset LatexCommand \index{sophisticated} \end_inset by making \begin_inset Quotes eld \end_inset Posted By Some_user \begin_inset Quotes erd \end_inset a link to the user's profile (see \begin_inset LatexCommand \ref{redirect-your-info-to-forums-user-profile} \end_inset for the related subject of user profile redirection). The formatAidHeader function should then be: \layout Code function formatAidHeader($aid) { \layout Code global $prefix, $db; \layout Code $sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'"; \layout Code $result = $db->sql_query($sql); \layout Code if($row = $db->sql_fetchrow($result)) { \layout Code $url = $row[url]; \layout Code $email = $row[email]; \layout Code if (isset($url)) { \layout Code $aid = "$aid"; \layout Code } elseif (isset($email)) { \layout Code $aid = "$aid"; \layout Code } else { \layout Code $aid = $aid; \layout Code } \layout Code }else { \layout Code $sql = "SELECT user_id FROM ".$prefix."_users WHERE username='$aid'"; \layout Code $result = $db->sql_query($sql); \layout Code $row = $db->sql_fetchrow($result); \layout Code $user_id = $row[user_id]; \layout Code $aid = "$aid"; \layout Code } \layout Code echo "$aid"; \layout Code } \layout Section Modifying the PHP-Nuke Sections module \begin_inset LatexCommand \label{modifying-PHP-Nuke-sections-module} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename sections.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-sections-2} \end_inset Administration panel: Sections. \end_inset \layout Standard In this section we modify the PHP-Nuke Section module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to order the articles in the Sections module ( \begin_inset LatexCommand \ref{order-articles-in-sections} \end_inset ). \layout Subsection How to order the articles in the Sections module \begin_inset LatexCommand \label{order-articles-in-sections} \end_inset \layout Standard Sometimes you may not be satisfied with the order of articles in the Sections \begin_inset LatexCommand \index{Sections} \end_inset module. \begin_inset LatexCommand \index{module} \end_inset To change it, edit the following line of the modules/Sections/index.php: \begin_inset LatexCommand \index{index.php} \end_inset \layout Code $result = sql_query("select artid, secid, title, content, counter \layout Code from ".$prefix."_seccont where secid=$secid $querylang", $dbi); \layout Standard Change it to \begin_inset Foot collapsed false \layout Standard See \begin_inset LatexCommand \url[How to sort in Sections]{http://www.nukeforums.com/forums/viewtopic.php?t=13447} \end_inset . \end_inset \layout Code $result = sql_query("select artid, secid, title, content, counter \layout Code from ".$prefix."_seccont where secid=$secid $querylang ORDER BY artid DESC", $dbi); \layout SGML \layout SGML \layout SGML Changing the order of results \layout SGML \layout SGML \layout SGML This is a typical example of changing the order of results of a database selection. This was achieved by solely adding "ORDER BY artid DESC" to the SQL query string. In plain text, this means "order the results by descending article id". The "right way" would of course be to sort by time. But lacking an extra timestamp field, we make use of the fact that later articles have a higher id. Thus, sorting by descending id will give last articles first. Think of this simple trick whenever you seek a simple way to change the order of some results. \layout SGML \layout SGML \layout Section Modifying the PHP-Nuke Downloads module \begin_inset LatexCommand \label{modifying-PHP-Nuke-downloads-module} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename downloads.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-downloads-4} \end_inset Administration panel: Downloads. \end_inset \layout Standard In this section we modify the PHP-Nuke Downloads module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to add URLs longer than 100 characters in Downloads and Web Links ( \begin_inset LatexCommand \ref{URLs-longer-than-100-characters} \end_inset ). \layout Subsection How to add URLs longer than 100 characters in Downloads and Web Links \begin_inset LatexCommand \label{URLs-longer-than-100-characters} \end_inset \layout Standard Not always is the database the sole culprit when you stumble upon an arbitrary limitation of the functionality: constraints are, for some obscure design \begin_inset LatexCommand \index{sign} \end_inset reason, also eagerly set in the code of PHP-Nuke itself. A typical example of this situation, is the limitation of the URL length in the Downloads and Web_Links modules to just 100 characters. To remove this constraint you need to make changes to the database tables \begin_inset LatexCommand \index{tables} \end_inset \emph on and \emph default the programming code. \layout Standard The database change consists of a MySQL command that changes the length of the relevant field. For the Downloads module, \begin_inset LatexCommand \index{module} \end_inset the relevant field is the \begin_inset Quotes eld \end_inset url \begin_inset LatexCommand \index{url} \end_inset \begin_inset Quotes erd \end_inset field in the nuke_downloads_downloads table, for the Web_Links module it is the \begin_inset Quotes eld \end_inset url \begin_inset LatexCommand \index{url} \end_inset \begin_inset Quotes erd \end_inset field in the nuke_links_links table. To change its length, type on the MySQL command line \layout Code alter table nuke_downloads_downloads modify url varchar(200); \layout Standard for the Downloads module, \begin_inset LatexCommand \index{module} \end_inset and \layout Code alter table nuke_links_links modify url varchar(200); \layout Standard for the Web_links module. \begin_inset LatexCommand \index{module} \end_inset \layout SGML \layout SGML \layout SGML Changing the length of database fields \layout SGML \layout SGML \layout SGML If you don't feel comfortable with the MySQL command line, you can use a graphical user interface (GUI) for it, like phpMyAdmin (see ). But you can also pack the above commands in a PHP program: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ]]> \layout SGML \layout SGML \layout SGML Upload it to your web server in the PHP-Nuke root directory (the one where config.php and mainfile.php are also located) and point your browser to it. The script even takes care to print a descriptive error message (a good programming practice), if an error occurs. \layout SGML \layout SGML \layout Standard But you are not done yet: for the length change to really take effect, you must change all \emph on relevant \emph default occurences of "maxlength" \begin_inset LatexCommand \index{maxlength} \end_inset in the PHP code to reflect the new length of the field in the various HTML forms. This means searching not only the modules folder, but also the admin folder, for files related to the two modules and containing the string \begin_inset Quotes eld \end_inset maxlength \begin_inset LatexCommand \index{maxlength} \end_inset \begin_inset Quotes erd \end_inset . \layout Itemize For the Downloads module, \begin_inset LatexCommand \index{module} \end_inset those are: \begin_deeper \layout Enumerate \begin_inset LatexCommand \index{Enumerate} \end_inset The modules/Downloads/index. \begin_inset LatexCommand \index{index} \end_inset php file: \begin_deeper \layout Code .""._FILEURL.":
"; \layout Code .""._URL.":


" \end_deeper \layout Enumerate The admin/modules/download.php file: \begin_deeper \layout Code .""._FILEURL.":  [ "._CHECK." ]
" \layout Code .""._FILEURL.":
"; \layout Code .""._PAGEURL.":  [ "._CHECK." ]
" \end_deeper \end_deeper \layout Itemize For the Web Links module, \begin_inset LatexCommand \index{module} \end_inset they are: \begin_deeper \layout Enumerate The modules/Web_Links/index. \begin_inset LatexCommand \index{index} \end_inset php file: \begin_deeper \layout Code .""._PAGEURL.":
"; \layout Code .""._URL.":


" \end_deeper \layout Enumerate The admin/modules/links.php file: \begin_deeper \layout Code .""._PAGEURL.":  [ "._VISIT." ]
" \layout Code .""._PAGEURL.":
"; \layout Code .""._PAGEURL.":  [ Visit ]
" \layout Code .""._PAGEURL.":  [ "._VISIT." ]
" \end_deeper \end_deeper \layout SGML \layout SGML \layout SGML Search for "maxlength" thoroughly! \layout SGML \layout SGML \layout SGML If it still does not work, then you forgot to change "maxlength" somewhere - perhaps in a file under the admin folder. Search thoroughly! \layout SGML \layout SGML \layout Section Modifying the PHP-Nuke Stories Archive module \begin_inset LatexCommand \label{modifying-PHP-Nuke-stories-archive} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename stories.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-stories-3} \end_inset Administration panel: Add story. \end_inset \layout Standard In this section we modify the PHP-Nuke Stories Archive module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize How to order the articles in the Stories Archive module ( \begin_inset LatexCommand \ref{order-articles-in-stories-archive} \end_inset ). \layout Subsection How to order the articles in the Stories Archive module \begin_inset LatexCommand \label{order-articles-in-stories-archive} \end_inset \layout Standard Sometimes you may wish a different order of articles in the Stories module. \begin_inset LatexCommand \index{module} \end_inset To change the article order so that the articles appear in alphabetical topic order, instead of a LIFO (last-in-first-out) order, edit the following line of the modules/Sections/index.php: \begin_inset LatexCommand \index{index.php} \end_inset \layout Code $result = sql_query("select sid, catid, title, time, comments, counter, topic, \layout Code alanguage, score, ratings from ".$prefix."_stories order by sid DESC \layout Code limit $min,$max", $dbi); \layout Standard Change it to (see \begin_inset LatexCommand \url[Sorting the Stories Archive by Topic first]{http://www.nukeforums.com/forums/viewtopic.php?t=13604} \end_inset ): \layout Code $result = sql_query("select sid, catid, title, time, comments, counter, topic, \layout Code alanguage, score, ratings from ".$prefix."_stories order by topic ASC \layout Code limit $min,$max", $dbi); \layout SGML \layout SGML \layout SGML Changing the order of results \layout SGML \layout SGML \layout SGML This is a typical example of changing the order of results of a database selection. This was achieved by solely replacing "ORDER BY sid DESC" with "ORDER BY topic ASC" in the SQL query string. In plain text, this means "order the results by ascending topic". Whenever you are not satisfied with the order of your results, you will know that you have to add or change an ORDER BY clause to an SQL query string somewhere in your module. Of course, you will still have to find where, but hopefully there will be only a few calls to sql_query() in the code, so that, in the worst case, you could try them all and find the one that works. \layout SGML \layout SGML \layout Chapter Modifying the PHP-Nuke administration panel \begin_inset LatexCommand \label{modifying-PHP-Nuke-admin-panel} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename admin-panel.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-admin-panel-2} \end_inset Administration panel. \end_inset \layout Standard This chapter is devoted to modifications of the administration panel - a rather exotic topic, but with interesting applications: \begin_inset LatexCommand \index{ations} \end_inset \layout Itemize How to set an arbitrary "Stories Number in Home" ( \begin_inset LatexCommand \ref{set-arbitrary-stories-number-in-home} \end_inset ), \layout Itemize How to allow HTML in the Newsletter ( \begin_inset LatexCommand \ref{allow-HTML-newsletter} \end_inset ). \layout Section How to set an arbitrary "Stories Number in Home" \begin_inset LatexCommand \label{set-arbitrary-stories-number-in-home} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename preferences.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-preferences-3} \end_inset Administration panel: Preferences. \end_inset \layout Standard You want to display only, say, 3 News on the hopepage of your PHP-Nuke. But in the administration panel you get only the options to change the "Stories Number in Home" to 5, 10, 15, 20 , 25 and 30. \layout Standard Go to admin/modules/settings. \begin_inset LatexCommand \index{settings} \end_inset php and change at line 61 \begin_inset Foot collapsed false \layout SGML Line numbers are subject to change. If you don't find what you expected, search for it. ]]> ]]> ]]> ]]> Inline graphic \end_inset : \layout Code ."
\backslash n"; \layout Code } \layout Standard Other themes construct their the OpenTable() and CloseTable() functions similarly, if not identically. We will use this fact to change the background colour in the Stories Archive module - and only there. To this end, we only need to define new OpenTable() and CloseTable() functions, with the colour of our choice, then use the new functions instead of the old ones everywhere in the module: \begin_inset LatexCommand \index{module} \end_inset \layout Standard In the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of your theme, add the following two functions \begin_inset Foot collapsed false \layout Standard Strictly seen, the CloseTableNew() function is not necessarily needed, since no new colour is defined there, but it is good to have, to keep the functions conceptually separated from the standard ones. \end_inset : \layout Code function OpenTableNew() { \layout Code global $bgcolor1, $bgcolor2; \layout Code echo "
\backslash n"; \layout Code echo "
\backslash n"; \layout Code } \layout Code \layout Code function CloseTableNew() { \layout Code echo "
\backslash n"; \layout Code } \layout Standard Give the new background colours, \begin_inset LatexCommand \index{colours} \end_inset $bgcolornew1 and $bgcolornew2, the values of your liking in the start of theme. \begin_inset LatexCommand \index{theme} \end_inset php, for example: \layout Code $bgcolornew1 = "#ffffff"; \layout Code $bgcolornew2 = "#660000"; \layout Standard Then just change every occurence of "OpenTable" and "CloseTable" with "OpenTable \begin_inset LatexCommand \index{OpenTable} \end_inset New" and "CloseTableNew" respectively in modules/Stories_Archive/index.php. \begin_inset LatexCommand \index{index.php} \end_inset That's all! The Stories Archive module will now use the new colours. \begin_inset LatexCommand \index{colours} \end_inset \layout Standard There is one small detail you may also want to fix though: the colours of the cells for the \begin_inset Quotes eld \end_inset Articles | Comments | Reads | Score | Date | Actions \begin_inset Quotes erd \end_inset links. To change those too, you will have to change the $bgcolour2 colour in the table cells of the show_month function of modules/Stories_Archive/index.php \begin_inset LatexCommand \index{index.php} \end_inset (see also \begin_inset LatexCommand \url[Background color in Stories Archive]{http://www.nukeforums.com/forums/viewtopic.php?t=12974} \end_inset ): \layout Code echo "" \layout Code ."" \layout Code ."" \layout Code ."" \layout Code ."" \layout Code ."" \layout Code .""; \layout Standard For your design to be consistent, the best way would be to change the six occurences of $bgcolor2 in the above code, to your new background colour \begin_inset LatexCommand \index{colour} \end_inset $bgcolornew2. \layout Standard If you want to change the \emph on foreground \begin_inset LatexCommand \index{foreground} \end_inset \emph default colour, \begin_inset LatexCommand \index{colour} \end_inset the easiest method might be to change the value of the text attribute in the tag that is echoed in the themeheader() function of theme. \begin_inset LatexCommand \index{theme} \end_inset php (see \begin_inset LatexCommand \url[How to change the main font color]{http://www.karakas-online.de/forum/viewtopic.php?t=378} \end_inset ): \layout Code echo ""; \layout Standard Setting \layout Code text= \backslash "#FF0000 \backslash " \layout Standard for example, should make all text appear in red. \layout Section Modifying the PHP-Nuke theme index \begin_inset LatexCommand \label{php-nuke-theme-modifying-index} \end_inset \layout Standard The \series bold themeindex() \series default function displays and formats the News articles. In its standard form, it will attribute a news article to the administrator, \begin_inset LatexCommand \index{administrator} \end_inset rather than the registered user who submitted it. It would be nice if the \begin_inset Quotes eld \end_inset Posted by \begin_inset Quotes erd \end_inset string pointed to the real author, not the administrator who approved and posted the submission (see \begin_inset LatexCommand \ref{fig-posted-by} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename posted-by.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-posted-by} \end_inset News article: \begin_inset Quotes eld \end_inset posted by \begin_inset Quotes erd \end_inset does not mean \begin_inset Quotes eld \end_inset submitted by \begin_inset Quotes erd \end_inset . \end_inset \layout Standard To give credit, \begin_inset LatexCommand \index{credit} \end_inset where credit is due, you must change function themeindex() in the file theme. \begin_inset LatexCommand \index{theme} \end_inset php of your theme, e.g. themes/NukeNews/theme. \begin_inset LatexCommand \index{theme} \end_inset php. Change the following: \layout Code if ("$aid" == "$informant") { \layout Code $content = "$thetext$notes \backslash n"; \layout Code } else { \layout Code if($informant != "") { \layout Code $content = "$informant "; \layout Code } else { \layout Code $content = "$anonymous "; \layout Code } \layout Code $content .= ""._WRITES." \backslash "$thetext \backslash "$notes \backslash n"; \layout Code } \layout Code $posted = ""._POSTEDBY." "; \layout Code $posted .= get_author($aid); \layout Standard to: \layout Code $content = "$thetext$notesn"; \layout Code $posted = ""._POSTEDBY." "; \layout Code if("$informant" == "") { \layout Code $posted .= "$anonymous "; \layout Code } else { \layout Code $posted .= get_author($informant); \layout Code } \layout Code \layout Standard or, if you want to be more flexible, to: \layout Code if ($informant == "") { \layout Code $informant = "Anonymous"; \layout Code }else { \layout Code $holder = sql_query("SELECT url, femail \layout Code FROM ".$user_prefix."_users where uname='$informant'", $dbi); \layout Code list($url, $femail) = sql_fetch_row($holder, $dbi); \layout Code if ($url != "") { \layout Code $informant = "$aid"; \layout Code } elseif ($femail != "") { \layout Code $informant = "$informant"; \layout Code } else { \layout Code $informant = "$aid"; \layout Code } \layout Code } \layout Code echo "$informant"; \layout Code \layout Standard If you apply the latter solution, you should also declare $user_prefix and $dbi to be global variables in themeindex(). \layout SGML \layout SGML \layout SGML Every theme is different! \layout SGML \layout SGML \layout SGML Not all themes are like the NukeNews theme. Some may format the "Posted by" string in a separate function. The important thing to remember is that you must find the line \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML in the themeindex() function. The name of the \begin_inset Quotes eld \end_inset informant \begin_inset Quotes erd \end_inset is echoed immediately after that line. That's the place to include the above pieces of code (perhaps replacing some function call). \layout SGML \layout SGML \layout Standard See \begin_inset LatexCommand \url[submit news problem]{http://www.nukeforums.com/forums/viewtopic.php?t=14121} \end_inset and \begin_inset LatexCommand \url[Need to change some links]{http://www.nukeforums.com/forums/viewtopic.php?t=12588} \end_inset for further discussion of this topic. \layout Standard The themeindex() function in theme. \begin_inset LatexCommand \index{theme} \end_inset php is also the place where the \begin_inset Quotes eld \end_inset number of reads \begin_inset LatexCommand \index{ads} \end_inset \begin_inset Quotes erd \end_inset is printed after the \begin_inset Quotes eld \end_inset posted by \begin_inset Quotes erd \end_inset part (see \begin_inset LatexCommand \url[How to remove the number of reads in News]{http://www.karakas-online.de/forum/viewtopic.php?t=386} \end_inset ). Thus, if you want to remove the number of reads in the News module and your theme is NukeNews, for example, you have to edit themes/NukeNews/theme. \begin_inset LatexCommand \index{theme} \end_inset php with a \begin_inset LatexCommand \url[decent text editor]{http://www.karakas-online.de/forum/viewtopic.php?t=122} \end_inset (see also \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ), find the line \layout Code $posted .= " "._ON." $time $timezone ($counter "._READS.")"; \layout Standard in the themeindex() function and change it to: \layout Code $posted .= " "._ON." $time $timezone "; \layout Section Modifying the PHP-Nuke theme footer \begin_inset LatexCommand \label{php-nuke-theme-modifying-footer} \end_inset \layout Itemize \begin_inset LatexCommand \ref{insert-right-extra-table} \end_inset \layout Itemize \begin_inset LatexCommand \ref{PHP-Nuke-Copyright-notice} \end_inset \layout Standard Here is a little unorthodox example of what you can achieve by modifying the theme footer: \begin_inset LatexCommand \index{footer} \end_inset \layout Standard Suppose you just wonder how you can make a new table to the right of each page ( \begin_inset LatexCommand \ref{insert-right-extra-table} \end_inset ), perhaps because you want to put an advertisement table there. The standard way to do this would be to write a PHP-Nuke block (see \begin_inset LatexCommand \ref{blocks} \end_inset ), insert it in PHP-Nuke through the block management panel (see \begin_inset LatexCommand \ref{admin-management} \end_inset ), position it in the right column, then define its relative position to the other blocks in the right column through the intuitive graphical arrows \begin_inset LatexCommand \index{arrows} \end_inset in the block table of the block management panel. \begin_inset LatexCommand \index{panel} \end_inset \layout Standard An alternative way is to edit your theme. \begin_inset LatexCommand \index{theme} \end_inset php. There, in the function themefooter(), you should see an IF statement for the blocks(right): \layout Code if ($index == 1) { \layout Code $tmpl_file = "themes/NukeNews/center_right.html"; \layout Code $thefile = implode("", file($tmpl_file)); \layout Code $thefile = addslashes($thefile); \layout Code $thefile = " \backslash $r_file= \backslash "".$thefile." \backslash ";"; \layout Code eval($thefile); \layout Code print $r_file; \layout Code blocks(right); \layout Code } \layout Standard The $index variable controls whether the right column should be displayed at all (together with all the blocks that were positioned \begin_inset Quotes eld \end_inset right \begin_inset Quotes erd \end_inset ). If it is equal to 1, the right column should be visible and a call to blocks(ri ght) is made. \layout Standard You can echo the HTML for the extra table cell after this IF block. \begin_inset LatexCommand \index{block} \end_inset This extra table cell will be visible in all pages and could contain a PHP-Nuke block with Google skyscraper ad ( \begin_inset LatexCommand \ref{advertisements-in-php-nuke-blocks} \end_inset ), or any other content of your choice. See \begin_inset LatexCommand \ref{insert-right-extra-table} \end_inset for the details. \layout SGML \layout SGML \layout SGML What makes right blocks disappear... \layout SGML \layout SGML \layout SGML ...is the theme footer, as you can see from the code above! It is in the themefoote r() function of theme.php in your theme folder where the value of $index is checked and blocks(right) is called to display the right blocks. If blocks(right) and the statements around it are called unconditionally, then the right blocks will never disappear, no matter what value $index has, and the method of \begin_inset LatexCommand \ref{hide-right-blocks} \end_inset will not work. You will then have to adjust themefooter() in your theme manually. See also \begin_inset LatexCommand \url[Disable right blocks in News Module]{http://www.nukeforums.com/forums/viewtopic.php?p=59094} \end_inset . \layout SGML \layout SGML \layout Subsection How to insert an extra table to the right of the page \begin_inset LatexCommand \label{insert-right-extra-table} \end_inset \layout Standard The themefooter() function in the theme. \begin_inset LatexCommand \index{theme} \end_inset php file of your theme is the right place to modify if you want to insert an extra table cell to the right of your page: \layout Standard Find the call to blocks(right) (see it in \begin_inset LatexCommand \ref{php-nuke-theme-modifying-footer} \end_inset ) and modify it by adding code as follows: \layout Code blocks(right); \layout Code } \layout Code echo ""; \layout Code echo ""; \layout Code echo " \backslash n" \layout Code ."
"._ARTICLES.""._COMMENTS.""._READS.""._USCORE.""._DATE.""._ACTIONS."
 Some text here."; \layout Code \layout Code // This is an extra table cell now \layout Code \layout Code $footer_message = "$foot1
$foot2
$foot3
$foot4"; \layout Code $tmpl_file = "themes/fiblack/footer.html"; \layout Code $thefile = implode("", file($tmpl_file)); \layout Code $thefile = addslashes($thefile); \layout Code $thefile = "$r_file="".$thefile."";"; \layout Code eval($thefile); \layout Code print $r_file; \layout Code } \layout Standard Or, as a more elaborate variation that includes an external piece of code (in this case the Login block): \layout Code blocks(right); \layout Code } \layout Code echo "
 Some text here.
"; \layout Code include("blocks/block-Login.php"); \layout Code $title = "Title Here"; \layout Code themesidebox($title,$content); \layout Code \layout Code // This is an extra table cell now \layout Code \layout Code $footer_message = "$foot1
$foot2
$foot3
$foot4"; \layout Code $tmpl_file = "themes/fiblack/footer.html"; \layout Code $thefile = implode("", file($tmpl_file)); \layout Code $thefile = addslashes($thefile); \layout Code $thefile = "$r_file="".$thefile."";"; \layout Code eval($thefile); \layout Code print $r_file; \layout Code } \layout Standard In both cases, it is important that the inserted code is outside the IF statement that controls the call to blocks(right). See \begin_inset LatexCommand \url[Insert a new table]{http://www.nukeforums.com/forums/viewtopic.php?topic=11461&forum=42} \end_inset for more details. \layout Subsection The PHP-Nuke Copyright notice \begin_inset LatexCommand \label{PHP-Nuke-Copyright-notice} \end_inset \layout Standard The theme footer also is the place where the PHP-Nuke copyright notice comes in. You don't need to do anything for this, it is done automatically as follows (see \begin_inset LatexCommand \url[PHP-Nuke Copyright and Logo]{http://www.karakas-online.de/forum/viewtopic.php?t=100} \end_inset ): \layout Standard The function themefooter() in theme. \begin_inset LatexCommand \index{theme} \end_inset php contains a call to the footmsg() function, \begin_inset LatexCommand \index{function} \end_inset as in the following example from the Milo theme (file themes/Milo/theme.php): \layout Code echo "
\backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ."
\layout Code \backslash
\backslash
\backslash n" \layout Code ."
\backslash n" \layout Code ."
\backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ." \backslash n" \layout Code ."
\backslash n"; \layout Code footmsg(); \layout Code echo "
\backslash n"; \layout Standard footmsg, in turn, is defined in the footer.php file (located in the root \begin_inset LatexCommand \index{root} \end_inset directory, together with config.php, \begin_inset LatexCommand \index{config.php} \end_inset mainfile.php and the other important files). There, among some code that displays the computation time it took to display the page, we read: \layout Code // DO NOT REMOVE THE FOLLOWING COPYRIGHT LINE. \layout Code YOU'RE NOT ALLOWED TO REMOVE NOR EDIT THIS. \layout Code echo "$copyright
$totaltime
\backslash n \backslash n"; \layout Standard So that's the place where the Copyright notice for PHP-Nuke comes from! Does that mean that, now that we have found it, we are entitled to edit or remove it? Absolutely NOT! In the INSTALL file that comes with the PHP-Nuke package, Franzisco Burzi, \begin_inset LatexCommand \index{Burzi} \end_inset the author of PHP-Nuke explicitly forbids this: \layout Code ############################################################################## \layout Code # I M P O R T A N T N O T E # \layout Code ############################################################################## \layout Code # IMPORTANT: I saw many sites that removes the copyright line in the footer # \layout Code # of each page. YOU'RE NOT ALLOWED TO REMOVE NOR CHANGE/EDIT THAT NOTE. If I # \layout Code # still see this problem happening I'll need to take extreme measures that # \layout Code # can include: to change the PHP-Nuke license, to encrypt some parts of the # \layout Code # code, stop distributing it for free and in an extreme case stop developing # \layout Code # it. The decision is in your hands. # \layout Code # If you do not agreed with this simple rule, delete all PHP-Nuke files # \layout Code # rigth now and move away from it. Thanks. # \layout Code ############################################################################## \layout Standard Still, even this simple and clear admonition from the author does not stop some folks to pose the same question in the forums again and again: Am I allowed to take the Copyright Notice away? The argument often presented \begin_inset LatexCommand \index{presented} \end_inset is one that involves the Licence uder which PHP-Nuke is released, the \begin_inset LatexCommand \url[GNU General Public Licence]{http://www.gnu.org/copyleft/gpl.html} \end_inset (GPL). If I am allowed to change the code under the GPL, \begin_inset LatexCommand \index{GPL} \end_inset the argument goes, and the Copyright Notice is generated by a function call to footmsg(), why not just change the code and delete that call in my theme? \begin_inset LatexCommand \index{theme} \end_inset I can do this, right? \layout Standard Wrong. In an article titled \begin_inset LatexCommand \url[PHP-Nuke GPL Copyright Removal Question Finally Solved]{http://phpnuke.org/modules.php?name=News&file=article&sid=4947} \end_inset , MissS writes: \layout Quotation A while back, questions were raised as to whether or not the copyright notice at the bottom of PHPNuke created pages could be removed. Now there is an answer to this question, straight from the GNU people. \layout Quotation The GNU website states that if you have any questions concerning licensing, you can simply email them for clarification. That is exactly what I did and what follows is my email to them... \layout Standard So MissS wrote to licensing@gnu.org on Sept. 19th, 2002 and asked: \layout Quotation I have a question about the GNU/GPL license. There is a program called PHP-Nuke that has been released under this license. (This program can be found at www.phpnuke.org) This program is a content management system that provides the structure for a website along with the means to administer that site. \layout Quotation What I would like to know is this: if I use this PHPNuke program to create my website, \begin_inset LatexCommand \index{website} \end_inset must the copyright notice (that is included at the bottom of each page that is created with PHPNuke) remain there in order to remain in compliance with this license? There is also a copyright notice within the source code files themselves. \layout Standard Dave Turner's answer was clear, albeit somewhat lapidary: \layout Quotation Yes. See section 2c of the GPL for details. \layout Standard MissS was also confused as to whether PHP-Nuke can be technically considered as what the GPL in its 2c section calls a program that \begin_inset Quotes eld \end_inset normally reads commands interactively when run \begin_inset Quotes erd \end_inset , in which case it must, among other things, \begin_inset Quotes eld \end_inset print or display an announcement including an appropriate copyright notice \begin_inset Quotes erd \end_inset : \layout Quotation This subject came up a while back at PHPNuke. \begin_inset LatexCommand \index{PHPNuke} \end_inset org and no-one seemed to know the real \layout Quotation answer. I have spent quite sometime reading over your license and can't definitively figure out \layout Quotation this answer for myself. (I had questions such as: is the output from a program like this truly \layout Quotation considered interactive or not?) \layout Quotation Please let me know. I don't want to remove the copyright footers on the output pages if I am \layout Quotation not legally allowed to do so. \layout Standard To which Dave Turner replied: \layout Quotation I think a web-based message board clearly reads commands interactively. So, if there is such a notice, you can't remove it. But you could alter its form, so long as it is still appropriate. \layout Quotation -Dave Turner \layout Quotation Free Software Licensing Guru \begin_inset LatexCommand \index{Guru} \end_inset \layout Quotation This is not legal advice. If you need legal advice, see a lawyer. \layout Standard This pretty much says it all. \layout Section Modifying the PHP-Nuke theme icons \begin_inset LatexCommand \label{php-nuke-theme-modifying-icons} \end_inset \layout Standard You are not allowed to use PHP-Nuke's own icons (found in \begin_inset LatexCommand \url[phpnuke.org: Topics]{http://phpnuke.org/modules.php?name=Topics} \end_inset ). From the \begin_inset LatexCommand \url[PHP-Nuke FAQ]{http://phpnuke.org/modules.php?name=FAQ&myfaq=yes&id_cat=1&categories=PHP-Nuke+General+Info} \end_inset : \layout Quotation Can I copy and use your topics graphics? \begin_inset LatexCommand \index{graphics} \end_inset \layout Quotation Absolutely No. All the topics graphics has been made by me and have copyright. \begin_inset LatexCommand \index{copyright} \end_inset You can't copy, modify and/or use those graphics. \begin_inset LatexCommand \index{graphics} \end_inset You can only use "phpnuke.gif" topic image to setup a topic in your web site that refers "only" to PHP-Nuke. Will be exceptions to this rule for PHP-Nuke community's sites. If you run a community support site (for PHP-Nuke ONLY), drop me line. You'll need my written permission to use them. Be fair and don't play with my hard work. \layout Standard Thus, you must use your own icons. \begin_inset LatexCommand \index{icons} \end_inset You will have to either use icons that are royalty free, or licence some for use on your site, or create your own ones. \layout Standard To create your own PHP-Nuke icons, \begin_inset LatexCommand \index{icons} \end_inset you can use some of the tools available specifically for this purpose, e.g. \begin_inset LatexCommand \url[The Topic Dude]{http://www.nukeresources.com/modules.php?name=Downloads&d_op=viewdownloaddetails&lid=154&ttitle=The_Topic_Dude} \end_inset . \layout Section Theme construction: the rules to follow \begin_inset LatexCommand \label{theme-rules} \end_inset \layout Standard Considering that the example is always on NukeNews, \begin_inset LatexCommand \index{NukeNews} \end_inset I suggest you always use this theme as an example, by using the HTML template without directly inserting too many tags in the PHP code, you save time and increase the sites stylistic effect by easily making changes across your site. \layout Enumerate When you add images in an automatic way by using a visual editor, \begin_inset LatexCommand \index{editor} \end_inset the path will be only images/image\SpecialChar \@. gif, and you have to correct it by hand with the right path. \layout Enumerate You can insert variables in the HTML that will then be called by PHP - it is important that they are inserted in the global part of the function \begin_inset LatexCommand \index{function} \end_inset that will include the file. \layout Enumerate The visual editor has the defect to open and close the tables, \begin_inset LatexCommand \index{tables} \end_inset correcting what it thinks is an error. Pay attention because sometimes, in the html files we use, a table is not closed because it will be closed by the successive html file. For example, as often happened, DreamWeaver would close a header by making a mistake in the tables. \begin_inset LatexCommand \index{tables} \end_inset The header must be closed in the following way: \begin_deeper \layout Code
\layout Standard Where this table is that one that includes the right blocks. \end_deeper \layout Enumerate Try to \begin_inset LatexCommand \url[validate the HTML code]{http://www.karakas-online.de/myServices/w3c-html-validator.html} \end_inset as much as possible and to use the style sheets (see \begin_inset LatexCommand \ref{CSS-syntax} \end_inset ) as much you can. In this way you will save a lot of time when you will modify colors, fonts \begin_inset LatexCommand \index{fonts} \end_inset etc. \layout Section How to change a buggy PHP-Nuke theme \begin_inset LatexCommand \label{change-buggy-php-nuke-theme} \end_inset \layout SGML You changed your PHP-Nuke theme to one that is buggy. Now, you cannot see anything, or you only see errors and the Administration panel cannot be reached to change the theme - a chicken-and-egg problem... ]]> ]]> ]]> ]]> Inline graphic \layout Standard There are various solutions to this problem: \layout Enumerate Copy the following code into a file and save it as fixtheme. \begin_inset LatexCommand \index{theme} \end_inset php: \begin_deeper \layout Code \layout Standard If you don't have the NukeNews theme uploaded in your site then change the value for $def_theme in the code above so that it reflects one of your working themes, \begin_inset LatexCommand \index{themes} \end_inset save it, upload it to where nuke's config.php file is, then point your browser to http://yoursite.com/fixtheme. \begin_inset LatexCommand \index{theme} \end_inset php (thanks to \begin_inset LatexCommand \url[Humpa]{http://www.humpa.com} \end_inset for this). \end_deeper \layout Enumerate Just rename the DeepBlue theme (or some other theme known to work) folder to the problematic one. \layout Enumerate Use phpMyAdmin and change the default_theme field in the nuke_config table. \layout Section How to prevent users from changing the theme in PHP-Nuke \begin_inset LatexCommand \label{prevent-users-from-changing-php-nuke-theme} \end_inset \layout Standard PHP-Nuke comes with several standard themes. \begin_inset LatexCommand \index{themes} \end_inset It gives your registered users the possibility to change the theme at the click of a button (see \begin_inset LatexCommand \ref{frontend} \end_inset ). But what if you don't want your users to do that? What if you want them to stay with the default theme you chose in the Preferences (see \begin_inset LatexCommand \ref{administration-functions} \end_inset ) of the administration panel? \begin_inset LatexCommand \index{panel} \end_inset \layout Standard There are two ways to achieve this (see \begin_inset LatexCommand \url[I do not want to let users choose their own themes]{http://www.karakas-online.de/forum/viewtopic.php?t=330} \end_inset ): \layout Enumerate You delete all themes except the one chosen by you. Themes are stored in the themes folder, under directories that carry the theme name. PHP-Nuke counts the available themes in function nav() of the file modules/Your _Account/navbar.php: \begin_deeper \layout Code $handle=opendir('themes'); \layout Code while ($file = readdir($handle)) { \layout Code if ( (!ereg("[.]",$file)) ) { \layout Code $thmcount++; \layout Code } \layout Code } \layout Code closedir($handle); \layout Standard If the theme count $thmcount is greater than 1 - and only then - , the registere d user is presented the possibility to change the theme. \begin_inset LatexCommand \index{theme} \end_inset This is done again in function nav() of modules/Your_Account/navbar.php a few lines further down: \layout Code if ($thmcount > 1) { \layout Code $menuimg = menuimg("themes.gif"); \layout Code echo "" \layout Code ."
\layout Code \backslash
" \layout Code ."" \layout Code ._SELECTTHETHEME."" \layout Code ."
" \layout Code .""._STORIESHOME.":" \layout Standard to \layout Code ."
" \layout Code .""._STORIESHOME.":" \layout Standard Now you can select "3" from the drop-down list. You get the idea. See \begin_inset LatexCommand \url[How to set an arbitrary "Stories Number in Home"]{http://www.karakas-online.de/forum/viewtopic.php?t=40} \end_inset . \layout Section How to allow HTML in the Newsletter \begin_inset LatexCommand \label{allow-HTML-newsletter} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename newsletter.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-newsletter-2} \end_inset Administration panel: Newsletter. \end_inset \layout Standard If you want to use HTML, \begin_inset LatexCommand \index{HTML} \end_inset instead of only plain text in the Newsletter from the administration panel, \begin_inset LatexCommand \index{panel} \end_inset you have to do the following: \layout Standard Replace the function newsletter_send() in admin/modules/newsletter. \begin_inset LatexCommand \index{newsletter} \end_inset php with: \layout Code function newsletter_send($title, $content) { \layout Code global $user_prefix, $sitename, $dbi, $nukeurl, $adminmail; \layout Code $send_html_messages = "yes"; \layout Code $from = $adminmail; \layout Code $subject = "[$sitename Newsletter]: ".stripslashes($title).""; \layout Code $content = stripslashes($content); \layout Code $content = "$sitename "._NEWSLETTER." \backslash n \backslash n \backslash n$content \backslash n \backslash n- \layout Code $sitename "._STAFF." \backslash n \backslash n \backslash n \backslash n \backslash n \backslash n"._NLUNSUBSCRIBE.""; \layout Code $result = sql_query("select email from ".$user_prefix. \layout Code "_users where newsletter='1'", $dbi); \layout Code while(list($email) = sql_fetch_row($result, $dbi)) { \layout Code $xheaders = "From: " . $sitename . " <" . $adminmail . "> \backslash n"; \layout Code $xheaders .= "X-Sender: <" . $adminmail . "> \backslash n"; \layout Code $xheaders .= "X-Mailer: PHP \backslash n"; // mailer \layout Code $xheaders .= "X-Priority: 6 \backslash n"; // Urgent message! \layout Code if ($send_html_messages == "yes") { \layout Code $xheaders .= "Content-Type: text/html; \layout Code charset=iso-8859-1 \backslash n"; // Mime type \layout Code } \layout Code mail("$email","$subject","$content",$xheaders); \layout Code } \layout Code Header("Location: admin.php?op=newsletter_sent"); \layout Code } \layout Standard and the function massmail_send() with \layout Code function massmail_send($title, $content) { \layout Code global $user_prefix, $sitename, $dbi, $nukeurl, $adminmail; \layout Code $send_html_messages = "yes"; \layout Code $from = $adminmail; \layout Code $subject = "[$sitename]: $title"; \layout Code $content = stripslashes($content); \layout Code $content = ""._FROM.": $sitename \backslash n \backslash n \backslash n \backslash n$content \backslash n \backslash n \backslash n \backslash n- \layout Code $sitename "._STAFF." \backslash n \backslash n \backslash n \backslash n"._MASSEMAILMSG.""; \layout Code $result = sql_query("select email from ".$user_prefix \layout Code ."_users where uid != '1'", $dbi); \layout Code while(list($email) = sql_fetch_row($result, $dbi)) { \layout Code $xheaders = "From: " . $sitename . " <" . $adminmail . "> \backslash n"; \layout Code $xheaders .= "X-Sender: <" . $adminmail . "> \backslash n"; \layout Code $xheaders .= "X-Mailer: PHP \backslash n"; // mailer \layout Code $xheaders .= "X-Priority: 6 \backslash n"; // Urgent message! \layout Code if ($send_html_messages == "yes") { \layout Code $xheaders .= "Content-Type: text/html; \layout Code charset=iso-8859-1 \backslash n"; // Mime type \layout Code } \layout Code mail("$email","$subject","$content",$xheaders); \layout Code } \layout Code Header("Location: admin.php?op=massmail_sent"); \layout Code } \layout Standard The changes are in both functions the same: a flag, $send_html_messages, is checked and if set to "yes", the headers of the Newsletter mails (stored in the $xheaders variable) get an extra line for the MIME type: \layout Code Content-Type: text/html; charset=iso-8859-1 \layout Standard See also \begin_inset LatexCommand \url[HTML Newsletter]{http://www.nukeforums.com/forums/viewtopic.php?t=13945} \end_inset , but be warned that the code presented in that link, may not escape double quotes, \begin_inset LatexCommand \index{quotes} \end_inset probabbly due to an upgrade bug in the forums. \layout Chapter Creating PHP-Nuke blocks \begin_inset LatexCommand \label{blocks} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename blocks.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-blocks-2} \end_inset Administration panel: Blocks. \end_inset \layout Standard Having seen how to \emph on modify \emph default a PHP-Nuke block ( \begin_inset LatexCommand \ref{modifying-php-nuke-blocks} \end_inset ), we can gradually try our skills in \emph on creating \emph default one. We proceed by showing: \layout Itemize The characteristics of the various types of blocks ( \begin_inset LatexCommand \ref{block-types} \end_inset ), \layout Itemize How to create a new block ( \begin_inset LatexCommand \ref{block-creation} \end_inset ), \layout Itemize A simple Content block ( \begin_inset LatexCommand \ref{Simple-Content-block} \end_inset ), \layout Itemize How to include PHP/HTML files in a PHP-Nuke block ( \begin_inset LatexCommand \ref{how-to-include-files} \end_inset ), \layout Itemize How to use Javascript in PHP-Nuke blocks ( \begin_inset LatexCommand \ref{javascript-in-php-nuke-blocks} \end_inset ), \layout Itemize How to display Flash in PHP-Nuke blocks ( \begin_inset LatexCommand \ref{flash-php-nuke-blocks} \end_inset ), \layout Itemize How to show advertisements in PHP-Nuke blocks ( \begin_inset LatexCommand \ref{advertisements-in-php-nuke-blocks} \end_inset ), \layout Itemize How to display images in PHP-Nuke blocks ( \begin_inset LatexCommand \ref{display-images-php-nuke-blocks} \end_inset ), \layout Itemize How to display HTML forms in a block: \begin_inset LatexCommand \index{block} \end_inset Paypal ( \begin_inset LatexCommand \ref{paypal-block-for-php-nuke} \end_inset ). \layout Section The characteristics of the various types of blocks \begin_inset LatexCommand \label{block-types} \end_inset \layout Standard There are 3 different types of PHP-Nuke blocks: \layout Itemize RSS/RDF: \begin_inset LatexCommand \index{RDF} \end_inset They capture news that's available from other sites in standard reading format, i\SpecialChar \@. e\SpecialChar \@. text (For example the site \begin_inset LatexCommand \url[spaghettibrain]{www.spaghettibrain.com} \end_inset has a lot of news that are at other sites' disposal). \layout Itemize Blocks of contents: \begin_inset LatexCommand \index{contents} \end_inset blocks in which we insert simple text or HTML text that will be then displayed inside the block (See following example) \layout Itemize Blocks of files: They are PHP scripts that execute fixed commands (see \begin_inset LatexCommand \ref{block-creation} \end_inset ) \layout Standard In this paragraph we will see a simple example of how to insert the links and the text in a text block. \begin_inset LatexCommand \index{block} \end_inset If you already know a little HTML there is no point in following this example. \layout Standard We suppose you want to insert a block with text and a link to 3 different sites: \layout Standard The Webmaster who wrote this book manages the following sites: \layout Itemize \begin_inset LatexCommand \url[spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[spaghettiopen.com]{http://www.spaghettiopen.com} \end_inset \layout Itemize \begin_inset LatexCommand \url[spaghettipython.com]{http://www.spaghettipython.com} \end_inset \layout Standard The text will be formatted in this way in order to be inserted in the block \begin_inset LatexCommand \index{block} \end_inset (see \begin_inset LatexCommand \ref{fig-block-example} \end_inset ): \layout Code webmaster who writes this book manages the following sites:
\layout Code spaghettibrain.com \layout Code claudioerba.com \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename snapshot15.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-block-example} \end_inset Block example \end_inset \layout Standard Some Small HTML lessons: \layout Description \series medium < \series default b> It is for bold text, it opens a tag. All words that we write after this tag will be bold until
(which closes the tag). \layout Description \series medium < \series default br> It is for a page break, it does not need to be closed. \layout Description Site\SpecialChar \- Name is used to open the http://siteyouwa nt.com. \layout Section How to create a new block \begin_inset LatexCommand \label{block-creation} \end_inset \layout Standard To create a block of the third type, i\SpecialChar \@. e\SpecialChar \@. a php script that interfaces with the database and extrapolates the data, \begin_inset LatexCommand \index{data} \end_inset first of all we have to understand how these blocks are structured. They are contained in a folder called blocks, the name of the block must be block-blockname\SpecialChar \@. php. It is very important all blocks start with \begin_inset Quotes eld \end_inset block- \begin_inset Quotes erd \end_inset . Every block in which the name will start with block- will be included in the screen of the blocks that can be activated. \begin_inset LatexCommand \index{activated} \end_inset We will find in the blocks administration menu all the available blocks in the file_name drop-down list. If not assigned by the administrator, \begin_inset LatexCommand \index{administrator} \end_inset the name will be the same that follows block- We can't use break spaces in a block name, they must be replaced by using underscore _ . All the blocks that will respect these rules will be inserted in the blocks admin menu. \begin_inset LatexCommand \index{menu} \end_inset \layout Standard We describe: \layout Itemize How to create a block, \begin_inset LatexCommand \index{block} \end_inset theoretical approach ( \begin_inset LatexCommand \ref{block-theory} \end_inset ), \layout Itemize How to create a block, \begin_inset LatexCommand \index{block} \end_inset a practical example ( \begin_inset LatexCommand \ref{block-practice} \end_inset ). \layout Subsection How to create a block, theoretical approach \begin_inset LatexCommand \label{block-theory} \end_inset \layout Standard You have to follow these rules when creating a block: \begin_inset LatexCommand \index{block} \end_inset \layout Itemize In every block you create you have to insert the following code at the beginning : \begin_deeper \layout Code if (eregi("block-Name_of_Block.php", $PHP_SELF)) { \layout Code Header("Location: index.php"); \layout Code die(); \layout Code } \layout Standard By using this code you protect the file avoiding users approaching it directly from the blocks folder, and the block will be displayed only when selected from your site. \end_deeper \layout Itemize In the blocks you can include everything you want, Perl, java, php, flash \begin_inset LatexCommand \index{flash} \end_inset etc... \layout Itemize All the block output must have a value that can be obtained from the variable $content. \layout Standard Remember that you have a limited amount of space in the block, \begin_inset LatexCommand \index{block} \end_inset pay special attention to the layout! \layout SGML \layout SGML \layout SGML Warning \layout SGML \layout SGML \layout SGML In order to have W3C standard compatible blocks, Francisco Burzi says: \layout Quotation "To respect the W3c standards for HTML 4.01 Transitional, \begin_inset LatexCommand \index{Transitional} \end_inset it is very important that you replace all "instances of &" in the URL by the tag "& " \layout SGML For example the URL: \layout Code \layout SGML must be written: \layout Code \layout SGML and don't use, for example, the tag "li" (used to create a list), but leave that in the style sheet (CSS) which will make it for you. \layout SGML \layout SGML \layout Standard The background for the tables and font etc\SpecialChar \@. , are better left to the style sheet (CSS). \layout Standard We will now see how to construct a block starting from the beginning. \layout Subsection How to create a block, a practical example \begin_inset LatexCommand \label{block-practice} \end_inset \layout Standard We will make a very simple block that shows the pages visited in our site the day before. We'll have a single query and a single value, in order to make things easier. Our block is called "hits", so the complete name of the block will be block-hit s.php \layout Standard First of all, we open the php tag \layout Code \layout Standard Our complete script will be : \layout Code \layout Section Simple Content block \begin_inset LatexCommand \label{Simple-Content-block} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename content.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-content-2} \end_inset Administration panel: Content. \end_inset \layout Standard PHP-Nuke comes with a Content module ( \begin_inset LatexCommand \ref{fig-content-2} \end_inset ). But how about a Content \series bold block \begin_inset LatexCommand \index{block} \end_inset \series default ? How to display links to Content pages in a PHP-Nuke block? \begin_inset LatexCommand \index{block} \end_inset A block may be desirable in case you wish to place a link summary of the Content module's er...content, somewhere in the left, central or right columns. \layout Standard After you have created the desired categories for the Content module, \begin_inset LatexCommand \index{module} \end_inset you can then go to http://yoursite.com/admin.php? \begin_inset LatexCommand \index{admin.php} \end_inset op=content and start adding pages to the categories. To find out the link to these pages, you will have to click on the Content \begin_inset LatexCommand \index{Content} \end_inset link in the modules block, \begin_inset LatexCommand \index{block} \end_inset view each page and copy its url from the browser's address window, then just add these urls to a html block with maybe the following HTML code: \layout Code   · \layout Code  Page Title 1
\layout Code   · \layout Code  Page Title 2
\layout Code   · \layout Code  Page Title 3
\layout Code   · \layout Code  Page Title 4
\layout Code   · \layout Code  Page Title 5
\layout Standard A block that does the job is the following: \layout Code · \layout Code  Page Title 1
"; \layout Code $content .= "nbsp; · \layout Code  Page Title 2
"; \layout Code $content .= "nbsp; · \layout Code  Page Title 3
"; \layout Code $content .= "nbsp; · \layout Code  Page Title 4
"; \layout Code $content .= "nbsp; · \layout Code  Page Title 5
"; \layout Code \layout Code ?> \layout Standard Name it block-Content, \begin_inset LatexCommand \index{Content} \end_inset put it in the blocks folder, then "create" it in the blocks administration (see \begin_inset LatexCommand \ref{administration-functions} \end_inset ). \layout Section How to include PHP/HTML files in a PHP-Nuke block \begin_inset LatexCommand \label{how-to-include-files} \end_inset \layout Standard Suppose you want to write a block, \begin_inset LatexCommand \index{block} \end_inset block-bar.php, that includes the file foo/bar.php. The way PHP-Nuke displays a block is that it first includes the block, \begin_inset LatexCommand \index{block} \end_inset with a statement like \layout Code include("blocks/block-bar.php"); \layout Standard then makes a table and puts in the title, \begin_inset LatexCommand \index{title} \end_inset and makes another table row, and "echo"es the $content variable. Thus, the $content variable must contain all the output of foo/bar.php, if your block has to contain its output. The PHP output control functions come in here very handy. The \begin_inset LatexCommand \url[PHP output control functions]{http://www.php.net/manual/en/ref.outcontrol.php} \end_inset allow you to control when output is sent from the script. This can be useful in various situations, \begin_inset LatexCommand \index{ations} \end_inset especially if you need to send headers to the browser after your script has began outputting data. \begin_inset LatexCommand \index{data} \end_inset The output control functions (or output buffering functions, as they are often called and as the ob_ prefix in their name suggests) do not affect headers sent using header() or setcookie(), only functions such as echo() and data between blocks of PHP code. \layout Standard Output buffering is a powerful tool in PHP which allows you to buffer a script's output. You can even edit this buffer before returning it to the client. The PHP functions that constitute the output buffering toolbox are: \layout Itemize ob_start([callback function]) - Starts an output buffering session. \begin_inset LatexCommand \index{session} \end_inset \layout Itemize ob_flush() - Send the contents of the buffer to the client and clear the buffer. \begin_inset LatexCommand \index{buffer} \end_inset \layout Itemize ob_get_contents() - Returns the contents of the buffer. \begin_inset LatexCommand \index{buffer} \end_inset The buffer is not cleared. \layout Itemize ob_end_clean() - Ends the current buffering session and purges the buffer. \begin_inset LatexCommand \index{buffer} \end_inset \layout Itemize ob_end_flush() - Ends the current buffering session and displays the buffer. \begin_inset LatexCommand \index{buffer} \end_inset \layout Itemize ob_get_length() - (Version >= 4.0.2) Return the size of the current buffer. \begin_inset LatexCommand \index{buffer} \end_inset \layout Itemize ob_get_clean() - (Version >= 4.3) Composite of ob_get_contents() and \layout Itemize ob_end_clean(). The buffer is returned and the session ends. \layout Standard How can we use output buffering to include the output of foo/bar.php in our PHP-Nuke block? \begin_inset LatexCommand \index{block} \end_inset The idea is simple: rather than having PHP send output directly to the standard output device (the browser) as the script gets executed, we will define a special output buffer which stores all the output generated by the script during its lifetime. When we do this, the output of the script is never seen by the user unless we explicitly make the contents of this buffer visible via a call to PHP's output control API (through one of the above functions). We put the foo folder in the main phpnuke directory, and use this code our block: \begin_inset LatexCommand \index{block} \end_inset \layout Code ob_start(); \layout Code include("foo/bar.php"); \layout Code $output = ob_get_contents(); \layout Code ob_end_clean(); \layout Code $content = $output; \layout Standard This way the $content variable will contain the output of foo/bar.php, which will thus be shown in the block. \begin_inset LatexCommand \index{block} \end_inset To learn more about PHP output buffering, \begin_inset LatexCommand \index{buffering} \end_inset see \begin_inset LatexCommand \url[Output Buffering with PHP]{http://www.devshed.com/Server_Side/PHP/OutputBuffering/} \end_inset and \begin_inset LatexCommand \url[PHP Output Buffering tutorial]{http://jinxidoru.com/tutorials/buffering.html} \end_inset . See also \begin_inset LatexCommand \url[Scripting a new Block Problem]{http://www.nukeforums.com/forums/viewtopic.php?t=11465} \end_inset , for a complete example of including a PHP scoring application in a PHP-Nuke block. \begin_inset LatexCommand \index{block} \end_inset \layout Section How to use Javascript in PHP-Nuke blocks \begin_inset LatexCommand \label{javascript-in-php-nuke-blocks} \end_inset \layout Standard Javascript can be used with PHP-Nuke without problems, as long as you remember that they operate in different environments (see \begin_inset LatexCommand \url[Frames, JavaScript, and PHP Overview]{http://forums.devnetwork.net/viewtopic.php?t=1030} \end_inset ): \layout Itemize PHP-Nuke, like PHP, \begin_inset LatexCommand \index{PHP} \end_inset is server side. Therefore, if you want to pass data from a form to PHP-Nuke, you \emph on have to \emph default submit it and load the page again. There is no getting around it. \layout Itemize Javascript is client side (run in the browser), and can help you with dynamic \begin_inset LatexCommand \index{dynamic} \end_inset functionality. \begin_inset LatexCommand \index{functionality} \end_inset You can easily use JavaScript and PHP-Nuke together. However, just like PHP, \begin_inset LatexCommand \index{PHP} \end_inset PHP-Nuke knows \emph on nothing \emph default about Javascript. \begin_inset LatexCommand \index{Javascript} \end_inset PHP-Nuke will just echo the Javascript code to the HTML page, just as it would echo the value of a string variable. \layout Standard Thus, from the point of view of PHP and PHP-Nuke, there is no difference between \layout Code \layout Standard and \layout Code \layout Code \layout Code '; \layout Code \layout Code ?> \layout Standard They both echo strings, \begin_inset LatexCommand \index{strings} \end_inset of which the first one is simply displayed in the client's browser as a welcome message, while the second one is interpreted by the client's browser and leads to the browser sending a request for the News module, \begin_inset LatexCommand \index{module} \end_inset which in turn sends the usual home page of a PHP-Nuke site to be displayed on the client. \layout Standard With this in mind, Javascript does not demand any special treatment when used in PHP-Nuke blocks. Just append the Javascript code to the $content variable of the block and you are done. Of course, you have to escape double quotes - and it is a good idea to add a newline ( \backslash n) to the end of each Javascript line (see \begin_inset LatexCommand \url[Javascript and BLOCKs]{http://www.nukeforums.com/forums/viewtopic.php?t=13048} \end_inset ). \layout Standard If you use \begin_inset LatexCommand \url[sed]{http://www.gnu.org/software/sed/manual/sed.html} \end_inset , the following sequence of sed commands, applied to a Javascript file, will produce the right PHP code to include in the PHP-Nuke block: \begin_inset LatexCommand \index{block} \end_inset \layout SGML \layout SGML 1,$s/"/ \backslash \backslash "/g \layout SGML 1,$s/^/ \backslash $content \backslash .= "/ \layout SGML 1,$s/$/";/ \layout SGML 1,$s/";$/ \backslash \backslash n";/ \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Escape all double quotes. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Add the string '$content .= "' at the start of every line. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Add the string '";' at the end of every line. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Add a newline \backslash n at the end of each JS line. \layout SGML \layout SGML \layout SGML \layout Standard You can put them in a file, sedscr, \begin_inset LatexCommand \index{sedscr} \end_inset and tell sed to read sedscr for commands, while editing the original Javascript file (javascript): \layout Code sed -f sedscr javascript > block-Javascript.php \layout Standard Of course, you can use vi ( \begin_inset LatexCommand \ref{vi} \end_inset ) too - see \begin_inset LatexCommand \ref{javascript-php} \end_inset for a similar example - or just do the substitutions manually. The examples in this section demonstrate what you have to do (see also \begin_inset LatexCommand \url[Javascript in a PHP-Nuke block]{http://www.karakas-online.de/forum/viewtopic.php?t=379} \end_inset ): \layout Itemize How to create a Hello World block ( \begin_inset LatexCommand \ref{create-hello-world-block} \end_inset ), \layout Itemize How to create a fade block ( \begin_inset LatexCommand \ref{create-fade-block} \end_inset ), \layout Itemize How to create a Help Center Live block ( \begin_inset LatexCommand \ref{create-help-center-live-block} \end_inset ). \layout Subsection How to create a Hello World block \begin_inset LatexCommand \label{create-hello-world-block} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename hello-world-javascript.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-hello-world-javascript} \end_inset Hello World block with Javascript. \end_inset \layout Standard We will start with a very simple block, \begin_inset LatexCommand \index{block} \end_inset one that just displays \begin_inset Quotes eld \end_inset Hello World \begin_inset Quotes erd \end_inset . Once you get the idea, you will be able to construct any Javascript block \begin_inset LatexCommand \index{block} \end_inset for PHP-Nuke - they all follow the same rules. \begin_inset LatexCommand \index{rules} \end_inset \layout Standard We will keep the Javascript code in a separate file, say hello-world.php, \begin_inset LatexCommand \index{hello-world.php} \end_inset in the PHP-Nuke includes directory. The includes directory is a natural place for it, because it also contains the javascript. \begin_inset LatexCommand \index{javascript} \end_inset php file (see \begin_inset LatexCommand \ref{javascript-php} \end_inset ). You can use the javascript. \begin_inset LatexCommand \index{javascript} \end_inset php file to store your own Javascript functions (as shown in \begin_inset LatexCommand \url[Javascript in a PHP-Nuke block]{http://www.karakas-online.de/forum/viewtopic.php?t=379} \end_inset ), but for this simple example, hello-world.php is more than enough. It contains only a few lines: \layout Code \layout Standard Now, create a block, \begin_inset LatexCommand \index{block} \end_inset block-Hello_World.php, in the blocks folder that contains: \layout Code "; \layout Code \layout Code ?> \layout Standard As you can see, block-Hello_World.php loads the hello-world.php from the includes \begin_inset LatexCommand \index{includes} \end_inset folder as a Javascript code. hello-world.php, \begin_inset LatexCommand \index{hello-world.php} \end_inset in turn, is executed and echoes the document.write command in the HTML file that is sent to the client's browser. When a the browser receives it (and has Javascript enabled), executes the code writing the "Hello World" message in the place it was called - in the Hello World block. \begin_inset LatexCommand \index{block} \end_inset \layout Standard Using this technique, you can create blocks that are very rich in functionality \begin_inset LatexCommand \index{functionality} \end_inset - just echo their code with a PHP file and call that file as Javascript \begin_inset LatexCommand \index{Javascript} \end_inset code from the block. \begin_inset LatexCommand \index{block} \end_inset See \begin_inset LatexCommand \ref{create-help-center-live-block} \end_inset for a non-trivial example. \layout Subsection How to create a fade block \begin_inset LatexCommand \label{create-fade-block} \end_inset \layout Standard So you have seen this cool fade effect on a site and you decided to incorporate \begin_inset LatexCommand \index{corporate} \end_inset it in a PHP-Nuke block on your site too? I mean that effect that makes the image fade gradually away, when you pass over it with the mouse cursor - and comes again gradually back the next time you revisit it with the mouse cursor. Before you plunge into this, consider that it is just an effect - and one that will work only with Internet Explorer. \begin_inset LatexCommand \index{Explorer} \end_inset If you still feel you must have it, here is the PHP-Nuke block that demonstrate s this fade effect: \layout Code \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "/* \backslash n"; \layout Code $content .= "Gradual-Highlight Image Script II- \backslash n"; \layout Code $content .= "By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca) \backslash n"; \layout Code $content .= "Permission granted to Dynamicdrive.com to feature script in archive \backslash n"; \layout Code $content .= "For full source to script, visit http://dynamicdrive.com \backslash n"; \layout Code $content .= "*/ \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "nereidFadeObjects = new Object(); \backslash n"; \layout Code $content .= "nereidFadeTimers = new Object(); \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "/* object - image to be faded (actual object, not name); \backslash n"; \layout Code $content .= "* destop - destination transparency level (ie 80, for mostly solid) \backslash n"; \layout Code $content .= "* rate - time in milliseconds between trasparency changes (best under 100) \backslash n"; \layout Code $content .= "* delta - amount of change each time (ie 5, for 5% change in transparency) \backslash n"; \layout Code $content .= "*/ \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "function nereidFade(object, destOp, rate, delta){ \backslash n"; \layout Code $content .= "if (!document.all) \backslash n"; \layout Code $content .= "return \backslash n"; \layout Code $content .= "if (object != \backslash "[object] \backslash "){ //do this so I can take a string too \backslash n"; \layout Code $content .= "setTimeout( \backslash "nereidFade( \backslash "+object+ \backslash ", \backslash "+destOp+ \backslash ", \backslash "+rate+ \backslash ", \backslash "+delta+ \backslash ") \backslash ",0); \backslash n"; \layout Code $content .= "return; \backslash n"; \layout Code $content .= "} \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "clearTimeout(nereidFadeTimers[object.sourceIndex]); \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "diff = destOp-object.filters.alpha.opacity; \backslash n"; \layout Code $content .= "direction = 1; \backslash n"; \layout Code $content .= "if (object.filters.alpha.opacity > destOp){ \backslash n"; \layout Code $content .= "direction = -1; \backslash n"; \layout Code $content .= "} \backslash n"; \layout Code $content .= "delta=Math.min(direction*diff,delta); \backslash n"; \layout Code $content .= "object.filters.alpha.opacity+=direction*delta; \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "if (object.filters.alpha.opacity != destOp){ \backslash n"; \layout Code $content .= "nereidFadeObjects[object.sourceIndex]=object; \backslash n"; \layout Code $content .= "nereidFadeTimers[object.sourceIndex]=setTimeout \layout Code ( \backslash "nereidFade(nereidFadeObjects[ \backslash "+object.sourceIndex+ \backslash "], \backslash "+destOp+ \backslash ", \layout Code \backslash "+rate+ \backslash ", \backslash "+delta+ \backslash ") \backslash ",rate); \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "} \backslash n"; \layout Code $content .= "} \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= " \backslash n"; \layout Code $content .= "
"; \layout Code \layout Code ?> \layout Standard This is an adaptation of the \begin_inset LatexCommand \url[Dynamic Highlight II Script]{http://www.dynamicdrive.com/dynamicindex4/highlightgrad2.htm} \end_inset , by J Mark Birenbaum, \begin_inset LatexCommand \index{Birenbaum} \end_inset that just appends the Javascript code in the $content variable of a PHP-Nuke block. \begin_inset LatexCommand \index{block} \end_inset You can adjust some parameters, such as the transparency level, the time between trasparency changes and amount of change each time - see the comments \begin_inset LatexCommand \index{comments} \end_inset in the script's code. You should of course at least adapt the image source file (images/xxx.png \begin_inset LatexCommand \index{png} \end_inset in the code) to your situation. \layout Subsection How to create a Help Center Live block \begin_inset LatexCommand \label{create-help-center-live-block} \end_inset \layout Standard We will now move on to consider a block that can integrate the whole functionali ty of a Help Center: \begin_inset LatexCommand \index{Center} \end_inset the Help Center Live block for PHP-Nuke. \begin_inset LatexCommand \url[Help Center Live]{http://www.helpcenterlive.com} \end_inset is an Open Source Application that is distributed under the GNU Genreal Public License (GPL). It helps you build a real support department for your business. \begin_inset LatexCommand \index{business} \end_inset With Help Center Live you can: \layout Itemize Create online accounts for your departments. \layout Itemize Create online accounts for your support operators and assign them to departments. \layout Itemize Create FAQs for your customers. \begin_inset LatexCommand \index{customers} \end_inset \layout Itemize If an operator is online, he can see which hosts currently view the company's page and can initiate chat sessions with those hosts. \layout Itemize If someone from a support department is online (has logged in Help Center \begin_inset LatexCommand \index{Center} \end_inset Live), the visitors browsing the company's page can see this and initiate a chat session with that support person. Thus, a customer can directly contact support personnel and seek a solution to his problem. \layout Itemize At the end of the chat session, \begin_inset LatexCommand \index{session} \end_inset a transcript of the session can be sent to the participants, at e-mail addresses of their choice. \layout Itemize If nobody from the support department(s) is online, the visitor still has the possibility to issue a trouble ticket. \begin_inset LatexCommand \index{ticket} \end_inset \layout Itemize Trouble tickets are tracked through a database and there exists a sophisticated \begin_inset LatexCommand \index{sophisticated} \end_inset backend for dealing with them. \layout Standard How can you incorporate all this functionality into your PHP-Nuke site? \layout Standard At first, you must install Help Center Live on our site, or, if we only want to test it, local system. \begin_inset LatexCommand \index{system} \end_inset For this, download the package from \begin_inset LatexCommand \url[Help Center Live]{http://www.helpcenterlive.com} \end_inset and extract its contents into some folder of your web root, \begin_inset LatexCommand \index{root} \end_inset say under /helpcenter. Then you must edit the config. \begin_inset LatexCommand \index{config} \end_inset php file in the inc directory of that folder with the decent text editor ( \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ) of your choice. There are various parameters you can set up there, but the most important are the $URL_* ones \layout Code $URL_site = "midas"; \layout Code $URL_dir = "/helpcenter/"; \layout Code $URL_maindir = "http://midas/helpcenter"; \layout Code $URL_secure = 0; \layout Standard as well as the DB_* ones: \layout Code $DB_host = "localhost"; \layout Code $DB_user = "db user here"; \layout Code $DB_pass = "db password here"; \layout Code $DB_name = "db name here"; \layout Code $DB_prefix = "prefix here"; \layout Code $DB_pconnect = 0; \layout Standard The $DB_host, $DB_user, $DB_pass and $DB_name variables could be the same as the $dbhost, $dbuser, \begin_inset LatexCommand \index{dbuser} \end_inset $dbpass and $dbname variables in config.php respectively (see \begin_inset LatexCommand \ref{config-php-file} \end_inset ), although not necessarily so. \layout SGML \layout SGML \layout SGML Terminate the DB_prefix with an underscore! \layout SGML \layout SGML \layout SGML If you use a $DB_prefix, make sure it ends in an underscore (_), otherwise it will be directly concatenated with the table names, rendering them difficult to tell apart. \layout SGML \layout SGML \layout Standard The $URL_site, $URL_dir and $URL_secure variables are only used in calls to the \begin_inset LatexCommand \url[PHP setcookie() function]{http://www.php.net/manual/en/function.setcookie.php} \end_inset : \layout Code setcookie("Help Center LiveUser", $INFO_username, $time, $URL_dir, $URL_site, $URL_secure); \layout SGML Calls to setcookie() like the above are scattered throughout the code - \begin_inset LatexCommand \ref{tab-Help-Center-Live-setcookie} \end_inset lists all files and lines containing such calls. If you experience the infamous login loop problem, it is probably because the setcookie() function was not able to set the cookie on the client. ]]> ]]> ]]> ]]> Inline graphic \layout Standard \begin_inset Float table placement htbp wide false collapsed false \layout Caption \begin_inset LatexCommand \label{tab-Help-Center-Live-setcookie} \end_inset Help Center Live: setcookie() calls \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard File \end_inset \begin_inset Text \layout Standard setcookie() call \end_inset \begin_inset Text \layout Standard cp/logout.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveOperator", $LOGIN_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard cp/logout.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLivePassword", $LOGIN_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard cp/login.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveOperator", $LOGIN_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard cp/login.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLivePassword", $LOGIN_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard lh/live_request.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveGuest", $REQUEST_name, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard lh/live_request.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveGuest", $REQUEST_delname, $deltime, $URL_dir, $URL_site , $URL_secure); \end_inset \begin_inset Text \layout Standard lh/live_request.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveGuest", $REQUEST_name, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard lh/live_mail.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveUser", $LOGIN_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard lh/live_mail.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLivePass", $LOGIN_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_register.php \end_inset \begin_inset Text \layout Standard setcookie("Help Center LiveUser", $REGISTER_username, $time, $URL_dir, $URL_site , $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_register.php \end_inset \begin_inset Text \layout Standard setcookie("Help Center LivePass", $REGISTER_password, $time, $URL_dir, $URL_site , $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_login.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveUser", $LOGIN_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_login.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLivePass", $LOGIN_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_logout.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLiveUser", $LOGIN_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_logout.php \end_inset \begin_inset Text \layout Standard setcookie("HelpCenterLivePass", $LOGIN_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_info.php \end_inset \begin_inset Text \layout Standard setcookie("Help Center LiveUser", $INFO_username, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \begin_inset Text \layout Standard tt/user_info.php \end_inset \begin_inset Text \layout Standard setcookie("Help Center LivePass", $INFO_password, $time, $URL_dir, $URL_site, $URL_secure); \end_inset \end_inset \end_inset \layout Standard This happens if, for example, you are installing Help Center Live locally, and the host name for $URL_site is taken from a hosts file and not from DNS. \begin_inset LatexCommand \index{DNS} \end_inset One way to get around this is to change all calls to setcookie() listed in \begin_inset LatexCommand \ref{tab-Help-Center-Live-setcookie} \end_inset and take out the last two parameters, $URL_site and $URL_secure, as in the following example: \layout Code setcookie("Help Center LiveUser", $INFO_username, $time, $URL_dir); \layout Standard After the installation of Help Center Live, you can point your browser the the address you entered for $URL_maindir (http://midas/helpcenter, in our example) and, after a successful login, \begin_inset LatexCommand \index{login} \end_inset you will be presented with the main screen ( \begin_inset LatexCommand \ref{fig-help-center-live-main} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-main.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-main} \end_inset Help Center Live: Main screen. \end_inset \layout Standard Now, create a PHP-Nuke block that uses the method of our Hello World example in \begin_inset LatexCommand \ref{create-hello-world-block} \end_inset to incorporate Help Center Live's functionality: \begin_inset LatexCommand \index{functionality} \end_inset \layout Code "; \layout Code \layout Code ?> \layout Standard We named the block above "block-Online_Support" \begin_inset LatexCommand \index{block-Online_Support} \end_inset , but of course you can use whatever title you like, as long as it is passed as the "needle" string to the eregi() function of the block. \begin_inset LatexCommand \index{block} \end_inset The main code consists of only one line, which inserts a Javascript code, whose source file is the lh/live.php PHP script of Help Center Live. We did the same in \begin_inset LatexCommand \ref{create-hello-world-block} \end_inset to output a Hello World message, but now, this simple line opens a whole world of possibilities for our PHP-Nuke page! Let's see what happens when we activate the Online Support block we just created: \layout Standard As long as all Help Center operators are logged off, the block will display a \begin_inset Quotes eld \end_inset Live Support is Offline \begin_inset Quotes erd \end_inset message, as in \begin_inset LatexCommand \ref{fig-help-center-live-block-offline} \end_inset . \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-offline.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-offline} \end_inset Help Center Live block: Live Support is Offline. \end_inset \layout Standard In this case, \begin_inset LatexCommand \index{case} \end_inset a click on the arrow in the block's inside will open a window that gives the customer the possibility to enter a trouble ticket ( \begin_inset LatexCommand \ref{fig-help-center-live-block-trouble-ticket} \end_inset ). The window also offers a link to the FAQ and offers the choice to refer to an existing trouble ticket or create a new one. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-trouble-ticket.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-trouble-ticket} \end_inset Help Center Live block: Creating a trouble ticket. \end_inset \layout Standard On the other side, if some support operator is online \emph on and has launched the request monitor \begin_inset LatexCommand \index{monitor} \end_inset \emph default (which opens a window for the operator, \begin_inset LatexCommand \index{operator} \end_inset displaying the live connections he is currently maintaining), the block will display it with a \begin_inset Quotes eld \end_inset Live Support is Online! \begin_inset Quotes erd \end_inset message ( \begin_inset LatexCommand \ref{fig-help-center-live-block-online} \end_inset ). \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-online.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-online} \end_inset Help Center Live block: Live Support is Online. \end_inset \layout Standard The request monitor, \begin_inset LatexCommand \index{monitor} \end_inset on the operator's side, will display all hosts that are currently viewing the PHP-Nuke page with the Online Support block showing the \begin_inset Quotes eld \end_inset Live Support is Online! \begin_inset Quotes erd \end_inset message ( \begin_inset LatexCommand \ref{fig-help-center-live-block-request-monitor} \end_inset ). In other words, \begin_inset LatexCommand \index{words} \end_inset both users and operators are informed of each other's online presence. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-request-monitor.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-request-monitor} \end_inset Help Center Live block: Request monitor for the operator. \end_inset \layout Standard Now - and this adds a tremendous value to that tiny block we just created - each side can initiate an online chat with the other part: \layout Standard The operator can click on the \begin_inset Quotes eld \end_inset Initiate \begin_inset Quotes erd \end_inset link and, after selecting the aproppriate department, initiate a chat with the selected user. The user will get pop-up window, notifying him of the operator's wish for a chat ( \begin_inset LatexCommand \ref{fig-help-center-live-block-user-notify} \end_inset ). The user can then decide whether to accept or decline the chat request. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-user-notify.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-user-notify} \end_inset Help Center Live block: User notification of the operator's chat request. \end_inset \layout Standard On the user's side, everybody can click on the arrow besides the \begin_inset Quotes eld \end_inset Online! \begin_inset Quotes erd \end_inset message in the Online Support block. \begin_inset LatexCommand \index{block} \end_inset This will initiate a chat request on behalf of the user ( \begin_inset LatexCommand \ref{fig-help-center-live-block-user-request} \end_inset ). The operator will get a pop-up window notifying him of the user's request, which he can accept or decline as well. \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename help-center-live-block-user-request.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-help-center-live-block-user-request} \end_inset Help Center Live block: User chat request. \end_inset \layout Standard Either way, initiating from the operator's or user's side, a chat session \begin_inset LatexCommand \index{session} \end_inset starts between the two, hopefully leading to the solution of the user's problem. A transcript of the chat can be sent to an e-mail address of the participant's choice for future reference. \layout Standard This completes our brief review of Help Center Live's features. \begin_inset LatexCommand \index{features} \end_inset If you have a look at the code of the Online Support block above and the code of the Hello World block in \begin_inset LatexCommand \ref{create-hello-world-block} \end_inset , you will see that they both use the same method to incorporate functionality \begin_inset LatexCommand \index{functionality} \end_inset in a PHP-Nuke block through Javascript. \begin_inset LatexCommand \index{Javascript} \end_inset The method is the same, but what a huge difference in functionality! There, a simple \begin_inset Quotes eld \end_inset Hello World \begin_inset Quotes erd \end_inset output - here, a full-featured Help Center! This demonstrates the broad spectrum of possibilities that a simple line like \layout Code $content.="
"; \layout Standard can offer, when used intelligently in a PHP-Nuke block with Javascript. \begin_inset LatexCommand \index{Javascript} \end_inset \layout SGML \layout SGML \layout SGML Help Center Live is looking for a sponsor! \layout SGML \layout SGML \layout SGML HCL is getting well over a million hits per month and its on a huge increase keeping in mind that Fantastico now has HCL as a featured script for install. Mike, the developer of HCL, offers it under the GPL - however, he is looking for sponsor to help him continue its development for free and cope with the ever-increasing hosting fees and other expenses. Please contact Mike, if you are interested and serious about sponsoring HCL. \layout SGML \layout SGML \layout Section How to display Flash in PHP-Nuke blocks \begin_inset LatexCommand \label{flash-php-nuke-blocks} \end_inset \layout Standard To show Flash in a PHP-Nuke block, \begin_inset LatexCommand \index{block} \end_inset you simply have to include the appropriate HTML code in the $content variable. Since the HTML code is something like \layout Code \layout Code \layout Code \layout Code \layout Code \layout Standard the PHP-Nuke block code should be something like \layout Code $content = " " \layout Code ." " \layout Code ." " \layout Code ."" \layout Code .""; \layout Standard See \begin_inset LatexCommand \ref{PHP-Nuke-header-display-flash-object} \end_inset on how to display Flash in the PHP-Nuke header, like a banner. \begin_inset LatexCommand \index{banner} \end_inset \layout Section How to show advertisements in PHP-Nuke blocks \begin_inset LatexCommand \label{advertisements-in-php-nuke-blocks} \end_inset \layout Standard Advertisements are a popular source of revenue for webmasters. It doesn't take long until the young webmaster feels attracted to the sirene call of affiliate programs, banners or context relevant advertising. \layout Standard Advertisements are often created through the use of a Javascript function, \begin_inset LatexCommand \index{function} \end_inset called at the right place in the HTML code. We have already treated the subject of Javascript in PHP-Nuke blocks (see \begin_inset LatexCommand \ref{javascript-in-php-nuke-blocks} \end_inset ) and modules (see \begin_inset LatexCommand \ref{javascript-in-php-nuke-modules} \end_inset ) and seen that Javascript does not pose any special problems with PHP-Nuke. However, due to the increasing popularity of Google's \begin_inset LatexCommand \url[AdSense]{https://www.google.com/adsense/overview} \end_inset program, there has been an increasing demand for ready-to-use solutions in the PHP-Nuke field. The following code examples should be seen as representative examples of how such advertising functionality can be incorporated in PHP-Nuke blocks. You can use them as starting point for \begin_inset LatexCommand \url[similar advertising solutions]{http://www.content.overture.com/d/USm/ps/cm.jhtml} \end_inset , as offered by today's modern search engines or affiliate programs. \layout SGML \layout SGML \layout SGML Ready-to-use Google AdSense Block \layout SGML \layout SGML \layout SGML If you don't feel like writing your own Google AdSense block, just use a ready-made one! Go to \begin_inset LatexCommand \url[http://home.vie4life.com/downloads-cat-13.html]{http://home.vie4life.com/downloads-cat-13.html} \end_inset and download a ready-to-use AdSense block. \layout SGML \layout SGML \layout Standard Create a block called block-AdSense. \begin_inset LatexCommand \index{AdSense} \end_inset php and add the following in the file: \layout Code \layout Code \layout Code \layout Code \layout Code "; \layout Code \layout Code ?> \layout SGML \layout SGML \layout SGML Don't forget: \layout SGML \layout SGML \layout SGML Add your Google client number in the script. \layout SGML \layout SGML \layout Standard Activate the AdSense block in your administration panel (see \begin_inset LatexCommand \ref{admin-management} \end_inset ) by clicking on the \begin_inset Quotes eld \end_inset Blocks \begin_inset LatexCommand \index{Blocks} \end_inset \begin_inset Quotes erd \end_inset links and choosing it from the blocks list as a new block. \begin_inset LatexCommand \index{block} \end_inset \layout Section How to display images in PHP-Nuke blocks \begin_inset LatexCommand \label{display-images-php-nuke-blocks} \end_inset \layout Standard Blocks offer a quick way to incorporate content in PHP-Nuke. They are happily used to display images, \begin_inset LatexCommand \index{images} \end_inset since they can be placed anywhere in the three layout columns - and their position can be comfortably changed from the administration panel. \begin_inset LatexCommand \index{panel} \end_inset A very common use of blocks in PHP-Nuke is to display \emph on dynamic \begin_inset LatexCommand \index{dynamic} \end_inset \emph default images, \begin_inset LatexCommand \index{images} \end_inset i.e. images that change depending on some parameter of dynamic nature, \begin_inset LatexCommand \index{nature} \end_inset most offen time: a daily quote, a daily weather forecast or a daily comic. \begin_inset LatexCommand \index{comic} \end_inset \layout Standard Most of the time you will not be the original author of the quote, forecast \begin_inset LatexCommand \index{forecast} \end_inset or comic. \begin_inset LatexCommand \index{comic} \end_inset You will want to fetch this content from some popular source on the Internet. \begin_inset LatexCommand \index{Internet} \end_inset \layout SGML \layout SGML \layout SGML Before you proceed: think on copyright! \layout SGML \layout SGML \layout SGML We will describe the tecnology that allows you to use somebody else's work to make your site more beautiful, attractive or informative. This almost certainly touches that person's copyright. Please take the time to read the admonition on copyright in \begin_inset LatexCommand \ref{PHP-Nuke-comic-block} \end_inset ! \layout SGML \layout SGML \layout Standard PHP enables you to read a remote URL, \begin_inset LatexCommand \index{URL} \end_inset store its whole content in one (!) variable, then search the contents of the variable for any regular expression (for regular expressions, see \begin_inset LatexCommand \ref{regular-expressions} \end_inset ). We will use this technique to find out the filename of the \begin_inset LatexCommand \url[User Friendly]{http://www.userfriendly.org} \end_inset daily comic strip, \begin_inset LatexCommand \index{strip} \end_inset in order to display it in a PHP-Nuke block. This \begin_inset LatexCommand \url[UserFriendly block]{http://www.karakas-online.de/phpnuke/block-User_Friendly.tar} \end_inset reads the \begin_inset LatexCommand \url[User Friendly daily cartoon page]{http://www.userfriendly.org/static/} \end_inset line by line, searches for the pattern \begin_inset LatexCommand \index{pattern} \end_inset \layout Code whateverLatest Stripwhatever \layout Standard extracts the location of the image file (imagefile) from it and displays it in the block. \begin_inset LatexCommand \index{block} \end_inset The \begin_inset LatexCommand \url[PHP code of the User Friendly block ]{http://www.karakas-online.de/myServices/showfile.php?highlight=userfriendly} \end_inset is a classic example of how you can do this \begin_inset Quotes eld \end_inset scrapping \begin_inset LatexCommand \index{scrapping} \end_inset \begin_inset Quotes erd \end_inset in PHP (-Nuke): \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ufurl: $ufurl
";]]> \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML could not be opened
";]]> \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML .*", $line, $out)) {]]> \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ";]]> \layout SGML \layout SGML \backslash";]]> \layout SGML \layout SGML ]]> \layout SGML
\layout SGML \layout SGML \layout SGML \layout SGML This is the standard check at the start of every PHP-Nuke block: if the name of the script, as it was called by the user, contains the full name of the block, then the user must have called the block directly. In this case we redirect him to the home page. As with modules, a direct call of a block not only will not work, it will also bypass all security measures of PHP-Nuke (see for example \begin_inset LatexCommand \ref{security-audit} \end_inset ). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The URL of the remote page containing the dynamic image. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML Initialization of the image filename. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML We open the remote page for reading ("r"). This operation returns a "file handle", a unique identifier for the opened file, which is stored in $textfile. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML If the opening operation failed, we output an error message in the content variable of the block and quit. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML If the opening operation succeeded, we start reading the content of the remote page in a loop, line-by-line, until the end-of-file (eof) character is encountered. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML We only read 1500 characters at a time. This is more than enough for our purposes. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This is where all the magic takes place! We search the line we just read for occurences of a regular expression. The expression itself means \layout SGML \layout SGML whatever<IMG ALT="Latest Strip"whateverSRC="imagefile">whatever \layout SGML \layout SGML \layout SGML where "whatever" may be any content, including space. The regular expression contains a subexpression in the place of the image filename. This results in the file name being stored in the $out array, as its first element. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML We copy the first element the $out array to the $imagefile variable. By construction of the regular expression above, $imagefile now contains the image filename of the daily comic strip. We only have to display it! \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML We echo an image anchor using as source the filename we just "scrapped" from our source page. This displays the daily comic strip without fetching the image to our web server (hot linking!). \layout SGML \layout SGML \layout SGML \layout Standard A similar technique is used in news aggregators, \begin_inset LatexCommand \index{aggregators} \end_inset like the MyHeadlines module (see \begin_inset LatexCommand \ref{PHP-Nuke-My-Headlines-module} \end_inset ), that \begin_inset Quotes eld \end_inset scrap \begin_inset Quotes erd \end_inset news sources for pieces of dynamic information that are not otherwise available (i.e. not available as RSS/RDF news feeds), see \begin_inset LatexCommand \url[Template Based Scraping]{http://jmagar.com/modules/MyHeadlines/MyHeadlines/docs/headline_scraper.htm} \end_inset . For each source page, a regular expression is stored in a table. Its subexpressions will automatically store the dynamic information pieces that are of interest to us in the elements of some $out array. We would then only have to display those elements for each source. \layout SGML \layout SGML \layout SGML Quod medicina aliis, aliis est acre venenum \begin_inset Foot collapsed false \layout Standard One person's medicine is another's foul poison. \end_inset \layout SGML \layout SGML \layout SGML If you are an artist whose images are being hot-linked with the above methods without your permission, you are certainly not excited. But don't despair! You can defend your work with a simple technique that requires only the Apache mod_rewrite module and a few lines in your .htaccess file. See \begin_inset LatexCommand \ref{make-PHP-Nuke-hot-link-stealth} \end_inset . \layout SGML \layout SGML \layout Subsection How to display random images in PHP-Nuke blocks \begin_inset LatexCommand \label{display-random-images-php-nuke-blocks} \end_inset \layout Standard We now move to a more advanced example of a PHP-Nuke block: \begin_inset LatexCommand \index{block} \end_inset a block that displays random images. \begin_inset LatexCommand \index{images} \end_inset Suppose you have a collection of images in a directory of your webserver \begin_inset LatexCommand \index{server} \end_inset and would like to display a random image each time in a PHP-Nuke block. \begin_inset LatexCommand \index{block} \end_inset Using PHP-Nuke's own positioning capabilities for blocks (in the administration \begin_inset LatexCommand \index{administration} \end_inset panel, \begin_inset LatexCommand \index{panel} \end_inset from the \begin_inset Quotes eld \end_inset Blocks \begin_inset LatexCommand \index{Blocks} \end_inset \begin_inset Quotes erd \end_inset link, see \begin_inset LatexCommand \ref{administration-functions} \end_inset ), you can achieve an almost arbitrary positioning of random images in your page - a functionality that could be used to display whatever visual content you like, ranging from a \begin_inset Quotes eld \end_inset daily babe \begin_inset LatexCommand \index{babe} \end_inset \begin_inset Quotes erd \end_inset to a random skyscraper banner. \begin_inset LatexCommand \index{banner} \end_inset \layout Standard To create a random image block for PHP-Nuke, proceed as follows (see \begin_inset LatexCommand \url[Random Picture Block]{http://www.nukeforums.com/forums/viewtopic.php?t=12256} \end_inset ): \layout Standard Make a script called block-RandomPics.php and put it in the blocks folder. The code for block-RandomPics.php is: \layout Code read()) { \layout Code if (eregi("gif", $file) || eregi("jpg", $file)) { \layout Code $imglist .= "$file "; \layout Code } \layout Code } \layout Code \layout Code closedir($imgs->handle); \layout Code $imglist = explode(" ", $imglist); \layout Code $a = sizeof($imglist)-2; \layout Code $random = mt_rand(0, $a); \layout Code $image = $imglist[$random]; \layout Code $asin = explode(".", $image); \layout Code \layout Code $content = ""; \layout Code $content .= "
"; \layout Code $content .= "\backslash

"; \layout Code $content .= "Click for full picture.

"; \layout Code \layout Code ?> \layout Standard The block-RandomPics.php block reads all .gif's and .jpg's from the $whereimgs directory into an array ($imglist), computes a random index between 0 and the maximum array index ($a) and uses the random index to select an image name from the array. It then writes some HTML code to display a thumbnail of 120 pixels width with a ling to the original picture. The link itself passes the show parameters on the URL as the concatenation \begin_inset LatexCommand \index{concatenation} \end_inset of the $whereimgs directory and the random image name ($image) to a script we still have to write, PicShow.php. \begin_inset LatexCommand \index{PicShow.php} \end_inset \layout SGML \layout SGML \layout SGML The right images path \layout SGML \layout SGML \layout SGML Taking into account that block-RandomPics.php has to be located in the blocks folder, then, if your images folder is the folder \begin_inset Quotes eld \end_inset pictures \begin_inset Quotes erd \end_inset under the \begin_inset Quotes eld \end_inset PHP-Nuke root \begin_inset Quotes erd \end_inset directory (i.e. under the same directory where mainfile.php, index.php, config.php etc. are located), then you have to prepend a \begin_inset Quotes eld \end_inset ../ \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset pictures \begin_inset Quotes erd \end_inset , as we did in the code, assuming that you don't want to give an absolute, fully qualified URL there. \layout SGML \layout SGML \layout Standard For PicShow.php, \begin_inset LatexCommand \index{PicShow.php} \end_inset which is the script that will show the full image, we have to write code that behaves just like a standard PHP-Nuke module (but without any administrati on functions), so you can see it as an example of a minimal module: \begin_inset LatexCommand \index{module} \end_inset \layout Code

Go back!

\layout Code

\layout Code "; \layout Code \layout Code closetable(); \layout Code include("footer.php"); \layout Code \layout Code ?> \layout Section How to display HTML forms in a block: Paypal \begin_inset LatexCommand \label{paypal-block-for-php-nuke} \end_inset \layout Standard A lot of sites have a block, \begin_inset LatexCommand \index{block} \end_inset asking for donations through \begin_inset LatexCommand \url[PayPal]{https://www.paypal.com} \end_inset . It is easy to construct your own, all you need is get an account from PayPal, \begin_inset LatexCommand \index{PayPal} \end_inset then construct an HTML form that contains your data, \begin_inset LatexCommand \index{data} \end_inset for example: \layout Code Help keep our web site online with a donation! \layout Code
\layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code \layout Code
\layout Standard The meaning of the form fields is the following: \layout Description cmd: Must be set to "_xclick" (required). \layout Description business: \begin_inset LatexCommand \index{business} \end_inset This is your PayPal ID, or email address, where payments will be sent. This email address must be confirmed and linked to your Verified Business or Premier account. (required). \layout Description item_name: \begin_inset LatexCommand \index{item_name} \end_inset Description of donation (maximum 127 characters). If omitted, donor will see a field in which they have the option of entering an Item Name (optional). \layout Description amount: The price or amount of the purchase, not including shipping, handling, or tax. \begin_inset LatexCommand \index{tax} \end_inset If omitted, this value will be editable by the buyer at the time of purchase (optional). \layout Description no_note: Including a note with payment. \begin_inset LatexCommand \index{payment} \end_inset If set to 1, your customer will not be prompted to include a note. If omitted or set to 0, your customer will be prompted to include a note (optional). \layout Description currency_code: The currency of the payment. \begin_inset LatexCommand \index{payment} \end_inset Defines the currency in which the monetary variables (amount, shipping, shipping2, handling, tax) are denoted. Possible values are USD (U.S. \begin_inset LatexCommand \index{U.S.} \end_inset Dollar), EUR (Euro), GBP (Pound Sterling), CAD (Canadian Dollar), JPY (Yen). If omitted, all monetary fields will be interpreted as U.S. \begin_inset LatexCommand \index{U.S.} \end_inset Dollars (optional). \layout Description tax: \begin_inset LatexCommand \index{tax} \end_inset Transaction-based tax override variable. Set to a flat tax amount you would like to apply to the transaction regardless of the buyer s location. If present, this value overrides any tax settings that may be set in the seller s Profile. If omitted, Profile tax settings (if any) will apply (optional). \layout SGML \layout SGML \layout SGML PayPal hyperlink variables \layout SGML \layout SGML \layout SGML There are many more hyperlink variables that you can use in your PayPal block, covering all aspects of a donation transaction. You should consult the \begin_inset LatexCommand \url[PayPal Donations Manual]{https://www.paypal.com/en_US/pdf/donations.pdf} \end_inset , to learn about all the possibilities! \layout SGML \layout SGML \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename paypal1.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-paypal1} \end_inset PayPal donation button \end_inset \layout Standard Pasting the code above into your website would generate a button that looks like \begin_inset LatexCommand \ref{fig-paypal1} \end_inset . To create a block out of this HTML Form, all we have to do is add the obligator y check for the block name, transform all lines to strings and append them to the $content variable, taking care to escape all double quotes between the string quotes: \begin_inset LatexCommand \index{quotes} \end_inset \layout Code "; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "cmd \backslash " value= \backslash "_xclick \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "business \backslash " value= \backslash "My email \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "item_name \backslash " value= \backslash "My Homepage \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "amount \backslash " value= \backslash "10.00 \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "no_note \backslash " value= \backslash "1 \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "currency_code \backslash " value= \backslash "USD \backslash ">"; \layout Code $content .= "input type= \backslash "hidden \backslash " name= \backslash "tax \backslash " value= \backslash "0 \backslash ">"; \layout Code $content .= "input type= \backslash "image \backslash " src= \backslash "https://www.paypal.com/images/x-click-but04.gif \backslash " \layout Code border= \backslash "0 \backslash " name= \backslash "submit \backslash " \layout Code alt= \backslash "Make payments with PayPal - it"s fast, free and secure! \backslash ">"; \layout Code $content .= "/form>"; \layout Code \layout Code ?> \layout Code \layout Standard Put the above code in a file called block-Donations. \begin_inset LatexCommand \index{ations} \end_inset php in the blocks folder. Then, just activate and position the block from the blocks management link in the administration panel. \begin_inset LatexCommand \index{panel} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename paypal2.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-paypal2} \end_inset PayPal donation block. \end_inset \layout Standard Depending on your theme, \begin_inset LatexCommand \index{theme} \end_inset the block will look as in \begin_inset LatexCommand \ref{fig-paypal2} \end_inset . You can experiment with various button images from the PayPal site. For more information on donations with PayPal, \begin_inset LatexCommand \index{PayPal} \end_inset see the \begin_inset LatexCommand \url[PayPal Donations Manual]{https://www.paypal.com/en_US/pdf/donations.pdf} \end_inset . \layout Chapter Creating modules \begin_inset LatexCommand \label{creating-modules} \end_inset \layout Standard After having seen how to modify PHP-Nuke modules, \begin_inset LatexCommand \index{modules} \end_inset we are in a position to try our skills at creating one - in this chapter we will show you how! We cover: \layout Itemize Module structure ( \begin_inset LatexCommand \ref{module-structure} \end_inset ), \layout Itemize The rules to follow ( \begin_inset LatexCommand \ref{module-rules} \end_inset ), \layout Itemize Module creation, the public part ( \begin_inset LatexCommand \ref{module-public} \end_inset ), \layout Itemize Module creation, administrator part ( \begin_inset LatexCommand \ref{module-admin} \end_inset ), \layout Itemize How to include a HTML file in a PHP-Nuke module ( \begin_inset LatexCommand \ref{include-HTML-file-in-module} \end_inset ), \layout Itemize How to include a HTML file and its links in a PHP-Nuke module ( \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module} \end_inset ), \layout Itemize How to include a HTML file and its links using an iframe in a PHP-Nuke module \begin_inset LatexCommand \index{module} \end_inset ( \begin_inset LatexCommand \ref{include-HTML-file-and-links-in-module-iframe} \end_inset ), \layout Itemize How to include a plain text file in a PHP-Nuke module ( \begin_inset LatexCommand \ref{include-plain-text-file-in-module} \end_inset ), \layout Itemize How to use Javascript in PHP-Nuke modules ( \begin_inset LatexCommand \ref{javascript-in-php-nuke-modules} \end_inset ), \layout Itemize How to create a Logout module ( \begin_inset LatexCommand \ref{create-logout-module} \end_inset ), \layout Itemize How to show advertisements in PHP-Nuke modules ( \begin_inset LatexCommand \ref{advertisements-in-php-nuke-modules} \end_inset ), \layout Itemize How to display HTML forms in a module ( \begin_inset LatexCommand \ref{HTML-forms-in-module} \end_inset ). \layout Section Module structure \begin_inset LatexCommand \label{module-structure} \end_inset \layout Standard The PHP-Nuke modules are PHP-written applications that manage the central part of the site. For example, the \begin_inset Quotes eld \end_inset News \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Forum \begin_inset LatexCommand \index{Forum} \end_inset \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset Members List \begin_inset Quotes erd \end_inset etc. are all modules. \begin_inset LatexCommand \index{modules} \end_inset Each module, based on it's complexity, \begin_inset LatexCommand \index{complexity} \end_inset is structured using one part for the user's and another for the administrator, \begin_inset LatexCommand \index{administrator} \end_inset in this case there are some contents we have to modify. It's all managed from the modules. \begin_inset LatexCommand \index{modules} \end_inset php file which alone, carries out the job of authentication and management of the access rights on that module. \begin_inset LatexCommand \index{module} \end_inset The modules. \begin_inset LatexCommand \index{modules} \end_inset php file checks and verifies if the module was activated or not, and verifies the access rights. This saves us a lot of work because we don't have to insert these controls in every module we create. \layout Standard We refer you to what is written in \begin_inset LatexCommand \ref{module-management} \end_inset to be more exhaustive. \layout Standard For example in the avantgo module, in order to load the index. \begin_inset LatexCommand \index{index} \end_inset php file, it's enough to pass the module name to the parameter string, the file that will be searched for is index.php. \begin_inset LatexCommand \index{index.php} \end_inset \layout Code modules.php?name=AvantGo \layout Standard If instead we wanted to call a page different from the default index.php \begin_inset LatexCommand \index{index.php} \end_inset (say, print.php), the string we will have to pass is : \layout Code modules.php?name=AvantGo & file=print \layout Standard That is the file variable with a value (print) that corresponds to the name of the file we want to load without the .php extension. \layout Standard Inside of the folder modules/nameofmodule there is also a subfolder called "language". In this fashion we manage in a simple and immediate way the multilanguage \begin_inset LatexCommand \index{multilanguage} \end_inset functionality inside the modules. \begin_inset LatexCommand \index{modules} \end_inset \layout Standard The rows modules. \begin_inset LatexCommand \index{modules} \end_inset php work in this way: \layout Itemize It includes the mainfile.php \begin_inset LatexCommand \index{mainfile.php} \end_inset \layout Itemize Verifies if the module is active \layout Itemize Verifies whether the string passes a file name different from index.php \begin_inset LatexCommand \index{index.php} \end_inset \layout Itemize Verifies the permissions of the module (whether everybody can see it, or only registered users, or only the administrator). \layout Section Creating fully compatible modules: the rules to follow \begin_inset LatexCommand \label{module-rules} \end_inset \layout Standard For people who have a base knowledge of the PHP language it is very simple to construct a module. \begin_inset LatexCommand \index{module} \end_inset Generally to create a PHP-Nuke module means: \layout Itemize To create PHP files for the users, ie the public part of the site \layout Itemize To create an administrator interface \layout Itemize To verify that everything we have created is in keeping with the PHP-Nuke development rules. \begin_inset LatexCommand \index{rules} \end_inset \layout Standard But what about the development rules? \begin_inset LatexCommand \index{rules} \end_inset \layout Standard It is a good idea to stop on this point before continuing on to the programming part. \layout Enumerate Rule: \begin_inset LatexCommand \index{Rule} \end_inset the modules must be included in the folder modules/namemodule in the public part and the folder admin/modules in the administration part \layout Enumerate Rule: \begin_inset LatexCommand \index{Rule} \end_inset the main file of the module included in modules/nameofmodule must be called index.php \begin_inset LatexCommand \index{index.php} \end_inset \layout Enumerate Rule: the tables in the php syntax are indicated by prefix. \begin_inset LatexCommand \index{prefix} \end_inset For example Nuke pages will be indicated with "$prefix."_pages, where $prefix \begin_inset LatexCommand \index{prefix} \end_inset takes the value from the config. \begin_inset LatexCommand \index{config} \end_inset php file which is nuke by default. \layout Enumerate Rule: \begin_inset LatexCommand \index{Rule} \end_inset the location of the images or links must start from the root of your html directory and not from the folder modules/nameofmodule because the files contained in it are included in a file placed in html's root directory that's called modules. \begin_inset LatexCommand \index{modules} \end_inset php \layout Enumerate Rule: \begin_inset LatexCommand \index{Rule} \end_inset to manage the multilanguage function in an optimal way we have to create some text abstractions that we will insert in the files by making a folder called \begin_inset Quotes eld \end_inset language \begin_inset Quotes erd \end_inset inside the folder of the module. \begin_inset LatexCommand \index{module} \end_inset Everything will then be automatically recalled. For example, if we need to create a module that we call Topolino (the Italian \begin_inset LatexCommand \index{Italian} \end_inset name of Mickey Mouse) we must give the possibility to those who use the Italian interface to read "Topolino" \begin_inset LatexCommand \index{Topolino} \end_inset and to those who use the English one to read "Mickey Mouse" ; -). \layout Standard How do we do it? \layout Standard First of all we create the folder \begin_inset Quotes eld \end_inset language \begin_inset Quotes erd \end_inset inside the folder modules/topolino We insert in this folder two php files that we will call lang-italian.php and lang-english.php We create an abstraction \begin_inset LatexCommand \index{abstraction} \end_inset for topolino, \begin_inset LatexCommand \index{topolino} \end_inset in the lang-italian.php it will be: \layout Code define("_TOPO", "Topolino"); \layout Standard And in English it will be: \layout Code define("_TOPO", "Mickey Mouse"); \layout Standard In this way inserting in the module the abstraction "_TOPO" this will be automatically replaced by Topolino in the Italian interface and by Mickey \begin_inset LatexCommand \index{key} \end_inset Mouse in the English interface. \begin_inset LatexCommand \index{interface} \end_inset \layout Section Module creation, the public part \begin_inset LatexCommand \label{module-public} \end_inset \layout Standard We continue using the example of Topolino from \begin_inset LatexCommand \ref{module-rules} \end_inset and create a very simple module that displays a GIF of Topolino with a list of 3 predefined names that are editable by the users. This is a nonsense module but it's simple enough to be understood by everybody. The DB we will use is MySQL, \begin_inset LatexCommand \index{MySQL} \end_inset but the example, by changing some detail, works with all DB's. First of all let's see the skeleton of every module that we will construct: \layout Code \layout SGML \layout SGML \layout SGML Before making anything it's necessary to create a folder called "modules/Topolin o", the file we have just created (with the other contents) must be called index.php and must stay in that folder. \layout SGML \layout SGML \layout Standard We create a table in the database called nuke_topolino that is structured in this way: \layout Itemize idperson: \begin_inset LatexCommand \index{idperson} \end_inset It is a cell that contains the id of person (int 11, primary) \layout Itemize nameperson: It is a cell that contains the names of the people (varchar 60) \layout Standard And we manually insert (by using PHPMyAdmin - see \begin_inset LatexCommand \ref{phpmyadmin2} \end_inset - or an equivalent interface) the names of the 3 people we are interested in, see \begin_inset LatexCommand \ref{fig-inserting-values} \end_inset (the module, for simplicity reasons doesn't allow you to add or to cancel \begin_inset LatexCommand \index{cancel} \end_inset people but only editing those that already exist). \layout Itemize Id 1: Topolino \begin_inset LatexCommand \index{Topolino} \end_inset \layout Itemize Id 2: Minnie \begin_inset LatexCommand \index{Minnie} \end_inset \layout Itemize Id 3: Pluto \begin_inset LatexCommand \index{Pluto} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename snapshot16.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-inserting-values} \end_inset PHPMyAdmin: inserting values \end_inset \layout SGML \layout SGML \layout SGML It's possible to include the footer at the end of every function. It's a solution that is a bit more complex because we must write more lines, but I have to stress how much alot of modules use it. \layout SGML \layout SGML \layout Standard Once that the table of the DB is ready we can begin to enjoy creating the code that will give us back our output. Our output will be one simple query with a cycle that will give back the values inserted in the database (the simplest thing in the world, Gosh!). \layout SGML \layout SGML \layout SGML Attention! \layout SGML \layout SGML \layout SGML To maintain the abstraction of the DB so that it can work on various database's in an independent way, we cannot use classic PHP syntax that is generally used by the MySQL addicted ; -), instead we must use the syntax illustrated in the file include/sql_layer.php \layout SGML \layout SGML \layout Standard The query that we will compile will be structured in the following way: \layout Code $resultpersons = sql_query("SELECT idperson, nameperson FROM "$prefix."_topolino" , $dbi); \layout Code \layout Code for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++){ \layout Code list($idperson, $nameperson) = sql_fetch_row($resultpersons, $dbi); \layout Code echo "$idperson - $nameperson < br >"; \layout Code } \layout Standard Very simple, isn't it? OK!, before passing to the administrator's interface \begin_inset LatexCommand \index{interface} \end_inset for this module, \begin_inset LatexCommand \index{module} \end_inset we will start to modify it with the intention of giving it a minimum style dignity. \layout Standard I would propose: \layout Itemize to insert the results in a table \layout Itemize to put a title to it and a description for the module. \begin_inset LatexCommand \index{module} \end_inset \layout Standard We can do this by rendering all of the module's compatible with the multilanguag e system of PHP-Nuke: We define the abstractions that will compose the two phrases we need, in the file lang-english.php we have to insert: \begin_inset LatexCommand \index{insert} \end_inset \layout Code \layout Standard Remember to insert a file called index. \begin_inset LatexCommand \index{index} \end_inset htm in our language folder! We need it to protect the inside of that folder from undesired navigations. \begin_inset LatexCommand \index{navigations} \end_inset We are nearly at the end of the frontend part, now we have to insert the stylistic part in the code that we have created and to assemble everything. We take two code pieces previously constructed (The initial one and the one created by us) and we join the stylistic modification: \layout Code "; \layout Code echo""._BENVETOPOMOD.""; \layout Code echo "

"; \layout Code \layout Code opentable(); \layout Code echo "
"; \layout Code echo""._DESCRITOPOMOD.""; \layout Code echo "

"; \layout Code $resultpersons = sql_query("SELECT idperson, nameperson \layout Code FROM ".$prefix."_topolino", $dbi); \layout Code for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++) { \layout Code list($idperson, $nameperson) = sql_fetch_row($resultpersons, $dbi); \layout Code echo "$idperson - $nameperson
"; \layout Code } \layout Code closetable(); \layout Code \layout Code include("footer.php"); \layout Code \layout Code ?> \layout Standard We have only added text, some breaks for the headers and an \begin_inset Quotes eld \end_inset Opentable(); \begin_inset Quotes erd \end_inset and a \begin_inset Quotes eld \end_inset Closetable(); \begin_inset Quotes erd \end_inset to include the text. The result can be seen in \begin_inset LatexCommand \ref{fig-example-module} \end_inset \layout Standard \begin_inset Float figure placement htbp wide false collapsed false \layout Caption \begin_inset Graphics FormatVersion 1 filename snapshot17.eps display default size_type 0 rotateOrigin center lyxsize_type 0 \end_inset \begin_inset LatexCommand \label{fig-example-module} \end_inset Example module. \end_inset \layout Section Module creation, administrator part \begin_inset LatexCommand \label{module-admin} \end_inset \layout Standard It's time to create the administration part of the module. \begin_inset LatexCommand \index{module} \end_inset In this very simple module the only function that will work on the DB will be the one in which we can modify the text of one of the three languages that we have created. First of all, we have to create the files to insert in the folders: \layout Itemize admin/case \begin_inset LatexCommand \index{admin/case} \end_inset \layout Itemize admin/links \begin_inset LatexCommand \index{admin/links} \end_inset \layout Itemize admin/modules \layout Standard It's important to remember how much we have just said in \begin_inset LatexCommand \ref{directory-structure} \end_inset : \layout Description Admin: \begin_inset LatexCommand \index{Admin} \end_inset contains 4 subdirectories (links, language, case, modules) that manage the various administration modules. \begin_inset LatexCommand \index{modules} \end_inset The folder that holds the files is modules/admin/ . \layout Standard The folder \series bold admin/links \begin_inset LatexCommand \index{admin/links} \end_inset \series default instead says that the admin module must recall and position one language in admin for that determined module. \begin_inset LatexCommand \index{module} \end_inset \layout Standard Example (Administration for the FAQ module): \layout Code if (($radminsuper==1) OR ($radminfaq==1)) { \layout Code adminmenu("admin.php?op=FaqAdmin ", "" _FAQ." ", "faq.gif"); \layout Code } \layout Standard This module: \begin_inset LatexCommand \index{module} \end_inset \layout Itemize Verifies the administration rights (This module can be set up so it can be viewed by the superadmin or an admin) \layout Itemize It passes a \begin_inset Quotes eld \end_inset CASE \begin_inset LatexCommand \index{CASE} \end_inset \begin_inset Quotes erd \end_inset (op=FaqAdmin) that indicates to the admin. \begin_inset LatexCommand \index{admin} \end_inset php file (that includes all the admin modules) the module to call, associates a value in order to translate the term \begin_inset Quotes eld \end_inset FAQ \begin_inset LatexCommand \index{FAQ} \end_inset \begin_inset Quotes erd \end_inset and associates an image for the visual administration (faq. \begin_inset LatexCommand \index{faq} \end_inset gif). \layout Standard The folder \series bold admin/case \begin_inset LatexCommand \index{admin/case} \end_inset \series default instead serves to define the module to be used in each specified case . This is important when, using the same admin file, we need to perform more operations using a CASE statement: \begin_inset LatexCommand \index{CASE statement} \end_inset \layout Code case1 = insert \layout Code case2 = cancel \layout Code etc... \layout Standard In fact it says which module to call in order to verify the CASE condition. \begin_inset LatexCommand \index{condition} \end_inset For example, in the FAQ module there are lots of cases, here are the last 2: \layout Code case "FaqAdmin": \layout Code case "FaqCatGo": \layout Code include ("admin/modules/adminfaq.php"); \layout Code break; \layout Standard Both CASE statements call the adminfaq. \begin_inset LatexCommand \index{faq} \end_inset php file, but they are used for different operations. \begin_inset LatexCommand \index{ations} \end_inset The first one calls the file with the default scheme, \begin_inset LatexCommand \index{scheme} \end_inset the second, on the other hand, gives its O:K. to insert a new category. \begin_inset LatexCommand \index{category} \end_inset \layout Standard This happens through a string like \begin_inset Quotes eld \end_inset admin.php? \begin_inset LatexCommand \index{admin.php} \end_inset op=FaqAdmin \begin_inset Quotes erd \end_inset in the first case and \begin_inset Quotes eld \end_inset admin.php? \begin_inset LatexCommand \index{admin.php} \end_inset op=FaqCatGo \begin_inset Quotes erd \end_inset in the second. \layout Standard We will now create, in the following order, the files: \layout Itemize admin/modules/topolino. \begin_inset LatexCommand \index{topolino} \end_inset php \layout Itemize admin/case/case.topolino. \begin_inset LatexCommand \index{topolino} \end_inset php \layout Itemize admin/links/links.topolino. \begin_inset LatexCommand \index{topolino} \end_inset php \layout Standard In order to create the file inside the modules folder (modules/topolino. \begin_inset LatexCommand \index{topolino} \end_inset php) we must have a structure of this type: \layout Itemize Starting part of the file (Similar for all the modules) \layout Itemize Definition of the necessary functions. \layout Itemize Definition of the necessary cases in order to call the various functions for the admin module. \begin_inset LatexCommand \index{module} \end_inset \layout Itemize Final part of the file. \layout Standard The syntax for the starting part of the file is the following: \layout Code Select mouse
"; \layout Code echo "$idperson - $nameperson $tmpLink"; \layout Code } \layout Code closetable(); \layout Code include("footer.php"); \layout Code } \layout Standard The next function to implement is the one that corresponds to the selection of one of the three records: \layout Code function mouseselect() { \layout Code global $admin, $bgcolor2, $prefix, $dbi, $multilingual, $idtopo; \layout Code include ("header.php"); \layout Code GraphicAdmin(); \layout Code \layout Code opentable(); \layout Code echo "idtopo=".$idtopo; \layout Code $querystr = "SELECT idperson, nameperson \layout Code FROM ".$prefix."_topolino where idperson='$idtopo'"; \layout Code $resultpersons = sql_query($querystr, $dbi) \layout Code or die ("Invalid query in mouseselect"); \layout Code for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++){ \layout Code list($idperson, $nameperson) = sql_fetch_row($resultpersons, $dbi); \layout Code echo "
"; \layout Code echo "

"; \layout Code echo " "; \layout Code echo " "; \layout Code echo " "; \layout Code echo "
"; \layout Code } \layout Code closetable(); \layout Code \layout Code include("footer.php"); \layout Code } \layout Standard It is very important to take note of some things: \layout Enumerate The variables that we insert will be the ones to be checked, in fact you can see the variable \begin_inset Quotes eld \end_inset $idtopo \begin_inset Quotes erd \end_inset was inserted between the used variables. \layout Enumerate The value checked in the CASE statements is passed to us through a hidden form field \layout Code (< input type= \backslash "hidden \backslash "name= \backslash "op \backslash "value= \backslash "mousemodify \backslash ">). \layout Standard The last function we consider is the one that corresponds to the update \begin_inset LatexCommand \index{date} \end_inset of the values in the database (Here too we added the two variables that we were interested in ($nameperson, $idperson): \layout Code function mousemodify() { \layout Code global $admin, $bgcolor2, $prefix, $dbi, $multilingaul, \layout Code $idtopo, $nameperson, $idperson; \layout Code include ("header.php"); \layout Code GraphicAdmin(); \layout Code Opentable(); \layout Code sql_query("Update ".$prefix."_topolino set nameperson=' $nameperson' \layout Code where idperson=$idperson", $dbi); \layout Code echo"OK"; \layout Code die(mysql_error()); \layout Code closetable(); \layout Code include("footer.php"); \layout Code } \layout Standard The last two elements to insert are the definitions for the CASE statements \begin_inset LatexCommand \index{statements} \end_inset (that is, which function to call according to the variable passed to the module) and the closing of the file. \layout Standard Definition of the cases: \layout Code if ($radminsuper==1) { \layout Code switch($op) { \layout Code case "": \layout Code mousedisplay(); \layout Code break; \layout Code case "topolino"; \layout Code mousedisplay(); \layout Code break; \layout Code case "mouseselect"; \layout Code mouseselect(); \layout Code break; \layout Code case "mousemodify"; \layout Code mousemodify(); \layout Code break; \layout Code } \layout Code } \layout Code else { \layout Code echo "Access Denied"; \layout Code } \layout Standard The complete modules/topolino. \begin_inset LatexCommand \index{topolino} \end_inset php file is thus (see also \begin_inset LatexCommand \url[Problems with new mods]{http://www.karakas-online.de/forum/viewtopic.php?p=367} \end_inset ): \layout Code Select mouse
"; \layout Code echo "$idperson - $nameperson $tmpLink"; \layout Code } \layout Code closetable(); \layout Code include("footer.php"); \layout Code } \layout Code \layout Code function mouseselect() { \layout Code global $admin, $bgcolor2, $prefix, $dbi, $multilingual, $idtopo; \layout Code include ("header.php"); \layout Code GraphicAdmin(); \layout Code Opentable(); \layout Code echo "idtopo=".$idtopo; \layout Code $querystr = "SELECT idperson, nameperson FROM ".$prefix."_topolino \layout Code where idperson='$idtopo'"; \layout Code $resultpersons = sql_query($querystr, $dbi) \layout Code or die ("Invalid query in mouseselect"); \layout Code for ($m=0; $m < sql_num_rows($resultpersons, $dbi); $m++) \layout Code { \layout Code list($idperson, $nameperson) = sql_fetch_row($resultpersons, $dbi); \layout Code echo "
"; \layout Code echo "

"; \layout Code echo " "; \layout Code echo " "; \layout Code echo " "; \layout Code echo "
"; \layout Code } \layout Code closetable(); \layout Code include("footer.php"); \layout Code } \layout Code \layout Code function mousemodify() { \layout Code global $admin, $bgcolor2, $prefix, $dbi, $multilingaul, $idtopo, \layout Code $nameperson, $idperson; \layout Code include ("header.php"); \layout Code GraphicAdmin(); \layout Code Opentable(); \layout Code sql_query("Update ".$prefix."_topolino set nameperson=' $nameperson' \layout Code where idperson=$idperson", $dbi); \layout Code echo"OK"; \layout Code die(mysql_error()); \layout Code closetable(); \layout Code include("footer.php"); \layout Code } \layout Code \layout Code ?> \layout Code \layout Standard The cases definition page is very easy to construct, it gathers the cases that are included in the file admin/modules/topolino. \begin_inset LatexCommand \index{topolino} \end_inset php and puts them in the file admin/case/case.topolino. \begin_inset LatexCommand \index{topolino} \end_inset php \layout Standard This is the syntax: \begin_inset LatexCommand \index{syntax} \end_inset \layout Code \layout Standard The last two things we have to make are the compilation of the file admin/links/ link.topolino. \begin_inset LatexCommand \index{topolino} \end_inset php and the creation of a language module: Compilation of the file link.topolino. \begin_inset LatexCommand \index{topolino} \end_inset php \layout Code \layout Standard Where: admin.php?op=topolino defines which module must be called, " _EDITTOPOLINO \begin_inset LatexCommand \index{_EDITTOPOLINO} \end_inset " is the term to translate (it must be compiled in admin/language). For the modification of the language module I refer you to the previous paragraph with one single note. The language file of the admin section is common for all (admin/language), the relative languages must be added to the end of those that already exist. Just another thing, the syntax of this example is not perfect, its beyond the scope of this to make it work perfectly but it does illustrate the operation of the module (Which you will find available for download at \begin_inset LatexCommand \url[www.spaghettibrain.com]{http://www.spaghettibrain.com} \end_inset so you will be able to study it). \layout Section How to include a HTML file in a PHP-Nuke module \begin_inset LatexCommand \label{include-HTML-file-in-module} \end_inset \layout Standard From what we have said about the structure of a PHP-Nuke module (see \begin_inset LatexCommand \ref{module-structure} \end_inset ), it is easy to include a HTML file in a module - all we have to do is use the PHP include command, \begin_inset LatexCommand \index{command} \end_inset to include it between the calls to OpenTable() and CloseTable() functions: \layout Itemize Create a folder under the modules directory. Call it whatever you like, but take care to replace blanks with underscores \begin_inset LatexCommand \index{underscores} \end_inset in the name. \layout Itemize Using a decent text editor (see \begin_inset LatexCommand \ref{editing-PHP-Nuke-files} \end_inset ), create a text file called index. \begin_inset LatexCommand \index{index} \end_inset php in that newly created directory. \layout Itemize Copy the following code in index.php: \begin_inset LatexCommand \index{index.php} \end_inset \begin_deeper \layout Code \end_deeper \layout Itemize Change the licence to reflect your decisions. Of course, I urg