3 * Provide functions to handle article trackbacks.
5 * @subpackage SpecialPage
9 define('MEDIAWIKI', true);
10 require_once('./includes/Defines.php');
12 if (!file_exists('LocalSettings.php'))
15 require_once('./LocalSettings.php');
16 require_once('includes/Setup.php');
18 require_once('Title.php');
19 require_once('DatabaseFunctions.php');
24 function XMLsuccess() {
26 <?xml version=\"1.0\" encoding=\"utf-8\"?>
34 function XMLerror($err = "Invalid request.") {
35 header("HTTP/1.0 400 Bad Request");
37 <?xml version=\"1.0\" encoding=\"utf-8\"?>
40 <message>Invalid request: $err</message>
46 if (!$wgUseTrackbacks)
47 XMLerror("Trackbacks are disabled.");
49 if ( !isset($_POST['url'])
50 ||
!isset($_POST['blog_name'])
51 ||
!isset($_REQUEST['article']))
52 XMLerror("Required field not specified");
54 $dbw =& wfGetDB(DB_MASTER
);
56 $tbtitle = $_POST['title'];
57 $tbex = $_POST['excerpt'];
58 $tburl = $_POST['url'];
59 $tbname = $_POST['blog_name'];
60 $tbarticle = $_REQUEST['article'];
62 $title = Title
::newFromText($tbarticle);
63 if (!$title->exists())
64 XMLerror("Specified article does not exist.");
66 $dbw->insert('trackbacks', array(
67 'tb_page' => $title->getArticleID(),
68 'tb_title' => $tbtitle,