Disabling Unread Posts

  • I can, indeed, remove the counter with CSS, but that doesn't prevent the information from being calculated. I'm not sure how much work the system goes through to maintain that number, though; it could be minimal.

    • Offizieller Beitrag

    I'm not sure how much work the system goes through to maintain that number, though; it could be minimal.

    The impact should be fairly low, as it uses a series of shortcuts to reduce the impact:

    • Items older than 1 week are automatically assumed to be read
    • Querying the database uses timestamps from a secondary table, all timestamps will fall inside the 1 week window

    By scoping the possible results to the past 7 weeks only, the database can easily apply the time filter first (there is an extra index for that), greatly reducing the number of rows it has to work with. Also it uses a single query to fetch the data for all boards at once.

    If you want to get rid of this query, you'll need to provide a custom version of the boardNodeList template (please use the ACP and template groups, not manually editing of the file!) and remove all occurrences of getUnreadThreads() and getTotalUnreadThreads(). Because this data is lazy loaded, removing any call of these methods in the template will actually prevent it from fetching that data in the first place.

    Hint: You can combine the debug mode with the benchmark, turning the benchmark into a clickable link that gives insight into the actual queries that were executed and what impact they had on load time. You could edit the index.php and insert something like that at the top:

    Code
    if ($_SERVER['REMOTE_ADDR'] === 'yourFancyIP') {
        define('ENABLE_DEBUG_MODE', 1);
        define('ENABLE_BENCHMARK', 1);
    }

    Just keep in mind to get rid of that block again. It is basically abusing the fact, that the options.inc.php checks if the constant already exists before attempting to set it on this own.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!