Gabriel Torres Posted July 27, 2021 Posted July 27, 2021 Hello, Currently the solved counter in the user's pane only shows up in forums where the solved feature is enabled. See image attached. I think this counter should be shown in all forums. Just because in one particular forum we can't mark topics as solved, I don't think we should hide the fact that the user solved topics in other forums within the same community. Thanks.
Afrodude Posted July 28, 2021 Posted July 28, 2021 @Gabriel Torres it's easy to accomplish this by editing your theme template.  Find postContainer, and then find this  {{if isset( $comment->author_solved_count )}} <li> <a href='{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=solutions" seoTemplate="profile_solutions" seoTitle="$comment->author()->members_seo_name"}' title="{lang="solved_badge_tooltip" pluralize="$comment->author_solved_count"}" data-ipsTooltip class='ipsType_blendLinks'> <i class='fa fa-check-circle'></i> {number="$comment->author_solved_count"} </a> </li> {{endif}} It's going to be in line 101.  Delete line 101 = {{if isset( $comment->author_solved_count )}} and line 107 = {{endif}}. Save and enjoy solved counter everywhere in forums.
Gabriel Torres Posted July 28, 2021 Author Posted July 28, 2021 @Afrodude I've already tried this. It doesn't work, because the variable $comment->author_solved_count is set to 0/NULL from the PHP code.
Afrodude Posted July 28, 2021 Posted July 28, 2021 (edited) 27 minutes ago, Gabriel Torres said: @Afrodude I've already tried this. It doesn't work, because the variable $comment->author_solved_count is set to 0/NULL from the PHP code. What I just told you works just fine. I tested it.  Just do exactly what I mentioned above, and you will reach what you looking for 100%. Edited July 28, 2021 by Afrodude
Gabriel Torres Posted July 29, 2021 Author Posted July 29, 2021 @Afrodude Are you sure you are testing in a forum with the Solved functionality disabled?
Afrodude Posted July 29, 2021 Posted July 29, 2021 3 minutes ago, Gabriel Torres said: @Afrodude Are you sure you are testing in a forum with the Solved functionality disabled? Yes. The only issue that it will show even for members who have zero count.
Gabriel Torres Posted July 29, 2021 Author Posted July 29, 2021 @Afrodude When I say "it doesn't work here", I mean that the counter shows, but as zero instead of the correct solved counter when I remove the {if} statement. Think about it: in the original logic, if $comment->author_solved_count is different from zero, then the counter is shown. The only occasion that the HTML tag/counter wouldn't be shown is if $comment->author_solved_count = 0. If I remove the if statement, the counter is displayed as 0, however, this user's solved counter isn't zero (it is 53)... As I said, the source code is forcing the counter to be zero even when it isn't when the post is in a forum that has the solved option disabled. I made a very simple test: I enabled "Enable Solved?" for that forum and the counter was displayed (as 53, not zero). If I disable this option, the counter is displayed as 0 (with the {if} tag removed). Â
Afrodude Posted July 29, 2021 Posted July 29, 2021 (edited) 4 minutes ago, Gabriel Torres said: Think about it: in the original logic, if $comment->author_solved_count is different from zero, then the counter is shown. The only occasion that the HTML tag/counter wouldn't be shown is if $comment->author_solved_count = 0. True you are right, and this is what I have been trying to solve in the past two days. Edited July 29, 2021 by Afrodude
Management Charles Posted September 15, 2021 Management Posted September 15, 2021 That's a good point. I am going to check if this is intended or something we just didn't think about. But I agree with you 🙂 I'll follow up soon! Askancy and David.. 1 1
Recommended Posts