Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-17307

postrow.U_MINI_POST shouldn't be visible to bots

    XMLWordPrintable

Details

    Description

      To prevent similar topic pages to be browsed by identified bots (like Google), all occurences of postrow.U_MINI_POST should be hidden from them. Sure, there is canonical links on these pages, but the bots shouldn't even browse similar pages if possible (waste of time, server resources, etc.).

      On each topic pages, some postrow.U_MINI_POST links are hidden but other aren't.

      These postrow.U_MINI_POST links are hidden to identified bots (viewtopic_body.html) :

                      <!-- IF S_IS_BOT -->
                          <span><i class="icon fa-file fa-fw <!-- IF postrow.S_UNREAD_POST -->icon-red<!-- ELSE -->icon-lightgray<!-- ENDIF --> icon-md" aria-hidden="true"></i><span class="sr-only">{postrow.MINI_POST}</span></span>
                      <!-- ELSE -->
                          <a class="unread" href="{postrow.U_MINI_POST}" title="{postrow.MINI_POST}">
                              <i class="icon fa-file fa-fw <!-- IF postrow.S_UNREAD_POST -->icon-red<!-- ELSE -->icon-lightgray<!-- ENDIF --> icon-md" aria-hidden="true"></i><span class="sr-only">{postrow.MINI_POST}</span>
                          </a>
                      <!-- ENDIF --> 

      These postrow.U_MINI_POST links are visible to identified bots (viewtopic_body.html) :

              <h3 {% if postrow.S_FIRST_ROW %}class="first"{% endif %}>
                  {% if postrow.POST_ICON_IMG %}
                      <img src="{{ T_ICONS_PATH }}{{ postrow.POST_ICON_IMG }}" width="{{ postrow.POST_ICON_IMG_WIDTH }}" height="{{ postrow.POST_ICON_IMG_HEIGHT }}" alt="{{ postrow.POST_ICON_IMG_ALT }}" title="{{ postrow.POST_ICON_IMG_ALT }}">
                  {% endif %}
                  <a {% if postrow.S_FIRST_UNREAD %}class="first-unread" {% endif %}href="{{ postrow.U_MINI_POST }}">{{ postrow.POST_SUBJECT }}</a>
              </h3> 

      The line with postrow.U_MINI_POST should be replaced by the following one:

      {% if not S_IS_BOT %}<a {% if postrow.S_FIRST_UNREAD %}class="first-unread" {% endif %}href="{{ postrow.U_MINI_POST }}">{% endif %}{{ postrow.POST_SUBJECT }}{% if not S_IS_BOT %}</a>{% endif %} 

      Attachments

        Activity

          People

            Unassigned Unassigned
            Big Monstro Big Monstro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: