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

Wrong class added to topiclist, when there's no announcement topic.

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Styles
    • Labels:
      None
    • Environment:
      PHP 5.2.12, MySQL 5.1.43, Windows 7, Google Chrome

      Description

      If there are no announcement topics, the container for topiclist get the classes: "forumbg announcement".

      The code involved is line 126 in viewforum_body.html (Prosilver):

      <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH --> announcement<!-- ENDIF -->">

      If there's at least one announcement topic the code works, and only the container div for the list of announcement topic(s) get the class "announcement" appended, and the list of announcement topics is separated from the rest of the topics.

      If there are no announcement topcis the only container div for topiclist will still be appended with the class "announcements" in addition to the "forumbg" class.

      Hope I made it clear enough to understand.
      I talked to rxu on the irc channel about it as well, and was told to create a ticket here.

        Activity

        Hide
        bantu Andreas Fischer added a comment -

        The 1 in "topicrow.S_TOPIC_TYPE gt 1" is a magic number and shouldn't be used as per the coding guidelines. The "gt" is probably also a bad idea, a MOD might add another type, which doesn't have to be an announcement.

        Better explicitly use S_POST_ANNOUNCE and S_POST_GLOBAL.

        Show
        bantu Andreas Fischer added a comment - The 1 in "topicrow.S_TOPIC_TYPE gt 1" is a magic number and shouldn't be used as per the coding guidelines. The "gt" is probably also a bad idea, a MOD might add another type, which doesn't have to be an announcement. Better explicitly use S_POST_ANNOUNCE and S_POST_GLOBAL.
        Hide
        nickvergessen Joas Schilling added a comment -

        I copied the IF statement from the code 5 lines below.
        I changed both now and added a class global-announce to the switch later, to be able to customize this aswell: sticky, announce and report were already available, but global-announcements are not having announce = true.

        http://github.com/nickvergessen/phpbb3/commit/82db1c9c50eeac0c18a62f062c12f3f0846a4961

        Show
        nickvergessen Joas Schilling added a comment - I copied the IF statement from the code 5 lines below. I changed both now and added a class global-announce to the switch later, to be able to customize this aswell: sticky, announce and report were already available, but global-announcements are not having announce = true. http://github.com/nickvergessen/phpbb3/commit/82db1c9c50eeac0c18a62f062c12f3f0846a4961
        Hide
        bantu Andreas Fischer added a comment -

        Sorry, merged the old commit.

        Show
        bantu Andreas Fischer added a comment - Sorry, merged the old commit.
        Hide
        bantu Andreas Fischer added a comment -

        Ah no, I only forgot to include the second commit in the merge. So no issue. Fully merged now.

        Show
        bantu Andreas Fischer added a comment - Ah no, I only forgot to include the second commit in the merge. So no issue. Fully merged now.

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            LadyAnna Anna Broman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development