Esempio n. 1
0
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_trackbacks.js'));
# Exit if we cannot view page
if (!$can_view_page) {
    dcPage::close();
    exit;
}
if (!empty($_GET['sent'])) {
    echo '<p class="message">' . __('All pings sent.') . '</p>';
}
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . $page_title . '</h2>';
echo '<p><a href="' . $core->getPostAdminURL($post->post_type, $id) . '">&#171; ' . sprintf(__('Back to "%s"'), html::escapeHTML($post->post_title)) . '</a></p>';
echo '<h3 id="entry-preview-title">' . html::escapeHTML($post->post_title) . '</h3>' . '<div class="frame-shrink" id="entry-preview">' . ($post->post_excerpt_xhtml ? $post->post_excerpt_xhtml . '<hr />' : '') . $post->post_content_xhtml . '</div>';
if (!empty($_GET['auto'])) {
    flush();
    $tb_urls = implode("\n", $TB->discover($post->post_excerpt_xhtml . ' ' . $post->post_content_xhtml));
} else {
    $auto_link = '<strong><a href="trackbacks.php?id=' . $id . '&amp;auto=1">' . __('Auto discover ping URLs') . '</a></strong>';
}
echo '<h3>' . __('Ping blogs') . '</h3>' . '<form action="trackbacks.php" id="trackback-form" method="post">' . '<p><label class="area">' . __('URLs to ping:') . form::textarea('tb_urls', 60, 5, $tb_urls) . '</label></p>' . '<p><label class="area">' . __('Send excerpt:') . form::textarea('tb_excerpt', 60, 3, $tb_excerpt) . '</label></p>' . '<p>' . form::hidden('id', $id) . $core->formNonce() . '<input type="submit" value="' . __('Ping blogs') . '" />&nbsp;&nbsp;' . $auto_link . '</p>' . '</form>';
$pings = $TB->getPostPings($id);
if (!$pings->isEmpty()) {
    echo '<h3>' . __('Previously sent pings') . '</h3>';
    echo '<ul class="nice">';
    while ($pings->fetch()) {
        echo '<li>' . dt::dt2str(__('%Y-%m-%d %H:%M'), $pings->ping_dt) . ' - ' . $pings->ping_url . '</li>';
    }
    echo '</ul>';
}
dcPage::close();