Class: trackback

Source Location: /bblog/inc/trackback.class.php ( Revision Log )

Class trackback

Class Overview

trackback.class.php - Implements trackback handling according to the Trackback specification found at http://www.sixapart.com/pronet/docs/trackback_spec

Located in /bblog/inc/trackback.class.php [line 14]



		
				Author(s):
		
		
		
Information Tags:
License:  GNU General Public License
Copyright:  Kenneth Power <kenneth.power@gmail.com>
Version:  $Id: $

Properties

Methods

[ Top ]
Property Summary
mixed   $_db  
mixed   $_ip  
mixed   $_post  
mixed   $_tbdata  

[ Top ]
Method Summary
trackback   trackback()   Contructor
mixed   allowTrackback()   Performs various checks to determine whether the trackback is allowed.
void   receiveTrackback()   Process a trackback someone sent to us
void   userResponse()   Respond to a trackback ping

[ Top ]
Properties
mixed   $_db [line 15]

[ Top ]
mixed   $_ip [line 18]

[ Top ]
mixed   $_post [line 17]

[ Top ]
mixed   $_tbdata [line 16]

[ Top ]
Methods
Constructor trackback  [line 25]

  trackback trackback( object $db, object $post  )

Contructor

Parameters:
object   $db: 
object   $post:  The post receiving the trackback


[ Top ]
allowTrackback  [line 147]

  mixed allowTrackback( )

Performs various checks to determine whether the trackback is allowed.

Most checks are user-configurable via the admin options control panel. The following are checked: Flooding User Input (comments, trackbacks) disallowed URL (a requirement of the spec)


API Tags:
Return:  If a trackback is allowed, return true, else return an array of error messages


[ Top ]
receiveTrackback  [line 47]

  void receiveTrackback( string $ip, array $ext_vars, [int $commentid = null]  )

Process a trackback someone sent to us

Parameters:
string   $ip:  IP Address of the pinger
array   $ext_vars:  The trackback data, in the format: +================================================+ | key | value | +-----------+------------------------------------+ | url* | URL of the pinging site | +-----------+------------------------------------+ | title | Title of the referring article | +-----------+------------------------------------+ | excerpt | Excerpt from the referring article | +-----------+------------------------------------+ | blog_name | Name of the referring blog | +===========+====================================+
int   $commentid:  If given, the ID of a comment in a blog


[ Top ]
userResponse  [line 123]

  void userResponse( int $err, string $msg  )

Respond to a trackback ping

According to the specification: <quote> In the event of a succesful ping, the server MUST return a response in the following format:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <response>
  3. <error>0</error>
  4. </response>
In the event of an unsuccessful ping, the server MUST return an HTTP response in the following format:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <response>
  3. <error>1</error>
  4. <message>The error message</message>
  5. </response>
</quote>

Parameters:
int   $err:  0 or 1 only. 0 == Success; 1 == Failure
string   $msg:  Only necessary when an error is raised. In this case it is an error message


[ Top ]