Created
August 21, 2012 10:01
Revisions
-
i-like-robots revised this gist
Sep 24, 2012 . 2 changed files with 81 additions and 40 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,12 +11,3 @@ function comment_form_hidden_fields() wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment', false ); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,36 +1,86 @@ <?php $comments = get_comments( array( 'post_id' => get_the_ID(), 'status' => 'approve' ) ); ?> <div id="comments"> <h3><?php echo count($comments) ?> Comments</h3> <?php WPTheme::comment_form_unapproved() ?> <?php if ( count($comments) ) : ?> <ol class="base comment-list"> <?php foreach ( $comments as $comment ) : ?> <li id="comment-<?php echo $comment->comment_post_ID ?>"> <div class="comment"> <h6 class="comment-title"><?php echo $comment->comment_author ?> said:</h6> <p class="comment-date"> Posted on <time datetime="<?php echo $comment->comment_date ?>" itemprop="datePublished"><?php echo date('d.m.Y', strtotime($comment->comment_date) ) ?></time> at <?php echo date('H:i', strtotime($comment->comment_date) ) ?> </p> <div class="comment-body"> <?php echo $comment->comment_content ?> </div> </div> </li> <?php endforeach ?> </ol> <?php else : ?> <p> There are no responses to this article, why not be the first? </p> <?php endif ?> <?php if ( comments_open() ) : ?> <form action="<?php echo site_url('/wp-comments-post.php') ?>" method="post"> <ul class="form-collection"> <?php if ( is_user_logged_in() ) : ?> <li> <span class="field-hint">Logged in as <?php echo get_user_option('user_nicename') ?></span> </li> <?php else : ?> <li> <label for="comment-author" class="field-label">Name</label> <input type="text" name="author" id="comment-author" required /> </li> <li> <label for="comment-email" class="field-label">Email</label> <input type="email" name="email" id="comment-email" required /> </li> <?php endif ?> <li> <label for="comment-body" class="field-label">Comment</label> <textarea name="comment" id="comment-body" required></textarea> </li> <?php if ( ! is_user_logged_in() ) : ?> <li> <label for="comment-query" class="field-label">20 - 15 + 7 =</label> <input type="text" name="result" id-"comment-query" required /> </li> <?php endif ?> <li class="button-field"> <button type="submit">Post comment</button> <?php comment_form_hidden_fields() ?> </li> </ul> </form> <?php else : ?> <hr /> <p class="nocomments"> Comments are closed for this article. </p> <?php endif ?> </div> -
i-like-robots revised this gist
Aug 21, 2012 . 2 changed files with 25 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <?php /** * Comment form hidden fields */ function comment_form_hidden_fields() { comment_id_fields(); if ( current_user_can( 'unfiltered_html' ) ) { wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment', false ); } } /** * Get current (active) user */ function get_active_user() { global $current_user; return $current_user; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ <form action="<?php echo site_url('/wp-comments-post.php') ?>" method="post" id="comments"> <ul class="form-collection"> <?php if ( is_user_logged_in() ) : ?> <li> <span class="field-hint">Logged in as <?php echo get_active_user()->user_login ?></span> </li> <?php else : ?> <li> @@ -22,14 +22,7 @@ </li> <li class="button-field"> <input type="submit" name="submit" value="Post comment" /> <?php comment_form_hidden_fields() ?> </li> </ul> </form> -
i-like-robots created this gist
Aug 21, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ <?php if ( comments_open() ) : ?> <form action="<?php echo site_url('/wp-comments-post.php') ?>" method="post" id="comments"> <ul class="form-collection"> <?php if ( is_user_logged_in() ) : global $current_user; ?> <li> <span class="field-hint">Logged in as <?php echo $current_user->user_login ?></span> </li> <?php else : ?> <li> <label for="comment-author" class="field-label">Name</label> <input type="text" name="author" id="comment-author" /> </li> <li> <label for="comment-email" class="field-label">Email</label> <input type="email" name="email" id="comment-email" /> </li> <?php endif ?> <li> <label for="comment-body" class="field-label">Comment</label> <textarea name="comment" id="comment-body"></textarea> </li> <li class="button-field"> <input type="submit" name="submit" value="Post comment" /> <?php comment_id_fields(); if ( current_user_can( 'unfiltered_html' ) ) { wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment', false ); } ?> </li> </ul> </form> <?php else : ?> <p class="nocomments"> Comments are closed for this article. </p> <?php endif ?>