Simple Shoutbox v1.0 Created by Adam Di Pardo

1. About

A shoutbox is a small website application that allows for the users of a website to share quick, short messages to other users who are also viewing the website. A shoutbox is not intended for carrying out long discussions or conversations but instead is intended for messages that are either too short or not important enough to share on other mediums, such as discussion boards or email. Examples of what should be written in a shoutbox could be links, quick announcements or simple questions and answers.

This shoutbox is small, lightweight and ajax-powered. This means that the user never has to refresh or reload the page in order to send messages or see new messages that other people send. This shoutbox is also live, meaning that as soon as one user sends a message it is instantly received by other users viewing the shoutbox, without them having to reload the page.

2. Requirements

In order for this script to properly run your web server must have at least PHP 5 and MySQL 4. Older versions may or may not work. Also note that for the user to be able to use the shoutbox they will need a browser that supports JavaScript.

3. Installation

Installation of this shoutbox is very simple and should take no more than a few minutes to get fully up and running.

Begin by opening 'includes/config.php' with any text editor. In this file you will need to edit a few configuration variables such as your database information and any options that you would like. A full list of configuration variables and explanations are listed below.

Variable Description
$scfg["shoutboxPassword"] This is a password to be used for accessing the Admin (admin.php) script.
$scfg["databaseHost"] This is your database host, this is almost always 'localhost'.
$scfg["databaseName"] This is the name of the database that you will be using, make sure that it is created before the installation
$scfg["databaseUser"] This is the username used for accessing the database, again this needs to be created before running the installation and also needs to have full priveleges for the above database.
$scfg["databasePassword"] This is the password for the above user
$scfg["databaseTable"] This is the name of the table that you would like to use for the shoutbox, this table SHOULD NOT be created before the installation, the script will automatically create this table.
$scfg["pathToShoutbox"] This is the path to where the shoutbox.php file is located. For example, if you placed the shoutbox folder in the root directory of your website then this should be set to '/shoutbox'


The following settings do not need to be edited right away, they can be changed at any time.

Variable Description
$scfg["shoutboxLines"] This is the number of lines, or 'shouts', that you would like to have displayed in your shoutbox
$scfg["shoutboxHistory"] If enabled, this option will show a link to view ALL shouts in the shoutbox. Enter '1' to enable or '0' to disable.
$scfg["shoutboxSeperateLines"] If enabled, this option will print the Username and Message of each shout on seperate lines. Enter '1' to enable or '0' to disable.
$scfg["shoutboxCharacterLimit"] This is the character limit that each messages/username can have, messages that go over this limit are cut. This needs to be greater than 0.


After configuring these settings, upload everything (including the folder itself) in the 'shoutbox' folder to your web server. That's it! You can test your installation by surfing to 'http://yourwebsite.com/shoutbox/shoutbox.php'. If you see a shoutbox then everything has been setup fine, if you see any kind of error double check the above configuration settings.

4. Usage

The shoutbox has been designed so that it is easy to integrate with any existing php website. To include the shoutbox in your website use the following PHP code:

<?php include "/path/to/shoutbox/shoutbox.php"; ?>

For example, if you placed the 'shoutbox' folder in the root directory of your website and you are accessing the shoutbox from the root directory, the code would look like:

<?php include "shoutbox/shoutbox.php"; ?>

After completing this, you should see your shoutbox appear on your website.

5. Themes

The shoutbox comes with two themes; 'White' is a very light colored theme designed for websites that are light in color, 'Grey' is a theme that is much more dark and intended for dark colored websites. You can switch between these themes using the $scfg["shoutboxTheme"] configuration variable.

Each theme consists of only 1 CSS file and two images located in the 'shoutbox/images' folder. Therefor, it is very easy to edit these themes or create new ones if you would like to. Included in the zip file are two PNG files created using Adobe Fireworks, these files can be opened in either Adobe Fireworks or Adobe Photoshop and edited to create additional themes.

6. Support

Validation Errors

If you are getting validation errors with this script it is more than likely because of one line in shoutbox.php which uses the HTML LINK tag to include the stylesheet. Unfortunatley the link tag is not allowed in the BODY tag of an HTML document, which is why you are getting a validation error.

In order to fix this error you will need to open shoutbox.php and find the following line:

<link rel='stylesheet' type='text/css' href='<?php echo $scfg["pathToShoutbox"]; ?>/css/shoutbox.css'/>

Replace this with

<!--<link rel='stylesheet' type='text/css' href='<?php echo $scfg["pathToShoutbox"]; ?>/css/shoutbox.css'/>-->

Next, you will need to add the following line to the HEAD section of the HTML document that you are including the shoutbox in.

<link rel='stylesheet' type='text/css' href='PATH_TO_shoutbox.css'/>

Make sure that you replace 'PATH_TO_shoutbox.css' with the location of where the stylesheet. For example if you placed the 'shoutbox' folder in your website's root directory the path would be: "shoutbox/css/shoutbox.css"


For further support please contact adamdipardo@gmail.com