blog->getPosts($params); if ($post->isEmpty()) { $core->error->add(__('This entry does not exist or is not published')); $can_view_page = false; } else { $TB = new dcTrackback($core); $tb_excerpt = $post->post_excerpt_xhtml.' '.$post->post_content_xhtml; $post_title = $post->post_title; $post_url = $post->getURL(); } } else { $core->error->add(__('This entry does not exist.')); $can_view_page = false; } # Change excerpt if (!empty($_POST['tb_excerpt'])) { $tb_excerpt = $_POST['tb_excerpt']; } # Sanitize excerpt $tb_excerpt = html::clean($tb_excerpt); $tb_excerpt = html::decodeEntities($tb_excerpt); $tb_excerpt = text::cutString(html::escapeHTML($tb_excerpt),255); $tb_excerpt = preg_replace('/\s+/ms',' ',$tb_excerpt); # Send pings if ($post && !$post->isEmpty() && !empty($_POST['tb_urls'])) { $tb_urls = $_POST['tb_urls']; $tb_urls = str_replace("\r",'',$tb_urls); $post_title = html::escapeHTML(trim(html::clean($post_title))); foreach (explode("\n",$tb_urls) as $tb_url) { try { $TB->ping($tb_url,$id,$post_title,$tb_excerpt,$post_url); } catch (Exception $e) { $core->error->add($e->getMessage()); } } if (!$core->error->flag()) { http::redirect('trackbacks.php?id='.$id.'&sent=1'); } } $page_title = __('Ping blogs'); /* 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 '

'.__('All pings sent.').'

'; } echo '

'.html::escapeHTML($core->blog->name).' › '.$page_title.'

'; echo '

« '. sprintf(__('Back to "%s"'),html::escapeHTML($post->post_title)).'

'; echo '

'. html::escapeHTML($post->post_title).'

'. '
'. ($post->post_excerpt_xhtml ? $post->post_excerpt_xhtml.'
' : ''). $post->post_content_xhtml. '
'; if (!empty($_GET['auto'])) { flush(); $tb_urls = implode("\n",$TB->discover($post->post_excerpt_xhtml.' '.$post->post_content_xhtml)); } else { $auto_link = ''. __('Auto discover ping URLs').''; } echo '

'.__('Ping blogs').'

'. '
'. '

'. '

'. '

'.form::hidden('id',$id). $core->formNonce(). '  '. $auto_link.'

'. '
'; $pings = $TB->getPostPings($id); if (!$pings->isEmpty()) { echo '

'.__('Previously sent pings').'

'; echo ''; } dcPage::close(); ?>