Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6.1 is here with critical security patches. One of them has been publicly disclosed.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Duplicate Title Checker - If duplicated, add it as a new comment to existing discussion.

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!

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.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Ì guess you are searching for redirect discussionUrl($discussion);

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    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.

  • ShadowdareShadowdare π Moderator

    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 | Publish articles with the Articles app

  • soforilansoforilan New
    edited February 4

    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.

Sign In or Register to comment.