Subversion Repositories ZenDark

Rev

Rev 3 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 27
Line 3... Line 3...
3
 * The template for displaying Comments.
3
 * The template for displaying Comments.
4
 */
4
 */
5
?>
5
?>
6
<div id="comments">
6
<div id="comments">
7
        <?php if (post_password_required()) { ?>
7
        <?php if (post_password_required()) { ?>
8
                <h3 class="comments-title"><?php _e( 'This post is password protected: enter the password to view any comments', 'sdt' ); ?></h3>
-
 
-
 
8
                <h3 class="comments-title"><?php _e( 'This post is password protected: enter the password to view any comments', 'zendark' ); ?></h3>
9
        </div><!-- #comments -->
9
        </div><!-- #comments -->
10
        <?php
10
        <?php
11
                        /* Stop the rest of comments.php from being processed,
11
                        /* Stop the rest of comments.php from being processed,
12
                         * but don't kill the script entirely -- we still have
12
                         * but don't kill the script entirely -- we still have
13
                         * to fully load the template.
13
                         * to fully load the template.
Line 17... Line 17...
17
        ?>
17
        ?>
18
18
19
<?php if (have_comments()) : ?>
19
<?php if (have_comments()) : ?>
20
        <h3 class="comments-title">
20
        <h3 class="comments-title">
21
                <?php
21
                <?php
22
                        printf(_n('One comment on "%2$s"', '%1$s comments on "%2$s"', get_comments_number(), 'sdt'), number_format_i18n(get_comments_number()), get_the_title());
-
 
-
 
22
                        printf(_n('One comment on "%2$s"', '%1$s comments on "%2$s"', get_comments_number(), 'zendark'), number_format_i18n(get_comments_number()), get_the_title());
23
    ?>
23
    ?>
24
        </h3>
24
        </h3>
25
25
26
<?php
26
<?php
27
  /* Here is what you do if you want paged comments, i.e. showing comments and
27
  /* Here is what you do if you want paged comments, i.e. showing comments and
Line 30... Line 30...
30
   */
30
   */
31
 
31
 
32
  if (get_option('page_comments')) : // are there comments to navigate through
32
  if (get_option('page_comments')) : // are there comments to navigate through
33
    if (get_comment_pages_count() > 1) : ?>
33
    if (get_comment_pages_count() > 1) : ?>
34
        <nav id="comment-nav-above">
34
        <nav id="comment-nav-above">
35
                <div class="nav-next"><?php next_comments_link(__('⇽ Newer Comments', 'sdt')); ?></div>
-
 
36
                <div class="nav-previous"><?php previous_comments_link(__('Older Comments ⇾', 'sdt')); ?></div>
-
 
-
 
35
                <div class="nav-next"><?php next_comments_link(__('⇽ Newer Comments', 'zendark')); ?></div>
-
 
36
                <div class="nav-previous"><?php previous_comments_link(__('Older Comments ⇾', 'zendark')); ?></div>
37
        </nav>
37
        </nav>
38
  <?php endif; ?>
38
  <?php endif; ?>
39
39
40
  <?php
40
  <?php
41
                /* Loop through and list the comments. Tell wp_list_comments()
41
                /* Loop through and list the comments. Tell wp_list_comments()
42
                 * to use twentyeleven_comment() to format the comments.
42
                 * to use twentyeleven_comment() to format the comments.
43
                 * If you want to overload this in a child theme then you can
43
                 * If you want to overload this in a child theme then you can
44
                 * define twentyeleven_comment() and that will be used instead.
44
                 * define twentyeleven_comment() and that will be used instead.
45
                 * See twentyeleven_comment() in twentyeleven/functions.php for more.
45
                 * See twentyeleven_comment() in twentyeleven/functions.php for more.
46
                 */
46
                 */
47
                wp_list_comments(array('callback' => 'sdt_all_comment'));
-
 
-
 
47
                wp_list_comments(array('callback' => 'zendark_all_comment'));
48
48
49
    if (get_comment_pages_count() > 1) :
49
    if (get_comment_pages_count() > 1) :
50
  ?>
50
  ?>
51
 
51
 
52
                <nav id="comment-nav-below">
52
                <nav id="comment-nav-below">
53
                        <div class="nav-next"><?php next_comments_link(__('⇽ Newer Comments', 'sdt')); ?></div>
-
 
54
                        <div class="nav-previous"><?php previous_comments_link(__('Older Comments ⇾', 'sdt')); ?></div>
-
 
-
 
53
                        <div class="nav-next"><?php next_comments_link(__('⇽ Newer Comments', 'zendark')); ?></div>
-
 
54
                        <div class="nav-previous"><?php previous_comments_link(__('Older Comments ⇾', 'zendark')); ?></div>
55
                </nav>
55
                </nav>
56
    <?php endif; ?>
56
    <?php endif; ?>
57
  <?php endif; // check for comment navigation ?>
57
  <?php endif; // check for comment navigation ?>
58
58
59
<?php
59
<?php
Line 65... Line 65...
65
                 * to use twentyeleven_comment() to format the comments.
65
                 * to use twentyeleven_comment() to format the comments.
66
                 * If you want to overload this in a child theme then you can
66
                 * If you want to overload this in a child theme then you can
67
                 * define twentyeleven_comment() and that will be used instead.
67
                 * define twentyeleven_comment() and that will be used instead.
68
                 * See twentyeleven_comment() in twentyeleven/functions.php for more.
68
                 * See twentyeleven_comment() in twentyeleven/functions.php for more.
69
                 */
69
                 */
70
                wp_list_comments(array('callback' => 'sdt_comment'));
-
 
-
 
70
                wp_list_comments(array('callback' => 'zendark_comment'));
71
71
72
    // Check if we have pingbacks/trackbacks before displaying them
72
    // Check if we have pingbacks/trackbacks before displaying them
73
    if (sdt_trackback_number($comments) != 0) :
-
 
-
 
73
    if (zendark_trackback_number($comments) != 0) :
74
  ?>
74
  ?>
75
  <h3 class="comments-title">Trackback e pingback</h3>
75
  <h3 class="comments-title">Trackback e pingback</h3>
76
76
77
  <?php
77
  <?php
78
                /* This way we separate comments from trackpacks/pingbacks
78
                /* This way we separate comments from trackpacks/pingbacks
79
                 */
79
                 */
80
      wp_list_comments(array('callback' => 'sdt_trackback'));
-
 
-
 
80
      wp_list_comments(array('callback' => 'zendark_trackback'));
81
    endif;
81
    endif;
82
   endif; // check for comment navigation ?>
82
   endif; // check for comment navigation ?>
83
<?php endif; ?>
83
<?php endif; ?>
84
84
85
<?php
85
<?php
86
                /* If comments and trackbacks are closed, let's leave a little note, shall we?
86
                /* If comments and trackbacks are closed, let's leave a little note, shall we?
87
                 * But we don't want the note on pages.
87
                 * But we don't want the note on pages.
88
                 */
88
                 */
89
                if (!comments_open() && !pings_open() && !is_page()) :
89
                if (!comments_open() && !pings_open() && !is_page()) :
90
        ?>
90
        ?>
91
    <h3 class="comments-title"><?php _e('Comments and trackbacks are closed', 'sdt'); ?></h3>
-
 
-
 
91
    <h3 class="comments-title"><?php _e('Comments and trackbacks are closed', 'zendark'); ?></h3>
92
<?php endif; ?>
92
<?php endif; ?>
93
93
94
<?php
94
<?php
95
                /* If comments are closed, let's leave a little note, shall we?
95
                /* If comments are closed, let's leave a little note, shall we?
96
                 * But we don't want the note on pages.
96
                 * But we don't want the note on pages.
97
                 */
97
                 */
98
                if (!comments_open() && pings_open() && !is_page()) :
98
                if (!comments_open() && pings_open() && !is_page()) :
99
        ?>
99
        ?>
100
    <h3 class="comments-title"><?php _e('Comments are closed', 'sdt'); ?></h3>
-
 
-
 
100
    <h3 class="comments-title"><?php _e('Comments are closed', 'zendark'); ?></h3>
101
<?php endif; ?>
101
<?php endif; ?>
102
102
103
<?php
103
<?php
104
                /* If trackbacks are closed, let's leave a little note, shall we?
104
                /* If trackbacks are closed, let's leave a little note, shall we?
105
                 * But we don't want the note on pages.
105
                 * But we don't want the note on pages.
106
                 */
106
                 */
107
                if (comments_open() && !pings_open() && !is_page()) :
107
                if (comments_open() && !pings_open() && !is_page()) :
108
        ?>
108
        ?>
109
    <h3 class="comments-title"><?php _e('Trackbacks are closed', 'sdt'); ?></h3>
-
 
-
 
109
    <h3 class="comments-title"><?php _e('Trackbacks are closed', 'zendark'); ?></h3>
110
<?php endif; ?>
110
<?php endif; ?>
111
111
112
<?php
112
<?php
113
                /* If there are no comments but they are opened, let's leave a little note, shall we?
113
                /* If there are no comments but they are opened, let's leave a little note, shall we?
114
                 * But we don't want the note on pages.
114
                 * But we don't want the note on pages.
115
                 */
115
                 */
116
                if (comments_open() && !is_page() && !have_comments()) :
116
                if (comments_open() && !is_page() && !have_comments()) :
117
        ?>
117
        ?>
118
                <h3 class="comments-title"><?php printf(__('0 comments on "%1$s"', 'sdt'), get_the_title()); ?></h3>
-
 
-
 
118
                <h3 class="comments-title"><?php printf(__('0 comments on "%1$s"', 'zendark'), get_the_title()); ?></h3>
119
<?php endif; ?>
119
<?php endif; ?>
120
120
121
<?php
121
<?php
122
/* If comments are open, display a reply form. The function comment_form() is
122
/* If comments are open, display a reply form. The function comment_form() is
123
 * necessary to have a form when replying to posts.
123
 * necessary to have a form when replying to posts.
124
 */
124
 */
125
  if (comments_open()) :
125
  if (comments_open()) :
126
126
127
    // Code to generate form fields
127
    // Code to generate form fields
128
    $fields = array(
128
    $fields = array(
129
      'author' => '<p class="comment-form-field"><label for="author">'.__('Name', 'sdt').($req ? ' *' : '').'</label><br /><input id="author" name="author" type="text" value="'.esc_attr($commenter['comment_author']).'" size="100"'.$aria_req.' /></p>',
-
 
130
      'email' => '<p class="comment-form-field"><label for="email">'.__('Email', 'sdt').($req ? ' *' : '').'</label><br /><input id="email" name="email" type="text" value="'.esc_attr($commenter['comment_author_email']).'" size="100"'.$aria_req.' /></p>',
-
 
131
      'url' => '<p class="comment-form-field"><label for="url">'.__('Website', 'sdt').'</label><br /><input id="url" name="url" type="text" value="'.esc_attr($commenter['comment_author_url']).'" size="100" /></p>'
-
 
-
 
129
      'author' => '<p class="comment-form-field"><label for="author">'.__('Name', 'zendark').($req ? ' *' : '').'</label><br /><input id="author" name="author" type="text" value="'.esc_attr($commenter['comment_author']).'" size="100"'.$aria_req.' /></p>',
-
 
130
      'email' => '<p class="comment-form-field"><label for="email">'.__('Email', 'zendark').($req ? ' *' : '').'</label><br /><input id="email" name="email" type="text" value="'.esc_attr($commenter['comment_author_email']).'" size="100"'.$aria_req.' /></p>',
-
 
131
      'url' => '<p class="comment-form-field"><label for="url">'.__('Website', 'zendark').'</label><br /><input id="url" name="url" type="text" value="'.esc_attr($commenter['comment_author_url']).'" size="100" /></p>'
132
    );
132
    );
133
133
134
    comment_form(array(
134
    comment_form(array(
135
      'title_reply' => __('Write a Comment', 'sdt'),
-
 
136
      'comment_notes_before' => '<p class="comment-notes">'.__('Your email address will not be published.', 'sdt').($req ? __(' Required fields are marked with *', 'sdt') : '').'</p>',
-
 
-
 
135
      'title_reply' => __('Write a Comment', 'zendark'),
-
 
136
      'comment_notes_before' => '<p class="comment-notes">'.__('Your email address will not be published.', 'zendark').($req ? __(' Required fields are marked with *', 'zendark') : '').'</p>',
137
      'fields' => apply_filters('comment_form_default_fields', $fields),
137
      'fields' => apply_filters('comment_form_default_fields', $fields),
138
      'logged_in_as' => '<p class="logged-in-as">'.sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out ⇾</a>', 'sdt'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))).'</p>',
-
 
139
      'must_log_in' => '<p class="must-log-in">'.sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'sdt'), wp_login_url(apply_filters('the_permalink', get_permalink()))).'</p>',
-
 
140
      'comment_field' => '<p class="comment-form-comment"><label for="comment">'._x('Comment', 'noun', 'sdt').($req ? ' *' : '').'</label><br /><textarea id="comment" name="comment" cols="80" rows="8" aria-required="true"></textarea></p>',
-
 
141
      'comment_notes_after' => '<p class="form-allowed-tags">'.sprintf(__('Allowed <abbr title="HyperText Markup Language">HTML</abbr> code: %s', 'sdt'), '<code>'.allowed_tags().'</code>').'</p>',
-
 
142
      'label_submit' => __('Post Comment', 'sdt'),
-
 
143
      'title_reply_to' => __('Leave a Reply to %s', 'sdt'),
-
 
144
      'cancel_reply_link' => __('(Cancel reply)', 'sdt')
-
 
-
 
138
      'logged_in_as' => '<p class="logged-in-as">'.sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out ⇾</a>', 'zendark'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))).'</p>',
-
 
139
      'must_log_in' => '<p class="must-log-in">'.sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'zendark'), wp_login_url(apply_filters('the_permalink', get_permalink()))).'</p>',
-
 
140
      'comment_field' => '<p class="comment-form-comment"><label for="comment">'._x('Comment', 'noun', 'zendark').($req ? ' *' : '').'</label><br /><textarea id="comment" name="comment" cols="80" rows="8" aria-required="true"></textarea></p>',
-
 
141
      'comment_notes_after' => '<p class="form-allowed-tags">'.sprintf(__('Allowed <abbr title="HyperText Markup Language">HTML</abbr> code: %s', 'zendark'), '<code>'.allowed_tags().'</code>').'</p>',
-
 
142
      'label_submit' => __('Post Comment', 'zendark'),
-
 
143
      'title_reply_to' => __('Leave a Reply to %s', 'zendark'),
-
 
144
      'cancel_reply_link' => __('(Cancel reply)', 'zendark')
145
    ));
145
    ));
146
  endif;
146
  endif;
147
?>
147
?>
148
148
149
</div><!-- #comments -->
149
</div><!-- #comments -->