Public Member Functions | |
__construct () | |
send ($tb_data) | |
receive () | |
send_error ($message= 'Incomplete Information') | |
send_success () | |
data ($item) | |
process ($url, $data) | |
extract_urls ($urls) | |
validate_url ($url) | |
get_id ($url) | |
convert_xml ($str) | |
limit_characters ($str, $n=500, $end_char= '…') | |
convert_ascii ($str) | |
set_error ($msg) | |
display_errors ($open= '< p >', $close= '</p >') | |
__construct | ( | ) |
Constructor
public
convert_ascii | ( | $str) |
High ASCII to Entities
Converts Hight ascii text and MS Word special chars to character entities
public
string |
convert_xml | ( | $str) |
Convert Reserved XML characters to Entities
public
string |
data | ( | $item) |
Fetch a particular item
public
string |
display_errors | ( | $open = '<p>' , |
|
$close = '</p>' |
|||
) |
Show error messages
public
string | |
string |
extract_urls | ( | $urls) |
Extract Trackback URLs
This function lets multiple trackbacks be sent. It takes a string of URLs (separated by comma or space) and puts each URL into an array
public
string |
get_id | ( | $url) |
Find the Trackback URL's ID
public
string |
limit_characters | ( | $str, | |
$n = 500 , |
|||
$end_char = '…' |
|||
) |
Character limiter
Limits the string based on the character count. Will preserve complete words.
public
string | |
integer | |
string |
process | ( | $url, | |
$data | |||
) |
Process Trackback
Opens a socket connection and passes the data to the server. Returns TRUE on success, FALSE on failure
public
string | |
string |
receive | ( | ) |
Receive Trackback Data
This function simply validates the incoming TB data. It returns FALSE on failure and TRUE on success. If the data is valid it is set to the $this->data array so that it can be inserted into a database.
public
send | ( | $tb_data) |
Send Trackback
public
array |
send_error | ( | $message = 'Incomplete Information' ) |
Send Trackback Error Message
Allows custom errors to be set. By default it sends the "incomplete information" error, as that's the most common one.
public
string |
send_success | ( | ) |
Send Trackback Success Message
This should be called when a trackback has been successfully received and inserted.
public
set_error | ( | $msg) |
Set error message
public
string |
validate_url | ( | $url) |
Validate URL
Simply adds "http://" if missing
public
string |