check(1);
include dirname(__FILE__).'/inc/connexion.php';
openPopup(__('Entry validation'));
$post_id = (!empty($_GET['post_id'])) ? $_GET['post_id'] : '';
$co_id = (!empty($_GET['co_id'])) ? $_GET['co_id'] : '';
$is_post = $is_comment = false;
if ($post_id != '')
{
$post = $blog->getPostByID($post_id);
$is_post = true;
echo '
'.__('Entry validation').'
';
}
elseif ($co_id != '')
{
$comment = $blog->getComment($co_id);
$is_comment = true;
echo ''.__('Comment validation').'
';
}
if ((empty($post) || $post->isEmpty()) && (empty($comment) || $comment->isEmpty()))
{
echo
''.__('Error(s)').' :
'.
'
'.($is_post ? __('No entry') : __('No comment')).'
';
}
else
{
flush();
if ($post_id != '') {
$content = $post->f('post_chapo')."\n".$post->f('post_content');
} else {
$content = $comment->f('comment_content');
}
if (($valid = validator::xhtml($content)) === false)
{
echo ''.__('Cannot connect to server.').'
';
}
elseif ($valid['valid'] == true)
{
echo ''.($is_post ? __('Valid entry') : __('Valid comment')).'
';
}
elseif ($valid['valid'] == false)
{
echo ''.($is_post ? __('Invalid entry') : __('Invalid comment')).'
';
if ($valid['errors'] != '')
{
echo ''.__('Errors list').' :
';
echo $valid['errors'];
}
}
echo ''.sprintf(__('Validation done with %s'),'WDG HTML Validator').'
'.
'http://www.htmlhelp.com/tools/validator/
';
echo '';
}
closePopup();
?>