document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. global $mandigo_options, $dirs;
  3.  
  4. /* do not delete these lines */
  5. if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  6. die ('Please do not load this page directly. Thanks!');
  7.  
  8. // if there's a password
  9. if (!empty($post->post_password)) {
  10. // and it doesn't match the cookie
  11. if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
  12. ?>
  13. <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
  14. <?php
  15. return;
  16. }
  17. }
  18.  
  19. /*
  20. if you really feel like it,
  21. you can start editing here
  22. */
  23.  
  24. // the post/page author
  25. $the_author = get_the_author();
  26. $the_author_email = get_the_author_email();
  27.  
  28. // if there's at least one comment
  29. if ($comments) {
  30. ?>
  31. <div id="comments">
  32. <?php
  33. comments_number(
  34. __('No Responses to ', 'mandigo'),
  35. __('One Response to ', 'mandigo'),
  36. __('% Responses to ', 'mandigo')
  37. );
  38. ?>
  39. &#8220;<?php the_title();?>&#8221;
  40. </div>
  41.  
  42. <?php
  43. // loop through comments
  44. // what we do here is process each comment, build <li> items, and separate real comments from trackbacks
  45. // we will display them later according to the chosen options
  46. foreach ($comments as $comment) {
  47. // the comment id
  48. $id = get_comment_ID();
  49.  
  50. // a BIG sprintf, not for the faint of heart
  51. $comment_list_item = sprintf('
  52. <li class="clear%s" id="comment-%s">
  53. <div class="commenter%s"%s>
  54. %s
  55. <cite>%s</cite>
  56. %s
  57. <small class="commentmetadata"><a href="#comment-%s">%s</a> %s</small>
  58. </div>
  59. <div class="comment">
  60. %s
  61. </div>
  62. </li>
  63. ',
  64.  
  65. ( // first %s, highlight author comment class
  66. (
  67. $mandigo_options['comments_highlight_author']
  68. && get_comment_author() == $the_author
  69. && get_comment_author_email() == $the_author_email
  70. )
  71. ? ' authorcomment'
  72. : ''
  73. ),
  74.  
  75. $id, // second %s, the comment id
  76.  
  77. ( // 3rd %s, gravatar class
  78. (
  79. !$mandigo_options['comments_no_gravatars']
  80. && function_exists('get_avatar')
  81. && function_exists('get_comment_author_email')
  82. )
  83. ? ' avatar'
  84. : ''
  85. ),
  86.  
  87. ( // 4th %s, gravatar
  88. !$mandigo_options['comments_no_gravatars']
  89. ? (
  90. function_exists('get_avatar') && function_exists('get_comment_author_email')
  91. ? sprintf(
  92. ' style="background: url(%s) no-repeat top left;"',
  93. preg_replace(
  94. '/.+src=[\\'"]([^\\'"]+)[\\'"].+/',
  95. '\\1',
  96. get_avatar(get_comment_author_email(), '36')
  97. )
  98. )
  99. : ''
  100. )
  101. : ''
  102. ),
  103.  
  104. ( // 5th %s, animation link
  105. !$mandigo_options['disable_animations'] // if animations are not disabled
  106. ? sprintf(
  107. '<span class="switch-post"><a href="javascript:toggleComment(%s);" id="switch-comment-%s"><img src="'. $dirs['www']['icons'] .'bullet_toggle_minus.png" alt="" class="png" /></a></span>',
  108. $id,
  109. $id
  110. )
  111. : ''
  112. ),
  113.  
  114. sprintf( // 6th %s, the user name
  115. __('%s says:', 'mandigo'),
  116. get_comment_author_link()
  117. ),
  118.  
  119. ( // 7th %s, whether the comment is pending moderation or not
  120. $comment->comment_approved == '0'
  121. ? '<em>'. __('Your comment is awaiting moderation.', 'mandigo') .'</em><br />'
  122. : ''
  123. ),
  124.  
  125. $id, // 8th %s, the comment id again
  126.  
  127. sprintf( // 9th %s, "which date at what time"
  128. __('%s at %s', 'mandigo'),
  129. get_comment_date(__('F jS, Y', 'mandigo')),
  130. get_comment_time()
  131. ),
  132.  
  133. ( // 10th %s, the edit comment link, if appropriate
  134. function_exists('get_edit_comment_link') && current_user_can('edit_post', $post->ID)
  135. ? ' - '. apply_filters(
  136. 'edit_comment_link',
  137. '<a href="'. get_edit_comment_link($id) .'">'. __('Edit', 'mandigo') .'</a>',
  138. $comment->comment_ID
  139. )
  140. : ''
  141. ),
  142.  
  143. // 11th %s, the comment itself
  144. apply_filters('comment_text', get_comment_text())
  145.  
  146. ); // end of big sprintf, phew!
  147.  
  148.  
  149. // if this is a trackback
  150. if ($comment->comment_type == 'trackback') {
  151.  
  152. // and we chose to display them either above or below regular comments
  153. if ($mandigo_options['trackbacks_position'] == 'above' || $mandigo_options['trackbacks_position'] == 'below') {
  154. // put them in a separate list
  155. $trackback_list[] = $comment_list_item;
  156. }
  157.  
  158. // if we chose to display them along other comments
  159. elseif ($mandigo_options['trackbacks_position'] == 'along') {
  160. $comment_list[] = $comment_list_item;
  161. }
  162. }
  163.  
  164. else {
  165. $comment_list[] = $comment_list_item;
  166. }
  167.  
  168. } // end of foreach loop
  169.  
  170. // if we have trackbacks and we chose to display them ABOVE comments
  171. if ($mandigo_options['trackbacks_position'] == 'above' && $trackback_list) {
  172. ?>
  173. <br />
  174. <div id="trackbacks"><?php _e('Trackbacks', 'mandigo'); ?></div>
  175. <ol class="commentlist">
  176. <?php
  177. echo implode("\\n", $trackback_list);
  178. ?>
  179. </ol>
  180. <div id="trackbacks"><?php _e('Comments', 'mandigo'); ?></div>
  181. <?php
  182. }
  183.  
  184.  
  185.  
  186. // the comments
  187. ?>
  188.  
  189. <ol class="commentlist">
  190. <?php
  191. echo implode("\\n", $comment_list);
  192. ?>
  193. </ol>
  194.  
  195. <?php
  196.  
  197.  
  198.  
  199. // if we have trackbacks and we chose to display them BELOW comments
  200. if ($mandigo_options['trackbacks_position'] == 'below' && $trackback_list) {
  201. ?>
  202. <div id="trackbacks"><?php _e('Trackbacks', 'mandigo'); ?></div>
  203. <ol class="commentlist">
  204. <?php
  205. echo implode("\\n", $trackback_list);
  206. ?>
  207. </ol>
  208. <?php
  209. }
  210.  
  211. }
  212.  
  213.  
  214.  
  215. // this is displayed when there are no comments
  216. else {
  217.  
  218. // if comments are open (but there are no comments)
  219. if ($post->comment_status == 'open') {
  220. }
  221.  
  222. // if comments are closed
  223. else {
  224. ?>
  225. <p class="nocomments"><?php _e('', 'mandigo'); ?></p>
  226.  
  227. <?php
  228. }
  229. } // end of 'whether there are comments or not' condition
  230.  
  231.  
  232.  
  233. // if comments are open
  234. if ($post->comment_status == 'open') {
  235. ?>
  236.  
  237. <br><br><div id="respond"><?php _e('Dont be shy now, Comment this post', 'mandigo'); ?></div>
  238.  
  239. <?php
  240. // if only registered users can comment, and the current user is not logged in
  241. if (get_option('comment_registration') && !$user_ID) {
  242. ?>
  243.  
  244.  
  245.  
  246. <p><?php _e('You must be logged in to post a comment.', 'mandigo'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('Login', 'mandigo'); ?> &raquo;</a></p>
  247. <?php
  248. }
  249.  
  250. // if user can leave a comment
  251. else {
  252. ?>
  253.  
  254. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  255.  
  256. <?php
  257. // if the user is logged in
  258. if ($user_ID) {
  259. ?>
  260.  
  261. <p><?php printf(__('Logged in as %s', 'mandigo'),'<a href="'. get_option('siteurl') .'/wp-admin/profile.php">'. $user_identity .'</a>'); ?>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account', 'mandigo'); ?>"><?php _e('Logout', 'mandigo'); ?> &raquo;</a></p>
  262.  
  263. <?php
  264. }
  265.  
  266. // if the user is not logged in
  267. else {
  268. ?>
  269. <div align="left">
  270. <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
  271. <label for="author"><small><?php _e('Name', 'mandigo'); ?> <?php if ($req) echo "(". __('required', 'mandigo') .")"; ?></small></label></p>
  272.  
  273. <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
  274. <label for="email"><small><?php _e('E-mail', 'mandigo'); ?> (<?php _e('will not be published', 'mandigo'); ?>) <?php if ($req) echo "(". __('required', 'mandigo') .")"; ?></small></label></p>
  275.  
  276. <!--<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
  277. <label for="url"><small><?php _e('Website', 'mandigo'); ?></small></label></p>-->
  278.  
  279. </div>
  280. <?php
  281. }
  282.  
  283.  
  284.  
  285. // if HTML tags are allowed in comments
  286. if ($mandigo_options['comments_allow_markup']) {
  287. ?>
  288. <p><small><strong>XHTML:</strong> <?php _e('You can use these tags:', 'mandigo'); ?> <?php echo allowed_tags(); ?></small></p>
  289. <?php
  290. }
  291. ?>
  292.  
  293.  
  294. <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
  295.  
  296. <?php //show_subscription_checkbox(); ?>
  297.  
  298. <p>
  299. <input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'mandigo'); ?>" />
  300. <input type="hidden" name="comment_post_ID" value="<?php echo $post->ID; ?>" />
  301. </p>
  302.  
  303.  
  304. <?php
  305. do_action('comment_form', $post->ID);
  306. ?>
  307. </form>
  308.  
  309.  
  310. <?php
  311. } // end of 'whether the user is logged in or not' condition
  312. } // end of 'if comments are open' condition
  313. ?>
');