Скала Posted March 15, 2014 Share Posted March 15, 2014 приветствую, знатоки. Подскажите как сделать так, чтобы когда переходишь на страницу новых публикации, сама кнопка "Просмотр новых публикаций" перекрашивалась, так, как перекрашивается кнопка "Форумы" при переходе на форум.Надеюсь понятно объяснил. Link to comment Share on other sites More sharing options...
siv1987 Posted March 15, 2014 Share Posted March 15, 2014 Используя условия в шаблоне что мы находимся на странице новые публикации, добавить к ссылке css класс для которого будут заданы желаемые стили. Link to comment Share on other sites More sharing options...
Скала Posted March 15, 2014 Author Share Posted March 15, 2014 вот код меню. класс <ul class='ipsList_inline' id='community_app_menu'> отвечает за обе кнопки. но "Форумы" активные при переходе на них. а "Просмотр новых публикации" не активен. Link to comment Share on other sites More sharing options...
siv1987 Posted March 15, 2014 Share Posted March 15, 2014 Потому что там нет условия для того чтобы она выделялась.Замените li#nav_explore <li id='nav_explore' class='right'> <a href='{parse url="app=core&module=search&do=viewNewContent&search_app=<if test="viewnewcontentapp:|:$this->registry->getCurrentApplication() != 'core' AND IPSLib::appIsSearchable( $this->registry->getCurrentApplication() )">{$this->registry->getCurrentApplication()}<else />forums</if>" base="public"}' accesskey='2' title='{$this->lang->words['view_new_posts']}' class='<if test="$this->request['module'] == 'search' && $this->request['do'] == 'viewNewContent'">active</if>'>{$this->lang->words['view_new_posts']}</a> </li> Link to comment Share on other sites More sharing options...
Скала Posted March 15, 2014 Author Share Posted March 15, 2014 на что заменить? Link to comment Share on other sites More sharing options...
siv1987 Posted March 15, 2014 Share Posted March 15, 2014 @Скала, в коде class к ссылке видите? Значит на этот код и нужно заменить. Link to comment Share on other sites More sharing options...
Скала Posted March 16, 2014 Author Share Posted March 16, 2014 разобрался, по другому методу. спасибо, можно закрывать. Link to comment Share on other sites More sharing options...
siv1987 Posted March 16, 2014 Share Posted March 16, 2014 Закрывать зачем? JQuery, о боже мой. Why?? jQuery(function(){ if ( window.location.href.indexOf('app=core&module=search&do=viewNewContent&search_app=members') > -1 || window.location.href.indexOf('app=core&module=search&do=viewNewContent&search_app=forums') > -1){ jQuery('#nav_explore').addClass('active'); } }); Если уж так сильно хочется на javascript, нужно писать на фреймворке форума <script> document.observe('dom:loaded', function(){ if(location.href.indexOf('app=core&module=search&do=viewNewContent') > -1){ var nav = $('nav_explore'); nav.addClassName('active'); } }); </script> Хотя наверное куда проще добавить строчку к тегу ссылке. class='<if test="$this->request['module'] == 'search' && $this->request['do'] == 'viewNewContent'">active</if>' Link to comment Share on other sites More sharing options...
shtoki Posted July 22, 2015 Share Posted July 22, 2015 А не подскажите, как можно запретить гостям просматривать "Новые публикации"?Спасибо! Link to comment Share on other sites More sharing options...
siv1987 Posted July 22, 2015 Share Posted July 22, 2015 Новые публикации являются частью поиска. Если гости не имеют права пользоваться поиском, новые публикации также будут недоступны.Как оставить открытым поиск но запретить только новые публикации уже обсуждались, поищите на форуме решение. Link to comment Share on other sites More sharing options...
shtoki Posted July 23, 2015 Share Posted July 23, 2015 Спасибо большое. Временно отключил вместе с поиском, пока не найду решение (по отдельному закрытию "Новые публикации") которое обсуждалось. Link to comment Share on other sites More sharing options...
siv1987 Posted July 23, 2015 Share Posted July 23, 2015 Здесь обсуждалось на оборот, как разрешить новые публикации и закрыть поиск. В вашем случае - разрешить поиск но закрыть новые публикации гостям:/admin/applications/core/modules_public/search/search.php /* Check the member authorization */ Выше добавить /* Allow search new-content for guests */ if( ( $this->request['module'] == 'search' AND $this->request['do'] == 'viewNewContent' AND $this->request['search_app'] == 'forums' ) AND ! $this->memberData['member_id'] ) { $this->registry->output->showError( 'no_permission_to_search', 10146.1, null, null, 403 ); } 1 Link to comment Share on other sites More sharing options...
shtoki Posted July 24, 2015 Share Posted July 24, 2015 Спасибо большое за ответ!Попробую. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now