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
PingbackRepresents a Pingback ping.
Functions
globalIDGet the global identifier for this trackback.
insertStores the pingback data in a file.
isPingbackDetermines if an object or file is a saved pingback.
getAnchorGets an anchor to the entry on the page.
getFilenameConverts an anchor from getAnchor into a filename.
getPut the saved data into a template for display.
isLocalDetermines whether or not the pingback is to an entry on the current blog and/or server.
fetchPageRequests a URL from a remote host and returns the resulting data.
checkPingbackEnabledChecks if a given URL is pingback-enabled or not.

Functions

globalID

function globalID()

Get the global identifier for this trackback.

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.

isPingback

function isPingback($path = false)

Determines if an object or file is a saved pingback.

Parameters

pathThe optional path to the pingback 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 pingback directory, false otherwise

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.

get

function get()

Put the saved data into a template for display.

Returns

The data to be sent to the client.

isLocal

function isLocal()

Determines whether or not the pingback is to an entry on the current blog and/or server.

Returns

True if the source and target are on the same host, false otherwise.

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 globalID()
Get the global identifier for this trackback.
function insert($ent)
Stores the pingback data in a file.
function isPingback($path = false)
Determines if an object or file is a saved pingback.
function getAnchor()
Gets an anchor to the entry on the page.
function getFilename($anchor)
Converts an anchor from getAnchor into a filename.
function get()
Put the saved data into a template for display.
function isLocal()
Determines whether or not the pingback is to an entry on the current blog and/or server.
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.
Close