PHP-Nuke: Management and Programming
Chris Karakas
Claudio Erba
Chris Karakas - Conversion from LyX to DocBook SGML, Index, document generation, PHP-Nuke module, see Credits
Andre Purfield - Translation from italian (v.1.0) and translation project coordination, see Credits
Fortunato Matarazzo - Translation from italian (v.1.0), see Credits
Chris Karakas - Translation from italian (v.1.0), see Credits
| Revision History | ||
|---|---|---|
| Customized | 03.24.2006 | Revised by: AnOldMan |
| Removed all html head/content and body tags, forcing site integration. Added section 17.2.3 Creating a Graphical Modules Block | ||
| Revision 2.1 | 04.08.2005 | Revised by: CK |
| 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. | ||
| Revision 2.0 | 16.02.2004 | Revised by: CK |
| Added more than 400 pages of additional material. See Credits section for the exact details. | ||
| Revision 1.2.1 | 22.08.2003 | Revised by: CK |
| Now available as PHP-Nuke module too. Link to the module source in the Formats section. Smaller logo. | ||
| Revision 1.2 | 29.05.2003 | Revised by: CK |
| New logo, CSS stylesheet, HTML validation, footer icons. Incorporated LDP reviewer's comments. Created Aknowledgements and Availability of sources sections. | ||
| Revision 1.1 | 13.02.2003 | Revised by: AP |
| Cleaned up the wording and a few typos. | ||
| Revision 1.0 | 09.01.2003 | Revised by: CK |
| First complete version. | ||


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.
- Table of Contents
- 1. Terms of distribution
-
- 1.1. Disclaimer
- 1.2. Formats
- 1.3. Licence
- 1.4. Availability of sources
- 1.5. Credits
-
- 1.5.1. Version 1.0
- 1.5.2. Versions 1.x
- 1.5.3. Version 2.0
- 1.5.4. Version 2.1
- 1.5.5. General
- 1.6. Aknowledgements
- 1.7. Conventions
- 1.8. The book behind the book
-
- 1.8.1. The general idea
- 1.8.2. Line of attack
- 1.9. How to translate this HOWTO
- 2. Introduction to PHP-Nuke
-
- 2.1. Purpose
- 2.2. What Is PHP-Nuke
- 2.3. Short history of PHP-Nuke
- 2.4. The PHP-Nuke Communities
- 2.5. Why use PHP-Nuke and not static HTML pages
- 2.6. The PHP-Nuke forks
-
- 2.6.1. PHP-Nuke vs. Post-Nuke
- 2.6.2. PHP-Nuke vs. XOOPS
- 2.6.3. XOOPS vs. Post-Nuke
- 3. How to install PHP-Nuke
-
- 3.1. Prerequisites
- 3.2. Installation process
-
- 3.2.1. Download
- 3.2.2. Upload through FTP
- 3.2.3. File permissions
- 3.2.4. Database creation
- 3.3. How to install PHP-Nuke through phpMyAdmin
-
- 3.3.1. What Is PHPMyadmin
- 3.3.2. How to install phpMyAdmin
- 3.4. phpMyAdmin: How to administer MySQL via Web
- 3.5. How to install PHP-Nuke using nukesql.php
- 3.6. How to install PHP-Nuke locally
-
- 3.6.1. easyPHP
- 3.6.2. XAMPP
- 3.6.3. Apache2Triad
- 3.6.4. Apache, PHP and MySQL on Mandrake Linux
- 3.6.5. Apache, PHP and MySQL on Red Hat Linux
- 3.7. The config.php file
-
- 3.7.1. More than one PHP-Nuke sites
- 3.8. Resources
- 3.9. Common installation problems
-
- 3.9.1. Test scripts
- 3.9.2. Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
- 3.9.3. Call to undefined function: message_die() in db.php line 88
- 3.9.4. Error: Failed opening 'language/lang-.php' for inclusion
- 3.9.5. Fatal error: Failed opening required 'includes/sql_layer.php'
- 3.9.6. Sorry, such file doesn't exist...
- 3.9.7. Warning: setlocale(): Passing locale category name as string is deprecated
- 3.9.8. Security code is not showing up
- 3.9.9. Warning: Invalid argument supplied for foreach() in mainfile.php
- 3.9.10. Include path is wrong
- 3.9.11. Users don't receive any confirmation mails
- 3.9.12. Login loop
- 3.9.13. You have an error in your SQL syntax near '-------------
- 3.9.14. Error: Couldn't update private forum permissions
- 3.9.15. Invalid session in forums
- 3.9.16. You cannot create the administrator account
- 3.9.17. You lost the administrator password, or deleted the admin account
- 3.9.18. You get garbage in some parts of the page
- 3.9.19. Compressed output in forums
- 3.9.20. Warning: Cannot add header information...in forums
- 3.9.21. In Windows, you get an empty page
- 3.9.22. You get a lot of Notice lines in the output of PHP-Nuke
- 3.9.23. How to get a more descriptive error message
- 3.10. Common miscellaneous errors
- 4. How to upgrade PHP-Nuke
- 5. How to move PHP-Nuke
- 6. Front end structure: user view
-
- 6.1. The preinstalled modules
- 6.2. Non-installed modules
- 6.3. The preinstalled blocks
- 7. Back end structure: administrator view
-
- 7.1. The administration functions
-
- 7.1.1. phpBB Forum administration
- 7.2. The Preferences Page
- 8. PHP-Nuke add-ons
-
- 8.1. Add-on themes
-
- 8.1.1. AutoTheme
- 8.2. Add-on blocks
-
- 8.2.1. Moon & Sun block
- 8.2.2. Meteosat block
- 8.2.3. Comic block
- 8.2.4. Menu Builder
- 8.2.5. Treemenu with PHP
- 8.2.6. Treemenu with Javascript
- 8.2.7. Google AdSense block
- 8.2.8. Random Quotes block
- 8.3. Add-on modules
-
- 8.3.1. Daily Comic module
- 8.3.2. Event calendar
- 8.3.3. NSN Your Account Tweak module
- 8.3.4. Approve Membership module
- 8.3.5. Gallery module
- 8.3.6. IP Tracking module
- 8.3.7. Protector module
- 8.3.8. WebCam module
- 8.3.9. My Headlines module
- 8.3.10. PHP-Nuke-Tools module
- 8.3.11. Upload module
- 8.3.12. Upload add-on for phpBB
- 8.3.13. ODP module
- 8.3.14. eCommerce module
- 8.3.15. WorkBoard Module
- 9. Architecture and structure
-
- 9.1. Directory structure
- 9.2. Main page management
- 9.3. Module management
- 9.4. Administration management
- 10. Session management
- 11. Editing PHP (-Nuke) files
- 12. Modifying the PHP-Nuke database
- 13. Modifying PHP-Nuke texts
-
- 13.1. General PHP-Nuke texts
- 13.2. PHP-Nuke module texts
- 13.3. PHP-Nuke module and block titles
- 14. Customising PHP-Nuke themes
-
- 14.1. Structure of a PHP-Nuke theme
- 14.2. Modifying the PHP-Nuke theme HTML template
- 14.3. Modifying the PHP-Nuke theme header
-
- 14.3.1. How to create a top navigation bar as in NukeNews theme
- 14.3.2. How to insert a Search Box as in SlashOcean theme
- 14.3.3. How to change the PHP-Nuke header depending on some global feature
- 14.3.4. How to change the logo in the PHP-Nuke header
- 14.3.5. How to change the logo's dimensions dynamically
- 14.3.6. How to change placement of the banner in the PHP-Nuke header
- 14.3.7. How to display a watermark background image
- 14.3.8. How to display a Flash object in the PHP-Nuke header
- 14.3.9. How to hide the left blocks
- 14.4. Modifying the PHP-Nuke theme body
-
- 14.4.1. How to get multipage News articles
- 14.4.2. How to change background colour
- 14.5. Modifying the PHP-Nuke theme index
- 14.6. Modifying the PHP-Nuke theme footer
- 14.7. Modifying the PHP-Nuke theme icons
- 14.8. Theme construction: the rules to follow
- 14.9. How to change a buggy PHP-Nuke theme
- 14.10. How to prevent users from changing the theme in PHP-Nuke
- 14.11. How to change the PHP-Nuke theme depending on the module
- 14.12. How to change the font size in PHP-Nuke
- 15. Modifying the PHP-Nuke HTML header
- 16. Modifying mainfile.php
- 17. Modifying PHP-Nuke blocks
-
- 17.1. How to change a buggy block
- 17.2. How to build custom module blocks
-
- 17.2.1. Simple module block
- 17.2.2. Treemenu block
- 17.2.3. Creating a Graphical Modules Block
-
- 17.2.3.1. Making a new themesidebox() function
- 17.2.3.2. Modifying mainfile.php
- 17.2.3.3. Modifying block-Modules
- 17.2.3.4. Implementing New themesidebox2() function
- 17.2.3.5. Modifying block-Modules for conditional display
- 17.2.3.6. Final step
- 17.2.3.7. Advanced
- 17.3. How to build RSS blocks with variable number of news items
- 17.4. How to get scrolling headlines in blocks
- 18. Modifying PHP-Nuke modules
-
- 18.1. Modifying any PHP-Nuke module
-
- 18.1.1. How to hide the right blocks
- 18.1.2. How to change a buggy module
- 18.2. Modifying the PHP-Nuke Homepage
- 18.3. Modifying the PHP-Nuke FAQ module
- 18.4. Modifying the PHP-Nuke Reviews module
- 18.5. Modifying the PHP-Nuke Web_Links module
- 18.6. Modifying the PHP-Nuke Your_Account module
-
- 18.6.1. How to redirect users to the Homepage
- 18.6.2. How to redirect Your Info to the Forums user profile
- 18.6.3. How to redirect users to Login and back
- 18.6.4. How to disable registration
- 18.6.5. How to let users register immediately
- 18.6.6. How to approve users before registration
- 18.6.7. How to register users through iBill
- 18.6.8. How to change the maximum allowed length for user names
- 18.7. Modifying the PHP-Nuke News module
- 18.8. Modifying the PHP-Nuke Submit News module
-
- 18.8.1. How to bypass article approval
- 18.9. Modifying the PHP-Nuke Sections module
- 18.10. Modifying the PHP-Nuke Downloads module
- 18.11. Modifying the PHP-Nuke Stories Archive module
- 19. Modifying the PHP-Nuke administration panel
- 20. Creating PHP-Nuke blocks
-
- 20.1. The characteristics of the various types of blocks
- 20.2. How to create a new block
- 20.3. Simple Content block
- 20.4. How to include PHP/HTML files in a PHP-Nuke block
- 20.5. How to use Javascript in PHP-Nuke blocks
-
- 20.5.1. How to create a Hello World block
- 20.5.2. How to create a fade block
- 20.5.3. How to create a Help Center Live block
- 20.6. How to display Flash in PHP-Nuke blocks
- 20.7. How to show advertisements in PHP-Nuke blocks
- 20.8. How to display images in PHP-Nuke blocks
- 20.9. How to display HTML forms in a block: Paypal
- 21. Creating modules
-
- 21.1. Module structure
- 21.2. Creating fully compatible modules: the rules to follow
- 21.3. Module creation, the public part
- 21.4. Module creation, administrator part
- 21.5. How to include a HTML file in a PHP-Nuke module
- 21.6. How to include a HTML file and its links in a PHP-Nuke module
- 21.7. How to include a HTML file and its links using an iframe in a PHP-Nuke module
- 21.8. How to include a plain text file in a PHP-Nuke module
- 21.9. How to use Javascript in PHP-Nuke modules
- 21.10. How to create a Logout module
- 21.11. How to show advertisements in PHP-Nuke modules
-
- 21.11.1. Google AdSense in the News module
- 21.11.2. Google AdSense on top of a PHP-Nuke module
- 21.12. How to display HTML forms in a module
- 22. Duplicating PHP-Nuke modules
- 23. Security
-
- 23.1. How secure is PHP-Nuke?
- 23.2. The impact of bad security record on software popularity
- 23.3. Common PHP-Nuke security vulnerabilities
-
- 23.3.1. Cross-site scripting with PHP-Nuke
- 23.3.2. SQL injection with PHP-Nuke
- 23.3.3. Path disclosure with PHP-Nuke
- 23.3.4. Cross-site tracing with PHP-Nuke
- 23.4. How to guard against security vulnerabilities in PHP-Nuke
-
- 23.4.1. Security fixes
- 23.4.2. Security measures
- 23.4.3. Security audit
- 23.4.4. Permissions on folders and files
- 23.4.5. Cookies - timeout and configuration
- 23.5. How to ban IP addresses
- 23.6. Hacked - now what?
- 24. Accelerating PHP-Nuke
-
- 24.1. Caching PHP-Nuke
-
- 24.1.1. jpcache
- 24.1.2. Cache-Lite
- 24.1.3. Turck MMCache
- 24.1.4. Caching PHP-Nuke: Conclusion
- 25. Optimizing PHP-Nuke
-
- 25.1. Search engines and dynamic URLs
- 25.2. mod_rewrite
-
- 25.2.1. API phases
- 25.2.2. Ruleset processing
- 25.2.3. Quoting special characters
- 25.2.4. Regex backreference availability
- 25.3. Regular expressions
- 25.4. The .htaccess file
- 25.5. How to make PHP-Nuke search engine friendly
-
- 25.5.1. GoogleTap
- 25.6. How to make PHP-Nuke hot link stealth
- 25.7. How to make a dynamic CSS
- 25.8. How to proceed when MySQL is slow
- 26. How to solve common probems with PHP-Nuke
-
- 26.1. How to repair a corrupt table
- 26.2. How to restore PHP-Nuke from backup
-
- 26.2.1. How to restore a single table
- 26.2.2. How to restore a large backup
- 26.3. How to install new modules
- 26.4. How to install patches and correct errors
- 26.5. How to find all registration links
- 26.6. How to allow anonymous web link submissions
- 26.7. How to disable DEBUG mode
- 27. Miscellaneous
-
- 27.1. How to change the Home module
- 27.2. How to use PHP-Nuke under SSL
- 27.3. How to change PHP parameters when you don't have access to php.ini
- 27.4. How to display HTML code in a FAQ
- 27.5. How to enter thousands of web links
- 27.6. How to enter thousands of download links
- 27.7. How to check the validity of thousands of web links
- 27.8. How to enter thousands of ephemerids
- 27.9. How to make the Encyclopedia international
- 27.10. How to find the user name in a module
- 27.11. How to correct thousands of users fields
- 27.12. How to size the select boxes in a module
- 27.13. How to deal with date and time
-
- 27.13.1. How to find the last date of...
- 27.13.2. How to adjust server time
- 27.13.3. The Discordian Calendar
- 27.14. How to deal with quotes in the site's name
- 27.15. How to embed a Flash object in PHP-Nuke News
- 27.16. How to backup your MySQL database using only the browser
- 28. Programmer's tools
-
- 28.1. The database tables
- 28.2. The syntax of HTML code
-
- 28.2.1. How to format text in HTML
- 28.2.2. How to create a link in HTML
- 28.2.3. How to insert an image in HTML
- 28.2.4. How to create a table in HTML
- 28.3. The syntax of CSS
- 28.4. The syntax of PHP code
- 28.5. The syntax of SQL code
- 28.6. MySQL Front, how to administer a MySQL DB from Windows
- 28.7. Foxserv, making PHP-Nuke work on Windows Systems
- A. Appendix
-
- A.1. The GNU Free Documentation Licence
-
- A.1.1. PREAMBLE
- A.1.2. APPLICABILITY AND DEFINITIONS
- A.1.3. VERBATIM COPYING
- A.1.4. COPYING IN QUANTITY
- A.1.5. MODIFICATIONS
- A.1.6. COMBINING DOCUMENTS
- A.1.7. COLLECTIONS OF DOCUMENTS
- A.1.8. AGGREGATION WITH INDEPENDENT WORKS
- A.1.9. TRANSLATION
- A.1.10. TERMINATION
- A.1.11. FUTURE REVISIONS OF THIS LICENSE
- A.1.12. ADDENDUM: How to use this License for your documents
- Index
- List of Tables
- 6-1. Classification with topics and sections
- 14-1. <body> tags in theme.php of various themes
- 16-1. Calls to filter_text from PHP-Nuke modules (v.6.8)
- 16-2. Calls to check_html from PHP-Nuke modules (v.6.8)
- 20-1. Help Center Live: setcookie() calls
- 21-1. Changing HTML links for use in a custom PHP-Nuke module
- 21-2. Alternative way of changing HTML links for use in a custom PHP-Nuke module
- 23-1. List of PHP-Nuke security vulnerabilities
- 25-1. URL replacement with replace_for_mod_rewrite(): dynamic to static.
- List of Figures
- 2-1. phpnuke.org, the official PHP-Nuke site.
- 3-1. WS_FTP: General connection parameters.
- 3-2. WS_FTP: Main screen with local and remote windows.
- 3-3. PHP-Nuke 6.0 file structure
- 3-4. WS_FTP context menu on right mouse click: chmod (UNIX)
- 3-5. WS_FTP Remote file permissions window
- 3-6. PHPMyAdmin start screen.
- 3-7. phpMyAdmin: Select database.
- 3-8. phpMyAdmin: Navigation bar.
- 3-9. phpMyAdmin: field functions.
- 3-10. phpMyAdmin: SQL function.
- 3-11. phpMyAdmin: database dump.
- 3-12. phpMyAdmin: table forum_topics.
- 3-13. phpMyAdmin: Create database.
- 3-14. phpMyAdmin: table structure and selection.
- 3-15. phpMyAdmin: SQL query.
- 3-16. phpMyAdmin: table data.
- 3-17. easyPHP: Installation screen.
- 3-18. easyPHP icon in the bottom bar.
- 3-19. phpinfo: PHP screen for a Windows system.
- 3-20. RPMdrake: selecting the Apache package(s) for installation.
- 3-21. Mandrake Control Center.
- 3-22. Red Hat Menu: Packages.
- 3-23. Red Hat: Package Sections.
- 3-24. Red Hat: Service Configuration Panel.
- 3-25. analyze.php: MySQL connection transcript.
- 3-26. analyze.php: MySQL security warning.
- 3-27. Modules administration panel.
- 3-28. Security code in the User Login screen.
- 3-29. phpinfo(): GD library information.
- 3-30. analyze.php: GD library information.
- 3-31. User Login screen.
- 3-32. Administration panel: Forums.
- 3-33. Administration panel: Forums.
- 3-34. Administration panel: Edit Admins.
- 3-35. Administration panel: Edit Admins.
- 3-36. phpMyAdmin: field functions.
- 3-37. Gzip compression in the Admin Panel of the Forums module.
- 3-38. Administration panel: Modules.
- 3-39. Missing blocks.
- 6-1. PHP-Nuke Homepage
- 6-2. Classifying articles
- 6-3. Downloads module
- 6-4. Private messages
- 6-5. Search module
- 6-6. Statistics module
- 6-7. Your account
- 6-8. Splatt Forum.
- 6-9. phpBB Forum.
- 6-10. The standard Modules block
- 6-11. Waiting Content block.
- 6-12. Who Is Online block.
- 6-13. Languages block.
- 6-14. Surveys block.
- 6-15. Login block.
- 7-1. Administration panel.
- 7-2. Administration panel: Add story.
- 7-3. Attaching a poll to an article awaiting admission.
- 7-4. Article Poll block.
- 7-5. Administration panel: Backup DB.
- 7-6. Administration panel: Banners.
- 7-7. Administration panel: Blocks.
- 7-8. Administration panel: Content.
- 7-9. Administration panel: Downloads.
- 7-10. Administration panel: Edit Admins.
- 7-11. Administration panel: Edit Users.
- 7-12. Administration panel: Encyclopedia.
- 7-13. Administration panel: Ephemerids.
- 7-14. Administration panel: FAQ.
- 7-15. Administration panel: Forums.
- 7-16. Administration panel: HTTP Referers.
- 7-17. Administration panel: Messages.
- 7-18. Administration panel: Modules.
- 7-19. Modules administration panel.
- 7-20. Administration panel: Newsletter.
- 7-21. Administration panel: Optimize DB.
- 7-22. Administration panel: Preferences.
- 7-23. Administration panel: Reviews.
- 7-24. Administration panel: Sections.
- 7-25. Administration panel: Submissions.
- 7-26. Administration panel: Surveys.
- 7-27. Administration panel: Topics.
- 7-28. Administration panel: Add a new topic.
- 7-29. Administration panel: Web Links.
- 7-30. Administration panel: Logout.
- 7-31. Administration panel: Forums.
- 7-32. Administration panel: Preferences.
- 7-33. General site info in the Preferences page.
- 7-34. Icons in the footer.
- 7-35. WebMail service options in the Preferences page.
- 8-1. Moon, Moon & Sun and Sun blocks.
- 8-2. Meteosat block.
- 8-3. Menu block with Menu Builder.
- 8-4. Treemenu block with PHP.
- 8-5. Treemenu block with Javascript.
- 8-6. Modules block. created with Sommaire Paramétrable.
- 8-7. Random Quotes block.
- 8-8. Event Calendar
- 8-9. Calendar1 Block
- 8-10. Calendar2 Block
- 8-11. Calendar3 Block
- 8-12. Calendar4 Block
- 8-13. Calendar5 Block
- 8-14. Extra options for user management in the NSN Your Account Tweak module.
- 8-15. Pending applications in the Approve Membership module.
- 8-16. Approval message in the Approve Membership module.
- 8-17. E-mail management in the Approve Membership module, part I.
- 8-18. E-mail management in the Approve Membership module, part II.
- 8-19. Gallery module.
- 8-20. Gallery related files at nukedgallery.
- 8-21. IP Tracking module: IP Tracking Info.
- 8-22. IP Tracking module: Page View Info.
- 8-23. camPortal block.
- 8-24. camPortal module.
- 8-25. ConquerCam: main window with the Options dialog opened up.
- 8-26. MyHeadlines Box containing syndicated content.
- 8-27. MyHeadlines: Subscribing to News sources.
- 8-28. PHP-Nuke Tools block
- 8-29. PHP-Nuke Tools module: Module Creator.
- 8-30. Upload module.
- 8-31. ODP module.
- 8-32. Calloways Cart module: Add Product screen.
- 8-33. Administration panel: WorkBoard.
- 8-34. WorkBoard module: Administration panel.
- 9-1. PHP-Nuke directory structure.
- 12-1. Extra Info field of User Personal Information (Your Info)
- 14-1. Structure of the NukeNews theme.
- 14-2. Structure of other themes, without HTML templates.
- 14-3. Top navigation bar in the NukeNews theme.
- 14-4. News article: "posted by" does not mean "submitted by".
- 16-1. Administration panel: Messages.
- 17-1. The standard Modules block
- 17-2. The standard Modules block.
- 17-3. Treemenu Block.
- 17-4. Treemenu Block with "Links" expanded.
- 17-5. Treemenu Block







