Jump to content

How to display solved count in hovercard?


Xontero

Recommended Posts

Hi guys. I wanna to show solved count in hovercard so I use below codes, but these codes turn 0 result.. 😕 

<!-- for solved count-->
<div class='ipsPadding_horizontal:half ipsFlex ipsFlex-fd:column-reverse ipsFlex-ai:center'>
  <dd class='ipsType_semiBold ipsType_large ipsType_dark ipsMargin:none'>{number="$comment->author_solved_count"}</dd>
  <dt class='ipsType_light'><i class='bx bx-badge-check' ></i></dt>
</div>

How can I fix that?

@ZIKURIK

Edited by LoveHate
Link to comment
Share on other sites

с решениями и в топиках такая же проблема.
через "author_solved_count" они выводятся только в разделе с вопросами.
мб можно как-то по-другому ещё, не учитывая прямого вывода с бд, конечно.

прямой вывод в postcontainer:
{{$solved = \IPS\Db::i()->select( 'COUNT(*)', 'core_solved_index', array( 'member_id=?', $comment->author()->member_id ) )->first();}}
{$solved}
прямой вывод в hovercard:
{{$solved = \IPS\Db::i()->select( 'COUNT(*)', 'core_solved_index', array( 'member_id=?', $meber->member_id ) )->first();}}
{$solved}

Link to comment
Share on other sites

2 часа назад, LoveHate сказал:

How can I fix that?

 

2 часа назад, by_ix сказал:

мб можно как-то по-другому ещё, не учитывая прямого вывода с бд, конечно.


это делает функция solutionCount()

<!-- for solved count-->
<div class='ipsPadding_horizontal:half ipsFlex ipsFlex-fd:column-reverse ipsFlex-ai:center'>
  <dd class='ipsType_semiBold ipsType_large ipsType_dark ipsMargin:none'>{number="$member->solutionCount()"}</dd>
  <dt class='ipsType_light'><i class='bx bx-badge-check' ></i></dt>
</div>

 

Link to comment
Share on other sites

LoveHate 

{{$pms = \IPS\Db::i()->select( 'COUNT(*)', 'core_message_posts', array( 'msg_author_id=?', $member->member_id ) )->first();}}
{$pms}

{{$files = \IPS\Db::i()->select( 'COUNT(*)', 'downloads_files', array( 'file_submitter=?', $member->member_id ) )->first();}}
{$files}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Ваша ссылка была автоматически строена.   Отображать как обычную ссылку

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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