Mark Posts as Best Answer [Deleted]

Coming up in the next version:
  • A view of all of a user's posts that are marked as best answers.
  • Integration with trophies.
  • An option to view all unanswered threads in a forum.
Good thinking. This should make the add-on even more useful and engaging.
 
when i make an best answer, i get this error

Code:
ErrorException: Undefined index: allow_best_answer - library/BestAnswer/Model/BestAnswer.php:29

Stack Trace
#0 /home/**/domains/**.nl/public_html/library/BestAnswer/Model/BestAnswer.php(29): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/**...', 29, Array)
#1 /home/**/domains/**.nl/public_html/library/BestAnswer/Model/Post.php(9): BestAnswer_Model_BestAnswer->canMarkAsBestAnswer(Array, Array, Array)
#2 /home/**/domains/**.nl/public_html/library/XenForo/Search/DataHandler/Post.php(185): BestAnswer_Model_Post->preparePost(Array, Array, Array, Array, Array)
#3 /home/**/domains/**.nl/public_html/library/Tapatalk/Model/Search.php(42): XenForo_Search_DataHandler_Post->prepareResult(Array, Array)
#4 /home/**/domains/**.nl/public_html/library/XenForo/Model/Search.php(339): Tapatalk_Model_Search->getViewableSearchResultData(Array, Array, true, NULL)
#5 /home/**/domains/**.nl/public_html/library/BBM/Protection/Model/Search.php(7): XenForo_Model_Search->getSearchResultsForDisplay(Array, NULL)
#6 /home/**/domains/**.nl/public_html/library/XenForo/ControllerPublic/Search.php(413): BBM_Protection_Model_Search->getSearchResultsForDisplay(Array)
#7 /home/**/domains/**.nl/public_html/library/XenForo/FrontController.php(337): XenForo_ControllerPublic_Search->actionResults()
#8 /home/**/domains/**.nl/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/**/domains/**.nl/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
Aanvraagstatus
array(3) {
  ["url"] => string(67) "http://www.**.nl/index.php?search/885679/&q=bakbezoek&o=date"
  ["_GET"] => array(3) {
    ["search/885679/"] => string(0) ""
    ["q"] => string(9) "bakbezoek"
    ["o"] => string(4) "date"
  }
  ["_POST"] => array(0) {
  }
}
 
Hello, @Lior. :)
Can you add a block with the best answer to top of page topic, like IPB?
1.webp

It would be great and very comfortable for users! ;)
 
Last edited:
Added an option to allow moderators to mark any post as best answer.

Coming up in the next version:
  • A view of all of a user's posts that are marked as best answers.
  • Integration with trophies.
  • An option to view all unanswered threads in a forum.
You're my hero.
 
Great addon. A suggestion; Would you consider adding a feature where we are be able to select more than one post as good answer?
 
Very nice!

Is Best Answer marked, or can it be, in the forum view? Or can they easily be found as part of a search? For instance, when searching for something would either a checkbox or a tag in the results showing "has best answer" or similar be possible?
 
Agreed. :)

Agreed again. This is particularly helpful for forums like mine where there is more than one acceptable answer, where one is not 'better' than the other.
Isn't having the choice to say "good answer" to multiple posts devaluing the whole concept of the add-on? I mean, we could just end up with a situation similar to "like" spam.

If a member can say that every response in a thread was a "good answer" then it makes the whole thing pretty pointless. IMHO.

It would be better left as "Best answer".
 
when i make an best answer, i get this error

Code:
ErrorException: Undefined index: allow_best_answer - library/BestAnswer/Model/BestAnswer.php:29

Stack Trace
#0 /home/**/domains/**.nl/public_html/library/BestAnswer/Model/BestAnswer.php(29): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/**...', 29, Array)
#1 /home/**/domains/**.nl/public_html/library/BestAnswer/Model/Post.php(9): BestAnswer_Model_BestAnswer->canMarkAsBestAnswer(Array, Array, Array)
#2 /home/**/domains/**.nl/public_html/library/XenForo/Search/DataHandler/Post.php(185): BestAnswer_Model_Post->preparePost(Array, Array, Array, Array, Array)
#3 /home/**/domains/**.nl/public_html/library/Tapatalk/Model/Search.php(42): XenForo_Search_DataHandler_Post->prepareResult(Array, Array)
#4 /home/**/domains/**.nl/public_html/library/XenForo/Model/Search.php(339): Tapatalk_Model_Search->getViewableSearchResultData(Array, Array, true, NULL)
#5 /home/**/domains/**.nl/public_html/library/BBM/Protection/Model/Search.php(7): XenForo_Model_Search->getSearchResultsForDisplay(Array, NULL)
#6 /home/**/domains/**.nl/public_html/library/XenForo/ControllerPublic/Search.php(413): BBM_Protection_Model_Search->getSearchResultsForDisplay(Array)
#7 /home/**/domains/**.nl/public_html/library/XenForo/FrontController.php(337): XenForo_ControllerPublic_Search->actionResults()
#8 /home/**/domains/**.nl/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/**/domains/**.nl/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}
Aanvraagstatus
array(3) {
  ["url"] => string(67) "http://www.**.nl/index.php?search/885679/&q=bakbezoek&o=date"
  ["_GET"] => array(3) {
    ["search/885679/"] => string(0) ""
    ["q"] => string(9) "bakbezoek"
    ["o"] => string(4) "date"
  }
  ["_POST"] => array(0) {
  }
}
Did you upgrade to the latest version?

Hello, @Lior. :)
Can you add a block with the best answer to top of page topic, like IPB?
View attachment 52046

It would be great and very comfortable for users! ;)
In this add-on, the best answer is shown first, right after the original thread, so showing it at the top of the page is kind of redundant, isn't it?

Sorry, maybe I'm missing something, so you're gonna have to explain it to me.

Very nice!

Is Best Answer marked, or can it be, in the forum view? Or can they easily be found as part of a search? For instance, when searching for something would either a checkbox or a tag in the results showing "has best answer" or similar be possible?
Good idea, do you have a preference as to how to indicate a thread has been answered?



As for multiple posts, @yavuz @jmurrayhead, I'm gonna have to think about it, as it's kind of a drastic change.
 
In this add-on, the best answer is shown first, right after the original thread, so showing it at the top of the page is kind of redundant, isn't it?
Or maybe there is a possibility to make a choice of the type settings display best answer in the topic? Either the block as I have written, or as is done now.
Sorry for my English. :(
 
Or maybe there is a possibility to make a choice of the type settings display best answer in the topic? Either the block as I have written, or as is done now.
Sorry for my English. :(
I'm just wondering what would be the point, as IMO showing the best answer right after the actual thread is ideal, and I don't see why showing a snippet of it at the top of the thread instead would be better.
 
Thanks for the update.

I try to upgrade

got this error

Code:
Zend_Db_Statement_Mysqli_Exception: Mysqli prepare error: Unknown column 'xf_post.user_id' in 'field list' - library/Zend/Db/Statement/Mysqli.php:77

Stack Trace

#0 /home/mydomain/domains/mydomain.nl/public_html/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('??????SELECT xf...')
#1 /home/mydomain/domains/mydomain.nl/public_html/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '??????SELECT xf...')
#2 /home/mydomain/domains/mydomain.nl/public_html/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('??????SELECT xf...')
#3 /home/mydomain/domains/dreamreef.nl/public_html/library/Zend/Db/Adapter/Abstract.php(734): Zend_Db_Adapter_Abstract->query('??????SELECT xf...', Array)
#4 /home/v/domains/mydomain.nl/public_html/library/BestAnswer/Installer.php(32): Zend_Db_Adapter_Abstract->fetchAll('??????SELECT xf...')
#5 [internal function]: BestAnswer_Installer::install(Array, Array, Object(SimpleXMLElement))
#6 /home/mydomain/domains/mydomain.nl/public_html/library/XenForo/Model/AddOn.php(215): call_user_func(Array, Array, Array, Object(SimpleXMLElement))
#7 /home/mydomain/domains/mydomain.nl/public_html/library/ConvEss/Model/AddOn.php(24): XenForo_Model_AddOn->installAddOnXml(Object(SimpleXMLElement), 'BestAnswer')
#8 /home/mydomain/domains/mydomain.nl/public_html/library/XenForo/Model/AddOn.php(169): ConvEss_Model_AddOn->installAddOnXml(Object(SimpleXMLElement), 'BestAnswer')
#9 /home/mydomain/domains/mydomain.nl/public_html/library/XenForo/ControllerAdmin/AddOn.php(231): XenForo_Model_AddOn->installAddOnXmlFromFile('/tmp/phpaRDr3Q', 'BestAnswer')
#10 /home/mydomain/domains/mydomain.nl/public_html/library/XenForo/FrontController.php(337): XenForo_ControllerAdmin_AddOn->actionUpgrade()
#11 /home/mydomain/domains/mydomain.nl/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#12 /home/v/domains/mydomain.nl/public_html/admin.php(13): XenForo_FrontController->run()
#13 {main}
Aanvraagstatus
array(3) {
  ["url"] => string(60) "http://www.mydomain.nl/admin.php?add-ons/BestAnswer/upgrade"
  ["_GET"] => array(1) {
    ["add-ons/BestAnswer/upgrade"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["server_file"] => string(0) ""
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
Verwijder... Sluit
 
Top Bottom