If your autowriter Robot writes every 5 minutes probablility is high that the LAST_POST_AUTHOR will be the Robot, but also the author of the penultimate post, unless you've already blocked the autowriter to reply in a topic where he is already the last poster.
Exactly..!warmweer wrote: ↑Sat Jan 20, 2018 7:14 pmIf your autowriter Robot writes every 5 minutes probablility is high that the LAST_POST_AUTHOR will be the Robot, but also the author of the penultimate post, unless you've already blocked the autowriter to reply in a topic where he is already the last poster.
What is it exactly you want to achieve? Is it excluding search results for posts where the LAST_POST_AUTHOR is the robot, or show the latest last post made by a non-robot user in a topic? Or even something else?
This, not because I have a solution, or even an idea, but because the request isn't clear enough (to me). Just a guess, looking at the image: it seems you want to show a list with the post_title of the latest post made by a non-robot user, in each topic. Is that correct?
submit_post()
function in functions_posting.php
. This is what you need to prevent from happening if the user is your bot user. Unfortunately, there is no event to alter or remove these SQL queries against the forums table.1: My error..! I need this in index_body.phpwarmweer wrote: ↑Sun Jan 28, 2018 10:04 am 1st remark = why only in viewforum_body.html and not in index_body.html as well?
2nd remark = all it takes (I think) is changing the SQLs in viewforum.php and index.php. But this is no small change since the you would need a completely new SQL to look in each topic to find the last post_id not made by the user_id who is the autowriter, in other words the SQL needs to look into the posts_table.
3rd remark: You last statement might just simplify it since the robot never replies to a topic, in other words al you would need is to exclude topics started by the autowriter Robot and without replies (and then the topics_table would still suffice) and the change to the existing SQL is very small.
Disclaimer: this is all just going from memory and I'ld really have to look into a database to be able to take all situations into account.
What's the table..?kasimi wrote: ↑Sun Jan 28, 2018 11:50 am The last post information is stored in each forum row, because fetching this information when viewing the forum would be too expensive. When submitting a post, the post's forum row is updated, see thesubmit_post()
function infunctions_posting.php
. This is what you need to prevent from happening if the user is your bot user. Unfortunately, there is no event to alter or remove these SQL queries against the forums table.
Code: Select all
if($username != ' Robot' || $user_id != 49){
}
It's not as simple as you may think.LuigiMdg wrote: ↑Mon Jan 29, 2018 12:18 am ...
What's the table..?
I can insert a simple:Code: Select all
if($username != ' Robot' || $user_id != 49){ }
if
there will not only affect the index page but your entire board.