But it could become one!
A few days ago, I found this thread here:
https://xenforo.com/community/threa...hread-if-it-only-contains-their-posts.219590/
And then I thought to myself, okay, let's build this now. But what exactly are we building here?
But being who I am, it continued!
Wouldn't it be good if the user could also see his deleted threads? I spent half a day looking through various files, entities for node, forum, thread, post, but also forum types and thread types. I stuck my nose everywhere, extended classes, and each time found that it didn't work that way or not without additional queries. I was so desperate that I wrote to someone from Xenforo, I'll leave his name out, I don't know if he wants more such questions.
He replied to me later. In the meantime, I came across the ThreadFinder. And that was exactly his tip. ThreadFinder and Entity Thread. Okay, I almost had that too.
I had first adapted the source code of Xenforo itself as I needed it, that was child’s play and only one condition. Done! But then that also had to go into an extension of the class.
And then I sat there for three, four hours, sweating and cursing, and couldn’t get it done. At some point, I realized that I always have to run a class that starts with $conditions = [] first. Then I looked at what my changes to the Xenforo source code do with print_r($conditions). And then finally I found a solution that programmers might not like.
But it works for now.
But being who I am, that's not enough!
Because if the admin deletes something and the user with special rights deletes something, those are two different things! So
And now it could become a love song if I post my code here as far as I have it done and discuss it with you.
Is there any interest?
A few days ago, I found this thread here:
https://xenforo.com/community/threa...hread-if-it-only-contains-their-posts.219590/
And then I thought to myself, okay, let's build this now. But what exactly are we building here?
- Permission for soft and hard delete
- Check if the thread belongs to the user and if all posts are his
- Let him delete the thread
But being who I am, it continued!
Wouldn't it be good if the user could also see his deleted threads? I spent half a day looking through various files, entities for node, forum, thread, post, but also forum types and thread types. I stuck my nose everywhere, extended classes, and each time found that it didn't work that way or not without additional queries. I was so desperate that I wrote to someone from Xenforo, I'll leave his name out, I don't know if he wants more such questions.
He replied to me later. In the meantime, I came across the ThreadFinder. And that was exactly his tip. ThreadFinder and Entity Thread. Okay, I almost had that too.
I had first adapted the source code of Xenforo itself as I needed it, that was child’s play and only one condition. Done! But then that also had to go into an extension of the class.
And then I sat there for three, four hours, sweating and cursing, and couldn’t get it done. At some point, I realized that I always have to run a class that starts with $conditions = [] first. Then I looked at what my changes to the Xenforo source code do with print_r($conditions). And then finally I found a solution that programmers might not like.
But it works for now.
But being who I am, that's not enough!
Because if the admin deletes something and the user with special rights deletes something, those are two different things! So
- user can delete their own threads if only their own posts are in them.
- soft and hard delete
- user can see their own deleted threads - but only if they deleted them themselves.
- user can restore their own deleted threads - but only if they deleted them themselves.
And now it could become a love song if I post my code here as far as I have it done and discuss it with you.
Is there any interest?