Pingback

Represents a Pingback ping.  Pingbacks are similar in purpose to Trackbacks, but are fully automated (as per the spec, no user interaction required) and implemented using XML-RPC.  The Pingback specification is available at http://hixie.ch/specs/pingback/pingback

Events

OnInitFired when the object is about to initialize.
InitCompleteFired after the object has been initialized.
OnInsertFired before a pingback is stored.
InsertCompleteFired after a pingback is saved.
OnDeleteFired when a pingback is about to be deleted.
DeleteCompleteFired right after a pingback has been deleted.
OnOutputFired when starting to process for display.
OutputCompleteFired when output is sent to the client.
Summary
Represents a Pingback ping.
Get the URI for various functions
Stores the pingback data in a file.
Gets an anchor to the entry on the page.
Converts an anchor from getAnchor into a filename.
Reads pingback data from a file.
Write pingback data to a file.
Put the saved data into a template for display.
Requests a URL from a remote host and returns the resulting data.
Checks if a given URL is pingback-enabled or not.

Functions

uri

function uri($type)

Get the URI for various functions

insert

function insert($ent)

Stores the pingback data in a file.  It is assumed that the source, target, title, and excerpt properties are set externally.

Parameters

entThe entry into which to insert this pingback.

getAnchor

function getAnchor()

Gets an anchor to the entry on the page.

Returns

The anchor to use for this pingback.

getFilename

function getFilename($anchor)

Converts an anchor from getAnchor into a filename.

Parameters

anchorThe anchor to turn into a filename.

Returns

The name of the pingback file.

readFileData

function readFileData($path = false)

Reads pingback data from a file.

Parameters

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

writeFileData

function writeFileData($path)

Write pingback 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.

fetchPage

function fetchPage($url,  
$headers = false)

Requests a URL from a remote host and returns the resulting data.

Parameters

urlThe URL to fetch.
headersOptional boolean to only fetch the page headers.  Defaults to false.

Returns

A string containing the HTTP headers and body of the requested URL.

checkPingbackEnabled

function checkPingbackEnabled($url)

Checks if a given URL is pingback-enabled or not.

urlThe URL to check.

Returns

If the resource has an X-Pingback header or a link element with the rel=”pingback” attribute set, then returns the URL specified in the header (if it exists) or the link element.  Returns false otherwise.

function uri($type)
Get the URI for various functions
function insert($ent)
Stores the pingback data in a file.
function getAnchor()
Gets an anchor to the entry on the page.
function getFilename($anchor)
Converts an anchor from getAnchor into a filename.
function readFileData($path = false)
Reads pingback data from a file.
function writeFileData($path)
Write pingback data to a file.
function get()
Put the saved data into a template for display.
function fetchPage($url,  
$headers = false)
Requests a URL from a remote host and returns the resulting data.
function checkPingbackEnabled($url)
Checks if a given URL is pingback-enabled or not.