Jump to content
Дизайн и модификация Invision Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
aLEX49566

Как вывести кол-во созданных тем

Recommended Posts

Всем привет. Подскажите, кто знает, как вывести в постконтейнере, под аватаром, количество созданных тем юзером/админом? На подобие того, как выводится кол-во созданных сообщений. Вроде не сложно, но мозг не поворачивается 

Edited by aLEX49566

Share this post


Link to post

Сделал так:

<a href="{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=content" seoTemplate="profile_content" seoTitle="$comment->author()->members_seo_name"}" rel="nofollow" title="{lang="member_post_count" pluralize="$comment->author()->member_posts"}" data-ipsTooltip class="ipsType_blendLinks">

                       {{$where[] = "starter_id = " . $comment->author()->member_id;}}

{{$author_topics = \IPS\forums\Topic::getItemsWithPermission( $where, NULL, 0 );}}

<i class="fa fa-comment"></i>  {{$topics_count = count($author_topics);}} {$topics_count}    

                </a>


 

Но перекидывает при нажатии на темы, а в сообщения. При наведении тоже показывает не темы а сообщения.

Edited by Lesovsky

Share this post


Link to post

Если бы кто с этими двумя моментами помог, был бы приемного благодарен!

Share this post


Link to post

Сделал. Доведу до ума, скину итог 

  • Like 1

Share this post


Link to post

Пишу с телефона, а тут кодом не вставить(

Для пк:

<li>

              {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}

                <a href="{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=content" seoTemplate="profile_content" seoTitle="$comment->author()->members_seo_name"}" rel="nofollow" title="{lang="member_post_count" pluralize="$comment->author()->member_posts"}" data-ipsTooltip class="ipsType_blendLinks">

              {{endif}}

                <i class="fa fa-comments"></i> {number="$comment->author()->member_posts" format="short"}

              {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}

                </a>

              {{endif}}

            </li>

                      

                        <li>

                            <a href="{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=content&type=forums_topic&change_section=1" seoTemplate="profile_content" seoTitle="$comment->author()->members_seo_name"}" rel="nofollow" title="{lang="User_Created_Themes"}" data-ipsTooltip class="ipsType_blendLinks">

                              {{$where[] = "starter_id = " . $comment->author()->member_id;}}

                             {{$author_topics = \IPS\forums\Topic::getItemsWithPermission( $where, NULL, 0 );}}

                                <i class="fa fa-comment"></i>  {{$topics_count = count($author_topics);}} {$topics_count}    

                              </a>

                         </li>

 

для моб:

 

<h3 class='ipsComment_author ipsType_blendLinks'>

          {template="userLink" app="core" group="global" params="$comment->author(), $comment->warningRef(), NULL, $comment->isAnonymous()"}

     

                    {template="reputationBadge" group="global" app="core" params="$comment->author()"}

                  

                        {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}

                <a href="{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=content" seoTemplate="profile_content" seoTitle="$comment->author()->members_seo_name"}" rel="nofollow" title="{lang="member_post_count" pluralize="$comment->author()->member_posts"}" data-ipsTooltip class="ipsType_blendLinks ipsRepBadge">

              {{endif}}

                <i class="fa fa-comments"></i> {number="$comment->author()->member_posts" format="short"}

              {{if \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) }}

                </a>

              {{endif}}

              

                             <a href="{url="app=core&module=members&controller=profile&id={$comment->author()->member_id}&do=content&type=forums_topic&change_section=1" seoTemplate="profile_content" seoTitle="$comment->author()->members_seo_name"}" rel="nofollow" title="{lang="User_Created_Themes"}" data-ipsTooltip class="ipsType_blendLinks  ipsRepBadge">

                              {{$where[] = "starter_id = " . $comment->author()->member_id;}}

                             {{$author_topics = \IPS\forums\Topic::getItemsWithPermission( $where, NULL, 0 );}}

                                <i class="fa fa-comment"></i>  {{$topics_count = count($author_topics);}} {$topics_count}    

                              </a>     

          </h3>

 

В языки:

<word key="User_Created_Themes" js="0">Созданные темы пользователя</word>

 

Результат:

IMG_3938.jpeg.fcb254b76cd64e1461a094ee6d8295c1.jpeg

 

IMG_3939.jpeg.ac5580f185319d38da9209a74312ddde.jpeg

Edited by Lesovsky
  • Upvote 1

Share this post


Link to post

Только по-хорошему нужно указывать в какие шаблоны нужно производить изменения.

Share this post


Link to post
5 часов назад, Lesovsky сказал:

Только по-хорошему нужно указывать в какие шаблоны нужно производить изменения.

Согласен. С телефона был. По человечески не вышло(. Как нибудь напишу по человечески : )

Edited by aLEX49566

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...