forked from vincent3569/zpBootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinc_print_comment.php
48 lines (47 loc) · 1.64 KB
/
inc_print_comment.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
<?php
switch ($_zp_gallery_page) {
case 'album.php':
$comments_open = getOption('comment_form_albums'); // option of comment_form plugin for albums
$comments_allowed = $_zp_current_album->getCommentsAllowed(); // value for current album
break;
case 'image.php':
$comments_open = getOption('comment_form_images');
$comments_allowed = $_zp_current_image->getCommentsAllowed();
break;
case 'pages.php':
$comments_open = getOption('comment_form_pages');
$comments_allowed = $_zp_current_zenpage_page->getCommentsAllowed();
break;
case 'news.php':
$comments_open = getOption('comment_form_articles');
$comments_allowed = $_zp_current_zenpage_news->getCommentsAllowed();
break;
default:
return;
break;
}
?>
<?php if (($comments_open) && (($comments_allowed) || (getCommentCount() > 0 ))) { ?>
<div id="comment_accordion" class="panel-group" role="tablist">
<div class="panel panel-default">
<div id="heading" class="panel-heading" role="tab">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#comment_accordion" href="#comment_collapse">
<span class="glyphicon glyphicon-comment"></span>
<?php
$num = getCommentCount();
if ($num == 0) {
echo gettext('No Comments');
} else {
echo sprintf(ngettext('%u Comment','%u Comments',$num), $num);
}
?>
</a>
</h4>
</div>
</div>
<div id="comment_collapse" class="collapse" role="tabpanel">
<?php printCommentForm(true, NULL, true); ?>
</div>
</div>
<?php } ?>