Class Phoggle

Phoggle

public class Phoggle

This class represents the entity of a Phoggle, a weblog system. The system is based on the creation of templates, thus separating content from programming logic to a high degree.

To use Phoggle, one first has to create templates and store them in the proper directory, entitled "template". After that, where Phoggle functionality is needed, a prerequiste header of "<? require_once("Phoggle.package"); ?> is to be used. Then, where appropriate, one can call any of the three functions:

<? $phoggle->generateContent(); ?>
<? $phoggle->generateRecent(); ?>
<? $phoggle->generateArchive(); ?>

For more information about details, please reference the API.


Constructor Summary
Phoggle(var $name, var $password, var $dbName)
          Constructs a Phoggle.
 
Method Summary
 void add(var $author, var $email, var $content, var $date, var $title)
          Adds an entry into the database.
 java.lang.String generateArchive(var $limit)
          Generates archived summaries based on a parsed template.
 java.lang.String generateContent(var $limit, var $start, var $end)
          Generates entries based on a parsed template.
 java.lang.String generateRecent(var $limit)
          Generates recent entry titles based on a parsed template.
 void tableReset()
          Resets the information in the database table.
 

Constructor Detail

Phoggle

public Phoggle(var $name,
               var $password,
               var $dbName)
Constructs a Phoggle. Essentially, its sole purpose is to create the database connection and checking for its validity.
Parameters:
$name - String specifying name
$password - String specifying password
$dbName - String specifying database name
Method Detail

generateContent

public java.lang.String generateContent(var $limit,
                                        var $start,
                                        var $end)
Generates entries based on a parsed template. One can also specify how many entries to limit generation to. If one specifies either a start or end UNIX timestamp date, only those entries relatively matching what was specified will return. Takes all the concatenated, generated recent entries and returns it as a string. Assumes a database connection has already been established. If nothing is passed, then will limit all entries to the current month.
Parameters:
$limit - int specifying the limit
$start - int specifying UNIX timestamp start date
$end - int specifying UNIX timestamp end date
$limit - Default Value: 0
$start - Default Value: 0
$end - Default Value: 0

generateRecent

public java.lang.String generateRecent(var $limit)
Generates recent entry titles based on a parsed template. One can also specify how many entries to limit generation to. Takes all the concatenated, generated recent entry titles and returns it as a string. Assumes a database connection has already been established.
Parameters:
$limit - int specifying the limit
$limit - Default Value: 10

generateArchive

public java.lang.String generateArchive(var $limit)
Generates archived summaries based on a parsed template. One can also specify how many entries to limit generation to. Takes all the concatenated, generated summaries and returns it as a string. Assumes a database connection has already been established.
Parameters:
$limit - int specifying the limit
$limit - Default Value: 10

add

public void add(var $author,
                var $email,
                var $content,
                var $date,
                var $title)
Adds an entry into the database. At minimum, content, author, and the timestamp must be specified for a complete entry. Assumes a database connection has already been established.
Parameters:
$author - String specifying the author
$email - String specifying the e-mail
$content - String specifying the content
$date - int specifying the current entry timestamp
$title - String specifying the title
$email - Default Value: ""
$title - Default Value: ""

tableReset

public void tableReset()
Resets the information in the database table. So, essentially, one is starting with a new table with no information. If a table doesn't exist, then will create the table. Assumes a database connection was previously, successfully established.