II. Installing NBBC
[ Previous: A. Requirements | Next: III.A. Your First NBBC Program ]
B. Installation
NBBC should have been provided to you as a .tar.gz file or as a .zip
archive file. Unpack this archive file. Inside, you should find this:
- nbbc/CHANGELOG (a list of everything new in this version of NBBC)
- nbbc/doc/*.* (various pieces of this user's manual)
- nbbc/nbbc.php (the compressed single-file version of NBBC)
- nbbc/readme.html (the main file for this user's manual)
- nbbc/smileys/*.gif (thirty standard smileys, as GIF image files)
- nbbc/src/nbbc_main.php (the main root include, with comments)
- nbbc/src/nbbc_lex.php (the lexical analyzer, with comments)
- nbbc/src/nbbc_lib.php (the standard BBCode library, with comments)
- nbbc/src/nbbc_parse.php (the core parser, with comments)
- nbbc/tools/collect_smileys.php (used for creating an HTML table of smileys)
- nbbc/tools/Makefile (used for creating nbbc.php from the other files)
- nbbc/tools/merge.pl (used for creating nbbc.php from the other files)
- nbbc/tools/test_nbbc.php (a test program to ensure NBBC works correctly)
To see if NBBC has been installed correctly, open tools/test_nbbc.php in your web browser.
This script will test all of the major features of NBBC, and it will perform several
security tests as well. If it reports that all of the tests succeeded, then NBBC has been
installed correctly.
Including NBBC in your project is fairly easy, and there's two possible ways to do it:
- You can use the compressed version of NBBC, which loads a little faster and is packed
into one PHP file. To do this, copy just "nbbc.php" into your project's directory,
and in your PHP script, you simply require_once("nbbc.php").
- You can use the uncompressed version of NBBC, which loads a little slower and is multiple
PHP files, but is well-commented and supports a debugging mode. To do this, copy all the
"nbbc_*.php" files from the "src/" directory into your project's directory,
and in your PHP script, you simply require_once("nbbc_main.php").
In addition to copying the PHP file(s), you probably also want to copy the "smileys/"
directory, which contains thirty smileys supported by the built-in Standard BBCode Library.
You can find a complete list of these smileys in Appendix A.
[ Previous: A. Requirements | Next: III.A. Your First NBBC Program ]
Copyright © 2010, the Phantom Inker. All rights reserved.