Jump to content

Solved counter in all forums


Recommended Posts

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.

solved-issue.png

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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 by Afrodude
Link to comment
Share on other sites

@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).

 

Link to comment
Share on other sites

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 by Afrodude
Link to comment
Share on other sites

  • 1 month later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...