Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to add a massive post at the end of each thread?
candyman
✭✭
I've closed my phpbb forum two years ago and now I'm going to open it again with Vanilla: for this reason I'd like to add at the end of each thread (there are hundreds...) a post explaining that this is the new post after the closing. A sort of boundary line.
How can I obtain this in a simple way without manually writing a post in every thread?
Can I give a command in the terminal/myPhpAdmin?
All these "advise post" are by the admin, obviously. Better if they would have the same date&time.
Thanks in advance.
0
Comments
One way to do this is to make a PHP script that queries the database for all the IDs of the discussions and then uses a loop with an array of those discussion IDs that instantiates CommentModel() from Vanilla to create a comment for each discussion ID along with the data for the comment.
Add Pages to Vanilla with the Basic Pages app
If you want to do this the SQL way, you could use the script below.
But beware: /!\
In nearly every software I know, writing directly to the database has some side effects nobody knows of and you should avoid it. I think there is an API and using this one would be much safer, although it would also take much more time.
But there might be some Plugins which expect additional info per comment and because this isn't provided with the script, either the script will fail or your forum is unusable.
Or even core functions might not work as expected after inserting comments by SQL. You should get feedback from some experienced Vanilla users before you start the SQL script below!
The code tag is not working the way it should (I'm new to markdown, it could be my fault): maybe you should better quote my posting and look at what I've written instead of using what is showing...
I would implement a plugin that offers the following features:
This plugin would have the benefit of not inserting a bunch of duplicate data while still being pretty easy to implement.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
if you replace this function in the comment body insert plugin. It will place a message on all the old messages.
I would put a message on the old messages of the forum rather than the new ones.
public function DiscussionController_AfterCommentBody_Handler($Sender) {
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I would pay a fee for a working plugin (to be honest I have already contacted Shadowdare for this).
According to you is it possible to run a script which can automatically add a comment inside the last post of every thread posted before a specific date?
My original idea was to adding a post (containing an image) after the conclusion of every posts written in the old era.
A sort of visible border.
LAST POST
image
NEW POST
Anyway, I would not that a tons of posts with the same date&time could create problems to the search engine.
I hope that different post IDs could avoid this, aren't they?
Thanks all for the useful suggestions.
p.s.: the optimum would be the possibility to use some css tricks to do the job...
@candyman
If @Shadowdare doesn't have the time or desire, pm with the amount you would pay. But only if @Shadowdare doesn't have the time or desire, i could do it for you.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
As far as my test using peregrine's comment insert plugin , you can add anything to the comments anywhere you want . even after the signatures or anywhere you want.
I was able to add, flash content, images, text, javascript. And I used css to put it anywhere I wanted.
public function DiscussionController_BeforeCommentBody_Handler($Sender) {
puts it in the meta section and you can just use css to make it appear above that
or
public function DiscussionController_AfterCommentBody_Handler($Sender) {
which makes it come out after the comment and use css to make it come out below that.
It is a great plugin that if you are creative you can do a lot with
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Let me know how this pans out.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
@hgtonight
"I would pay a fee"
that wakes us all up .
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.