tierra / topicsolved

phpBB Topic Solved extension: Allows posting questions, and accepting answers as solved.
https://www.phpbb.com/customise/db/extension/topic_solved/
GNU General Public License v2.0
23 stars 19 forks source link

Mark accepted answer #55

Open BlackSkorpio opened 8 years ago

BlackSkorpio commented 8 years ago

Would like to share a small "hack" that I just implemented in my forum since I was looking for a way to "highlight" the whole correct answer (as can be done in desk.com)

I'n my case I use a "somewhat" customized version of Simplicity (https://www.artodia.com/phpbb-styles/simplicity/) and added a the templates for it inside the ext style dir

I added this to my forum_fn.js,:

$('div:has(span.imageset.icon_solved_post)').addClass('solving_answer');

This snippet will look for the post with the class solving post, and give all it's parent divs the class solving_answer

After that I added this to my buttons.css

/* Highligt the correct post */
.postprofile + .postbody.solving_answer > div {
    background-color: rgba(217, 252, 217, 0.61);
    border: 1px dashed #ff6e00;
    padding:.1em .1em .1em .9em;
    border-radius: 3px;
}

This will then highlight the correct answer! :smiley:

Next thing "on my list" is to clone the correct answer and move a copy of that below the question/issue, and by that replicate the "proffesional look" from commercial alternatives as desk.com forums :+1:

If you want to see this live you can do that here: https://kokensupport.com/viewtopic.php?f=8&t=28

simpey84 commented 5 years ago

Hi ! I would like to customize the css of the best answer in my post list, your solution seems to be the one I'm looking for. Could you please be more specific where I have to insert your snippet in forum_fn.js ? I'm not familiar with php or Javascript but I think it won't work if I paste your code right at the end of the file ... Thanks !