1
0

comments.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php
  2. /**
  3. * COMMENTS TEMPLATE
  4. */
  5. /*if('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  6. die(__('Please do not load this page directly.', 'akina'));*/
  7. if(post_password_required()){
  8. return;
  9. }
  10. ?>
  11. <?php if(comments_open()): ?>
  12. <section id="comments" class="comments">
  13. <div class="commentwrap comments-hidden<?php echo iro_opt('comment_area')=='fold'?' comments-fold':'' ?>">
  14. <div class="notification"><i class="fa-regular fa-comment"></i><?php _e('view comments', 'sakurairo'); /*查看评论*/?> -
  15. <span class="noticom"><?php comments_number('NOTHING', '1'.__(" comment","sakurairo"), '%'.__(" comments","sakurairo")); ?> </span>
  16. </div>
  17. </div>
  18. <div class="comments-main">
  19. <h3 id="comments-list-title">Comments <span class="noticom"><?php comments_number('NOTHING', '1'.__(" comment","sakurairo"), '%'.__(" comments","sakurairo")); ?> </span></h3>
  20. <div id="loading-comments"><span></span></div>
  21. <?php if(have_comments()): ?>
  22. <ul class="commentwrap">
  23. <?php wp_list_comments(
  24. array(
  25. "type" => "comment",
  26. "callback" => "akina_comment_format",
  27. "reverse_top_level" => get_option('comment_order') == 'asc' ? null : true
  28. )
  29. );
  30. ?>
  31. </ul>
  32. <nav id="comments-navi">
  33. <?php paginate_comments_links('prev_text=« Older&next_text=Newer »');?>
  34. </nav>
  35. <?php else : ?>
  36. <?php if(comments_open()): ?>
  37. <div class="commentwrap">
  38. <div class="notification-hidden"><i class="fa-regular fa-comment"></i> <?php _e('no comment', 'sakurairo'); /*暂无评论*/?></div>
  39. </div>
  40. <?php endif; ?>
  41. <?php endif; ?>
  42. <?php
  43. if(comments_open()){
  44. $robot_comments= null;
  45. if(iro_opt('not_robot')) $robot_comments = '<label class="siren-checkbox-label"><input class="siren-checkbox-radio" type="checkbox" name="no-robot"><span class="siren-no-robot-checkbox siren-checkbox-radioInput"></span>'.__('I\'m not a robot', 'sakurairo').'</label>';
  46. $private_ms = iro_opt('comment_private_message') ? '<label class="siren-checkbox-label"><input class="siren-checkbox-radio" type="checkbox" name="is-private"><span class="siren-is-private-checkbox siren-checkbox-radioInput"></span>'.__('Comment in private', 'sakurairo').'</label>' : '';
  47. $mail_notify = iro_opt('mail_notify') ? '<label class="siren-checkbox-label"><input class="siren-checkbox-radio" type="checkbox" name="mail-notify"><span class="siren-mail-notify-checkbox siren-checkbox-radioInput"></span>'.__('Comment reply notify', 'sakurairo').'</label>' : '';
  48. $smilies_panel = '';
  49. $bilibili_smilies = '';
  50. $tieba_smilies = '';
  51. $menhera_smilies = '';
  52. $custom_smilies = '';
  53. $bilibili_push_smilies = '';
  54. $tieba_push_smilies = '';
  55. $menhera_push_smilies = '';
  56. $custom_push_smilies = '';
  57. $smilies_list = iro_opt('smilies_list');
  58. if ($smilies_list) {
  59. if (in_array('bilibili', $smilies_list)) {
  60. $bilibili_smilies = '<th class="bili-bar">bilibili~</th>';
  61. $bilibili_push_smilies = '<div class="bili-container motion-container" style="display:none;">' . push_bili_smilies() . '</div>';
  62. }
  63. if (in_array('tieba', $smilies_list)) {
  64. $tieba_smilies = '<th class="tieba-bar">Tieba</th>';
  65. $tieba_push_smilies = '<div class="tieba-container motion-container" style="display:none;">' . push_tieba_smilies() . '</div>';
  66. }
  67. if (in_array('yanwenzi', $smilies_list)) {
  68. $menhera_smilies = '<th class="menhera-bar">(=・ω・=)</th>';
  69. $menhera_push_smilies = '<div class="menhera-container motion-container" style="display:none;">' . push_emoji_panel() . '</div>';
  70. }
  71. if (in_array('custom', $smilies_list)) {
  72. $custom_smilies = '<th class="custom-bar"> '. iro_opt('smilies_name') .'</th>';
  73. $custom_push_smilies = '<div class="custom-container motion-container" style="display:none;">' . push_custom_smilies() . '</div>';
  74. }
  75. switch ($smilies_list[0]) {
  76. case "bilibili" :
  77. $bilibili_smilies = '<th class="bili-bar on-hover">bilibili~</th>';
  78. $bilibili_push_smilies = '<div class="bili-container motion-container" style="display:block;">' . push_bili_smilies() . '</div>';
  79. break;
  80. case "tieba" :
  81. $tieba_smilies = '<th class="tieba-bar on-hover">Tieba</th>';
  82. $tieba_push_smilies = '<div class="tieba-container motion-container" style="display:block;">' . push_tieba_smilies() . '</div>';
  83. break;
  84. case "yanwenzi" :
  85. $menhera_smilies = '<th class="menhera-bar on-hover">(=・ω・=)</th>';
  86. $menhera_push_smilies = '<div class="menhera-container motion-container" style="display:block;">' . push_emoji_panel() . '</div>';
  87. break;
  88. case "custom" :
  89. $custom_smilies = '<th class="custom-bar on-hover"> '. iro_opt('smilies_name') .'</th>';
  90. $custom_push_smilies = '<div class="custom-container motion-container" style="display:block;">' . push_custom_smilies() . '</div>';
  91. break;
  92. }
  93. $smilies_panel = '<p id="emotion-toggle" class="no-select">
  94. <span class="emotion-toggle-off">' . __("Click me OωO", "sakurairo")/*戳我试试 OωO*/ . '</span>
  95. <span class="emotion-toggle-on">' . __("Woooooow ヾ(≧∇≦*)ゝ", "sakurairo")/*嘿嘿嘿 ヾ(≧∇≦*)ゝ*/ . '</span>
  96. </p>
  97. <div class="emotion-box no-select">
  98. <table class="motion-switcher-table">
  99. <tr>
  100. '. $bilibili_smilies .'
  101. '. $tieba_smilies .'
  102. '. $menhera_smilies .'
  103. '. $custom_smilies .'
  104. </tr>
  105. </table>
  106. ' . $bilibili_push_smilies . '
  107. ' . $tieba_push_smilies . '
  108. ' . $menhera_push_smilies . '
  109. ' . $custom_push_smilies . '
  110. </div>';
  111. };
  112. $args = array(
  113. 'id_form' => 'commentform',
  114. 'id_submit' => 'submit',
  115. 'title_reply' => '',
  116. 'title_reply_to' => '<div class="graybar"><i class="fa-regular fa-comment"></i>' . __('Leave a Reply to', 'sakurairo') . ' %s' . '</div>',
  117. 'cancel_reply_link' => __('Cancel Reply', 'sakurairo'),
  118. 'label_submit' => __('BiuBiuBiu~', 'sakurairo'),
  119. 'comment_field' => '<p style="font-style:italic"><a href="https://segmentfault.com/markdown" target="_blank"><i class="fa-brands fa-markdown" style="color:var(--article-theme-highlight,var(--theme-skin-matching));"></i></a> Markdown Supported while <i class="fa-solid fa-code"></i> Forbidden</p><div class="comment-textarea"><textarea placeholder="' . __("You are a surprise that I will only meet once in my life", "sakurairo") . ' ..." name="comment" class="commentbody" id="comment" rows="5" tabindex="4"></textarea><label class="input-label">' . __("You are a surprise that I will only meet once in my life", "sakurairo") . ' ...</label></div>
  120. <div id="upload-img-show"></div>
  121. <!--插入表情面版-->
  122. ' . $smilies_panel . '
  123. <!--表情面版完-->',
  124. 'comment_notes_after' => '',
  125. 'comment_notes_before' => '',
  126. 'fields' => apply_filters( 'comment_form_default_fields', array(
  127. 'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar"><img alt="comment_user_avatar" src="' . iro_opt('vision_resource_basepath', 'https://s.nmxc.ltd/sakurairo_vision/@2.7/') . 'basic/avatar.jpeg"><div class="socila-check qq-check"><i class="fa-brands fa-qq"></i></div><div class="socila-check gravatar-check"><i class="fa-solid fa-face-kiss-wink-heart"></i></div></div>',
  128. 'author' =>
  129. '<div class="popup cmt-popup cmt-author"><input type="text" placeholder="' . __("Nickname or QQ number", "sakurairo") /*昵称或QQ号*/. ' ' . ( $req ? '(' . __("Name* ", "sakurairo") . ')' : '') . '" name="author" id="author" value="' . esc_attr($comment_author) . '" size="22" autocomplete="off" tabindex="1" ' . ($req ? "aria-required='true'" : '' ). ' /><span class="popuptext" style="margin-left: -115px;width: 230px;">' . __("Auto pull nickname and avatar with a QQ num. entered", "sakurairo")/*输入QQ号将自动拉取昵称和头像*/ . '</span></div>',
  130. 'email' =>
  131. '<div class="popup cmt-popup"><input type="text" placeholder="' . __("email", "sakurairo") . ' ' . ( $req ? '(' . __("Must* ", "sakurairo") . ')' : '') . '" name="email" id="email" value="' . esc_attr($comment_author_email) . '" size="22" tabindex="1" autocomplete="off" ' . ($req ? "aria-required='true'" : '' ). ' /><span class="popuptext" style="margin-left: -65px;width: 130px;">' . __("You will receive notification by email", "sakurairo")/*你将收到回复通知*/ . '</span></div>',
  132. 'url' =>
  133. '<div class="popup cmt-popup"><input type="text" placeholder="' . __("Site", "sakurairo") . '" name="url" id="url" value="' . esc_attr($comment_author_url) . '" size="22" autocomplete="off" tabindex="1" /><span class="popuptext" style="margin-left: -55px;width: 110px;">' . __("Advertisement is forbidden 😀", "sakurairo")/*禁止小广告😀*/ . '</span></div></div>' . $robot_comments . $private_ms . $mail_notify ,
  134. 'qq' =>
  135. '<input type="text" placeholder="QQ" name="new_field_qq" id="qq" value="' . esc_attr($comment_author_url) . '" style="display:none" autocomplete="off"/><!--此栏不可见-->'
  136. )
  137. )
  138. );
  139. comment_form($args);
  140. }
  141. ?>
  142. </div>
  143. </section>
  144. <?php endif; ?>