comments.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. $bilibili_smile = !iro_opt('comment_smile_bilibili') ? '' : '<th onclick="motionSwitch(\'.bili\')"
  49. class="bili-bar on-hover">bilibili~</th>';
  50. $bilibili_push_smile = !iro_opt('comment_smile_bilibili') ? '<div class="menhera-container motion-container">' :'<div class="bili-container motion-container">' . push_bili_smilies() . '</div><div class="menhera-container motion-container" style="display:none;">';
  51. $args = array(
  52. 'id_form' => 'commentform',
  53. 'id_submit' => 'submit',
  54. 'title_reply' => '',
  55. 'title_reply_to' => '<div class="graybar"><i class="fa-regular fa-comment"></i>' . __('Leave a Reply to', 'sakurairo') . ' %s' . '</div>',
  56. 'cancel_reply_link' => __('Cancel Reply', 'sakurairo'),
  57. 'label_submit' => __('BiuBiuBiu~', 'sakurairo'),
  58. 'comment_field' => '<p style="font-style:italic"><a href="https://segmentfault.com/markdown" target="_blank"><i class="fa-brands fa-markdown" style="color:var(--comment_area_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>
  59. <div id="upload-img-show"></div>
  60. <!--插入表情面版-->
  61. <p id="emotion-toggle" class="no-select">
  62. <span class="emotion-toggle-off">' . __("Click me OωO", "sakurairo")/*戳我试试 OωO*/ . '</span>
  63. <span class="emotion-toggle-on">' . __("Woooooow ヾ(≧∇≦*)ゝ", "sakurairo")/*嘿嘿嘿 ヾ(≧∇≦*)ゝ*/ . '</span>
  64. </p>
  65. <div class="emotion-box no-select">
  66. <table class="motion-switcher-table">
  67. <tr>'.$bilibili_smile.'
  68. <th onclick="motionSwitch(\'.menhera\')"
  69. class="menhera-bar">(=・ω・=)</th>
  70. <th onclick="motionSwitch(\'.tieba\')"
  71. class="tieba-bar">Tieba</th>
  72. </tr>
  73. </table>
  74. '.$bilibili_push_smile.push_emoji_panel().'
  75. </div>
  76. <div class="tieba-container motion-container" style="display:none;">' . push_tieba_smilies() . '</div>
  77. </div>
  78. <!--表情面版完-->',
  79. 'comment_notes_after' => '',
  80. 'comment_notes_before' => '',
  81. 'fields' => apply_filters( 'comment_form_default_fields', array(
  82. 'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar"><img src="' . iro_opt('vision_resource_basepath', 'https://s.nmxc.ltd/sakurairo_vision/@2.6/') . '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>',
  83. 'author' =>
  84. '<div class="popup cmt-popup cmt-author" onclick="cmt_showPopup(this)"><span class="popuptext" id="thePopup" style="margin-left: -115px;width: 230px;">' . __("Auto pull nickname and avatar with a QQ num. entered", "sakurairo")/*输入QQ号将自动拉取昵称和头像*/ . '</span><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'" : '' ). ' /></div>',
  85. 'email' =>
  86. '<div class="popup cmt-popup" onclick="cmt_showPopup(this)"><span class="popuptext" id="thePopup" style="margin-left: -65px;width: 130px;">' . __("You will receive notification by email", "sakurairo")/*你将收到回复通知*/ . '</span><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'" : '' ). ' /></div>',
  87. 'url' =>
  88. '<div class="popup cmt-popup" onclick="cmt_showPopup(this)"><span class="popuptext" id="thePopup" style="margin-left: -55px;width: 110px;">' . __("Advertisement is forbidden 😀", "sakurairo")/*禁止小广告😀*/ . '</span><input type="text" placeholder="' . __("Site", "sakurairo") . '" name="url" id="url" value="' . esc_attr($comment_author_url) . '" size="22" autocomplete="off" tabindex="1" /></div></div>' . $robot_comments . $private_ms . $mail_notify ,
  89. 'qq' =>
  90. '<input type="text" placeholder="QQ" name="new_field_qq" id="qq" value="' . esc_attr($comment_author_url) . '" style="display:none" autocomplete="off"/><!--此栏不可见-->'
  91. )
  92. )
  93. );
  94. comment_form($args);
  95. }
  96. ?>
  97. </div>
  98. </section>
  99. <?php endif; ?>