My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields
CI_Trackback Class Reference

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 >')
 

Data Fields

 $time_format = 'local'
 
 $charset = 'UTF-8'
 
 $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '')
 
 $convert_ascii = TRUE
 
 $response = ''
 
 $error_msg = array()
 

Constructor & Destructor Documentation

__construct ( )

Constructor

public

Member Function Documentation

convert_ascii (   $str)

High ASCII to Entities

Converts Hight ascii text and MS Word special chars to character entities

public

Parameters
string
Returns
string
convert_xml (   $str)

Convert Reserved XML characters to Entities

public

Parameters
string
Returns
string
data (   $item)

Fetch a particular item

public

Parameters
string
Returns
string
display_errors (   $open = '<p>',
  $close = '</p>' 
)

Show error messages

public

Parameters
string
string
Returns
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

Parameters
string
Returns
string
get_id (   $url)

Find the Trackback URL's ID

public

Parameters
string
Returns
string
limit_characters (   $str,
  $n = 500,
  $end_char = '&#8230;' 
)

Character limiter

Limits the string based on the character count. Will preserve complete words.

public

Parameters
string
integer
string
Returns
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

Parameters
string
string
Returns
bool
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

Returns
bool
send (   $tb_data)

Send Trackback

public

Parameters
array
Returns
bool
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

Parameters
string
Returns
void
send_success ( )

Send Trackback Success Message

This should be called when a trackback has been successfully received and inserted.

public

Returns
void
set_error (   $msg)

Set error message

public

Parameters
string
Returns
void
validate_url (   $url)

Validate URL

Simply adds "http://" if missing

public

Parameters
string
Returns
string

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