Trackback
LnBlogObject
Reply
Trackback
Pingback

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
OnInit

Fired when the object is about to initialize.

InitComplete

Fired after the object has been initialized.

POSTRetreived

Fired when POST data for a trackback is retreived.

OnDelete

Fired when a trackback is about to be deleted.

DeleteComplete

Fired right after a trackback has been deleted.

OnReceive

Fired when starting to receive a ping.

ReceiveComplete

Fired after receiving a ping.

OnSend

Fired before sending a ping.

SendComplete

Fired after sending a ping.

OnOutput

Fired when starting to process for display.

OutputComplete

Fired when output is sent to the client.

Functions
title
function title(
$no_escapefalse
)

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

Parameters
no_escape

Optional 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(
$pathfalse
)

Determines if an object or file is a saved trackback.

Parameters
path

The 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,
$params []
)

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
url

The 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(
$pathfalse
)

Reads trackback ping data from a file.

Parameters
path

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

writeFileData
function writeFileData(
$path
)

Write trackback data to a file.

Parameters
path

The 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
anchor

The 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.