Skip to content

CI_Trackback

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_Trackback

Trackback Class

Trackback Sending/Receiving Class

  • Class name: CI_Trackback
  • Namespace:

Properties

$charset

public string $charset = 'UTF-8'

Character set

  • Visibility: public

$data

public array $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '')

Trackback data

  • Visibility: public

$convert_ascii

public boolean $convert_ascii = TRUE

Convert ASCII flag

Whether to convert high-ASCII and MS Word characters to HTML entities.

  • Visibility: public

$response

public string $response = ''

Response

  • Visibility: public

$error_msg

public array<mixed,string> $error_msg = array()

Error messages list

  • Visibility: public

Methods

__construct

void CI_Trackback::__construct()

Constructor

  • Visibility: public

send

boolean CI_Trackback::send($tb_data)

Send Trackback

  • Visibility: public

Arguments

  • $tb_data mixed

receive

boolean 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.

  • Visibility: public

send_error

void CI_Trackback::send_error($message)

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.

  • Visibility: public

Arguments

  • $message mixed

send_success

void CI_Trackback::send_success()

Send Trackback Success Message

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

  • Visibility: public

data

string CI_Trackback::data($item)

Fetch a particular item

  • Visibility: public

Arguments

  • $item mixed

process

boolean 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

  • Visibility: public

Arguments

  • $url mixed
  • $data mixed

extract_urls

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

  • Visibility: public

Arguments

  • $urls mixed

validate_url

void CI_Trackback::validate_url($url)

Validate URL

Simply adds "http://" if missing

  • Visibility: public

Arguments

  • $url mixed

get_id

string CI_Trackback::get_id($url)

Find the Trackback URL's ID

  • Visibility: public

Arguments

  • $url mixed

convert_xml

string CI_Trackback::convert_xml($str)

Convert Reserved XML characters to Entities

  • Visibility: public

Arguments

  • $str mixed

limit_characters

string CI_Trackback::limit_characters($str, $n, $end_char)

Character limiter

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

  • Visibility: public

Arguments

  • $str mixed
  • $n mixed
  • $end_char mixed

convert_ascii

string CI_Trackback::convert_ascii($str)

High ASCII to Entities

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

  • Visibility: public

Arguments

  • $str mixed

set_error

void CI_Trackback::set_error($msg)

Set error message

  • Visibility: public

Arguments

  • $msg mixed

display_errors

string CI_Trackback::display_errors($open, $close)

Show error messages

  • Visibility: public

Arguments

  • $open mixed
  • $close mixed
Clone this wiki locally