XF 2.2 Как убрать дату сообщений?

Версия XenForo
v2.2.11

ФАКЕР

Проверенные
Сообщения
762
Решения
9
Реакции
76
Баллы
730
Добрый день.

Как можно убрать все даты с форума?
- дата создания темы
- дата ответов в теме
- даты в категориях
- даты на главной

Знаю, что в шаблонах лучше не трогать, но я не планирую обновлять форум, так, что вырезал бы и из шаблонов) вопрос только где это всё находится и как называется?

прикрепляю пару скринов. (что я имел ввиду)
 

Вложения

  • 22222222222222.png
    22222222222222.png
    78.1 KB · Просмотры: 52
  • 1111111111111111111.png
    1111111111111111111.png
    60.7 KB · Просмотры: 52
Решение
немного поправил, что бы ник не убирал:
Less:
.listInline {
    li {
        .fa-clock, time, &:before {
            display: none;
        }
    }
}
.message-attribution-main {
    li time {
        display: none;
    }
}
.structItem-cell.structItem-cell--latest {
    a time {
        display: none;
    }
}
.listInline {
    li time {
        display: none;
    }   
}
в шаблонах лучше не трогать
Модификациями? В "Найти" пишем нужный кусок кода, в "Заменить" оставляем пустоту.

Через extra.less и display: none; к элементам выводящим даты.
 
Модификациями? В "Найти" пишем нужный кусок кода, в "Заменить" оставляем пустоту.

Через extra.less и display: none; к элементам выводящим даты.
Проблема ещё и найти даты.
Например вот node_list_forum
Код:
<xf:macro name="depth1" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
    <div class="block">
        <div class="block-container">
            <div class="block-body">
                <xf:macro name="forum"
                          arg-node="{$node}"
                          arg-extras="{$extras}"
                          arg-children="{$children}"
                          arg-childExtras="{$childExtras}"
                          arg-depth="{$depth}" />
            </div>
        </div>
    </div>
</xf:macro>

<xf:macro name="depth2" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
    <xf:macro name="forum"
              arg-node="{$node}"
              arg-extras="{$extras}"
              arg-children="{$children}"
              arg-childExtras="{$childExtras}"
              arg-depth="{$depth}" />
</xf:macro>

<xf:macro name="depthN" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
    <li>
        <a href="{{ link('forums', $node) }}" class="subNodeLink subNodeLink--forum {{ $extras.hasNew ? 'subNodeLink--unread' : '' }}">
            <xf:fa icon="{{ $node.Data.TypeHandler.getTypeIconClass() ?: 'fa-comments' }}" class="subNodeLink-icon" />{$node.title}
        </a>
        <xf:macro template="forum_list" name="sub_node_list"
                  arg-children="{$children}"
                  arg-childExtras="{$childExtras}"
                  arg-depth="{{ $depth + 1 }}" />
    </li>
</xf:macro>

<xf:macro name="forum"
          arg-node="!"
          arg-extras="!"
          arg-children="!"
          arg-childExtras="!"
          arg-depth="!"
          arg-chooseName=""
          arg-bonusInfo="">

    <div class="node node--id{$node.node_id} node--depth{$depth} node--forum {{ $extras.hasNew ? 'node--unread' : 'node--read' }}">
        <div class="node-body">
            <span class="node-icon" aria-hidden="true">
                <xf:fa icon="{{ $node.Data.TypeHandler.getTypeIconClass() ?: 'fa-comments' }}" />
            </span>
            <div class="node-main js-nodeMain">
                <xf:if is="$chooseName">
                    <xf:checkbox standalone="true">
                        <xf:option labelclass="u-pullRight" class="js-chooseItem" name="{$chooseName}[]" value="{$node.node_id}" />
                    </xf:checkbox>
                </xf:if>
                <xf:set var="$descriptionDisplay" value="{{ property('nodeListDescriptionDisplay') }}" />
                <h3 class="node-title">
                    <a href="{{ link('forums', $node) }}" data-xf-init="{{ $descriptionDisplay == 'tooltip' ? 'element-tooltip' : '' }}" data-shortcut="node-description">{$node.title}</a>
                    <xf:if is="{$extras.hasNew} && property('uix_newNodeMarker')"><span class="uix_newIndicator">{{ phrase('new') }}</span></xf:if>
                </h3>
                <xf:if is="$descriptionDisplay != 'none' && $node.description">
                    <div class="node-description {{ $descriptionDisplay == 'tooltip' ? 'node-description--tooltip js-nodeDescTooltip' : '' }}">{$node.description|raw}</div>
                </xf:if>

                <div class="node-meta">
                    <xf:if is="!{$extras.privateInfo} && !property('uix_hideNodeStats')">
                        <div class="node-statsMeta">
                            <dl class="pairs pairs--inline">
                                <xf:if is="property('uix_nodeStatsIcons')">
                                    <dt><xf:fa icon="fa-comment" /></dt>
                                    <xf:else />
                                    <dt>{{ phrase('threads') }}</dt>
                                </xf:if>
                                <dd>{$extras.discussion_count|number_short(1)}</dd>
                            </dl>
                            <dl class="pairs pairs--inline">
                                <xf:if is="property('uix_nodeStatsIcons')">
                                    <dt><xf:fa icon="fa-comments" /></dt>
                                    <xf:else />
                                    <dt>{{ phrase('messages') }}</dt>
                                </xf:if>
                                <dd>{$extras.message_count|number_short(1)}</dd>
                            </dl>
                        </div>
                    </xf:if>

                    <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'menu'">
                        <xf:macro template="forum_list" name="sub_nodes_menu"
                                  arg-children="{$children}"
                                  arg-childExtras="{$childExtras}"
                                  arg-depth="{{ $depth + 1 }}" />
                    </xf:if>
                </div>

                <xf:if is="$depth == 2 AND property('nodeListSubDisplay') == 'flat'">
                    <xf:macro template="forum_list" name="sub_nodes_flat"
                              arg-children="{$children}"
                              arg-childExtras="{$childExtras}"
                              arg-depth="{{ $depth + 1 }}" />
                </xf:if>

                <xf:if is="$bonusInfo is not empty">
                    <div class="node-bonus">{$bonusInfo}</div>
                </xf:if>
            </div>

            <xf:if is="!{$extras.privateInfo} && !property('uix_hideNodeStats')">
                <div class="node-stats">
                    <dl class="pairs pairs--rows">
                        <dt>{{ phrase('threads') }}</dt>
                        <dd>{$extras.discussion_count|number_short(1)}</dd>
                    </dl>
                    <dl class="pairs pairs--rows">
                        <dt>{{ phrase('messages') }}</dt>
                        <dd>{$extras.message_count|number_short(1)}</dd>
                    </dl>
                </div>
            </xf:if>

            <div class="node-extra">
                <xf:if is="{$extras.privateInfo}">
                    <span class="node-extra-placeholder">{{ phrase('private') }}</span>
                    <xf:elseif is="{$extras.LastThread}" />
                    <div class="node-extra-icon">
                        <xf:if is="$xf.visitor.isIgnoring($extras.last_post_user_id)">
                            <xf:avatar user="{{ null }}" size="xs" />
                            <xf:else />
                            <xf:avatar user="{$extras.LastPostUser}" defaultname="{$extras.last_post_username}" size="xs" />
                        </xf:if>
                    </div>
                    <div class="uix_nodeExtra__rows">
                        <div class="node-extra-row">
                            <xf:if is="$extras.LastThread.isUnread()">
                                <a href="{{ link('threads/unread', $extras.LastThread) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
                                <xf:else />
                                <a href="{{ link('threads/post', $extras.LastThread, {'post_id': $extras.last_post_id}) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
                            </xf:if>
                        </div>
                        <div class="node-extra-row">
                            <ul class="listInline listInline--bullet">
                                <li><xf:date time="{$extras.last_post_date}" class="node-extra-date" /></li>
                                <xf:if is="$xf.visitor.isIgnoring($extras.last_post_user_id)">
                                    <li class="node-extra-user">{{ phrase('ignored_member') }}</li>
                                    <xf:else />
                                    <li class="node-extra-user"><xf:username user="{$extras.LastPostUser}" defaultname="{$extras.last_post_username}" /></li>
                                </xf:if>
                            </ul>
                        </div>
                    </div>
                    <xf:else />
                    <span class="node-extra-placeholder">{{ phrase('none') }}</span>
                </xf:if>
            </div>


        </div>
    </div>

    <xf:if is="{$depth} == 1">
        <xf:macro template="forum_list" name="node_list"
                  arg-children="{$children}"
                  arg-extras="{$childExtras}"
                  arg-depth="{{ $depth + 1 }}" />
    </xf:if>
</xf:macro>

forum_list:

Код:
<xf:if is="$xf.options.forumsDefaultPage != 'forums' OR ($xf.options.indexRoute AND $xf.options.indexRoute != 'forums/')">
    <xf:title>{{ phrase('forum_list') }}</xf:title>
<xf:else />
    <xf:h1>{{ phrase('forum_list') }}</xf:h1>
</xf:if>

<xf:page option="uix_mainTabSets" value="forum" />
<xf:page option="uix_mainTabActive" value="forum_list" />

<xf:macro template="metadata_macros" name="metadata"
    arg-description="{$xf.options.boardDescription}"
    arg-canonicalUrl="{{ link('canonical:' . $selfRoute) }}" />

<xf:wrap template="forum_overview_wrapper">
    <xf:set var="$pageSelected">forums</xf:set>
</xf:wrap>

<xf:widgetpos id="forum_list_sidebar" position="sidebar" />

<xf:widgetpos id="forum_list_above_nodes" />

<div class="uix_nodeList block">
    <xf:macro name="node_list" arg-children="{$nodeTree}" arg-extras="{$nodeExtras}" />
</div>

<xf:widgetpos id="forum_list_below_nodes" />

<xf:head option="rss_forum"><link rel="alternate" type="application/rss+xml" title="{{ phrase('rss_feed_for_x', {'title': $xf.options.boardTitle})|for_attr }}" href="{{ link('forums/index.rss', '-') }}" /></xf:head>

<xf:macro name="node_list_entry" arg-node="!" arg-extras="!" arg-children="!" arg-childExtras="!" arg-depth="1">
    <xf:css src="node_list.less" />
    <xf:set var="$nodeTemplate" value="{{ $node.getNodeTemplateRenderer($depth) }}" />
    <xf:if is="$nodeTemplate.macro">
        <xf:macro template="{$nodeTemplate.template}" name="{$nodeTemplate.macro}"
            arg-node="{$node}"
            arg-extras="{$extras}"
            arg-children="{$children}"
            arg-childExtras="{$childExtras}"
            arg-depth="{$depth}" />
    <xf:elseif is="{$nodeTemplate.template}" />
        <xf:include template="{$nodeTemplate.template}" />
    </xf:if>
</xf:macro>

<xf:macro name="node_list" arg-children="!" arg-extras="!" arg-depth="1">
    <xf:css src="node_list.less" />
    <xf:foreach loop="$children" key="$id" value="$child">
        <xf:macro name="node_list_entry"
            arg-node="{$child.record}" arg-extras="{$extras.{$id}}"
            arg-children="{$child.children}" arg-childExtras="{$extras}"
            arg-depth="{$depth}"
        />
    </xf:foreach>
</xf:macro>

<xf:macro name="sub_node_list" arg-children="!" arg-childExtras="!" arg-depth="3">
    <xf:if contentcheck="true">
        <ol>
        <xf:contentcheck>
            <xf:macro template="forum_list" name="node_list"
                arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
            />
        </xf:contentcheck>
        </ol>
    </xf:if>
</xf:macro>

<xf:macro name="sub_nodes_flat" arg-children="!" arg-childExtras="!" arg-depth="3">
    <xf:css src="node_list.less" />
    <xf:if contentcheck="true">
        <div class="node-subNodesFlat">
            <span class="node-subNodesLabel">{{ phrase('sub_forums:') }}</span>
            <ol class="node-subNodeFlatList">
            <xf:contentcheck>
                <xf:macro template="forum_list" name="node_list"
                    arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
                />
            </xf:contentcheck>
            </ol>
        </div>
    </xf:if>
</xf:macro>

<xf:macro name="sub_nodes_menu" arg-children="!" arg-childExtras="!" arg-depth="3">
    <xf:css src="node_list.less" />
    <xf:if contentcheck="true">
        <div class="node-subNodeMenu">
            <a class="menuTrigger" data-xf-click="menu" role="button" tabindex="0" aria-expanded="false" aria-haspopup="true">
                <span>{{ phrase('sub_forums') }}</span>
                <xf:fa icon="fa-folder" />
            </a>
            <div class="menu" data-menu="menu" aria-hidden="true">
                <div class="menu-content">
                    <h4 class="menu-header">{{ phrase('sub_forums') }}</h4>
                    <ol class="subNodeMenu">
                    <xf:contentcheck>
                        <xf:macro template="forum_list" name="node_list"
                            arg-children="{$children}" arg-extras="{$childExtras}" arg-depth="{{ $depth + 1 }}"
                        />
                    </xf:contentcheck>
                    </ol>
                </div>
            </div>
        </div>
    </xf:if>
</xf:macro>

Либо я не вижу, либо дат нет :(
 
Проблема ещё и найти даты.
Например вот node_list_forum
Код:
            <xf:if is="!{$extras.privateInfo} && !property('uix_hideNodeStats')">
                <div class="node-stats">
                    <dl class="pairs pairs--rows">
                        <dt>{{ phrase('threads') }}</dt>
                        <dd>{$extras.discussion_count|number_short(1)}</dd>
                    </dl>
                    <dl class="pairs pairs--rows">
                        <dt>{{ phrase('messages') }}</dt>
                        <dd>{$extras.message_count|number_short(1)}</dd>
                    </dl>
                </div>
            </xf:if>

            <div class="node-extra">
                <xf:if is="{$extras.privateInfo}">
                    <span class="node-extra-placeholder">{{ phrase('private') }}</span>
                    <xf:elseif is="{$extras.LastThread}" />
                    <div class="node-extra-icon">
                        <xf:if is="$xf.visitor.isIgnoring($extras.last_post_user_id)">
                            <xf:avatar user="{{ null }}" size="xs" />
                            <xf:else />
                            <xf:avatar user="{$extras.LastPostUser}" defaultname="{$extras.last_post_username}" size="xs" />
                        </xf:if>
                    </div>
                    <div class="uix_nodeExtra__rows">
                        <div class="node-extra-row">
                            <xf:if is="$extras.LastThread.isUnread()">
                                <a href="{{ link('threads/unread', $extras.LastThread) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
                                <xf:else />
                                <a href="{{ link('threads/post', $extras.LastThread, {'post_id': $extras.last_post_id}) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
                            </xf:if>
                        </div>
                        <div class="node-extra-row">
                            <ul class="listInline listInline--bullet">
                                <li><xf:date time="{$extras.last_post_date}" class="node-extra-date" /></li>
                                <xf:if is="$xf.visitor.isIgnoring($extras.last_post_user_id)">
                                    <li class="node-extra-user">{{ phrase('ignored_member') }}</li>
                                    <xf:else />
                                    <li class="node-extra-user"><xf:username user="{$extras.LastPostUser}" defaultname="{$extras.last_post_username}" /></li>
                                </xf:if>
                            </ul>
                        </div>
                    </div>
                    <xf:else />
                    <span class="node-extra-placeholder">{{ phrase('none') }}</span>
                </xf:if>
            </div>
        </div>
    </div>
А это что тогда?

Плюс на первом скриншоте это далеко не форумы, а темы. Нужный шаблон: thread_view. И да, на форуме было кучу решений как можно данную информацию убрать с помощью CSS, без модификаций шаблонов.
 
Код:
<li><xf:date time="{$extras.last_post_date}" class="node-extra-date" /></li>
Если это не вывод даты, то что тогда? Собственно и CSS-класс даты node-extra-date.

А откуда в стандартных движковых шаблонах появился код от UI.X?
!property('uix_hideNodeStats')
Тем более в настройках стиля можно попытаться поискать
 
немного поправил, что бы ник не убирал:
Less:
.listInline {
    li {
        .fa-clock, time, &:before {
            display: none;
        }
    }
}
.message-attribution-main {
    li time {
        display: none;
    }
}
.structItem-cell.structItem-cell--latest {
    a time {
        display: none;
    }
}
.listInline {
    li time {
        display: none;
    }   
}
 
С датами получилось.
Но остался один момент
Как убрать даты отсюда?
Суть того как прятать я думаю вы поняли по ответам выше)
.u-dt отвечает за это, попробуйте спрятать его
 
А есть шаблон который глобальный для дат и времени посещений а не выводить (скрывать) даты время по 1 в каждом? Что бы обвернув код шаблона в условие - даты время скрываются глобально со всех остальных шаблнов?
 
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу