3 * Provide functions to handle article trackbacks.
5 * @subpackage SpecialPage
7 require_once( './includes/WebStart.php' );
9 require_once('DatabaseFunctions.php');
14 function XMLsuccess() {
16 <?xml version=\"1.0\" encoding=\"utf-8\"?>
24 function XMLerror($err = "Invalid request.") {
25 header("HTTP/1.0 400 Bad Request");
27 <?xml version=\"1.0\" encoding=\"utf-8\"?>
30 <message>Invalid request: $err</message>
36 if (!$wgUseTrackbacks)
37 XMLerror("Trackbacks are disabled.");
39 if ( !isset($_POST['url'])
40 ||
!isset($_POST['blog_name'])
41 ||
!isset($_REQUEST['article']))
42 XMLerror("Required field not specified");
44 $dbw =& wfGetDB(DB_MASTER
);
46 $tbtitle = $_POST['title'];
47 $tbex = $_POST['excerpt'];
48 $tburl = $_POST['url'];
49 $tbname = $_POST['blog_name'];
50 $tbarticle = $_REQUEST['article'];
52 $title = Title
::newFromText($tbarticle);
53 if (!$title->exists())
54 XMLerror("Specified article does not exist.");
56 $dbw->insert('trackbacks', array(
57 'tb_page' => $title->getArticleID(),
58 'tb_title' => $tbtitle,