Class CI_Trackback - echiong/testRepo GitHub Wiki

##Class CI_Trackback

Trackback Class

Trackback Sending/Receiving Class

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Trackbacks
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/libraries/trackback.html
Located at system/libraries/Trackback.php

##Methods summary


public __construct ( )

Constructor


public boolean send ( array $tb_data )

Send Trackback

Parameters

$tb_data array

Returns boolean


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

Returns boolean


public send_error ( string $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.

Parameters

$message string


public send_success ( )

Send Trackback Success Message

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


public string data ( string $item )

Fetch a particular item

Parameters

$item string

Returns string


public boolean process ( string $url, string $data )

Process Trackback

Opens a socket connection and passes the data to the server. Returns TRUE on success, FALSE on failure

Parameters

$url string

$data string

Returns boolean


public string extract_urls ( string $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

Parameters

$urls string

Returns string


public string validate_url ( string $url )

Validate URL

Simply adds "http://" if missing

Parameters

$url string

Returns string


public string get_id ( string $url )

Find the Trackback URL's ID

Parameters

$url string

Returns string


public string convert_xml ( string $str )

Convert Reserved XML characters to Entities

Parameters

$str string

Returns string


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

Character limiter

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

Parameters

$str string

$n integer

$end_char string

Returns string


public string convert_ascii ( string $str )

High ASCII to Entities

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

Parameters

$str string

Returns string


public set_error ( string $msg )

Set error message

Parameters

$msg string


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

Show error messages

Parameters

$open string

$close string

Returns string

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="time_format" id="$time_format">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$time_format

'local'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="charset" id="$charset">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$charset

'UTF-8'
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="data" id="$data">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$data

array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => '')
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="convert_ascii" id="$convert_ascii">
	<td class="attributes"><code>
		public  
		boolean
	</code></td>

	<td class="name">

$convert_ascii

TRUE
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="response" id="$response">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$response

''
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
<tr data-order="error_msg" id="$error_msg">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$error_msg

array()
#
		<div class="description detailed">
			

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️