News:

Wondering if this will always be free?  See why free is better.

Main Menu

Best Answer

Started by Avalanche91, December 05, 2013, 09:09:24 AM

Previous topic - Next topic

drfun

I have refresh and reloaded the page in the browser but still nothing is coming up. i also open the forum on a different browser, open a different topic and the only thing coming up there is Quote, Modify and Remove

   
   

ECLIKS -Global Online community for Questions and Answers

Dzonny

Did you check your custom theme install while installing mod? Maybe the code is not placed inside your Display.template.php or the button image is not there?
Check if changes is made on your files following this page:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=3803;attach=227026;smf_version=2.0.6

Avalanche91

No, it's not about the browser cache, I already said it was a dumb suggestion but I had no other idea what it could be. Anyways, you can fix that by ticking the checkbox for your theme at the bottom of the installation page where the "Install in Other Themes" section is. The thing that bothers me is related to the picture, it seems that it is not being copied in the same directory as the custom theme, in our case Flagrantly. Even the images for Thank-o-matic are not available for Flagrantly, have you guys got any suggestions about the image?

drfun

Quote from: Dzonny on December 16, 2013, 05:20:36 AM
Did you check your custom theme install while installing mod? Maybe the code is not placed inside your Display.template.php or the button image is not there?
Check if changes is made on your files following this page:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=3803;attach=227026;smf_version=2.0.6

Thanks i went through all the file one after the other, and everything is in place, and it is working now. The only problem now is the image which is not displaying. however it sitting in the right folder it should be, that is "./Themes/default/images/buttons"
"
Any idea on how to get this image to display? i notice all the images in the "/Themes/default/images/buttons" ends with the extension .gif while the best_answer ends in .png
ECLIKS -Global Online community for Questions and Answers

Avalanche91

Nah, don't worry about the file extension, it reads the css file so you just have to copy the image Themes/default/images/buttons/best_answer.png to Themes/flagrantly202/images/buttons/best_answer.png.

drfun

Quote from: Avalanche91 on December 16, 2013, 10:10:49 AM
Nah, don't worry about the file extension, it reads the css file so you just have to copy the image Themes/default/images/buttons/best_answer.png to Themes/flagrantly202/images/buttons/best_answer.png.
Thanks, everything is working perfectly now. Thanks a lot to you all, for putting me through.
ECLIKS -Global Online community for Questions and Answers

Avalanche91

Quotev1.3
Added an icon shortcut to the best answer while browsing topics.

Since there haven't been any kind of bugs reported lately I think that this will be the final version and I will remove [WIP][MOD] from the title. Now I will work on making the mod available for SMF v1 since I was kindly asked to do so and even offered a bounty.

Thanks again to everyone who helped me repair and expand this modification. Cheers!  :)

akbora

Thanks Avalanche91, I want to change warning place last message intead of first message. How can I do? Can you help me about this.

Also let me add my asking list, best answer top10, top5 two way users applying best answer, and users that having best message

Edit: WARNİNG: Your file ext name is .RAR it must be .zip We can not install it.
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Avalanche91

Quote from: akbora on December 17, 2013, 02:12:42 PM
Edit: WARNİNG: Your file ext name is .RAR it must be .zip We can not install it.
I knew I had done something wrong.

Look for this piece of code in Display.template.php:
Code (php) Select
// If this is the question post; If we have a Best Answers; If the Best Answer is within the first 3 posts
if ($context['topic_first_message'] == $message['id'] && $context['ba']['id_msg'] && ($context['ba_display_link'] == false)) {
echo '<div id="best_answer_goto" class="centertext is_best_answer">' . $txt['bestanswer_jumpto_1'] . ' <a href="?topic=' . $context['ba']['id_topic'] . '.msg' . $context['ba']['id_msg'] . '#msg' . $context['ba']['id_msg'] . '">' . $txt['bestanswer_jumpto_2'] . '</a></div>';
}


Change $context['topic_first_message'] to $context['topic_last_message']. It will be displayed above the last message. In order to place it after the last post, you will have to move the entire piece of code to the end of the while loop but still inside of it.
Code (php) Select
while ($message = $context['get_message']())
{
/*
All the code and displaying the posts
*/

<-- Place the code here
}


Your asking list will be added to my to-do list. Just please try to explain better, I didn't understand most of the things you tried to say. I don't blame you for your English, I know the feeling I am not a native English speaker as well and I often make mistakes. I respect your efforts to express yourself. Please be more specific, what do you mean by top 10? I don't promise you anything for now, I just got other things to do.

akbora

I've changed first message to last message like your words but it gives error: Notice: Undefined index: ba_display_link in /home/xxxxxxx/public_html/Themes/default/Display.template.php on line 291 and no change still warning above first message.

İn fact I want it after last post that is bottom last post.

for Top10: You know there are two groups of user about BA.
1. Topic starter remarks BA,
2. User of takes BA.

Top 10 that is find out these counters of BA
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Avalanche91

Quote from: akbora on December 17, 2013, 10:54:11 PM
I've changed first message to last message like your words but it gives error: Notice: Undefined index: ba_display_link in /home/xxxxxxx/public_html/Themes/default/Display.template.php on line 291 and no change still warning above first message.

İn fact I want it after last post that is bottom last post.

for Top10: You know there are two groups of user about BA.
1. Topic starter remarks BA,
2. User of takes BA.

Top 10 that is find out these counters of BA
The purpose of this variable is to prevent the notification message from showing if the the best answer is within the first 3 answers. You can simply delete it. Just be careful, eventually you may not be able to uninstall the MOD. You are doing these changes at your own risk.

Avalanche91

Quotev1.4
Added support for 1.1.x versions (tested on 1.1.19, default theme);
Fixed: images not being copied to custom themes.

akbora

Avalanche91 I don't understand you.

I insisted I want to get to the bottom of the last message of warning, I would be glad if you could help on this issue.

What about BA top10? must see to whom it has given a best message remark this is very important. or you would not know it fade. Thank you
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Arantor

I think what Avalanche is saying is that just because you want something doesn't mean that anyone is obligated to provide it for you. It is working as the mod author intended, and the author is not bound by anyone to actually change it to suit you.

akbora

I've asked the author only. He gave me the code did not work but has failed. I've reported it. It was not a compulsion or otherwise harass or.

I may uninstall this mod. Most of my contribution was made for example message index icon. The aim here is to be a better mode.

Anyway: something like this would be very nice 'all best message button' How good is not it.Thank you
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Avalanche91

Quote from: akbora on December 19, 2013, 03:55:24 PM
I've asked the author only. He gave me the code did not work but has failed. I've reported it. It was not a compulsion or otherwise harass or.

I may uninstall this mod. Most of my contribution was made for example message index icon. The aim here is to be a better mode.

Anyway: something like this would be very nice 'all best message button' How good is not it.Thank you
Thank you, Arantor Beeblebrox the First, I have no idea how you manage to watch every single thread at these forums, your 50k posts here are impressive indeed, you have my respect.

Akbora, I do appreciate your opinion and your suggestions, I am pretty sure they would be very useful to the entire community but as I previously stated I don't have the time to make everything happen so this is the reason why I want to keep my mod as simple and clean as possible.

To be honest, I believe that I already told you how to achieve your desire to place the notification message at the bottom of the last post. It looks like I will have to repeat myself. $context['ba_display_link'] is there to prevent that notification from displaying if the post marked as best answer is within the first 3 posts. Getting that notice for undefined index means that there is already something broken. You may simply delete that variable (the line would look like this: if ($context['topic_last_message'] == $message['id'] && $context['ba']['id_msg']) { ), I don't recommend it but you do insist for things to go your way so this is how you can do it.

Cheers!

akbora

#96
Very thanks Avalanche91 for your reply.

I am assertive will be very nice If you do that 'all BA message button' board and board also sub-board on the homepage. How?

Edit:





For board  all message button

Thsi place is better than the old place I think.
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

jmpenasse

Hi Avalanche,

Thanks for this very usefull mod !

Here is my small contribution : French translation.

HTH

Best wishes and Happy New Year !

diegolyanky

Hi:

Nice MOD, I installed and worked fine.

Now, I need to give permissions to another groups...

How can I do that ?

I looked into:


/* - If being veiwed by topic starter, or may be an admin, or may be a mod;
- If this is not the first message;
- If somebody has not already marked any reply from the topic as Best Answer  */
if (($context['topic_starter_id'] == $context['user']['id'] || $context['user']['is_mod'] || $context['user']['is_admin']) && $message['id'] != $context['topic_first_message'] && $context['isMarkedBest'] == 0) {
echo '<a class="best_answer_button" href="' . $scripturl . '?action=bestanswer;do=mark;msg=' , $message['id'] , '"><img src="' . $settings['images_url'] . '/buttons/best_answer.gif" alt="' . $txt['bestanswer'] . '" title="' . $txt['bestanswer'] . '" align="middle" /><b>' . $txt['bestanswer'] . '</b></a>';
}
// Allows TopicStarter/Admin/Mod to unset a reply as Best Answer
if ($context['ba']['id_msg'] != 0 && $context['ba']['id_msg'] == $message['id'] && ($context['topic_starter_id'] == $context['user']['id'] || $context['user']['is_mod'] || $context['user']['is_admin']) && $message['id'] != $context['topic_first_message'] && $context['isMarkedBest'] == 1) {
echo '<a class="remove_best_answer_button" href="' . $scripturl . '?action=bestanswer;do=unmark;msg=' , $message['id'] , '"><img src="' . $settings['images_url'] . '/buttons/best_answer_remove.gif" alt="' . $txt['rv_bestanswer'] . '" title="' . $txt['rv_bestanswer'] . '" align="middle"  /><b>' . $txt['rv_bestanswer'] . '</b></a>';
}




What must I modify in these lines ?

Thanks a lot for helping me :)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Avalanche91

Erhm, it's not going to be that simple.
$context['topic_starter_id'] == $context['user']['id'] - checks whether the topic starter is behind the monitor
$context['user']['is_mod'] || $context['user']['is_admin'] - check whether an admin or a mod is behind the monitor
So I don't know if the members of your desired groups are placed in the same array. Even if they are you will have to edit more files, for example $sourcedir/BestAnswer.php. There are quite the similar checks except that I have placed one more (I have absolutely no idea why lol). Look for the array $adminOrModerator, it represents IDs from the database (1 is admin, 2 is global mod, 3 is just mod), I think it should be the table {{$db_prefix}}membergroups. Basically you just have to add more numbers that correspond to these groups of yours.

Advertisement: