WCN:Talk
Administrator's Manual for v2.0
Copyright 2004 Peter Falkenberg Brown ~ Open Source Software
http://worldcommunity.com ~ peterbrown@worldcommunity.com
Document Revision Date: October 9, 2004
This program was formerly published as "FutureForum", ending with
v1.33.
TABLE
OF CONTENTS
- Description of New Features in 2.0
- Installation
- File and Directory Permissions
- Partial List of Features (from v1.33)
- ToDo List
- History List
- Table Structure
DESCRIPTION
OF NEW FEATURES IN 2.0
WCN:Talk is a 'threaded' discussion board, written in Perl, using MySQL for
its backend database. It is a major upgrade to an earlier version, called "FutureForum",
last updated as v1.33. FutureForum was a 'public only' forum, with no ability
to have usernames and passwords for security of postings. The motivation to
upgrade it was to provide that security function. It now has both a 'public'
and a 'private' mode, which can be set with the variable '$forum_type'
in the setup file wcntalk_site.pl.
In the process, I changed the name to WCN:Talk -- 'WCN' because of our business
name, and 'Talk' because I read a very distressing article about 'poison' search
engine words. It seems that search engines drop sites sometimes because of the
usage of certain words, among them the word 'forum'. Thus, I replace the word
'forum' with the words 'talk' and ' discussion board' in various places in the
program.
Once I started adding the privacy features, I of course had to add more and
more features :-). These new features include:
- Private and Public Discussion Board Feature - (see above).
Note that the privacy function is done with 'session ids' and cookies.
- HTML Templates - Almost all html output has been separated out to
html template files. Thus, it's easy to change the look and feel of amost
all parts of the program. The 3 primary html template files are:
- html_header.html
- html_footer.html
- top_page_header.html
- Email Subscription - Now, because the program has a user table (allowing
password protection) it also has an email subscription function which allows
each user to receive a copy of each post via email. Alternatively, users can
receive an email at the end of the day containing a list of posts with authors
and subject lines. Users can subscribe to each forum section (see below) with
either option, or unsubscribe completely. There is also a function that allows
the admin user to setup a section (like 'Announcements') that has mandatory
subscription. In my opinion, the email subscription function is a significant
plus when it comes to bringing users back to the discussion board. If they
never receive any messages, they don't know if anyone has posted anything.
- Discussion Board Sections - The program now has the ability to have
multiple sections, each one contained in its own copy of the data table. This
way, discussions can be separated from each other. Sections can be set as
'read-only' so that admins can post announcements, but regular users can't
post in those sections.
- File Uploads - Now, if the variable '$allow_file_uploads' is set
to 'yes', private boards can have file uploads enabled. Public boards cannot
have file uploads at this time, primarily because the coding would require
a 'no-clobber' function on uploaded files that I haven't written yet. Of course,
public file uploading is a dangerous issue anyway, since someone could upload
nasty photos. Note that file uploads can be of any type. There is a variable
for setting file size limits. There is also a new table that stores the filenames
and descriptions. There is also a new link to display all file uploads.
- Administrative Options - There is an admin page for approving, editing
and deleting users. There is an admin function for managing sections, i.e.
adding and deleting sections and modifying section names and the topic list
assigned to each section. Note that the section data is stored in a Perl 'hash
of hashes', which is a text file on the server. Thus, if
you modify it, you should download it to your desktop for a backup of it.
- Registration Function - New users can register via a public function
(register.html). They'll be tagged as 'denied' until the admin approves them.
The admin will be sent an email saying someone has registered.
- Email Forgotten Password - Users can submit a form to email them
their forgotten passwords
- Improved Menu Interface - The Menu has undergone numerous improvements,
including more searching options.
- User Help Page - I've finally actually written a User Help Page.
- There are many other small improvements, as well as a cleaned up code set.
- See User Help File /talk/help.html for usage help
- See comments in setup files wcntalk_site.pl and wcntalk_vars.pl
for many technical notes
INSTALLATION
- Unzip the Files: Untar the 'wcntalk.v2.0.tar.gz'
file in your home directory (on your server). There will be 2 tar files
that will be unzipped, 'wcntalk_home_dir.tar' and 'wcntalk_webroot_dir.tar'.
- Untar the 'wcntalk_home_dir.tar' file in your home directory.
- Untar the 'wcntalk_webroot_dir.tar' file in your web document root directory,
e.g.: 'www' or 'html'.
Under Unix, the permissions will be automatically created. If you don't have
ssh access to untar them, and have to ftp them, see the notes below about
'File and Directory Permissions'.
Note: installation creates a 'talk' subdir under your
home directory and another 'talk' subdir inside your web document root directory.
It also adds a .my.cnf file and a .www.my.cnf file to
your home directory, so if you already have those two files, please back them
up first!
- Edit 5 Setup Files:
Edit index.cgi (in your 'www/talk' directory),
setting the $preferences_dir variable.
- Edit the variables in wcntalk_site.pl (in
your home_dir/talk directory), at least up to the point where it says:
'# the variables below don't necessarily have to be changed'.
You can also edit variables in the file wcntalk_vars.pl, but you don't
have to unless you don't like the generic settings.
- Edit the .www.my.cnf file with your username
and password for mysql (this file is for the main script).
- Edit the .my.cnf file with your username
and password for mysql (this file is for the table installation script).
Note that you could combine them if you only have one mysql username (which
must have table creation and table dropping privileges). If you combine them,
you should use .my.cnf so that the table installation script can find it (it
looks by default for the file '.my.cnf'). The reason to have 2 cnf files is
that the .my.cnf username usually has higher permissions, and is not readable
by the web, while the .www.my.cnf file is readable by the web and the user
listed in it has lower permissions (e.g: no grant table permissions).
- Edit the file .qmail-wcntalk with the correct
path if you use qmail and will use the autoresponder feature.
- Install the 3 Database Tables: wcntalk_main,
wcntalk_users and wcntalk_uploads with correct mysql permissions.
You can use the data table installation script, wcntalk_table_install.sh
and the data table upgrade script, wcntalk_table_upgrade.sh if you
like.
Upgrade Note: If you are upgrading from 'FutureForum
v1.33' then you should use the 'wcntalk_table_upgrade.sh' script to modify
the structure to your current forum table (it won't affect your current installation
because it just adds fields) and then add the other 2 tables. Note! If you're
upgrading, you'll have to either change the name of your primary forum table
from 'forum' to 'wcntalk_main', or edit the file wcntalk_section_data.pl
by hand, changing the multiple instances of 'wcntalk_main' to 'forum'.
- HTML Templates: You can change the look
and feel of the html templates if you like, although you don't have to.
- Login and Add a Record: Login and add a
welcome record to the wcntalk_main table. The default username is admin
and the password is admin.
- Click on the 'Admin' link and Change the username and
password! (you'll have to re-login!)
- Also, in the admin section, add your email address (as the admin) and other
details.
Note: You should fix your admin record even if you are going to use the forum
in 'public' mode, so that you can login and manage the forum (by going to
the url '/talk/admin' (in the case of a public forum - with a private forum,
just go to '/talk')).
- Modify Section Data: Also, in the admin
section, modify the 'Topics' list and other details for the wcntalk_main table
(under 'Manage Sections').
- Finally, in the admin section, add 'sections' if you want (i.e. other forum
tables).
Note that if you modify or add section data, new data will be written to the
file wcntalk_section_data.pl. You should download that, as a backup.
Also, if you add sections, you'll want to modify the variable $html_section_links
in the wcntalk_site.pl file.
- Test it out, and make it go live! Done!
FILE
AND DIRECTORY PERMISSIONS
All the files that are NOT mentioned below should be set to their default permissions
(text files 644 and directories 755).
- home_dir/talk files and dirs
- file: home/.my.cnf - 600 (readable
only by account owner)
- file: home/.www.my.cnf - 644 (world readable but not world writeable)
- file: home/.qmail-wcntalk - 644 (must be 644 for qmail)
- dir: home/talk/sessions - 777 (world writeable)
- file: home/talk/bin/libformat.so - 755 (executable)
- file: home/talk/bin/nconvert - 755 (executable)
- file: home/talk/wcntalk_autoresponder.cgi - 755 (executable)
- file: home/talk/wcntalk_send_list.cgi - 755 (executable)
- file: home/talk/wcntalk_table_install.sh - 755 (executable)
- file: home/talk/wcntalk_table_upgrade.sh - 755 (executable)
- file: home/talk/wcntalk_section_data.pl - 666 (world
writeable)
- www_dir/talk files and dirs
- dir: www/talk - 755 (executable)
- file: www/talk/index.cgi - 755 (executable)
- dir: www/talk/files - 777 (world writeable)
- dir: www/talk/files/wcntalk_main - 777 (world writeable)
PARTIAL
LIST OF FEATURES (from v1.33)
(see Description of Features
above for new features)
- configurable display of top page structure
- routine to import old messages from wwwboard.cgi (Matt Wright's Board)
(untested after v1.33)
- uses 'branch_no' design to keep track of 'threads'
- can display top page of messages with numerous selection or sorting methods
- uses MySQL database for speed and convenience (the major negative is that
the body text is not viewable by search engines)
- the message text is stored as pure text -- html cosmetics can be changed
in the script, and the display of the messages changes accordingly
- multiple board methodology (see notes below)
- unlimited levels of bullet images (see notes below)
- configurable max message and branch length vars (see notes) (default setting
handles 1 million top level messages, 10 million total)
- user option: email responses to user
- options to hide topics, date, time on message listings (shortens lines)
- security: has MySQL password; admin can change it
- shows 'current thread' and 'parent message' on message display
- blocks duplicate messages
- option to view only parent threads and expand thread on top page
- configurable html cosmetics
- a number of sticky menu options (on selects)
- uses topics in messages: uses select box to select by topic
- has 'toggle menu' function on top page - simple, advanced and no menu
- can select by date range and 'new' posts, and other selection criteria
- sends email of each post to admin
- sends response email of message to original poster
- automatically displays 'new' button for recent posts; ages automatically
- has security routines - maxlength of body, no html, no questionable chars
TODO
LIST
- Add admin functions (delete message, delete branch) .... deletes will affect
'responses'
- Emails sent to WCN:Talk 'incoming address' get posted in forum
HISTORY
LIST
- v2.0 - October 8, 2004
- Major Upgrade!
- (see description of 2.0 features above)
- v1.33 - July 1, 2001
- added an &error_message subroutine to allow better customization of
error messages
- changed all print ... ; exit; commands to &error_message calls
- added a &message_page_footer subroutine to allow better customization
of html, specifically to accomodate </table> end commands
- added calls to the &message_page_footer subroutine in the main code
- added the use of a top stub file, so that the main code doesn't need to
have a hardcoded reference to the include file
- added some table code in the &html_header subroutine (Yes, the graphics
are weak. Volunteers? :-)
- changed $dbh->func("_InsertID") to $dbh->{'mysql_insertid'}
- v1.32 - August 2, 2000
- Through the sharp eyes of one of our users, a simple but really unfortunate
bug was just squashed.
By adding the code: ', send_email' after the word 'seconds' on line 796 of
the main file, i.e:
OLD CODE, line 796:
seconds
NEW CODE, line 796:
seconds,
send_email
.. a bug was fixed which prevented RESPONSES from being sent to message posters.
You'd think I would have caught THAT bug, of all bugs. I think I didn't catch
it, because I had set myself to receive the admin messages - thus I received
two messages whenever I posted. Yes... this means that posters have not been
receiving replies.
My sincerest apologies to all.
- v1.31 - March 15, 2000
- - added a function to check for bad words
- v1.30 - December 11, 1999
- modified uri escape routine to include foreign letters
- separated out more setup elements into the setup file, including as much
html as possible. Hopefully, unless there are major code revisions, folks
will be able to simply plug in the new main file without changing the setup
file. (This remains to be seen.)
- modified structure of top page by using tables
- you can change the top page structure in the 'top_page_header' and
'top_page_footer' routines
- isolated display of messages from surrounding elements
- modified method of displaying message indentation.
- it now uses tables for each message, with the $tab var, placed in table
data cells on the left side of each table
- tables seemed to be the most stable method of indentation, so I abandoned
attempts to get <ul>,<dl>,$tab, or style sheets to work. All
of them, even <ul>, had serious limitations. (I didn't like <ul>
anyway, because I wanted to use custom bullets, and <ul> is crippled
that way. Time to change <ul>?)
- modified email code to allow < and > in the subject and body of email
messages, while still disallowing ` and " and |
- < and > are still not allowed in the database, so that html is
prevented. Too many possibilities for junk. HTML chars are replaced with
< and >
- v1.21 - July 30, 1999
- added more controls to display of new records; if there aren't enough new
records to satisfy the criteria, then additional records are displayed; otherwise,
the display might be empty.
- v1.2 - July 22, 1999
- first stable public release, changed .my.cnf to .www.my.cnf so that .my.cnf
can still be used from the shell, set to 600 (you don't want to put your admin
passwords in .www.my.cnf)
- v1.0 beta - beta release
TABLE
STRUCTURE
## Three primary tables for WCN:Talk
## Additional tables (sections) are copied from wcntalk_main
####################################################################
##
## Table structure for table 'wcntalk_main'
##
CREATE TABLE wcntalk_main (
message_no int(10) unsigned NOT NULL auto_increment,
user_id int(10) unsigned NOT NULL default '0',
parent_no int(10) unsigned NOT NULL default '0',
branch_no text NOT NULL,
level int(10) unsigned NOT NULL default '0',
topic varchar(100) NOT NULL default '',
subject varchar(100) NOT NULL default '',
author varchar(100) NOT NULL default '',
email varchar(100) NOT NULL default '',
date date NOT NULL default '0000-00-00',
time time NOT NULL default '00:00:00',
seconds bigint(25) NOT NULL default '0',
body text NOT NULL,
responses int(10) unsigned NOT NULL default '0',
send_email char(1) NOT NULL default '',
attached_file varchar(250) NOT NULL default '',
file_description text NOT NULL,
record_updated timestamp(14) NOT NULL,
PRIMARY KEY (message_no),
KEY topic (topic),
KEY subject (subject),
KEY date (date),
KEY seconds (seconds),
KEY level (level),
KEY author (author)
) TYPE=MyISAM;
##
## Table structure for table 'wcntalk_uploads'
##
CREATE TABLE wcntalk_uploads (
upload_id int(10) unsigned NOT NULL auto_increment,
filename varchar(250) NOT NULL default '',
file_description text NOT NULL,
thumbnail_name varchar(250) NOT NULL default '',
file_type varchar(50) NOT NULL default '',
table_name varchar(100) NOT NULL default '',
user_id int(10) unsigned NOT NULL default '0',
message_no int(10) unsigned NOT NULL default '0',
topic varchar(100) NOT NULL default '',
subject varchar(100) NOT NULL default '',
author varchar(100) NOT NULL default '',
email varchar(100) NOT NULL default '',
date date NOT NULL default '0000-00-00',
seconds bigint(25) NOT NULL default '0',
record_updated timestamp(14) NOT NULL,
PRIMARY KEY (upload_id),
KEY filename (filename),
KEY table_name (table_name),
KEY topic (topic),
KEY seconds (seconds),
KEY user_id (user_id)
) TYPE=MyISAM;
##
## Table structure for table 'wcntalk_users'
##
CREATE TABLE wcntalk_users (
user_id int(10) unsigned NOT NULL auto_increment,
honorific varchar(30) NOT NULL default '',
first_name varchar(50) NOT NULL default '',
last_name varchar(50) NOT NULL default '',
suffix varchar(20) NOT NULL default '',
email varchar(100) NOT NULL default '',
user_type varchar(50) NOT NULL default '',
status varchar(20) NOT NULL default '',
username varchar(16) NOT NULL default '',
password varchar(16) NOT NULL default '',
subscribed_forums text NOT NULL,
comments text NOT NULL,
record_created datetime NOT NULL default '0000-00-00 00:00:00',
record_updated timestamp(14) NOT NULL,
PRIMARY KEY (user_id),
KEY first_name (first_name),
KEY last_name (last_name),
KEY username (username)
) TYPE=MyISAM;
END
OF DOCUMENTATION