News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Best Answer

Started by SychO, November 02, 2020, 03:03:16 PM

Previous topic - Next topic

SychO

Link to the mod

✓ Best Answer


SMF2.1 mod to mark a reply as best answer.

Requires PHP7.3+



Installation
Download the latest release package and upload in the package manager of your forum.

Updating
Delete the mod and install a new release package.

License
The MIT License.
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Arantor

Suggestion: put a PHP version test inside database.php and don't allow it to install if PHP 7.2 or lower is present.

SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

Very nice lookin mod. Would be good on SMFH.

pocttopus

Very nice mod but I have issues. I don't have the button to mark best answer and also I have these errors in admin panel which suddenly have raised for 2000 in a couple of minutes on 2.1RC3:

FIRST ERROR:
Type of error: Undefined
8: Undefined index: id_best_msg

/home/XXXX/public_html/Sources/BestAnswer/Actions.php (Line 43)

SECOND ERROR:
Type of error: Undefined
8: Undefined index: id_board

/home/XXXX/public_html/Sources/BestAnswer/Policy.php (Line 36)

SychO

Have you made any custom modifications to the source code ?
What mods do you have installed ?
What's your php version ?
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

pocttopus

No, I have only changed the css, using the main theme but with different colors changed by myself.
This is the php ver.


SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

pocttopus

Sorry, here is the list:

Optimus    2.9 [04.06.20]
Scrolling Buttons    0.6
Login Menu Button    1.0
BBC Message Boxes    1.0
Light Portal    1.2
Social Login    4.0.0
Login Security    1.0.4
SMF Post Prefix    3.2.1
FA Board Icons    1.3
Avatars Display Integration    1.2
Quick Spoiler    1.2.6
Welcome Topic Mod
Simple Audio Video Embedder    5.1.4
Forum Width Setting    1.2
Personalized BBC    1.94.1
Auto Twitter Embed    2.0

SychO

Thank you, I am assuming one of those mods is perhaps overwriting a certain array given to a hook instead of mutating it, resulting in the errors mentioned. I will have to take a look in each and everyone of them, so for now just uninstall this mod.

Or maybe it has nothing to do with other mods and it's just a specific scenario where this mod fails. Either way I'll have to investigate it.
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

SychO

@pocttopus please try the 0.1.3 package, I think the issue was with the mod not properly appending to the array, conflicting with other mods.
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

pocttopus

It Works!
Thanks @Sycho.
This is awesome.  ;)

pocttopus

Now it's updated to 0.1.5?
What's new @SychO?  O:)

SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

I guess I will re-install it, lol. I just finished doing that like 5 minutes ago. :)

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Bigguy

Getting an error:

Trying to access array offset on value of type null

SychO

what line of what file ?
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

Line 28 of BestAnswer.template.php

SychO

Should be fixed in the new 0.1.6 package, please test :)
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

I will do that now, thank you sir.

Bigguy

That's got it. Thanks for the quick response. :)

SychO

Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

I have an issue with this mod again. I tried to mark a post as best answer, but when I do it gives me a white page....no errors at all in the logs. If I uninstall the mod the white page goes away and the topic behaves normal. I have edited the css on the site but I do not think that would effect it.

SychO

Is there nothing on your server error log ? What php version are you using ? Can you post a link to the topic ?
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Aleksi "Lex" Kilpinen

Cool mod, if I may suggest, the mod description could be a bit more descriptive though. For a while there, I was wondering how this actually functions, permissions and all -
Simple to set up, if you know how, but takes a minute to figure out if you just randomly happened across this package like me :P
The board settings are easy, as the install redirects to them - but after that, there's no indication that there's a permission setting added too ;)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bigguy

Quote from: SychO on November 15, 2020, 02:44:22 AM
Is there nothing on your server error log ? What php version are you using ? Can you post a link to the topic ?

No errors anywhere. I will check cpanel after I re-install it. I was going through old topics and trying to pick the answer to some of them. I got a few marked as best answer but when I tried one of them it went to a white screen. I will check again here soon.

SychO

seems like certain topics with specific criteria fail, I can't think of why since I haven't been able to reproduce this.

Quote from: Aleksi "Lex" Kilpinen on November 15, 2020, 03:27:55 AM
Cool mod, if I may suggest, the mod description could be a bit more descriptive though. For a while there, I was wondering how this actually functions, permissions and all -
Simple to set up, if you know how, but takes a minute to figure out if you just randomly happened across this package like me :P
The board settings are easy, as the install redirects to them - but after that, there's no indication that there's a permission setting added too ;)

Yea could use improvement.
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Bigguy

Quote from: SychO on November 15, 2020, 09:22:34 AM
seems like certain topics with specific criteria fail, I can't think of why since I haven't been able to reproduce this.

I have no idea what was in that topic. If I find it again maybe it'll shed some light on the matter. I'll see in a bit. I have to go out soon.

SilverKnight

Any love for a 2.0 version?

SychO

Quote from: SilverKnight on December 31, 2020, 01:45:21 AM
Any love for a 2.0 version?

Certainly not from me.

But you can try this one, which seems to be compatible with 2.0 (have never tested it myself though): https://custom.simplemachines.org/mods/index.php?mod=3803
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

jsx

SychO,

It's nice that you created such a mod. :)

Let 2.1 finally be released. 8)

SilverKnight

Any chance of a 2.0 version?

SychO

I already answered that question
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

gevv

Hi,

Thanks @SychO

Turkish translation.
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

jsx

@SychO

Can you tell me where I can find these two settings? I don't see them in Permissions.

$txt['permissionname_mark_best_answer_any'] = 'Own topics';
$txt['permissionname_mark_best_answer_own'] = 'Any topics';

Steve

Go to either membergroup permissions or board permissions. Select a membergroup and it should be the fourth  from the bottom:

You cannot view this attachment.
DO NOT pm me for support!

jsx

@Steve

I ask because I translated this mod into my language and I don't see those two words right there in the permissions.

Diego Andrés

I see what you mean.
I believe they were added just for good measure in case the permission ever describes just 'any', or just 'own'. But that's on SMF.

SMF Tricks - Free & Premium Responsive Themes for SMF.

jsx

Thanks for the clarification.

Advertisement: