4
// Located in comments.php
5
// Just before #comments
5
* @package ThematicCoreLibrary
6
* @subpackage CommentsExtensions
10
* Action Hook: thematic_abovecomments
12
* Located in comments.php
13
* Just before #comments
6
15
function thematic_abovecomments() {
7
16
do_action('thematic_abovecomments');
11
// Located in comments.php
12
// Just before #comments-list
20
* Action Hook: thematic_abovecommentslist
22
* Located in comments.php
23
* Just before #comments-list
13
25
function thematic_abovecommentslist() {
14
26
do_action('thematic_abovecommentslist');
18
// Located in comments.php
19
// Just after #comments-list
30
* Action Hook: thematic_belowcommentslist
32
* Located in comments.php
33
* Just after #comments-list
20
35
function thematic_belowcommentslist() {
21
36
do_action('thematic_belowcommentslist');
25
// Located in comments.php
26
// Just before #trackbacks-list
40
* Action Hook: thematic_abovetrackbackslist
42
* Located in comments.php
43
* Just before #trackbacks-list
27
45
function thematic_abovetrackbackslist() {
28
46
do_action('thematic_abovetrackbackslist');
32
// Located in comments.php
33
// Just after #trackbacks-list
50
* Action Hook: thematic_belowtrackbackslist
52
* Located in comments.php
53
* Just after #trackbacks-list
34
55
function thematic_belowtrackbackslist() {
35
56
do_action('thematic_belowtrackbackslist');
39
// Located in comments.php
40
// Just before the comments form
60
* Action Hook: thematic_abovecommentsform
62
* Located in comments.php
63
* Just before the comments form
41
65
function thematic_abovecommentsform() {
42
66
do_action('thematic_abovecommentsform');
46
// Adds the Subscribe to comments button
70
* Provides Plugin Compatibility: Subscribe to Comments
72
* Adds the subscribe to comments button.
74
* @link http://wordpress.org/extend/plugins/subscribe-to-comments/ Subscribe to Comments Plugin Page
47
76
function thematic_show_subscription_checkbox() {
48
77
if(function_exists('show_subscription_checkbox')) { show_subscription_checkbox(); }
50
79
add_action('comment_form', 'thematic_show_subscription_checkbox', 98);
53
// Located in comments.php
54
// Just after the comments form
82
* Action Hook: thematic_belowcommentsform
84
* Located in comments.php
85
* Just after the comments form
55
87
function thematic_belowcommentsform() {
56
88
do_action('thematic_belowcommentsform');
60
// Adds the Subscribe without commenting button
92
* Provides Plugin Compatibility: Subscribe to Comments
94
* Adds the subscribe without commenting button
96
* @link http://wordpress.org/extend/plugins/subscribe-to-comments/ Subscribe to Comments Plugin Page
61
98
function thematic_show_manual_subscription_form() {
62
99
if(function_exists('show_manual_subscription_form')) { show_manual_subscription_form(); }
64
101
add_action('thematic_belowcommentsform', 'thematic_show_manual_subscription_form', 5);
67
// Located in comments.php
68
// Just after #comments
104
* Action Hook: thematic_belowcomments
106
* Located in comments.php
107
* Just after #comments
69
109
function thematic_belowcomments() {
70
110
do_action('thematic_belowcomments');
73
// Located in comments.php
74
// Creates the standard text for one comment
114
* Filter: thematic_singlecomment_text
116
* Creates the standard text for one comment
117
* Located in comments.php
75
119
function thematic_singlecomment_text() {
76
$content = __('<span>One</span> Comment', 'thematic');
77
return apply_filters(thematic_singlecomment_text, $content);
120
$content = sprintf( _x( '%1$sOne%2$s Comment' , 'One Comment, where %$1s and %$2s are <span> tags', 'thematic' ), '<span>' , '</span>' );
121
return apply_filters( 'thematic_singlecomment_text', $content );
80
// Located in comments.php
81
// Creates the standard text for more than one comment
125
* Filter: thematic_multiplecomments_text
127
* Creates the standard text for more than one comment
128
* Located in comments.php
82
130
function thematic_multiplecomments_text() {
83
$content = __('<span>%d</span> Comments', 'thematic');
84
return apply_filters(thematic_multiplecomments_text, $content);
131
$content = '<span>%d</span> ' . __('Comments', 'thematic');
132
return apply_filters( 'thematic_multiplecomments_text', $content );
87
// creates the list comments arguments
88
function list_comments_arg() {
137
* Filter: list_comments_arg
139
* Creates the list comments arguments
141
function thematic_list_comments_arg() {
89
142
$content = 'type=comment&callback=thematic_comments';
90
143
return apply_filters('list_comments_arg', $content);
93
// Located in comments.php
94
// Creates the standard text 'Post a Comment'
148
* Filter: thematic_postcomment_text
150
* Creates the standard text 'Post a Comment'
151
* Located in comments.php
95
153
function thematic_postcomment_text() {
154
/* translators: comment form title */
96
155
$content = __('Post a Comment', 'thematic');
97
return apply_filters(thematic_postcomment_text, $content);
156
return apply_filters( 'thematic_postcomment_text', $content );
100
// Located in comments.php
101
// Creates the standard text 'Post a Reply to %s'
160
* Filter: thematic_postreply_text
162
* Creates the standard text 'Post a Reply to %s'
163
* Located in comments.php
102
165
function thematic_postreply_text() {
166
/* translators: comment reply form title, %s is author of comment */
103
167
$content = __('Post a Reply to %s', 'thematic');
104
return apply_filters(thematic_postreply_text, $content);
168
return apply_filters( 'thematic_postreply_text', $content );
107
// Located in comments.php
108
// Creates the standard text 'Comment' for the text box
172
* Filter: thematic_commentbox_text
174
* Creates the standard text 'Comment' for the text box
175
* Located in comments.php
109
177
function thematic_commentbox_text() {
110
$content = __('Comment', 'thematic');
111
return apply_filters(thematic_commentbox_text, $content);
114
// Located in comments.php
115
// Creates the standard text 'Post Comment' for the send button
178
/* translators: label for comment form textarea */
179
$content = _x('Comment', 'noun', 'thematic');
180
return apply_filters( 'thematic_commentbox_text', $content );
184
* Filter: thematic_cancelreply_text function.
186
* Creates the standard text 'Cancel reply'
187
* Located in comments-extensions.php
189
function thematic_cancelreply_text() {
190
$content = __('Cancel reply', 'thematic');
191
return apply_filters( 'thematic_cancelreply_text', $content );
195
* Filter: thematic_commentbutton_text
197
* Creates the standard text 'Post Comment' for the send button
198
* Located in comments.php
116
200
function thematic_commentbutton_text() {
117
$content = __('Post Comment', 'thematic');
118
return apply_filters(thematic_commentbutton_text, $content);
121
// Produces an avatar image with the hCard-compliant photo class
201
/* translators: text of comment button */
202
$content = esc_attr( __('Post Comment', 'thematic') );
203
return apply_filters( 'thematic_commentbutton_text', $content );
207
* Function: thematic_comment_form_args
208
* Filter: comment_form_default_fields
210
* Creates the standard arguments for comment_form()
211
* Located in comments.php
213
function thematic_comment_form_args( $post_id = null ) {
214
global $user_identity, $id;
216
if ( null === $post_id )
221
$req = get_option( 'require_name_email' );
223
$commenter = wp_get_current_commenter();
225
$aria_req = ( $req ? " aria-required='true'" : '' );
228
'author' => '<div id="form-section-author" class="form-section"><div class="form-label">' . '<label for="author">' . __( 'Name', 'thematic' ) . '</label> ' . ( $req ? '<span class="required">' . _x( '*', 'denotes required field', 'thematic' ) . '</span>' : '' ) . '</div>' . '<div class="form-input">' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . ' maxlength="20" tabindex="3"' . $aria_req . ' /></div></div><!-- #form-section-author .form-section -->',
229
'email' => '<div id="form-section-email" class="form-section"><div class="form-label"><label for="email">' . __( 'Email', 'thematic' ) . '</label> ' . ( $req ? '<span class="required">' . _x( '*', 'denotes required field', 'thematic' ) . '</span>' : '' ) . '</div><div class="form-input">' . '<input id="email" name="email" type="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="50" tabindex="4"' . $aria_req . ' /></div></div><!-- #form-section-email .form-section -->',
230
'url' => '<div id="form-section-url" class="form-section"><div class="form-label"><label for="url">' . __( 'Website', 'thematic' ) . '</label></div>' . '<div class="form-input"><input id="url" name="url" type="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="50" tabindex="5" /></div></div><!-- #form-section-url .form-section -->',
235
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
236
'comment_field' => '<div id="form-section-comment" class="form-section"><div class="form-label"><label for="comment">' . __(thematic_commentbox_text(), 'thematic') . '</label></div><div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6" aria-required="true"></textarea></div></div><!-- #form-section-comment .form-section -->',
238
'comment_notes_before' => '<p class="comment-notes">' . sprintf( _x( 'Your email is %1$snever%2$s published nor shared.' , '%$1s and %$2s are <em> tags for emphasis on never', 'thematic' ), '<em>' , '</em>' ) . ( $req ? ' ' . sprintf( _x('Required fields are marked %1$s*%2$s', '%$1s and %$2s are <span> tags', 'thematic'), '<span class="required">', '</span>' ) : '' ) . '</p>',
240
'must_log_in' => '<p id="login-req">' . sprintf( __('You must be %1$slogged in%2$s to post a comment.', 'thematic'), sprintf('<a href="%s" title ="%s">', esc_attr( wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ) ), esc_attr__( 'Log in', 'thematic' ) ), '</a>' ). '</p>',
242
'logged_in_as' => '<p id="login"><span class="loggedin">' . sprintf( __('Logged in as %s', 'thematic' ), sprintf( ' <a href="%1$s" title="%2$s">%3$s</a>', admin_url( 'profile.php' ), sprintf( esc_attr__('Logged in as %s', 'thematic'), $user_identity ) , $user_identity ) ) .'</span> <span class="logout">' . sprintf('<a href="%s" title="%s">%s</a>' , esc_attr( wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), esc_attr__('Log out of this account', 'thematic' ) , __('Log out?', 'thematic' ) ) . '</span></p>',
244
'comment_notes_after' => '<div id="form-allowed-tags" class="form-section"><p><span>' . sprintf( _x('You may use these %1$sHTML%2$s tags and attributes', '%$1s and %$2s are <abbr> tags', 'thematic'), '<abbr title="HyperText Markup Language">', '</abbr>' ) . '</span> <code>' . allowed_tags() . '</code></p></div>',
246
'id_form' => 'commentform',
247
'id_submit' => 'submit',
248
'title_reply' => thematic_postcomment_text(),
249
'title_reply_to' => thematic_postreply_text(),
250
'cancel_reply_link' => thematic_cancelreply_text(),
251
'label_submit' => thematic_commentbutton_text(),
254
return apply_filters( 'thematic_comment_form_args', $args );
258
* Produces an avatar image with the hCard-compliant photo class
122
260
function thematic_commenter_link() {
123
261
$commenter = get_comment_author_link();
124
262
if ( ereg( '<a[^>]* class=[^>]+>', $commenter ) ) {
130
268
$avatar_size = apply_filters( 'avatar_size', '80' ); // Available filter: avatar_size
131
269
$avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, $avatar_size ) );
132
270
echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
133
} // end thematic_commenter_link
136
// A hook for the standard comments template
274
* ActionHook: thematic_comments_template
137
276
function thematic_comments_template() {
138
277
do_action('thematic_comments_template');
139
} // end thematic_comments
142
// The standard comments template is injected into thematic_comments_template() by default
143
function thematic_include_comments() {
281
* Outputs the standard comments template
283
function thematic_include_comments() {
284
// Checking for defined constant to enable conditional comment display for Pages
285
if ( current_theme_supports( 'thematic_legacy_comment_handling' ) && is_page() ) {
286
// Needs post-meta key/value of "comments" to call comments template on Pages!
287
if ( get_post_custom_values('comments') )
288
comments_template('', true);
289
// WordPress standard comment handling is the default if constant is not set
144
291
comments_template('', true);
145
} // end thematic_include_comments
147
add_action('thematic_comments_template','thematic_include_comments',5);
b'\\ No newline at end of file'
295
add_action('thematic_comments_template','thematic_include_comments', 5);
297
function thematic_get_comment_link( $link , $comment, $args ) {
300
$args['type'] = 'comment';
301
$args['page'] = get_page_of_comment( $comment->comment_ID, $args );
303
if ( $args['per_page'] ) {
304
if ( '' == $args['page'] )
305
$args['page'] = ( !empty($in_comment_loop) ) ? get_query_var('cpage') : get_page_of_comment( $comment->comment_ID, $args );
307
if ( $wp_rewrite->using_permalinks() )
308
$link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' );
310
$link = add_query_arg( 'cpage', $args['page'], get_permalink( $comment->comment_post_ID ) );
312
$link = get_permalink( $comment->comment_post_ID );
315
return $link . '#comment-' . $comment->comment_ID;
317
add_filter( 'get_comment_link', 'thematic_get_comment_link', 10, 3 );
b'\\ No newline at end of file'