Question Threads

Question Threads 2.1.2

No permission to download
@CMTV thanks. One more question, when you are creating a new topic in a threads and questions type forum there is an option to choose which type of topic you are creating. Would it be possible to add there some tooltip or something to explain what is the difference between the two for the user? thanks.
 
@danger@ there is no build-in tooltip or hint about the difference between questions and threads but you can easy add one.

In template QT_forum_post_thread_is_question add explain attribute to the <xf:radiorow tag. For example:
HTML:
<xf:radiorow name="QT_question" label="{{ phrase('type') }}" value="0" explain="What is the difference? ...">

1521877478846.webp

The default choice can be set in the same line by setting value attribute to 1.
 
  1. Question mark type: Icon. Question mark solved/unsolved icon: fa-question-circle-o. Question mark solved color: #47A7EB. Question mark unsolved color: #F2930D
  2. Question mark type: Shape. Go to "Question mark [Shape]" and remove 50% of border radius. Then paste this code in the Extra code block:
    Less:
    display: inline-block;
    background: white !important;
    position: relative;
    
    &:after
    {
        position: absolute;
        top: 1px;
        left: 1px;
         
        width: 6px;
        height: 6px;
        content: '';
    }
    
    &.QT_solved:after
    {
        background: #00CD18;
    }
    &.QT_unsolved:after
    {
        background: #FF0000;
    }
    Best anwer mark type: Icon. Best answer mark icon: fa-check-square.
  3. Question mark type: Image. Download and place these three images in your "styles" folder: redstone_block.webpemerald_block.webpdiamond.webp. Question mark solved image: /styles/emerald_block.png. Question mark unsolved image /styles/redstone_block.png. Best answer mark type: Image. Best answer mark image: /styles/diamond.png
 
@Recep Baltaş, here is my PayPal page: https://www.paypal.me/cmtv You can donate there. Thank you!

Link goes to defauly PayPal page.

Came to report an error on admin dashboard:

Code:
InvalidArgumentException: Accessed unknown getter 'QT_question' on XF:Thread[538444] src/XF/Mvc/Entity/Entity.php:182

#0 src/XF/Mvc/Entity/Entity.php(100): XF\Mvc\Entity\Entity->get('QT_question')
#1 internal_data/code_cache/templates/l2/s1/public/QT_thread_view_question_mark.php(6): XF\Mvc\Entity\Entity->offsetGet('QT_question')
#2 src/XF/Template/Templater.php(1248): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#3 src/XF/Template/Templater.php(1322): XF\Template\Templater->renderTemplate('QT_thread_view_...', Array)
#4 internal_data/code_cache/templates/l2/s1/public/thread_view.php(66): XF\Template\Templater->includeTemplate('public:QT_threa...', Array)
#5 src/XF/Template/Templater.php(1248): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#9 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}


array(4) {
  ["url"] => string(67) "/sosyal/konu/telefonun-android-sueruemue-nasil-guencellenir.538444/"
  ["referrer"] => string(63) "https://www.technopat.net/sosyal/konu/dolar-4-tl.537338/page-11"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
@Recep Baltaş Do you have any additional info about this error?

Anyway the log says there was a problem occured in QT_thread_view_question_mark template: it was unable to get QT_question property from $thread variable.

Did you modify this template in any way?
 
Last edited:
No modifications were made on the addon. Just added the button "go to best answer" per your codes. I have two extra templates on forum. Maybe they create the problem?

One is UI.X Dark and the other ise Dimension.
 
Hi, we have a lot of these errors logged, however it took only a few minutes and the error is no more being logged. Not sure what may have been wrong, just reporting it here, maybe you will spot something.

Code:
Server error log
InvalidArgumentException: Accessed unknown getter 'QT_best_answers' on XF:User[812] src/XF/Mvc/Entity/Entity.php:182
Generated by: Unknown account Mar 29, 2018 at 1:14 PM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(100): XF\Mvc\Entity\Entity->get('QT_best_answers')
#1 internal_data/code_cache/templates/l1/s3/public/message_macros.php(53): XF\Mvc\Entity\Entity->offsetGet('QT_best_answers')
#2 src/XF/Template/Templater.php(661): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#3 internal_data/code_cache/templates/l1/s3/public/post_macros.php(49): XF\Template\Templater->callMacro('message_macros', 'user_info', Array, Array)
#4 src/XF/Template/Templater.php(661): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#5 internal_data/code_cache/templates/l1/s3/public/thread_view.php(543): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array)
#6 src/XF/Template/Templater.php(1248): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#7 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('public:thread_v...', Array)
#8 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#10 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#12 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#13 src/XF.php(328): XF\App->run()
#14 index.php(13): XF::runApp('XF\\Pub\\App')
#15 {main}
Request state
array(4) {
  ["url"] => string(64) "/threads/x-org-7-4-x-org-7-5-upgrade-issues-and-questions.13772/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
I've noticed that "most best answers" actually shows people that have not answered any questions yet if there are not enough people with answers to show. Might be worth considering adding the extra where-check to the fetcher to catch that case.
dUBpu0d.png
 
Top Bottom