This repository has been archived by the owner on Feb 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
86 lines (76 loc) · 2.75 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
function ping_count() {
global $id;
$comments_by_type = &separate_comments(get_comments('post_id=' . $id));
return count($comments_by_type['pings']);
}
function comment_count() {
global $id;
$comments_by_type = &separate_comments(get_comments('post_id=' . $id));
return count($comments_by_type['comment']);
}
add_filter('get_comments_number', 'comment_count', 0);
?>
<?php
function list_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?>
<?php } ?>
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
$themecolors = array(
'bg' => 'fff',
'border' => '777',
'text' => '1c1c1c',
'link' => '004276',
);
function tj_comment_class( $classname='' ) {
global $comment, $post;
$c = array();
if ($classname)
$c[] = $classname;
// Collects the comment type (comment, trackback),
$c[] = $comment->comment_type;
// If the comment author has an id (registered), then print the log in name
if ( $comment->user_id > 0 ) {
$user = get_userdata($comment->user_id);
// For all registered users, 'byuser'; to specificy the registered user, 'commentauthor+[log in name]'
$c[] = "byuser comment-author-" . sanitize_title_with_dashes(strtolower($user->user_login));
// For comment authors who are the author of the post
if ( $comment->user_id === $post->post_author )
$c[] = 'bypostauthor';
}
// Separates classes with a single space, collates classes for comment LI
return join(' ', apply_filters('comment_class', $c));
}
function journalist_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
<div id="div-comment-<?php comment_ID(); ?>" class="group">
<?php if ($comment->comment_approved == '0') : ?>
<div class="comment_mod">
<em><?php _e('Your comment is awaiting moderation.', 'journalist');?></em>
</div>
<?php endif; ?>
<div class="comment_author">
<div class="comment_author_gravatar"><?php echo get_avatar($comment,$size='32',$default='<path_to_url>');?></div>
<p><strong><?php comment_author_link() ?></strong></p>
<p><small><?php comment_date() ;?> <?php _e('at', 'journalist'); ?> <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a> <?php edit_comment_link(__('Edit', 'journalist')); ?></small></p>
</div>
<div class="comment_text">
<?php comment_text() ?>
</div>
<div class="comment_reply">
<?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>
</div>
<?php
}
?>