PHP-Nuke: Management and Programming
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.4.1.
phpMyAdmin navigation bar: Structure
3.4.2.
phpMyAdmin navigation bar: SQL
3.4.3.
phpMyAdmin navigation bar: Export
3.4.4.
phpMyAdmin: other commands
3.4.5.
How to install the DB of PHP-Nuke with
PHPMyadmin
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
3.10.1.
RSS block Error: There is a current problem with the headlines from this site
3.10.2.
MySQL errno: 145: Can't open file nuke_XXXX.MYI
3.10.3.
Modules do not show up and/or disappear
3.10.4.
Forums Error: Can't create a category without a name
3.10.5.
Left and right blocks are missing
4.
How to upgrade PHP-Nuke
4.1.
From 6.0 to 6.5
4.1.1.
Upgrade instructions for PHP-Nuke 6.0 without
Tom's bbtonuke port
4.1.2.
Upgrade instructions for PHP-Nuke 6.0 with
Tom's 2.0.6 bbtonuke port
4.2.
From phpBB to PHP-Nuke
4.3.
PHP-Nuke upgrade scripts
5. How to move PHP-Nuke
5.1.
Transferring a local installation to the Web
5.2.
Changing Web hoster
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
10.1.
How sessions work in the forums
10.2.
How to eliminate session checks
11.
Editing PHP (-Nuke) files
11.1. vi
11.2. Emacs
11.3.
Bluefish
11.4.
UltraEdit
11.5.
WinSyntax
11.6.
HTMLKit
11.7.
Crimson Editor
11.8. PHPEd
12.
Modifying the PHP-Nuke database
12.1.
More than 255 characters of user extra information
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.2.1.
Example creation of HTML file to include in the theme
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.6.1.
How to insert an extra table to the right of the page
14.6.2.
The PHP-Nuke Copyright notice
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
15.1.
How to implement a favourites icon (favicon.ico)
15.2.
How to prevent the statistics module from gathering hits from certain hosts
16.
Modifying mainfile.php
16.1.
How to allow special HTML tags
16.2.
How to change the order of messages
16.3.
How to change the duration of a public broadcast message
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.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.2.1.
How to redirect users to the Login page
18.2.2.
How to restrict the Homepage only to registered users
18.3.
Modifying the PHP-Nuke FAQ module
18.3.1.
How to add more than 127 FAQ answers
18.4.
Modifying the PHP-Nuke Reviews module
18.4.1.
How to allow only registered users to enter a review
18.4.2.
How to choose images from a dropdown list
18.5.
Modifying the PHP-Nuke Web_Links module
18.5.1.
How to display Web Links in the same window
18.5.2.
How to change the number of Web Links per page
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.7.1.
How to get rid of the need to use <br> for new lines
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.9.1.
How to order the articles in the Sections module
18.10.
Modifying the PHP-Nuke Downloads module
18.10.1.
How to add URLs longer than 100 characters in Downloads and Web Links
18.11.
Modifying the PHP-Nuke Stories Archive module
18.11.1.
How to order the articles in the Stories Archive module
19.
Modifying the PHP-Nuke administration panel
19.1.
How to set an arbitrary "Stories Number in Home"
19.2.
How to allow HTML in the Newsletter
20. Creating
PHP-Nuke blocks
20.1.
The characteristics of the various types of blocks
20.2.
How to create a new block
20.2.1.
How to create a block, theoretical approach
20.2.2.
How to create a block, a practical example
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.8.1.
How to display random 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.9.1.
Javascript functions in javascript.php
21.9.2.
Complete Javascript code in 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
22.1.
Duplicating the PHP-Nuke FAQ module
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.1.1.
Search engines and the GET method
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.3.1.
How to install modules that do not change the database structure
26.3.2.
How to install modules that change the database structure
26.3.3.
How to install modules that change the database structure and the files
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.4.1.
Variables
28.4.2.
Functions
28.4.3.
Switches
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