Closed dshovchko closed 7 years ago
then I will offer this variant
After some digging I agree there's an issue with comment count but the problem isn't in the database ...
For example if you look at this mybb post and this is in the mybb db:
(http://puu.sh/vCdam.png)
It does have 3 replies. And it does have also in flarum:
(http://puu.sh/vCdg5.png)
But in flarum it says 2 in the thread overview:
(http://puu.sh/vCdhU.png)
while in mybb it does say 3:
(http://puu.sh/vCdjy.png)
If you do +1 then posts without comments will be wrong
I have selected 3 discussions converted from mybb: id 1 has 0 replies id 11 has 1 reply id 121 has 2 replies
And created in flarum 3 discussions: id 131 has 0 replies id 132 has 1 reply id 133 has 2 replies
I have made it
What does it say in the mybb database ? Id 1, 11 and 12 - replies
I have added ORDER BY in query and changed setting comments_count and last_post_number
Ok, I get the comments_count now, its not logical tho, but i'll commit/fix it myself as i added some stuff already
Ок
Why +1? Comments are posts on a discussion without the original post Also lastpostnumber is not the count, its the number of the post and that always starts at 1
If you're saying this is wrong then it's MyBB fault but it's right either way
EDIT: I found an issue with last_post_number but the fix isn't
= 0
at the start, needs$lastpostnumber - 1
at end EDIT2: to get more easier its just$trow["replies"] + 1
- no even need that variable