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

How to change the background of a topic when it is SOLVED #57

Open cavive opened 8 years ago

cavive commented 8 years ago

How to make the background of a topic when it is SOLVED

like the attached file topicsolve

zavovi commented 3 years ago

Hi, I solved it:

In file topicsolved/event/main_listener.php add these lines:

        if (!empty($topic_data['topic_solved']) && $topic_data['topic_solved'] == $event['row']['post_id'] &&
            $topic_data['topic_type'] != POST_GLOBAL)
        {
            $post_row['S_POST_SOLVED'] = 1;
        }

into this method "viewtopic_modify_post_row_button". Then, you can put this line:

<!-- IF postrow.S_POST_SOLVED --> solved<!-- ENDIF -->

into class param in file "styles/prosilver/template/viewtopic_body.html" like here:

<div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF --><!-- IF postrow.S_POST_SOLVED --> solved<!-- ENDIF -->">

On the end, you must add style to ".solved". I added to file "styles/prosilver/theme/colours.css" like this:

.solved {
    background-color: #D8FFD8 !important;
}

Example is on my forum: http://forum.zavavov.cz/nove-napady-f14/aktualni-verze-t6.html