This repository was archived by the owner on Nov 28, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
179 lines (101 loc) · 3.59 KB
/
Copy pathcomments.php
File metadata and controls
179 lines (101 loc) · 3.59 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php /*
===============================================================
Commentpress Theme Comments
===============================================================
AUTHOR : Christian Wach <needle@haystack.co.uk>
---------------------------------------------------------------
NOTES
---------------------------------------------------------------
*/
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('Please do not load this page directly. Thanks!');
}
if ( post_password_required() ) { ?>
<div class="sidebar_contents_wrapper">
<div class="comments_container">
<h3 class="nocomments">Enter the password to view comments</h3>
</div><!-- /comments_container -->
</div><!-- /sidebar_contents_wrapper -->
<?php
return;
}
// declare access to globals
global $commentpress_obj, $post;
// if we have the plugin enabled...
if ( is_object( $commentpress_obj ) ) {
// are we asking for in-page comments?
if ( $commentpress_obj->db->is_special_page() ) {
// until WordPress supports a locate_theme_file() function, use filter
$include = apply_filters(
'cp_template_comments_in_page',
get_template_directory() . '/style/templates/comments_in_page.php'
);
// include 'comments in page' template
include( $include );
return;
}
// are we allowing comments on paragraphs?
if ( $commentpress_obj->comments_by_paragraph() ) {
// until WordPress supports a locate_theme_file() function, use filter
$include = apply_filters(
'cp_template_comments_by_para',
get_template_directory() . '/style/templates/comments_by_para.php'
);
// include comments split by paragraph template
include( $include );
return;
}
}
?>
<!-- comments.php -->
<div id="sidebar_contents_wrapper">
<div class="comments_container">
<?php if ( have_comments() ) : ?>
<h3 id="para-heading-"><?php
comments_number(
'<span>0</span> comments',
'<span>1</span> comment',
'<span>%</span> comments'
);
?> on the whole page</h3>
<div class="paragraph_wrapper">
<ol class="commentlist">
<?php wp_list_comments(
array(
// list comments params
'type'=> 'comment',
'reply_text' => 'Reply to this comment',
'callback' => 'cp_comments'
)
); ?>
</ol>
<div class="reply_to_para" id="reply_to_para-">
<p><a class="reply_to_para" href="<?php the_permalink() ?>?replytopara#respond" onclick="return addComment.moveFormToPara( '', '', '1' )">Leave a comment on the whole page</a></p>
</div>
</div><!-- /paragraph_wrapper -->
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- comments are open, but there are no comments. -->
<h3 class="nocomments">No comments on the whole page</h3>
<div class="paragraph_wrapper">
<div class="reply_to_para" id="reply_to_para-">
<p><a class="reply_to_para" href="<?php the_permalink() ?>?replytopara#respond" onclick="return addComment.moveFormToPara( '', '', '1' )">Leave a comment on the whole page</a></p>
</div>
</div><!-- /paragraph_wrapper -->
<?php else : // comments are closed ?>
<!-- comments are closed. -->
<h3 class="nocomments">Comments are closed.</h3>
<?php endif; ?>
<?php endif; ?>
</div><!-- /comments_container -->
</div><!-- /sidebar_contents_wrapper -->
<?php
// until WordPress supports a locate_theme_file() function, use filter
$include = apply_filters(
'cp_template_comment_form',
get_template_directory() . '/style/templates/comment_form.php'
);
// include comment form
include( $include );
?>