Board news and announcement system
Because of these limitations, I decided to overhaul the board news feature with a much more flexible system that allows the following things:
- Only global news items were possible (no way to limit them to certain boards or even topics).
- No way to limit the display of a given news item to a subset of user groups
News items can use full BBCode (and when edited by an administrator also HTML) formatting and can contain up to 65K of text (a TEXT column is being used for the content).
- News items are stored in a dedicated database table (unlike before, where they were part of the modSettings array)
- A news item may only appear in the message index of one or more boards, on the board index, or in the topic view. The latter can be useful to attach news to sticky or other important topics.
- A news item can be limited to one or more user groups. This makes it possible to show certain news items, like a registration hint, only to guests, for example.
- News can have a "teaser" (a shortened version) and provide a read more link for showing the complete item.
- Users may dismiss a news item that they've already seen, unless the item forbids this in which case it will always be visible. For a shortened news item that shows a "read more" link, the dismiss action is only available after reading the full text.
- Little overhead. The news items uses the caching system to reduce the number of database queries.