Exemple #1
0
    exit;
}
if ($trackback->checkRepost($dbh, TRACKBACK_REPOST_COUNT, TRACKBACK_REPOST_TIMESPAN) !== false) {
    echo Services_Trackback::getResponseError('Only ' . TRACKBACK_REPOST_COUNT . ' trackbacks from 1 IP address within ' . TRACKBACK_REPOST_TIMESPAN . ' secs are allowed on this site. Please try again later.', 1);
    exit;
}
$trackback->createSpamCheck('Akismet', $trackback->akismetOptions);
if ($trackback->checkSpam() === true) {
    echo Services_Trackback::getResponseError('Your trackback seems to be spam. If it is not, please contact the webmaster of this site.', 1);
    exit;
}
$res = $trackback->save($dbh);
if (PEAR::isError($res)) {
    echo Services_Trackback::getResponseError('Your trackback could not be saved, please try again or inform the administrator.', 1);
    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'));
$mailer = Damblan_Mailer::create('Trackback_New', $mailData);
// Get active maintainers only
$additionalHeaders['To'] = $trackback->getMaintainers(true);
if (!DEVBOX) {
    $res = $mailer->send($additionalHeaders);
} else {
    $res = true;
}
if (PEAR::isError($res)) {
    echo Services_Trackback::getResponseError('The notification email for your trackback could not be send. Please inform ' . PEAR_WEBMASTER_EMAIL . '.', 1);
    exit;
}
echo Services_Trackback::getResponseSuccess();