check(1); include dirname(__FILE__).'/inc/connexion.php'; # Mise hors ligne d'un commentaire if (!empty($_GET['com_id']) && isset($_GET['cancel'])) { if ($blog->statusComment($_GET['com_id']) !== false) { $redir = 'comments.php'; $redir .= (!empty($_GET['env'])) ? '?env='.$_GET['env'] : ''; header('Location: '.$redir); exit; } } $nb_per_page = 30; $nb_comments = $blog->getNbComments(); $max_pages = ceil($nb_comments/$nb_per_page); $env = (!empty($_GET['env']) && $_GET['env'] <= $max_pages) ? $_GET['env'] : 1; $comments = $blog->getComments('','DESC',(($env-1)*$nb_per_page).','.$nb_per_page); # Pour voir ou cacher les commentaires $js_openCloseAll = $h_script = ''; if (!$comments->isEmpty()) { $h_script = '\n"; $js_openCloseAll = '

'.__('show all').' - '. ''.__('hide all').'

'; } # Ligne pour afficher un commentaire function ligne_comment($data,$i) { $comment_id = $data['comment_id']; $comment_dt = $data['comment_dt']; $comment_auteur = $data['comment_auteur']; $comment_email = $data['comment_email']; $comment_site = $data['comment_site']; $comment_content = $data['comment_content']; $comment_pub = $data['comment_pub']; $comment_ip = $data['comment_ip']; $comment_trackback = $data['comment_trackback']; $post_titre = $data['post_titre']; $post_id = $data['post_id']; $comment_date = date('d/m/Y H:i',strtotime($comment_dt)); if($comment_pub) { $com_cancel = __('set offline'); $com_style = ''; $com_img = ' '; } else { $com_cancel = __('set online'); $com_style = ' cancel'; $com_img = ' '; } $str_tb = ($comment_trackback == 1) ? ' - trackback' : ''; $cancel_url = $_SERVER['REQUEST_URI']; $cancel_url .= (strpos($cancel_url,'?') !== false) ? '&' : '?'; $cancel_url .= 'com_id='.$comment_id.'&cancel=1'; $res = '
'. '

'.$com_img. ''. '  '. ''. $post_titre.''.$str_tb. ' - '.$com_cancel.''. '

'. '

'.$comment_date.' - '.$comment_auteur.'

'; $res .= ''; $res .= '
'; return $res; } # Affichage openPage(__('Comments'),$h_script); echo '

'.__('Comments').'

'; echo '

'.__('Comments listed from most recent to oldest').'

'; $lum = new multipage($env,'ligne_comment',$comments->getData(),$nb_comments,$nb_per_page); $lum->setOption('html_block','%s'); $lum->setOption('html_row','%s'); $lum->setOption('html_cell','%s'); $lum->setOption('html_links','

'.__('Page(s)').' : %s

'); $lum->setOption('html_cur_page','%s'); $lum->setOption('html_prev','<'.__('prev. page')); $lum->setOption('html_next',__('next page').'>'); $lum->setOption('html_prev_grp','...'); $lum->setOption('html_next_grp','...'); $lum->setOption('html_empty','

'.__('No comment yet').'

'); echo $lum->getLinks(); echo $js_openCloseAll; echo $lum->getPage(); echo $lum->getLinks(); closePage(); ?>