Пример #1
0
   $Id$
*/
auth_require('pear.dev');
$action = isset($_GET['action']) && !empty($_GET['action']) ? $_GET['action'] : false;
$track_id = isset($_GET['id']) && !empty($_GET['id']) ? $_GET['id'] : false;
$timestamp = isset($_GET['timestamp']) && !empty($_GET['timestamp']) ? $_GET['timestamp'] : false;
if (!$action || !$track_id || !$timestamp) {
    response_header('Trackback admin', null, null);
    report_error('Missing arguments. Exiting.');
    response_footer();
    exit;
}
include_once 'Damblan/Trackback.php';
include_once 'Damblan/Mailer.php';
$trackback = new Damblan_Trackback(array('id' => $track_id, 'timestamp' => $timestamp));
$res = $trackback->load($dbh);
$error = false;
if (!$res) {
    $msg = 'No trackback.';
    $error = true;
} elseif (PEAR::isError($res)) {
    $msg = $res->getMessage();
    $error = true;
}
if ($error) {
    response_header('Trackback admin', null, null);
    report_error('Error: ' . $msg);
    response_footer();
    exit;
}
$mailData = array('id' => $trackback->get('id'), 'blog_name' => $trackback->get('blog_name'), 'title' => $trackback->get('title'), 'url' => $trackback->get('url'), 'excerpt' => $trackback->get('excerpt'), 'date' => format_date($trackback->get('timestamp')), 'timestamp' => $trackback->get('timestamp'), 'user' => $auth_user->handle);