Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 27, 20213 yr 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.
July 28, 20213 yr @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.
July 28, 20213 yr Author @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.
July 28, 20213 yr @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, 20213 yr by Afrodude
July 29, 20213 yr Author @Afrodude Are you sure you are testing in a forum with the Solved functionality disabled?
July 29, 20213 yr @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.
July 29, 20213 yr Author @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).
July 29, 20213 yr 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, 20213 yr by Afrodude
September 15, 20213 yr Management 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!