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();
Esempio n. 2
0
    }
    echo '<h3>' . __('Trackbacks received') . '</h3>';
    if (!$trackbacks->isEmpty()) {
        showComments($trackbacks, $has_action, true);
    } else {
        echo '<p>' . __('No trackback') . '</p>';
    }
    if ($has_action) {
        echo '<div class="two-cols">' . '<p class="col checkboxes-helpers"></p>' . '<p class="col right"><label for="action" class="classic">' . __('Selected trackbacks action:') . '</label> ' . form::combo('action', $combo_action) . form::hidden('id', $post_id) . form::hidden(array('section'), 'trackbacks') . $core->formNonce() . '<input type="submit" value="' . __('ok') . '" /></p>' . '</div>' . '</form>';
    }
    /* Add trackbacks
    	-------------------------------------------------------- */
    if ($can_edit_post && $post->post_status) {
        echo '<div class="fieldset clear">';
        echo '<h3>' . __('Ping blogs') . '</h3>' . '<form action="' . $core->adminurl->get("admin.post", array('id' => $post_id)) . '" id="trackback-form" method="post">' . '<p><label for="tb_urls" class="area">' . __('URLs to ping:') . '</label>' . form::textarea('tb_urls', 60, 5, $tb_urls) . '</p>' . '<p><label for="tb_excerpt" class="area">' . __('Excerpt to send:') . '</label>' . form::textarea('tb_excerpt', 60, 5, $tb_excerpt) . '</p>' . '<p>' . $core->formNonce() . '<input type="submit" name="ping" value="' . __('Ping blogs') . '" />' . (empty($_GET['tb_auto']) ? '&nbsp;&nbsp;<a class="button" href="' . $core->adminurl->get("admin.post", array('id' => $post_id, 'tb_auto' => 1, 'tb' => 1)) . '">' . __('Auto discover ping URLs') . '</a>' : '') . '</p>' . '</form>';
        $pings = $TB->getPostPings($post_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>';
        }
        echo '</div>';
    }
    echo '</div>';
    #trackbacks
}
# Controls comments or trakbacks capabilities
function isContributionAllowed($id, $dt, $com = true)