Procedural File: lib-trackback.php
Source Location: /system/lib-trackback.php
Page Details:
TRB_SAVE_OK [line 37]
TRB_SAVE_REJECT [line 39]
TRB_SAVE_SPAM [line 38]
TRB_allowDelete [line 201]
boolean TRB_allowDelete(
string $sid, string $type)
|
|
Check if the current user is allowed to delete trackback comments.
Tags:
Parameters
| string |
$sid |
ID of the parent object of the comment |
| string |
$type |
type of the parent object ('article' = story, etc.) |
TRB_checkForSpam [line 236]
int TRB_checkForSpam(
string $url, [string $title = ''], [string $blog = ''], [string $excerpt = ''])
|
|
Check a trackback / pingback for spam
Tags:
Parameters
| string |
$url |
URL of the trackback comment |
| string |
$title |
title of the comment (set to $url if empty) |
| string |
$blog |
name of the blog that sent the comment |
| string |
$excerpt |
excerpt from the comment |
TRB_containsBacklink [line 435]
boolean TRB_containsBacklink(
string $body, string $urlToCheck)
|
|
Perform a backlink check on an HTML page
Tags:
Parameters
| string |
$body |
complete HTML page to check |
| string |
$urlToCheck |
URL to find in that page |
TRB_deleteTrackbackComment [line 325]
void TRB_deleteTrackbackComment(
int $cid)
|
|
Delete a trackback comment Note: Permission checks have to be done by the caller.
Parameters
| int |
$cid |
ID of the trackback comment |
TRB_detectTrackbackUrl [line 826]
mixed TRB_detectTrackbackUrl(
string $url)
|
|
Attempt to auto-detect the Trackback URL of a post.
Tags:
Parameters
| string |
$url |
URL of post with embedded RDF for the Trackback URL |
TRB_filterBlogname [line 174]
string TRB_filterBlogname(
string $blogname)
|
|
Filter the blog name for a trackback comment we've received
Tags:
Parameters
| string |
$blogname |
blog name for the comment |
TRB_filterExcerpt [line 188]
string TRB_filterExcerpt(
string $excerpt)
|
|
Filter the excerpt of a trackback comment we've received Note: Does not truncate the excerpt.
Tags:
Parameters
| string |
$excerpt |
excerpt of the trackback comment |
TRB_filterTitle [line 162]
string TRB_filterTitle(
string $title)
|
|
Filter the title for a trackback comment we've received
Tags:
Parameters
| string |
$title |
title of the comment |
TRB_formatComment [line 350]
string TRB_formatComment(
string $url, [string $title = ''], [string $blog = ''], [string $excerpt = ''], [timestamp $date = 0], [boolean $delete_option = false], [string $cid = ''], [string $ipaddress = ''], [string $token = ''])
|
|
Format one trackback comment for display Note: $excerpt is not truncated - this should have been done elsewhere
Tags:
Parameters
| string |
$url |
URL of the trackback comment |
| string |
$title |
title of the comment (set to $url if empty) |
| string |
$blog |
name of the blog that sent the comment |
| string |
$excerpt |
excerpt from the comment |
| timestamp |
$date |
date and time when the comment was sent |
| boolean |
$delete_option |
whether to display a link to delete the trackback comment |
| string |
$cid |
id of this trackback comment |
| string |
$ipaddress |
IP address the comment was sent from |
| string |
$token |
security token |
TRB_handleTrackbackPing [line 541]
boolean TRB_handleTrackbackPing(
string $sid, [string $type = 'article'])
|
|
Handles a trackback ping for an entry. Also takes care of the speedlimit and spam. Assumes that the caller of this function has already checked permissions! Note: Error messages are XML-formatted and echo'd out directly, as they are supposed to be processed by some sort of software.
Tags:
Parameters
| string |
$sid |
ID of entry that got pinged |
| string |
$type |
type of that entry ('article' for stories, etc.) |
TRB_linksToUs [line 476]
boolean TRB_linksToUs(
string $sid, string $type, string $urlToGet)
|
|
Check if a given web page links to us
Tags:
Parameters
| string |
$sid |
ID of entry that got pinged |
| string |
$type |
type of that entry ('article' for stories, etc.) |
| string |
$urlToGet |
URL of the page that supposedly links to us |
TRB_logRejected [line 84]
void TRB_logRejected(
$reason, [ $url = ''], string $logmsg)
|
|
Helper function for the curious: Log rejected trackbacks
Parameters
| string |
$logmsg |
Message to log |
| |
$reason |
|
| |
$url |
|
TRB_makeTrackbackUrl [line 143]
string TRB_makeTrackbackUrl(
string $id, [string $type = 'article'])
|
|
Returns the trackback URL for an entry Note: Trackback pings default to stories, so we leave off the type if it is 'article' to create shorter URLs.
Tags:
Parameters
| string |
$id |
the entry's ID |
| string |
$type |
type of the entry ('article' = story, etc.) |
TRB_renderTrackbackComments [line 670]
string TRB_renderTrackbackComments(
string $sid, string $type, string $title, string $permalink, [string $trackback_url = ''])
|
|
Render all the trackback comments for a specific entry
Tags:
Parameters
| string |
$sid |
entry id |
| string |
$type |
type of entry ('article' = story, etc.) |
| string |
$title |
the entry's title |
| string |
$permalink |
link to the entry |
| string |
$trackback_url |
trackback_url trackback URL for this entry |
TRB_saveTrackbackComment [line 266]
int TRB_saveTrackbackComment(
string $sid, string $type, string $url, [string $title = ''], [string $blog = ''], [string $excerpt = ''])
|
|
Save a trackback (or pingback) comment. Also filters parameters and handles multiple trackbacks from the same source. Note: Spam check should have been done before calling this function.
Tags:
Parameters
| string |
$sid |
entry id |
| string |
$type |
type of entry ('article' = story, etc.) |
| string |
$url |
URL of the trackback comment |
| string |
$title |
title of the comment (set to $url if empty) |
| string |
$blog |
name of the blog that sent the comment |
| string |
$excerpt |
excerpt from the comment |
TRB_sendNotificationEmail [line 887]
void TRB_sendNotificationEmail(
int $cid, [string $what = 'trackback'])
|
|
Send a notification email when a new trackback comment has been posted
Parameters
| int |
$cid |
ID of the trackback comment |
| string |
$what |
type of notification: 'trackback' or 'pingback' |
TRB_sendTrackbackPing [line 746]
mixed TRB_sendTrackbackPing(
string $targeturl, string $url, string $title, string $excerpt, [string $blog = ''])
|
|
Send a trackback ping Based on a code snippet by Jannis Hermanns, http://www.jannis.to/programming/trackback.html
Tags:
Parameters
| string |
$targeturl |
URL to ping |
| string |
$url |
URL of our entry |
| string |
$title |
title of our entry |
| string |
$excerpt |
text excerpt from our entry |
| string |
$blog |
name of our Geeklog site |
TRB_sendTrackbackResponse [line 55]
void TRB_sendTrackbackResponse(
int $error, [string $errormsg = ''], [int $http_status = 200], [string $http_text = "OK"])
|
|
Send a trackback response message
Parameters
| int |
$error |
- = OK, 1 = an error occured
|
| string |
$errormsg |
the error message (ignored for $error == 0) |
| int |
$http_status |
optional HTTP status code |
| string |
$http_text |
optional HTTP status code text |
TRB_trackbackRdf [line 113]
string TRB_trackbackRdf(
string $article_url, string $title, string $trackback_url)
|
|
Creates a piece of RDF pointing out the trackback URL Note: When putting this in an HTML page, it may be advisable to enclose it in HTML comments, i.e. <!-- ... -->
Tags:
Parameters
| string |
$article_url |
URL of our entry |
| string |
$title |
title of that entry |
| string |
$trackback_url |
trackback URL for our entry |
|
|