banner
阿珏酱

阿珏酱

いつもとは逆の電車に乗り、見たこともない風景を見に行く
twitter
github
facebook
bilibili
zhihu
steam_profiles
youtube

Implement Emlog's latest comment list to not display the blogger's comment replies.

Tips: When you see this prompt, it means that the current article has been migrated from the original emlog blog system. The publication time of the article is too long ago, and the layout and content may not be complete. Please understand.

Implement Emlog's latest comment list without displaying the blogger's comment replies

Date: 2017-5-6 Ajue Code Experiment Views: 1984 Comments: 0

Bloggers need to interact with visitors frequently, and the blogger's replies are also displayed as comments in the latest comments. In this way, if the blogger replies to several comments at once, the comments displayed in the latest comments will all be their own comments, which is not good.

Taking my current emlog 5.3.1 version as an example:

Open the cache.php file in the include/lib directory (this is a cache function file) and find the following code:

Mine is on line 179, as follows


Modify it to:



Tip: This is a piece of PHP code that executes SQL statements. The condition is to check whether the username of the comment user is the same as the blogger's username. If it is, the comment will not be displayed in the latest comment list. (You can also check the email address poster!='Ajue', after all, I don't reply with an email, so I can only check the username, of course, don't impersonate me)


Finally, after saving the file, update the cache in the emlog backend and refresh the webpage to see the effect.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.