MyBB Community Forums

Full Version: How To Put "This Post Was The Best Answer" in the post itself, using MySupport 0.4.2?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, if a post is "Marked as best answer", is there a way to put "this post was the best answer" in the actual post, above the writing in the post?

Is there a way of doing it using template conditionals? I just don't know what variables to use in the if conditional is true, do this, etc...
this simple css method works in modern browsers (recent versions of firefox , chrome .. etc)
add in mysupport.css or global.css of the theme
.mysupport_bestanswer_highlight:before {content: " * This Post selected as the Best Answer";}
Is there another way of doing it?
^ plugin file can be modified to add that (I can't check it in next few days. you may wait for some other person to provide guidance)
(2014-11-26, 06:41 AM).m. Wrote: [ -> ]^ plugin file can be modified to add that (I can't check it in next few days. you may wait for some other person to provide guidance)

I found out how to do it.


if($mybb->user['uid'] == $thread['uid'])

{
    if($thread['bestanswer'] == $post['pid'])
    {
    echo 'This Post Was The Best Answer';
    }
}

I used the two if statements above to make it work, but I inserted it in my Post Bit template using <? php tags ?>

Is there another way of inserting PHP in the postbit template, without using the PHP in template plugin? Is it unsecure to run raw PHP in templates?

EDIT: I converted the above PHP code into a Template Conditional if it helps with security. Does it?
^ adding such php code is not really insecure provided that
only trustworthy persons have access to your forum admin panel (esp. templates section)
however such code can be added through the plugin itself (may be it requires a new function)