Helios Posted January 8, 2019 Share Posted January 8, 2019 Подскажите, как сделать рекламу например после каждого 5 сообщения? Link to comment Share on other sites More sharing options...
siv1987 Posted January 8, 2019 Share Posted January 8, 2019 I. После первого сообщения можно вывести стандартными настройками рекламы System -> Advertisements. Выбрать расположение блока After the first post in each topic II. После n-сообщения придется править шаблон - forums > front > topics > topicНайти (здесь выводится блок из функции управления рекламными блоками) {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}} {$advertisement|raw} {{endif}} Ниже добавить {{if $postCount % settings.forums_posts_per_page == 5}} Блок с рекламой после 5 сообщения {{endif}} 1 Link to comment Share on other sites More sharing options...
Helios Posted January 9, 2019 Author Share Posted January 9, 2019 {{if $postCount % settings.forums_posts_per_page == 5}} Блок с рекламой после 5 сообщения {{endif}}Спасибо, получилось. Но как сделать после каждого n-сообщения? Link to comment Share on other sites More sharing options...
newbie Posted January 9, 2019 Share Posted January 9, 2019 Но как сделать после каждого n-сообщения? {{if $postCount % 5 == 0}} Блок с рекламой после каждого 5 сообщения {{endif}} 2 Link to comment Share on other sites More sharing options...
siv1987 Posted January 9, 2019 Share Posted January 9, 2019 Показа блока только в определенном разделе {{if $topic->forum_id == 1}} Блок в разделе forum_id=1 {{endif}} Показ только гостям {{if !member.member_id}} Блок только для гостей {{endif}} Link to comment Share on other sites More sharing options...
Эль Кукуй Posted April 1, 2019 Share Posted April 1, 2019 (edited) Добрый день! Не поможете немного? Если я хочу вставить рекламу после последнего сообщения, как сформулировать это условие? {{if $postCount == settings.forums_posts_per_page}}, или нет? UPD Разобрался, большое спасибо за подробные инструкции! Edited April 1, 2019 by Эль Кукуй Link to comment Share on other sites More sharing options...
siv1987 Posted April 1, 2019 Share Posted April 1, 2019 Либо добавить блок после завершения цикла {{endforeach}} {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}} {$advertisement|raw} {{endif}} {{endforeach}} <div>Блок с рекламой в конце сообщений</div> Link to comment Share on other sites More sharing options...
newbie Posted April 2, 2019 Share Posted April 2, 2019 Если я хочу вставить рекламу после последнего сообщения, как сформулировать это условие?Добавьте код после foreach, как указал siv1987. {{if $postCount == settings.forums_posts_per_page}}, или нет?Не будет работать, если на странице кол-во постов меньше указанного в настройках.Например, указали 25, а в теме (на странице) 17 постов. 1 Link to comment Share on other sites More sharing options...
wdvipers Posted May 30, 2019 Share Posted May 30, 2019 (edited) {{if $topic->forum_id == 1}} Блок в разделе forum_id=1 {{endif}}Как добавить несколько разделов? Edited May 30, 2019 by wdvipers Link to comment Share on other sites More sharing options...
newbie Posted May 30, 2019 Share Posted May 30, 2019 Как добавить несколько разделов? {{if in_array($topic->forum_id, array(1,2,3,4,5))}} Блок в форумах 1,2,3,4,5 {{endif}} 1 Link to comment Share on other sites More sharing options...
wdvipers Posted August 4, 2019 Share Posted August 4, 2019 Не буду других тем создавать, спрошу тут.Как можно добавить рекламу после определённой под категории и раздела? Link to comment Share on other sites More sharing options...
newbie Posted August 5, 2019 Share Posted August 5, 2019 и раздела?http://ipbskins.ru/forum/topic16060.html/page__view__findpost__p__107789после определённой под категорииВ том же шаблоне после {template="forumRow" group="index" app="forums" params="$forum"}добавить {{if $forum->_id == X}} Реклама {{endif}}X заменить на ID форума 1 Link to comment Share on other sites More sharing options...
wdvipers Posted September 19, 2019 Share Posted September 19, 2019 Для раздела {{if $category->_id == 1}} не работает Link to comment Share on other sites More sharing options...
newbie Posted September 19, 2019 Share Posted September 19, 2019 Для раздела {{if $category->_id == 1}} не работает В каком месте вставляете код? 1 Link to comment Share on other sites More sharing options...
wdvipers Posted September 20, 2019 Share Posted September 20, 2019 forums > front > index > indexПосле {template="forumRow" group="index" app="forums" params="$forum"} 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