136
|
1 |
<?php |
|
2 |
// Do not delete these lines |
|
3 |
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) |
|
4 |
die ('Please do not load this page directly. Thanks!'); |
|
5 |
|
|
6 |
if ( post_password_required() ) { ?> |
|
7 |
<p class="nocomments"><?php _e( "This post is password protected. Enter the password to view comments.", "wptouch" ); ?></p> |
|
8 |
<?php |
|
9 |
return; |
|
10 |
} |
|
11 |
?> |
|
12 |
|
|
13 |
<!-- You can start editing below here... but make a backup first! --> |
|
14 |
|
|
15 |
<div id="comment_wrapper"> |
|
16 |
<?php comments_number( __('', 'wptouch'), __('<h3 onclick="bnc_showhide_coms_toggle();" id="com-head"><img id="com-arrow" src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/com_arrow.png" alt="arrow" />1 Comment</h3>', 'wptouch'), __('<h3 onclick="bnc_showhide_coms_toggle();" id="com-head"><img id="com-arrow" src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/com_arrow.png" alt="arrow" />% Comments</h3>', 'wptouch') ); ?> |
|
17 |
|
|
18 |
<ol class="commentlist" id="commentlist"> |
|
19 |
<?php if ($comments) : ?> |
|
20 |
<?php foreach ($comments as $comment) : ?> |
|
21 |
<?php if (get_comment_type() == "comment") { ?> |
|
22 |
<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID(); ?>"> |
|
23 |
<div class="comwrap"> |
|
24 |
<div class="comtop<?php if ($comment->comment_approved == '0') : echo ' preview'; endif; ?>"> |
|
25 |
<?php if (bnc_is_gravatars_enabled()) { echo get_avatar( $comment, $size = '32', $default = '' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/blank_gravatar.jpg' ); } ?> |
|
26 |
<div class="com-author"><?php comment_author_link(); ?></div> <?php if ($comment->comment_approved == '0') : echo '<span>(moderation preview)</span>'; endif; ?> |
|
27 |
<div class="comdater"><span><?php wptouch_moderate_comment_link(get_comment_ID()); ?></span> |
|
28 |
<?php if (function_exists('time_since')) { |
|
29 |
echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago"; } else { the_time('F jS, Y'); |
|
30 |
} ?> |
|
31 |
</div> |
|
32 |
|
|
33 |
</div><!--end comtop--> |
|
34 |
<div class="combody"> |
|
35 |
<?php comment_text(); //delete_comment_link(get_comment_ID()); ?> |
|
36 |
</div> |
|
37 |
</div><!--end comwrap--> |
|
38 |
</li> |
|
39 |
|
|
40 |
<?php |
|
41 |
/* Changes every other comment to a different class */ |
|
42 |
if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> |
|
43 |
<?php } ?> |
|
44 |
<?php endforeach; |
|
45 |
/* end for each comment */ |
|
46 |
?> |
|
47 |
</ol> |
|
48 |
|
|
49 |
<?php else : // this is displayed if there are no comments so far ?> |
|
50 |
|
|
51 |
<?php if ('open' == $post->comment_status) : ?> |
|
52 |
<!-- If comments are open, but there are no comments. --> |
|
53 |
<li id="hidelist" style="display:none"></li> |
|
54 |
</ol> |
|
55 |
|
|
56 |
<?php else : // comments are closed ?> |
|
57 |
<!-- If comments are closed. --> |
|
58 |
<li style="display:none"></li> |
|
59 |
</ol> |
|
60 |
<h3 class="result-text"><?php _e( 'Comments are closed.', 'wptouch' ); ?></h3> |
|
61 |
|
|
62 |
<?php endif; ?><!--end comment status--> |
|
63 |
<?php endif; ?> |
|
64 |
|
|
65 |
<div id="textinputwrap"> |
|
66 |
<?php if ('open' == $post->comment_status) : ?> |
|
67 |
<?php if (get_option('comment_registration') && !$user_ID) : ?> |
|
68 |
<center> |
|
69 |
<h1> |
|
70 |
<?php sprintf( __( 'You must %slogin</a> or %sregister</a> to comment', 'wptouch' ), '<a href="' . get_option('wpurl') . '/wp-login.php">', '<a href="' . get_option('wpurl') . '"/wp-register.php">') ; ?> |
|
71 |
</h1> |
|
72 |
</center> |
|
73 |
|
|
74 |
<?php else : ?> |
|
75 |
|
|
76 |
<?php $filename = ABSPATH . 'wp-load.php'; |
|
77 |
if (bnc_is_ajax_coms_enabled() && file_exists($filename)) { ?> |
|
78 |
|
|
79 |
<div id="refresher" style="display:none;"> |
|
80 |
<img src="<?php echo compat_get_plugin_url( 'wptouch' ); ?>/images/good.png" alt="checkmark" /> |
|
81 |
<h3><?php _e( "Comment added.", "wptouch" ); ?></h3> |
|
82 |
» <a href="javascript:this.location.reload();"><?php _e( "Refresh the page", "wptouch" ); ?></a> <?php _e( "to post a new comment.", "wptouch" ); ?> |
|
83 |
</div> |
|
84 |
<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" onsubmit="$wptouch('#loading').fadeIn(100);var list = $wptouch('#commentlist'); var html = list.html(); var param = $wptouch('form').serialize(); $wptouch.ajax({url: '<?php echo compat_get_plugin_url( 'wptouch' ); ?>/themes/default/comments-ajax.php?' + param, success: function(data, status){ list.append(data); commentAdded(); }, type: 'get' }); return false;"> |
|
85 |
|
|
86 |
<?php } else { ?> |
|
87 |
|
|
88 |
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> |
|
89 |
|
|
90 |
<?php } ?> |
|
91 |
|
|
92 |
<?php if ($user_ID) : ?> |
|
93 |
|
|
94 |
<p class="logged" id="respond"><?php _e( "Logged in as", "wptouch" ); ?> <a href="<?php bloginfo('wpurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>:</p> |
|
95 |
|
|
96 |
<?php else : ?> |
|
97 |
|
|
98 |
<h3 id="respond"><?php _e( "Leave A Comment", "wptouch" ); ?></h3> |
|
99 |
<p> |
|
100 |
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> |
|
101 |
<label for="author"><?php _e( 'Name', 'wptouch' ); ?> <?php if ($req) echo "*"; ?></label> |
|
102 |
</p> |
|
103 |
|
|
104 |
<p> |
|
105 |
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> |
|
106 |
<label for="email"><?php _e( 'Mail (unpublished)', 'wptouch' ); ?> <?php if ($req) echo "*"; ?></label> |
|
107 |
</p> |
|
108 |
|
|
109 |
<p> |
|
110 |
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> |
|
111 |
<label for="url"><?php _e( 'Website', 'wptouch' ); ?></label> |
|
112 |
</p> |
|
113 |
|
|
114 |
<?php endif; ?> |
|
115 |
<?php do_action('comment_form', $post->ID); ?> |
|
116 |
<p><textarea name="comment" id="comment" tabindex="4"></textarea></p> |
|
117 |
|
|
118 |
<p> |
|
119 |
<input name="submit" type="submit" id="submit" tabindex="5" value="Publish" /> |
|
120 |
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
|
121 |
<div id="loading" style="display:none"> |
|
122 |
<img src="<?php echo compat_get_plugin_url( 'wptouch' ); ?>/themes/core/core-images/comment-ajax-loader.gif" alt="" /> <p><?php _e( 'Publishing...', 'wptouch' ); ?></p> |
|
123 |
</div> |
|
124 |
</p> |
|
125 |
<div id="errors" style="display:none"> |
|
126 |
<?php _e( "There was an error. Please refresh the page and try again.", "wptouch" ); ?> |
|
127 |
</div> |
|
128 |
</form> |
|
129 |
|
|
130 |
<?php endif; // If registration required and not logged in ?> |
|
131 |
|
|
132 |
</div><!--textinputwrap div--> |
|
133 |
</div><!-- comment_wrapper --> |
|
134 |
|
|
135 |
<?php endif; // if you delete this the sky will fall on your head ?> |