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

In this Discussion

Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

[Solved] A single response removes thread from "Unanswered" tab

This discussion is related to the Q&A addon.
kirkpa31kirkpa31 ✭✭
edited April 2013 in Vanilla 2.0 - 2.3

When a user leaves a comment to a question, the post no longer appears under the "Unanswered" tab. How can I change this so that it is only removed from this tab once someone selects "accept" to a response?

I'm sure this is an easy rearrangement of words within /plugins/qna/class.qna.plugin.php only I am struggling to find where.


  • kirkpa31kirkpa31 ✭✭
    edited February 2013

    I'm guessing that this is the code that needs to be altered.

    // Mark the question as answered. if (strtolower($Discussion['Type']) == 'question' && !$Discussion['Sink'] && !in_array($Discussion['QnA'], array('Answered', 'Accepted')) && $Discussion['InsertUserID'] != Gdn::Session()->UserID) { $Sender->SQL->Set('QnA', 'Answered');

    And this one

    $Count = Gdn::Cache()->Get('QnA-UnansweredCount'); if ($Count === Gdn_Cache::CACHEOP_FAILURE) $Count = ' <span class="Popin Count" rel="/discussions/unansweredcount">'; else $Count = ' <span class="Count">'.$Count.'</span>'; echo '<li'.$CssClass.'><a class="TabLink QnA-UnansweredQuestions" href="'.Url('/discussions/unanswered').'">'.T('Unanswered Questions', 'Unanswered').$Count.'</span></a></li>'; }

  • Figured it out. Only needed to modify the first bit of code I posted above.

    Replace the code with:

    // Mark the question as answered. if (strtolower($Discussion['Type']) == 'question' && !$Discussion['Sink'] && ($Discussion['QnA']) == 'accepted' && $Discussion['InsertUserID'] != Gdn::Session()->UserID) { $Sender->SQL->Set('QnA', 'Answered');

    Simply needed to get rid of the array.

  • kirkpa31kirkpa31 ✭✭
    edited February 2013

    crap now that messes up the popup boxes for this plugin. ugh still working on it I suppose.

  • kirkpa31kirkpa31 ✭✭
    edited February 2013

    Q&A recognizes both replies to a question thread and the accepted reply as being "answered" and therefore does not include the associated question thread within the Unanswered tab. I've just cut my losses and re-labeled this tab "Unassisted" to mean questions that have no replies at all.

    If anyone comes up with a stroke of genius to somehow create/change this tab so that it counts all questions as unanswered until they have been accepted, I would be truly appreciative.

  • kirkpa31kirkpa31 ✭✭
    edited March 2013

    No longer need this, kind of enjoy having the posts counted with no replies. Sry for the wasted thread, I suppose.

Sign In or Register to comment.