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.
Duplicate Title Checker - If duplicated, add it as a new comment to existing discussion.
soforilan
New
Hey guys,
I'm trying to accomplish something but my PHP knowledge is not enough for this. In order to keep every discussion unique, I want to have a duplicate title checker while starting a new discussion. Let's say we already have a discussion as "Bmw z3", if another user tries to start a new conversation with exact same name as "Bmw z3", add his post body to existing discussion as a new comment. How to do that? I'm ready to pay something for such an addon. Thank you!
0
Comments
Hmmm... interesting question. It's most certainly possible to intercept a discussion being posted, check if the title already exists, then post a comment to that thread instead of creating a new discussion, the only thing I'm wondering:
Does anyone know if it's possible to redirect to that other discussion?
Is there a function like controller()->redirect($url)?
There are other solutions but they'll be a bit hackish.
Ì guess you are searching for
redirect discussionUrl($discussion);
What I don't like about that idea is that something is happening what the user does not expect. I consider that bad UX. I assume I write a discussion and instead of having "my own" discussion, it is appended as a comment somewhere.
I don't like when software thinks its smarter than me. In would prefer getting a hint like that:
User writes the discussion title
After he is finished he changes to the body box
A JavaScript queries for a discussion with that title
If an identical (cool would be similar) title is found, a hint is shown
Then there should be two buttons "Post as new discussion" and a "Attach to existing discussion". The difficulty would be to decide to which discussion.
But if the existing discussions would be listed below the post, showing the first few sentences and all of them having a "Comment to this discussion" would be great.
If that freedom is not desired, you could at least warn the user that his discussion will not be a discussion but only a comment.
I've seen something similar implemented on other kinds of forums in the past. When a user goes to create a new post and writes in a title, a box will show up showing similar/related threads. Doing it this way would be less complicated and more smooth for the user experience.
Add Pages to Vanilla with the Basic Pages app
The concept of my forum will be a bit different than a regular one actually. It'd be more like an urban dictionary style so having 2 discussions for same thing would be a bit confusing for my user base. In this case, redirecting to the existed topic would not hurt user experience at all. I'm sure most of admins prefer having a single discussion full of information rather than several less-informative ones.
Actually I did manage to code something for checking duplicated topic but it does not add the comment to the existed discussion, instead, only gives an error. (It also trims special characters such as dot and comma)
I'd be glad to upload my class.postcontroller.php and let the masters turn it to a useful addon.