2020-12-30 19:04:58 +01:00
< ? php // Do not delete these lines
if ( 'comments.php' == basename ( $_SERVER [ 'SCRIPT_FILENAME' ])) die ( 'Ne pas télécharger cette page directement, merci !' );
if ( ! empty ( $post -> post_password )) { // if there's a password
if ( $_COOKIE [ 'wp-postpass_' . COOKIEHASH ] != $post -> post_password ) { // and it doesn't match the cookie
?>
< h2 >< ? php _e ( 'Protégé par mot de passe' ); ?> </h2>
< p >< ? php _e ( 'Entrer le mot de passe pour voir les commentaires' ); ?> </p>
< ? php return ;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'alt' ;
?>
<!-- You can start editing here . -->
< section class = " comment-list " >
< ? php if ( $comments ) : ?>
2020-12-30 22:42:54 +01:00
< h1 class = " page-title " id = " comments " >< ? php comments_number ( 'Pas de commentaire' , 'Un commentaire' , '% commentaires' ); ?> </h1>
2020-12-30 19:04:58 +01:00
< ? php foreach ( $comments as $comment ) : ?>
2020-12-30 22:42:54 +01:00
< article class = " card comment " >
< div class = " author-area " >
< ? echo get_avatar ( get_the_author_meta ( 'user_email' ), $size = '120' ); ?>
< div class = " author-metadata " >
< div class = " author-pseudo " > Écrit par < a href = " " > Pseudo </ a ></ div >
< small class = " author-date " > Le vendredi 19 septembre 2014 à 07 : 16 </ small >
</ div >
</ div >
< div class = " card-body " >
< ? php comment_text () ?>
</ div >
</ article >
2020-12-30 19:04:58 +01:00
< ? php /* Changes every other comment to a different class */
if ( 'alt' == $oddcomment ) $oddcomment = '' ;
else $oddcomment = 'alt' ;
?>
< ? php endforeach ; /* end for each comment */ ?>
< ? php else : // this is displayed if there are no comments so far ?>
< ? php if ( 'open' == $post -> comment_status ) : ?>
<!-- If comments are open , but there are no comments . -->
< ? php else : // comments are closed ?>
<!-- If comments are closed . -->
2020-12-30 22:42:54 +01:00
< p class = " nocomments toast toast-danger " > Les commentaires sont ferm s !</ p >
2020-12-30 19:04:58 +01:00
< ? php endif ; ?>
< ? php endif ; ?>
< ? php if ( 'open' == $post -> comment_status ) : ?>
2020-12-30 22:42:54 +01:00
< div class = " card card-primary " >
< h2 id = " respond " class = " card-header " > Laissez un commentaire </ h2 >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
<!-- Cas du besoin de s ' enregistrer -->
< ? php if ( get_option ( 'comment_registration' ) && ! $user_ID ) : ?>
< p > You must be < a href = " <?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?> " > connect & eacute ; </ a > pour laisser un commentaire .</ p >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
<!-- Utilisateur enregistré -->
< ? php else : ?>
< form action = " <?php echo get_option('siteurl'); ?>/wp-comments-post.php " method = " post " id = " commentform " >
< ? php if ( $user_ID ) : ?>
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< div class = " toast toast-info alert-flex " role = " alert " >
< p class = " mb-0 " >< i class = " fa fa-info fa-fw " ></ i > Connect & eacute ; en tant que < a class = " alert-link " href = " <?php echo get_option('siteurl'); ?>/wp-admin/profile.php " >< ? php echo $user_identity ; ?> </a>.</p>
< p class = " mb-0 align-right " >< a class = " alert-link " href = " <?php echo get_option('siteurl'); ?>/wp-login.php?action=logout " title = " Déconnecté de ce compte " >< i class = " fa fa-fw fa-power-off " ></ i ></ a ></ p >
</ div >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
<!-- Commentaire non - enregistré -->
< ? php else : ?>
< div class = " toast toast-info " >< p > Ce site utilise Akismet pour réduire les contenus indésirables ( spam , etc ) . < a href = " https://akismet.com/privacy/ " > En savoir plus sur la façon dont les données de vos commentaires sont traitées .</ a ></ p ></ div >
< div class = " input-group mb-3 " >
< input type = " text " class = " form-control " name = " author " id = " author " placeholder = " Nom <?php if ( $req ) echo " ( requis ) " ; ?> " aria - label = " Username " value = " <?php echo $comment_author ; ?> " size = " 40 " tabindex = " 1 " />
</ div >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< div class = " input-group mb-3 " >
< input type = " text " class = " form-control " name = " email " id = " email " placeholder = " Courriel (ne sera pas publié) <?php if ( $req ) echo " ( requis ) " ; ?> " value = " <?php echo $comment_author_email ; ?> " size = " 40 " tabindex = " 2 " />
</ div >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< div class = " input-group mb-3 " >
< input type = " text " class = " form-control " name = " url " id = " url " placeholder = " Site Web " value = " <?php echo $comment_author_url ; ?> " size = " 40 " tabindex = " 2 " />
</ div >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< ? php endif ; ?>
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< div class = " input-group mb-3 " >
< textarea class = " form-control " name = " comment " id = " comment " aria - label = " Contenu du commentaire " placeholder = " Contenu du commentaire " tabindex = " 4 " ></ textarea >
</ div >
< input type = " hidden " name = " comment_post_ID " value = " <?php echo $id ; ?> " />
< ? php do_action ( 'comment_form' , $post -> ID ); ?>
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
< p class = " align-right " >< button name = " submit " class = " btn btn-primary " type = " submit " id = " submit " tabindex = " 5 " value = " Envoyer " > Envoyer </ button >
</ p >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
</ form >
2020-12-30 19:04:58 +01:00
2020-12-30 22:42:54 +01:00
</ div >
2020-12-30 19:04:58 +01:00
< ? php endif ; // If registration required and not logged in ?>
</ section >
< ? php endif ; // if you delete this the sky will fall on your head ?>