BlogComment

Represents a comment on a blog entry or article.

Inherits

LnBlogObject, Entry

Events

OnInitFired when object is first created.
InitCompleteFired at end of constructor.
OnInsertFired before object is saved to persistent storage.  This is run after the insertion setup is done, but before anything is actually saved to disk.
InsertCompleteFired after object has finished saving.
OnDeleteFired before object is deleted.
DeleteCompleteFired after object is deleted.
OnUpdateFired before changes are saved to persistent storage.
UpdateCompleteFired after changes to object are saved.
OnOutputFired before output is generated.
OutputCompleteFired after output has finished being generated.
POSTRetrievedFired after data has been retreived from an HTTP POST.
Summary
BlogCommentRepresents a comment on a blog entry or article.
Functions
uriGet the URI for various functions.
getPathGet the path to use for to store the comment.
updateCommit changes to a comment.
deleteDelete a comment.
insertAdd a new comment on an entry or article.
getPostDataPulls data out of the HTTP POST headers and into the object.
getAnchorGet text to use as the name attribute in an HTML anchor tag.
getFilenameThe inverse of getAnchor, this converts an anchor into a file.
globalIDGet the global identifier for this trackback.
permalinkGet the permalink to the object.
isCommentDetermines whether or not the object is an existing, saved comment.
getParentGets a copy of the parent object of this comment, i.e.
getGets the markup to display the object in a web browser.

Functions

uri

function uri($type)

Get the URI for various functions.

getPath

function getPath($ts)

Get the path to use for to store the comment.  This is specific to file-based storage and so is for internal use only.

Parameters

tsThe timestamp of the entry.

Returns

A string to use for the file name.

update

function update ()

Commit changes to a comment.

Returns

True on success, false on failure.

delete

function delete ()

Delete a comment.

Returns

True on success, false on failure.

insert

function insert($entry)

Add a new comment on an entry or article.

Parameters

EntryThe entry to which this comment will belong.  This determines where the comment is stored.

Returns

True on success, false on failure.

getPostData

function getPostData()

Pulls data out of the HTTP POST headers and into the object.

The interface for this uses pre-defined POST field names they are as follows.  If the poster is an authenticated user, then the userid is also recorded automatically from the HTTP session. username - The name of the poster. email - The poster’s e-mail address. url - The poster’s homepage. showemail - If not empty, show the poster’s e-mail address publically. subject - The subject of the post. data - The post content.  This cannot be empty.

getAnchor

function getAnchor()

Get text to use as the name attribute in an HTML anchor tag.

Returns

A string for anchor text based on the file name/storage ID.

getFilename

function getFilename($anchor)

The inverse of getAnchor, this converts an anchor into a file.

Parameters

anchorAn anchor string generated by getAnchor.

Returns

A string with the name of the associated file.

globalID

function globalID()

Get the global identifier for this trackback.

permalink

function permalink()

Get the permalink to the object.  This is essentially the URI of the parent’s comments page with the anchor name appended.

Returns

The full URI to the object’s permalink, including page anchor.

isComment

function isComment($path = false)

Determines whether or not the object is an existing, saved comment.

Parameters

pathThe optional path to the comment data file.  If not specified, then the file property is used.

Returns

True if the comment data file exists, false otherwise.

getParent

function getParent()

Gets a copy of the parent object of this comment, i.e. the object which this is a comment on.

Returns

A BlogEntry or Article object, depending on the context.

get

function get($show_edit_controls = false)

Gets the markup to display the object in a web browser.

Parameters

show_edit_controlsOptional boolean that determines whether or not to display edit controls, e.g. delete link.

Returns

A string containing the markup.

function uri($type)
Get the URI for various functions.
function getPath($ts)
Get the path to use for to store the comment.
function update ()
Commit changes to a comment.
function delete ()
Delete a comment.
function insert($entry)
Add a new comment on an entry or article.
function getPostData()
Pulls data out of the HTTP POST headers and into the object.
function getAnchor()
Get text to use as the name attribute in an HTML anchor tag.
function getFilename($anchor)
The inverse of getAnchor, this converts an anchor into a file.
function globalID()
Get the global identifier for this trackback.
function permalink()
Get the permalink to the object.
function isComment($path = false)
Determines whether or not the object is an existing, saved comment.
function getParent()
Gets a copy of the parent object of this comment, i.e.
function get($show_edit_controls = false)
Gets the markup to display the object in a web browser.
A base object which is event-aware, i.e.
An abstract class representing entries of all types in the blog database.
Close