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.

Version 0.1.2 Released

This discussion is related to the ReplyTo addon.
edited October 2010 in Vanilla 2.0 - 2.8
Fixed bug where a comment added at the end of a discussion occasionally went to the front.

Fixed some tree building issues.

Tidy up the tree on deleting comments, moving child comments to the parent of the comment about to be deleted.

Removed declaration of the settings page, so you don't get a "settings" button, with a subsequent error page, in the plugins admin page.


  • Any moderator tools provided? For instance, "move higher" to move comment out of wrong branch, or to move to some comment (only these that were poster before that comment).
  • judgejjudgej
    edited October 2010
    No, there are no tools to do that at this point. It should be relatively simple to implement through the edit form - change the parent comment ID then call up "RebuildTree".

    It is a good point about limiting the attachments to earlier comments only, although the tree will handle reattachments to any earlier or later comments without any problem.

    Also the ability to take a comment out of the tree completely, which would leave it tagged onto the the discussion at the top level (taking post date into account automatically).

    Edit: thinking about it, how often would this kind of feature be needed? I'm sure it would be nice, but just weighing up the cost/benefits, it is not something that I am likely to spend any time on. I'll be happy to look at any code that anyone would like to provide, or it could even be provided as a separate plugin that extends this one.
  • Do you have a git repo?
  • judgejjudgej
    edited November 2010
    Nope. I tend to use subversion for small lumps of code, because it was just easy to set up and integrates well with file explorer. However, this module is just a series of zip files at the moment, so it is not easy to share development. Yet.
  • Hi! This looks GREAT, I installed it right away, but when trying to insert a new reply, I got the following error:

    Fatal error: Call to undefined method Gdn_MySQLDriver::SetCase() in /home/myusername/domain/forum/plugins/ReplyTo/class.replyto.plugin.php on line 199

    I looked all thru the GDN libraries and couldn't find "SetCase" so should that be Set?

    I changed it to Set, which you use everywhere else, which has the same variables in the same order… and the reply was created without errors, but it appeared at the end of the thread instead.

    This is on Vanilla 2.0.11.

    I really, really, really want to be able to use this feature since the amount of traffic on my forum is about to explode. :) I would gladly pay you for your time to fix this since I'm so eager to have it (and give back to the community :)
  • judgejjudgej
    edited November 2010
    NOTE: no need for this hack from v0.1.3

    Oh dear - that sounds like an extension I added in my installation to add a bit of missing functionality to the SQL driver. Details are here, raised as a feature request:

    If you use the cost posted there for now to try this plugin out, I'll work out a way around it (any suggestions welcomed). Sorry about that.

    Add this code:

    public function SetCase($SetField, $Field, $Options) { $CaseOptions = ''; foreach ($Options as $Key => $Val) { if ($Key == '') $CaseOptions .= ' else ' . $Val; else $CaseOptions .= ' when ' . $Key . ' then ' . $Val; } $this->Set($SetField, 'case ' . $Field . ' ' . $CaseOptions . ' end', FALSE); return $this; }

    to the bottom of library/database/class.sqldriver.php just after the SelectCase() method. I just have not worked out how to extend the core database classes from a plugin yet.
  • @ahoyhere - I have uploaded a new version that does not rely on the core "hack" extension. Give that a run and see how it goes.
  • Thanks, you rule! Downloading now & will report back. Do you have a donate button somewhere?
  • Hey, it works! Thanks Judge! I can't tell you how happy I am. I'm running an online class and when 50 students all post their concerns, and I then post 50 posts at the end of the thread to address each one, it's madness!
  • Judge, one more (minor) thing: the comments aren't visually indenting. I thought it was just my custom theme but I inspected the HTML and the reply comment didn't have any ReplyToDepth classes at all.

    It IS showing up right after the parent comment, though!
  • judgejjudgej
    edited November 2010
    Check the readme.txt file - there is a minor change to make to your theme file (I have highlighted it in a box at the top of the readme). This is just one thing that could not be hooked into the core from the plugin.

    What the change to the theme does, is apply the classes to the comments that are supplied by the plugin. If the script is not in your current theme, then it can be copied from the core into the theme and then modified. The instructions are in there and should hopefully be simple to follow.

    The classes do feel a little long-winded to me, and perhaps a better approach would be to provide data that allows the theme to decide how to create its own classes or markup changes. Any suggestions appreciated.

    Similarly, there is an issue with edited comments - the AJAX replacement comment loses all the indenting. My initial thought was to use JS to add the classes back onto the updated comment once it gets inserted into the DOM, but I am not sure how to go about that, i.e. what triggers to hook into. I've got halfway there - the classes of a comment are saved away when the user starts to edit an existing comment. I just don't know how to get it back onto the updated comment. Perhaps there is a completely different approach? See what you think.
  • judgejjudgej
    edited November 2010
    Just for completeness, I'll summarise the changes you need to make to your theme here. In your theme locate this file:


    If that file does not exist in your theme, then create it as a copy from:


    Locate the line that contains this markup (around line 29 in function WriteComment() in Vanilla 2.0.11):

    <div class="Comment">

    Add the classes to that line:

    <div class="Comment<?php if (!empty($Object->ReplyToClass)) echo ' ' . $Object->ReplyToClass; ?>">

    The condition is there to prevent errors if the plugin gets disabled or removed.
Sign In or Register to comment.