мвмвмм Posted April 4, 2021 Report Share Posted April 4, 2021 всем привет. На главном выводится Лучшие авторы. Как сделать чтобы первый выводилась Все время а не неделя Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 5, 2021 Author Report Share Posted April 5, 2021 Помощь Quote Link to comment Share on other sites More sharing options...
Respected Posted April 5, 2021 Report Share Posted April 5, 2021 Никак не сделать без правки кода. Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 5, 2021 Author Report Share Posted April 5, 2021 1 минуту назад, Respected сказал: Никак не сделать без правки кода. очень жаль😡 а какой файл отвечает на это Quote Link to comment Share on other sites More sharing options...
Respected Posted April 5, 2021 Report Share Posted April 5, 2021 core > front > widgets > topContributors, в нём поменять параметры ipsTabs_activeItem и aria-selected='true' на нужный список li. Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 7, 2021 Author Report Share Posted April 7, 2021 не получается что-то Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 9, 2021 Author Report Share Posted April 9, 2021 мучаюсь 2 дня как можно сделать Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 10, 2021 Author Report Share Posted April 10, 2021 нужна помощь Quote Link to comment Share on other sites More sharing options...
Desti Posted April 11, 2021 Report Share Posted April 11, 2021 topContributors.php public function render() { /* How many? */ $limit = isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5; /* Work out who has got the most reputation this week... */ $topContributorsThisWeek = array(); $topContributorsThisWeek = iterator_to_array( \IPS\Db::i()->select( 'member_id as themember, pp_reputation_points as rep', 'core_members', array( 'pp_reputation_points > 0' ), 'rep DESC', $limit )->setKeyField('themember')->setValueField('rep') ); arsort( $topContributorsThisWeek ); $topContributorsThisWeek = \array_slice( $topContributorsThisWeek, 0, $limit, TRUE ); /* Load their data */ if( \count( $topContributorsThisWeek ) ) { foreach ( \IPS\Db::i()->select( '*', 'core_members', \IPS\Db::i()->in( 'member_id', array_keys( $topContributorsThisWeek ) ) ) as $member ) { \IPS\Member::constructFromData( $member ); } } /* Display */ return $this->output( $topContributorsThisWeek, $limit ); } Шаблон topContributors <h3 class='ipsType_reset ipsWidget_title'>{lang="block_topContributors"}</h3> <div class='ipsTabs ipsTabs_small ipsTabs_stretch ipsClearfix' id='elTopContributors' data-ipsTabBar data-ipsTabBar-updateURL='false' data-ipsTabBar-contentArea='#elTopContributors_content'> <a href='#elTopContributors' data-action='expandTabs'><i class='fa fa-caret-down'></i></a> <ul role="tablist" class='ipsList_reset'> <li> <a href='#ipsTabs_elTopContributors_el_topContributorsAll_panel' aria-selected='true' class='ipsTabs_item ipsTabs_activeItem' id='el_topContributorsAll' role="tab" aria-selected='false'>{lang="alltime"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=week&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsWeek' role="tab" class='ipsTabs_item'>{lang="week"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=month&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsMonth' class='ipsTabs_item' role="tab" aria-selected='false'>{lang="month"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=year&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsYear' class='ipsTabs_item' role="tab" aria-selected='false'>{lang="year"}</a> </li> </ul> </div> <section id='elTopContributors_content' class='ipsWidget_inner ipsPad_half'> <div id="ipsTabs_elTopContributors_el_topContributorsWeek_panel" class='ipsTabs_panel'> {template="topContributorRows" group="widgets" app="core" params="$topContributorsThisWeek, 'all', $orientation"} </div> </section> У меня в таком виде всё работает нормально мвмвмм and Respected 1 1 Quote Link to comment Share on other sites More sharing options...
Desti Posted April 11, 2021 Report Share Posted April 11, 2021 13 минут назад, Desti сказал: $topContributorsThisWeek = \array_slice( $topContributorsThisWeek, 0, $limit, TRUE ); это можно удалить, limit уже есть в запросе Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 11, 2021 Author Report Share Posted April 11, 2021 1 час назад, Desti сказал: topContributors.php public function render() { /* How many? */ $limit = isset( $this->configuration['number_to_show'] ) ? $this->configuration['number_to_show'] : 5; /* Work out who has got the most reputation this week... */ $topContributorsThisWeek = array(); $topContributorsThisWeek = iterator_to_array( \IPS\Db::i()->select( 'member_id as themember, pp_reputation_points as rep', 'core_members', array( 'pp_reputation_points > 0' ), 'rep DESC', $limit )->setKeyField('themember')->setValueField('rep') ); arsort( $topContributorsThisWeek ); $topContributorsThisWeek = \array_slice( $topContributorsThisWeek, 0, $limit, TRUE ); /* Load their data */ if( \count( $topContributorsThisWeek ) ) { foreach ( \IPS\Db::i()->select( '*', 'core_members', \IPS\Db::i()->in( 'member_id', array_keys( $topContributorsThisWeek ) ) ) as $member ) { \IPS\Member::constructFromData( $member ); } } /* Display */ return $this->output( $topContributorsThisWeek, $limit ); } Шаблон topContributors <h3 class='ipsType_reset ipsWidget_title'>{lang="block_topContributors"}</h3> <div class='ipsTabs ipsTabs_small ipsTabs_stretch ipsClearfix' id='elTopContributors' data-ipsTabBar data-ipsTabBar-updateURL='false' data-ipsTabBar-contentArea='#elTopContributors_content'> <a href='#elTopContributors' data-action='expandTabs'><i class='fa fa-caret-down'></i></a> <ul role="tablist" class='ipsList_reset'> <li> <a href='#ipsTabs_elTopContributors_el_topContributorsAll_panel' aria-selected='true' class='ipsTabs_item ipsTabs_activeItem' id='el_topContributorsAll' role="tab" aria-selected='false'>{lang="alltime"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=week&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsWeek' role="tab" class='ipsTabs_item'>{lang="week"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=month&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsMonth' class='ipsTabs_item' role="tab" aria-selected='false'>{lang="month"}</a> </li> <li> <a href='{url="app=core&module=system&controller=ajax&do=topContributors&time=year&limit={$limit}&orientation={$orientation}"}' id='el_topContributorsYear' class='ipsTabs_item' role="tab" aria-selected='false'>{lang="year"}</a> </li> </ul> </div> <section id='elTopContributors_content' class='ipsWidget_inner ipsPad_half'> <div id="ipsTabs_elTopContributors_el_topContributorsWeek_panel" class='ipsTabs_panel'> {template="topContributorRows" group="widgets" app="core" params="$topContributorsThisWeek, 'all', $orientation"} </div> </section> У меня в таком виде всё работает нормально topContributors.php это через менеджер?или в админке? Quote Link to comment Share on other sites More sharing options...
Desti Posted April 11, 2021 Report Share Posted April 11, 2021 Не, с такими вопросами не ко мне (Платные услуги) Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 11, 2021 Author Report Share Posted April 11, 2021 23 минуты назад, Desti сказал: Не, с такими вопросами не ко мне (Платные услуги) Вот этот файл topContributors.php не могу найти где расположен Quote Link to comment Share on other sites More sharing options...
Zero108 Posted April 11, 2021 Report Share Posted April 11, 2021 Скачай на локал и на локале поищи по названию файла через Total Commander. Quote Link to comment Share on other sites More sharing options...
Respected Posted April 11, 2021 Report Share Posted April 11, 2021 /applications/core/widgets/topContributors.php Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 12, 2021 Author Report Share Posted April 12, 2021 21 час назад, мвмвмм сказал: topContributors.php это через менеджер?или в админке? все работает. Но неделя перестала работать можешь у себя проверить? Quote Link to comment Share on other sites More sharing options...
Desti Posted April 12, 2021 Report Share Posted April 12, 2021 В шаблоне в третьей снизу строке изменить id="ipsTabs_elTopContributors_el_topContributorsWeek_panel" на id="ipsTabs_elTopContributors_el_topContributorsAll_panel" мвмвмм 1 Quote Link to comment Share on other sites More sharing options...
мвмвмм Posted April 12, 2021 Author Report Share Posted April 12, 2021 4 часа назад, Desti сказал: В шаблоне в третьей снизу строке изменить id="ipsTabs_elTopContributors_el_topContributorsWeek_panel" на id="ipsTabs_elTopContributors_el_topContributorsAll_panel" Спасибо все норм. Можно последний штрих как теперь можно исправить вывод месяц? А то сейчас вывод месяц и вывод год одинаковые Quote Link to comment Share on other sites More sharing options...
Desti Posted April 12, 2021 Report Share Posted April 12, 2021 1 час назад, мвмвмм сказал: А то сейчас вывод месяц и вывод год одинаковые Ну так может они и правда одинаковые? В базу должны разные запросы уходить, причем этот подсчет делается в файле, который мы не трогали. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.