Public Member Functions | |
CI_Trackback () | |
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 >') | |
Public Attributes | |
$time_format = 'local' | |
$charset = 'UTF-8' | |
$data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '') | |
$convert_ascii = TRUE | |
$response = '' | |
$error_msg = array() |
CI_Trackback::CI_Trackback | ( | ) |
Constructor
public
CI_Trackback::convert_ascii | ( | $ | str | ) |
High ASCII to Entities
Converts Hight ascii text and MS Word special chars to character entities
public
string |
CI_Trackback::convert_xml | ( | $ | str | ) |
Convert Reserved XML characters to Entities
public
string |
CI_Trackback::data | ( | $ | item | ) |
Fetch a particular item
public
string |
CI_Trackback::display_errors | ( | $ | open = '<p>' , |
|
$ | close = '</p>' | |||
) |
Show error messages
public
string | ||
string |
CI_Trackback::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 |
CI_Trackback::get_id | ( | $ | url | ) |
Find the Trackback URL's ID
public
string |
CI_Trackback::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 |
CI_Trackback::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 |
CI_Trackback::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
CI_Trackback::send | ( | $ | tb_data | ) |
Send Trackback
public
array |
CI_Trackback::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 |
CI_Trackback::send_success | ( | ) |
Send Trackback Success Message
This should be called when a trackback has been successfully received and inserted.
public
CI_Trackback::set_error | ( | $ | msg | ) |
Set error message
public
string |
CI_Trackback::validate_url | ( | $ | url | ) |
Validate URL
Simply adds "http://" if missing
public
string |
CI_Trackback::$charset = 'UTF-8' |
CI_Trackback::$convert_ascii = TRUE |
CI_Trackback::$data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '') |
CI_Trackback::$error_msg = array() |
CI_Trackback::$response = '' |
CI_Trackback::$time_format = 'local' |