Mark Posts as Best Answer [Deleted]

Does the best answer always change when the votes change? So for example the first week post #2 has the most votes but a month/year later someone posts a better answer getting even more votes from the community.
 
purchased!
--
What version do this exactly?

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.


Mark-as-Best-Answer-1.2.4.rar (15.5 KB)
Mark-as-Best-Answer-1.2.5.zip (17.8 KB)
Mark-as-Best-Answer-1.2.6.zip (18.3 KB)
Mark-as-Best-Answer-1.2.7.zip (18.3 KB)
Mark-as-Best-Answer-1.2.8.zip (18.4 KB)
Mark-as-Best-Answer-1.3.0.zip (19.4 KB)
Mark-as-Best-Answer-1.4.0.zip (23.3 KB)
Mark-as-Best-Answer-1.4.1.zip (23.3 KB)
Mark-as-Best-Answer-1.5.0.zip (25.7 KB)
Mark-as-Best-Answer-1.5.1.zip (25.6 KB)

The latest version works ok, but I need exactly the feature in the video.
replace the first post with the best answer. my xf is 1.4.4
 
I mean, the second, exactly as in the video.
1.--> Question
2.--> Best answer
That's possible in all versions as far as I know. It's the 'Embed Answer in First Post' option.
I don't personally think it's a good idea to use the addon that way, but I think that's the way Lior coded it from the start.
 
I'd pay to have the Best Answer button moved directly to the left of Like button @Lior. Whaddaya say? Let's make it happen.
Currently, the Best Answer button is added to the post using the old hooks system (which I intend to change in the next version).

Therefore making this change manually is kind of a hassle, but if you'd like to do it anyway, you can.

1. Create a new template modification using the following page:
http://yourforum/admin.php?template-modifications/add

The Create Template Modification button is not shown in the template modifications list unless debug mode is enabled.

Template: post

Modification Key: addBestAnswerButton

Description: Adds a best answer button after the like button

Search Type: Simple Replacement

Find: <xen:if is="{$canReply}">

Replace:
<xen:include template="best_answer_post_private_controls" />
<xen:if is="{$canReply}">

2. Open library\BestAnswer\Listener.php.

Find the following line:
Code:
$contents .= $template->create('best_answer_post_private_controls', array('xenOptions' => XenForo_Application::get('options')->getOptions(), 'thread' => $template->getParam('thread'), 'post' => $hookParams['post'], 'marked' => XenForo_Model::create('BestAnswer_Model_BestAnswer')->postMarkedAsBestAnswer($hookParams['post'], $template->getParam('thread'))));

Replace it with the following line:
Code:
// $contents .= $template->create('best_answer_post_private_controls', array('xenOptions' => XenForo_Application::get('options')->getOptions(), 'thread' => $template->getParam('thread'), 'post' => $hookParams['post'], 'marked' => XenForo_Model::create('BestAnswer_Model_BestAnswer')->postMarkedAsBestAnswer($hookParams['post'], $template->getParam('thread'))));

I'm going to incorporate this change in the next version.

Got this error after install. Please help

Code:
Server Error

Mysqli prepare error: Not unique table/alias: 'thread'

    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 219
    XenForo_Model->fetchAllKeyed() in StickyFirstPost/Model/Post.php at line 35
    StickyFirstPost_Model_Post->getPostsInThread() in BestAnswer/Model/Post.php at line 30
    BestAnswer_Model_Post->getPostsInThread() in XenForo/ControllerPublic/Thread.php at line 68
    XenForo_ControllerPublic_Thread->actionIndex() in Waindigo/CustomFields/Extend/XenForo/ControllerPublic/Thread.php at line 16
    Waindigo_CustomFields_Extend_XenForo_ControllerPublic_Thread->actionIndex() in Waindigo/CustomPostFields/Extend/XenForo/ControllerPublic/Thread.php at line 16
    Waindigo_CustomPostFields_Extend_XenForo_ControllerPublic_Thread->actionIndex() in bdCache/XenForo/ControllerPublic/Thread.php at line 7
    bdCache_XenForo_ControllerPublic_Thread->actionIndex() in StickyFirstPost/ControllerPublic/Thread.php at line 57
    StickyFirstPost_ControllerPublic_Thread->actionIndex() in BestAnswer/ControllerPublic/Thread.php at line 18
    BestAnswer_ControllerPublic_Thread->actionIndex() in XenForo/FrontController.php at line 347
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /home/nginx/domains/********.**/public/index.php at line 13
Contacted via a PC.

@Lior. might you be interested in coding this to improve the addon please?
Yes, it's on my to-do list.

purchased!
--
What version do this exactly?

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.


Mark-as-Best-Answer-1.2.4.rar (15.5 KB)
Mark-as-Best-Answer-1.2.5.zip (17.8 KB)
Mark-as-Best-Answer-1.2.6.zip (18.3 KB)
Mark-as-Best-Answer-1.2.7.zip (18.3 KB)
Mark-as-Best-Answer-1.2.8.zip (18.4 KB)
Mark-as-Best-Answer-1.3.0.zip (19.4 KB)
Mark-as-Best-Answer-1.4.0.zip (23.3 KB)
Mark-as-Best-Answer-1.4.1.zip (23.3 KB)
Mark-as-Best-Answer-1.5.0.zip (25.7 KB)
Mark-as-Best-Answer-1.5.1.zip (25.6 KB)

The latest version works ok, but I need exactly the feature in the video.
replace the first post with the best answer. my xf is 1.4.4
Version 1.3.0 is what you're looking for.

Sorry about the misleading video, I'm going to update it when I get a change.
 
[...]
Version 1.3.0 is what you're looking for.
Sorry about the misleading video, I'm going to update it when I get a change.
Are you sure that the version 1.3.0 works and can do that in Xenforo 1.4.4?
installed without issues everything looks normal, but there are not any link of "best answer" in the thread.
permission are correctly actived. really need this addon running and doing exactly as in the video.
c352f99debe482f19f2037fe6145578f.png

--
ed562c8c70c0dee0e99f6367c9eac00f.png
--
3b8db2023a48b718a95310e80efab43a.png

--

f9919f4f4e7b41c400e0c75d943402bf.png
I really appreciate your help.

--

EDIT: the addon now works perfectly, my problem was the permission of the node.
thank you Lior!
good job!
 
Last edited:
Yes, it's on my to-do list.

@Lior.
Could you please add my request below for the next version please ? thx :)
v
v
v
@Lior.
Could you please add maximum times a member of particular usergroup to vote in a day ? (usergroup permission-based)

I think this is crucial for preventing "spam-voting" for this system.

Can't imagine if someone pursuing "best answer" trophy performs sock-doll-show with ridiculuous QA - asked and answered by himself (with different ids) :D
 
Just tested, and I've noticed the marked post is "moved" instead of "duplicated" ; Is it the expected behavior ? Because moving is weird as it lefts a hole in the discussion below if post was an answer of another post. If default behavior please consider an option to duplicate the post.
I want moved instead. what version do that?
---
@Lior. This was the date when you implemented that feature:

U4tSdiV.png
Ki6YqEf.png

Could you please help me with that?
Really appreciate your help Lior or someone.
---
Edit, FIXED!
 
Last edited:
Dear @Lior.
The beautiful version of this addon is the old version 1.3.0
instead add or remove features in new versions you could offer different versions with different behaviours. the addon have potential. is great!
Don't let die that pretty old version and consider my suggestion.
If you want to tell me something about it, just pm me ;)
Good luck!
 
@Lior.

Can you help me with instructions to remove tabs on member profile/member_view

I made 3 requests so far no help!

Do I uncheck any event code listerners?
Do I need to take out code from somewhere?
 
@Lior.

Can you help me with instructions to remove tabs on member profile/member_view

I made 3 requests so far no help!

Do I uncheck any event code listerners?
Do I need to take out code from somewhere?
Go to the add-on's template modifications, and disable the following:
  • member_view Add best answers pane.
  • member_view Add best answers tab.
 
Last edited:
Hello,

I just purchased this, seems to be working well. But I have created a icon to replace the default banner, I can remove the default image, border, etc, but I don't know where to remove the actual text "Best Answer". I have enabled debug mode, found the template that adds the indicator to the message and removed the phrase from the following part of the code:

<xen:if is="{$message.isBestAnswer}"><strong class="bestAnswerIndicator">***WAS HERE***<span></span><xen:if is="{$message.dupe}"></xen:if>

But the text still comes up when the message is first marked as best answer, after refreshing the page, the text disappears, but obviously I need it not to show up at all.

Other than that, great add on.

Any help would be muchio appreciatedio

Regards,

Richard
 
Sorry, but how to translate "Best answer" in posts, I have translated many Best answer phrases in admincp. but it still show in english.
Edit: found it , its: mark_as_best_answer_button
 
Last edited:
Back
Top Bottom