Trackback

Class for TrackBack entries.  This attempts to comply with theTrackBack specification at http://www.sixapart.com/pronet/docs/trackback_spec This is used to recieve and send TrackBack pings as well as to access locally stored ping data.

Inherits: LnBlogObject

Events

OnInitFired when the object is about to initialize.
InitCompleteFired after the object has been initialized.
POSTRetreivedFired when POST data for a trackback is retreived.
OnDeleteFired when a trackback is about to be deleted.
DeleteCompleteFired right after a trackback has been deleted.
OnReceiveFired when starting to receive a ping.
ReceiveCompleteFired after receiving a ping.
OnSendFired before sending a ping.
SendCompleteFired after sending a ping.
OnOutputFired when starting to process for display.
OutputCompleteFired when output is sent to the client.
Summary
TrackbackClass for TrackBack entries.
Functions
titleAn RSS compatibility method for getting the title of an entry.
getParentGets a copy of the parent object.
isTrackbackDetermines if an object or file is a saved trackback.
uriGet the URI for various functions
getPostDataPulls the trackback data out of the POST and into the object.
sendSend a TrackBack ping without using a form.
receiveReceive a TrackBack ping and store the data in a file.
incomingPingDetermines if there is a trackback ping in the POST data.
readFileDataReads trackback ping data from a file.
writeFileDataWrite trackback data to a file.
getPut the saved data into a template for display.
deletePermanently delete a trackback.
permalinkGives the permalink to the trackback entry.
getAnchorGets an anchor to the entry on the page.
getFilenameConverts an anchor from getAnchor or an ID from globalID into a filename.
globalIDGet the global identifier for this trackback.

Functions

title

function title($no_escape = false)

An RSS compatibility method for getting the title of an entry.

Parameters

no_escapeOptional boolean that tells the function to not escape ampersands and angle braces in the return value.

Returns

A string containing the title of this object.

getParent

function getParent()

Gets a copy of the parent object.

Returns

A BlogEntry or Article object, depending on the context.

isTrackback

function isTrackback($path = false)

Determines if an object or file is a saved trackback.

Parameters

pathThe optional path to the trackback data file.  If not given, then the object’s file property is used.

Returns

True if the data file exists and is under an entry trackback directory, false otherwise

uri

function uri($type)

Get the URI for various functions

getPostData

function getPostData()

Pulls the trackback data out of the POST and into the object.

As per the TrackBack specification located at http://www.sixapart.com/pronet/docs/trackback_spec, the interface for POSTs is as follows. title - The title of the pinging post. excerpt - An excerpt from the text of the pinging post. blog_name - The name of the blog to which the pinging post belongs. url - The URL of the pinging post.  This is the only required field.

send

function send($url)

Send a TrackBack ping without using a form.

Parameters

urlThe URL to which the trackback ping will be sent.

Returns

An associative array with ‘error’, ‘message’, and ‘response’ elements.  The error element contains the trackback return code from the remote server.  The message element contains the error message if there was one.  Note that a return code of 0 indicates success, while other values indicate an error.  The response element contains the full XML response, for debugging purposes.

receive

function receive()

Receive a TrackBack ping and store the data in a file.  This method also outputs a response in XML for the pinger.

Returns

Zero on success, 1 on failure.  Note that these are the same return codes described in the TrackBack specificaiton.

incomingPing

function incomingPing()

Determines if there is a trackback ping in the POST data.

Returns

True if there is a ping URL in the POST, false otherwise.

readFileData

function readFileData($path = false)

Reads trackback ping data from a file.

Parameters

pathOptional path for the data file.  Default is the current file.

writeFileData

function writeFileData($path)

Write trackback data to a file.

Parameters

pathThe path to which to write the data

Returns

True on success, false on failure.

get

function get()

Put the saved data into a template for display.

Returns

The data to be sent to the client.

delete

function delete()

Permanently delete a trackback.

Returns

True on success, false on failure.

permalink

function permalink()

Gives the permalink to the trackback entry.

Returns

A permalink to the trackback entry.

getAnchor

function getAnchor()

Gets an anchor to the entry on the page.

Returns

The anchor to use for this trackback.

getFilename

function getFilename($anchor)

Converts an anchor from getAnchor or an ID from globalID into a filename.

Parameters

anchorThe anchor or ID to turn into a filename.

Returns

The path to the trackback file.

globalID

function globalID()

Get the global identifier for this trackback.

function title($no_escape = false)
An RSS compatibility method for getting the title of an entry.
function getParent()
Gets a copy of the parent object.
function isTrackback($path = false)
Determines if an object or file is a saved trackback.
function uri($type)
Get the URI for various functions
function getPostData()
Pulls the trackback data out of the POST and into the object.
function send($url)
Send a TrackBack ping without using a form.
function receive()
Receive a TrackBack ping and store the data in a file.
function incomingPing()
Determines if there is a trackback ping in the POST data.
function readFileData($path = false)
Reads trackback ping data from a file.
function writeFileData($path)
Write trackback data to a file.
function get()
Put the saved data into a template for display.
function delete()
Permanently delete a trackback.
function permalink()
Gives the permalink to the trackback entry.
function getAnchor()
Gets an anchor to the entry on the page.
function getFilename($anchor)
Converts an anchor from getAnchor or an ID from globalID into a filename.
function globalID()
Get the global identifier for this trackback.
Close