thewall. server.php

Example which demonstrates a xajax implementation of a graffiti wall.

Summary
Example which demonstrates a xajax implementation of a graffiti wall.
Please see copyright.inc.php for a detailed description, copyright and license information.
The number of scribbles that will be retained.
The file that will be used to store the messages on the server.
Stores the html that is being generated for the current request.
Indicates that the html generated for this request is valid and can be added to the wall DATA_FILE.
Builds the html output and sets the isValid indicator.
Generate a font size based off a random number.
Generate a browser safe color based on a random number.
Generates a text-alignment value based on a random number.
Writes the current graffiti->html to the DATA_FILE when graffiti->isValid or returns an error message.
Processes the users form input and passes the values to an instance of the graffiti class.
Processes the data previously written to the DATA_FILE by graffiti->save.

Graffiti Wall Example

Please see copyright.inc.php for a detailed description, copyright and license information.

Define constants

Summary
The number of scribbles that will be retained.
The file that will be used to store the messages on the server.

Variables

MAX_SCRIBBLES

The number of scribbles that will be retained.  The default is 5.

DATA_FILE

The file that will be used to store the messages on the server.

graffiti

Summary
Stores the html that is being generated for the current request.
Indicates that the html generated for this request is valid and can be added to the wall DATA_FILE.
Builds the html output and sets the isValid indicator.
Generate a font size based off a random number.
Generate a browser safe color based on a random number.
Generates a text-alignment value based on a random number.
Writes the current graffiti->html to the DATA_FILE when graffiti->isValid or returns an error message.

Variables

html

var $html

Stores the html that is being generated for the current request.

isValid

var $isValid

Indicates that the html generated for this request is valid and can be added to the wall DATA_FILE.

Functions

graffiti

function graffiti($sHandle,
$sWords)

Builds the html output and sets the isValid indicator.

getRandomFontSize

function getRandomFontSize()

Generate a font size based off a random number.

getRandomColor

function getRandomColor()

Generate a browser safe color based on a random number.

getRandomAlignment

function getRandomAlignment()

Generates a text-alignment value based on a random number.

save

function save()

Writes the current graffiti->html to the DATA_FILE when graffiti->isValid or returns an error message.

xajax request handlers

Summary
Processes the users form input and passes the values to an instance of the graffiti class.
Processes the data previously written to the DATA_FILE by graffiti->save.

Functions

scribble

function scribble($aFormValues)

Processes the users form input and passes the values to an instance of the graffiti class.

If the graffiti class generates and error, it is returned to the browser using <xajax->alert>, otherwise, <xajax->script> is used to instruct the browser to make a request to updateWall and <xajax->clear> is used to clear the form input.

updateWall

function updateWall()

Processes the data previously written to the DATA_FILE by graffiti->save.

This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
var $html
Stores the html that is being generated for the current request.
var $isValid
Indicates that the html generated for this request is valid and can be added to the wall DATA_FILE.
The file that will be used to store the messages on the server.
function graffiti($sHandle,
$sWords)
Builds the html output and sets the isValid indicator.
function getRandomFontSize()
Generate a font size based off a random number.
function getRandomColor()
Generate a browser safe color based on a random number.
function getRandomAlignment()
Generates a text-alignment value based on a random number.
function save()
Writes the current graffiti->html to the DATA_FILE when graffiti->isValid or returns an error message.
function scribble($aFormValues)
Processes the users form input and passes the values to an instance of the graffiti class.
function updateWall()
Processes the data previously written to the DATA_FILE by graffiti->save.
Example which demonstrates a xajax implementation of a graffiti wall.
Example which demonstrates a xajax implementation of a graffiti wall.
Example which demonstrates a xajax implementation of a graffiti wall.