Website construction

Re enable comments for blog posts, and attach a key to fill in the user information code generation tool in comments

Jager · October 10 · 2014 · 4228 times read

The blog has closed comments for nearly a month, and the overall feeling is very comfortable. However, after reading the feedback on the message board, I feel that closing comments has brought some inconvenience to some friends who really need help. After thinking about the exam, I decided to open comments again.

But in Baidu Cloud Acceleration, I still enabled the acceleration of html, so every time I open the article page, the user information in the comments will be cleared! Therefore, for comments that are not very relevant and important, I suggest going to the message board to save time and effort.

Well, here is the code generation tool that I transferred from [Jianmeng's private plot] to automatically fill in user information for comments:

One click comment information code generation tool

Nickname (required):

Email address (required):

Site (optional):

Easy to use:

① After correctly filling in the nickname, email and site information, click Generate Code:

 Re enable comments for blog posts, and attach a key to fill in the user information code generation tool in comments

 

 Re enable comments for blog posts, and attach a key to fill in the user information code generation tool in comments

Ps: At this time, you can try to click [Quickly fill in the comment information of this article] to see whether the comment box of this article has normally filled in the information you just entered.

Use Ctrl+C to copy the generated code for future use:

 Javascript: document. getElementById ('author '). value=' Zhang Ge Blog '; document.getElementById('email').value = ' im@zhang.ge ';  document.getElementById('url').value = ' https://zhang.ge '; void(0)

② , Save to Favorites

1. If it is a third-party browser such as 360, you can directly drag [Fill in the comment information of this article quickly] to the browser favorites;

2. You can also right click [Quickly fill in the comments of this article], select Add to Favorites, and then use Ctrl+V to paste the previously copied code to the website

 Re enable comments for blog posts, attach a key to fill in the user information code generation tool in comments

 Re enable comments for blog posts, attach a key to fill in the user information code generation tool in comments

3: Directly use Ctrl+D to collect a web page, and then right-click the collection to modify the link content into the js code generated in this article.

③ . If you need to fill in the user information in the next comment, just click the link in the browser's favorites to automatically fill in the user information in the comment!

If you want to create such a tool, just paste the following code into the corresponding page of the blog (text mode is required):

 <script type="text/javascript"> (function($){ $(document).ready(function() { $('.code_result').hide(); $('#generate_code').click(function(){ var re = /^[0-9a-zA-Z]+([\.\-\_][0-9a-zA-Z]+)*@[0-9a-zA-Z]+([\.\-][0-9a-zA-Z]+)*. [a-zA-Z]+$/; if($('#commenter_author').val() == '') { $('#commenter_author').css('border', 'solid 1px #ff0000'); $('#commenter_author').focus(); } else if(!re.test($('#commenter_email').val())) { $('#commenter_email').css('border', 'solid 1px #ff0000'); $('#commenter_email').focus(); } else { var commenter_code = 'javascript:document.getElementById(\'author\').value = \''+$('#commenter_author').val()+'\';  document.getElementById(\'email\').value = \''+$('#commenter_email').val()+'\';  document.getElementById(\'url\').value = \''+$('#commenter_url').val()+'\';  void(0)'; $('#wp_commenter_code').html(commenter_code); $('.code_result>a').attr('href', commenter_code); $('.code_result').show(); } }); $('#cheon_code_generator input').keyup(function() { $(this).css('border', 'solid 1px #000000'); }); }); })(jQuery); </script> <div id="cheon_code_generator" style="padding:10px;"> <p>Nickname (required):<br/> <input type="text" value="" name="commenter_author" id="commenter_author" style="border:solid 1px #000;"></p> <p>Email address (required):<br/> <input type="text" value="" name="commenter_email" id="commenter_email" style="border:solid 1px #000;"></p> <p>Site:<br/> <input type="text" value="" name="commenter_url" id="commenter_url" style="border:solid 1px #000;"></p> <p><textarea cols="40" rows="10" name="wp_commenter_code" id="wp_commenter_code" style="border:solid 1px #000;"></textarea></p> <p><input type="button" value="Generate Code" id="generate_code" style="cursor: pointer; border: solid 1px # 000;"></p> <p class="code_result" style="display: none;">Drag the link below to your bookmark toolbar or right-click the link to add it to your favorites to create a shortcut for quickly filling in the information of WP reviewers< Br/><a href="#">Fill in WP comments quickly</a></p> </div>

After several struggles, I have integrated this function into the comment box of my blog:

about No CDN cache The "Lazy Man Code" button will only appear on the first comment page (that is, remember the user information). If the information has been remembered, this button will be hidden. Click [Change] Personal Information, and the "Lazy Man" button will appear. For the page with CDN, this button will always exist:

 Re enable comments for blog posts, and attach a key to fill in the user information code generation tool in comments

 Re enable comments for blog posts, attach a key to fill in the user information code generation tool in comments

Unfortunately, the function of clicking to automatically pop up the collection interface has not been realized. Do any prawns know how to make the regular click collection function compatible with non websites? Not the website, it seems that you can't pop up the collection prompt. If you understand, please give me some advice. Thank you very much!!

37 responses
  1. Weight network 2014-10-10 · 15:11

    This is really great~
    I used it

    •  avatar
      Jager 2014-10-10 · 17:09

      This function has been integrated into the comment box, but it is not perfect.

  2. Hong Kong server hosting 2014-10-10 · 15:31

    Open comments allow more communication.

  3. Reten 2014-10-10 · 15:51

    :mrgreen:

    The blog has been turned upside down again.

    •  avatar
      Jager 2014-10-10 · 17:10

      There is no end to life...

  4. MOLOGO 2014-10-10 · 16:51

    Well, I saw the sign in function

    •  avatar
      Jager 2014-10-10 · 17:10

      The key point is to automatically fill ha~: grin:

  5. Shanghai Insurance Network 2014-10-10 · 21:23

    You have something to worry about. You can see that you scroll on the side bar, and then scroll when you touch the side bar at the bottom. This is not good. Let's see how to solve it. This is also my problem. Please tell me when you have solved it.
    Also, the time mark for your comment box input has disappeared.

    •  avatar
      Jager 2014-10-10 · 21:46

      I don't think the problem of scrolling the bottom has much effect. The blocked part can be clicked before being blocked. This problem is mainly caused by the following scrolling part is too high. To solve this problem, just reduce the following content.

      When I input comments, my cursor is still there. If I don't see your problem, the cursor will change to input status | It's true.

      • Shanghai Insurance Network 2014-10-10 · 22:32

        The cursor is now normal. The problem of too much scrolling is not serious. You can see that my 404 page is serious (also uses the nerve cat you shared). I see some blogs can stop scrolling by touching the bottom of the sidebar. Patients with obsessive-compulsive disorder must find a way to solve this bug, ha ha

        •  avatar
          Jager 2014-10-10 · 23:32

          Forced refresh and opened your website. After looking at 404, I felt that the DIV was misplaced, which is different from mine.

  6. Dragon Third Young Master 2014-10-10 · 22:13

    I've come back again.

  7. PHP secondary development 2014-10-10 · 22:18

    Test! hey

    •  avatar
      Jager 2014-10-10 · 23:32

      Hey hey, have fun...

  8. Dragon Third Young Master 2014-10-10 · 22:19

    Sign in successfully! Sign in time: 10:12:01 p.m, Sign in every day to make life more exciting~

    The real man showed his face.....

    This message function is compared to Doha

    In addition, it is found that only one comment can be made, and the second time the user is still prompted to unlock, and the actual status has been solved. You must refresh once, and sign in again successfully! Sign in time: 10:18:54 p.m., sign in every day, and life is more exciting~

  9. Dragon Third Young Master 2014-10-10 · 22:24

    Sign in successfully! Sign in time: 10:23:31 p.m., sign in every day, and life is more exciting~

  10. Chinese history 2014-10-11 · 9:23

    It's good to open comments. You used this method very well at the beginning

  11. Super efly 2014-10-11 · 9:45

    It seems very good!!

    •  avatar
      Jager 2014-10-11 · 12:32

      Well, it works well,

  12. Summer Blog 2014-10-11 · 11:18

    It seems that WP can remember user information.

    •  avatar
      Jager 2014-10-11 · 11:23

      The article has stated that [but in Baidu Cloud Acceleration, I still enable the acceleration of html, so every time I open the article page, the user information in the comments will be cleared!], after opening the CDN, it is impossible to remember.

  13. Mengxuan Beauty 2014-10-11 · 11:53

    It doesn't need to be so complicated. Just double click the mouse to display our information in the information box, such as the nickname column, after the previous comments. The test on your site just now is also OK.

    •  avatar
      Jager 2014-10-11 · 12:32

      Some browsers do not support clicking and dropping down.
      In addition, I only need to click this method once. You need to click 3 times. The method is not complicated, and it is just a collection of js code.

      • Mengxuan Beauty 2014-10-11 · 12:54

        Indeed, sometimes the double click fails, which is just a matter of habit.

  14. Brother Fei 2014-10-12 · 20:51

    It's troublesome to leave a message. The station affects communication a

  15. Brother Fei 2014-10-12 · 20:51

    Sign in successfully! Sign in time: 8:50:07 p.m., sign in every day, and life is more exciting~

  16. Brother Fei 2014-10-14 · 13:48

    Sign in successfully! Sign in time: 1:48:08 p.m., sign in every day, and life is more exciting~

  17. Star Lollipop 2015-1-21 · 13:51

    Not bad, this is easy to use, thank you!

  18. Feng Zi 2015-4-29 · 15:33

    Sign in successfully! Sign in time: 3:29:11 p.m., sign in every day, and life is more exciting~

  19. Meteorite 2015-12-31 · 13:52

    Excuse me, do you have plug-ins in this message area? I can't code Thank you: oops:

  20. Meteorite 2015-12-31 · 13:52

    Thank you blogger

  21. Meteorite 2015-12-31 · 13:53

    Sign in successfully! Sign in time: 1:52:24 p.m., sign in every day, and life is more exciting~

  22. Long Xiaotian 2016-5-17 · 18:27

    There is more perfect js bookmark code, but it will not be optimized. I hope it can simplify the following code: The method of automatically filling in personal information for comments on blog websites (universal across all platforms and networks)

  23. Satisfied 2016-12-25 · 1:12

    This is fun, tested, good. A must for lazy people

  24. vultr 2017-1-29 · 14:58

    The following code seems to be more powerful!