Dotclear 2.24
Loading...
Searching...
No Matches
dcTrackback Class Reference

Public Member Functions

 __construct ()
 
Send
 getPostPings (int $post_id)
 
 ping (string $url, int $post_id, string $post_title, string $post_excerpt, string $post_url)
 

Data Fields

const PING_TABLE_NAME = 'ping'
 
 $table
 

Receive

 receiveTrackback (int $post_id)
 
 receivePingback (string $from_url, string $to_url)
 
 receiveWebmention ()
 

Discover

 discover (string $text)
 
static checkURLs (string $from_url, string $to_url)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Object constructor

References dcCore\app(), and PING_TABLE_NAME.

Member Function Documentation

◆ getPostPings()

getPostPings ( int  $post_id)

Get all pings sent for a given post.

Parameters
integer$post_idThe post identifier
Returns
dcRecord The post pings.

References dcCore\app().

◆ ping()

ping ( string  $url,
int  $post_id,
string  $post_title,
string  $post_excerpt,
string  $post_url 
)

Sends a ping to given $url.

Parameters
string$urlThe url
int$post_idThe post identifier
string$post_titleThe post title
string$post_excerptThe post excerpt
string$post_urlThe post url
Exceptions
Exception
Returns
mixed false if error

References dcCore\app(), html\clean(), and html\escapeHTML().

◆ receiveTrackback()

receiveTrackback ( int  $post_id)

Receives a trackback and insert it as a comment of given post.

Parameters
int$post_idThe post identifier

References $err, dcCore\app(), html\clean(), text\cutString(), html\decodeEntities(), html\escapeHTML(), and http\head().

◆ receivePingback()

receivePingback ( string  $from_url,
string  $to_url 
)

Receives a pingback and insert it as a comment of given post.

Parameters
string$from_urlSource URL
string$to_urlTarget URL
Exceptions
Exception
Returns
string

References html\clean(), text\cutString(), html\decodeEntities(), and html\escapeHTML().

◆ receiveWebmention()

receiveWebmention ( )

Receives a webmention and insert it as a comment of given post.

NB: plugin Fair Trackback check source content to find url.

Exceptions
Exception

References $code, $err, dcCore\app(), checkURLs(), html\clean(), text\cutString(), html\decodeEntities(), html\escapeHTML(), and http\head().

◆ discover()

discover ( string  $text)

Returns an array containing all discovered trackbacks URLs in $text.

Parameters
string$textThe text
Returns
array

◆ checkURLs()

static checkURLs ( string  $from_url,
string  $to_url 
)
static

URL helper.

Parameters
string$from_urlThe from url
string$to_urlTo url
Exceptions
Exception

References html\sanitizeURL().

Referenced by dcXmlRpc\pingback_ping(), and receiveWebmention().

Field Documentation

◆ PING_TABLE_NAME

const PING_TABLE_NAME = 'ping'

◆ $table

$table

Pings table name


The documentation for this class was generated from the following file: