That sort of info needs to be stored in the database, e.g.:
CREATE TABLE `article_views`(
`id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT
,`article` INT(11) UNSIGNED NOT NULL COMMENT ‘id of article`
,`user` INT(11) UNSIGNED NOT NULL COMMENT ‘id of user who viewed post’
,`time` DATETIME NOT NULL COMMENT ‘date/time when user viewed article’
Same for making user groups: you’d need to store that info in your database, and have your scripts check to make sure the logged-in user has permission to do whatever they’re trying to do.
Are you using a content management system, or are you trying to code something yourself?
Well, that’s “the idea.” When you display the message to a user, update the database with that information. On subsequent requests, you can check those records.
*If* by “messages” you mean something like emails or IMs, where you only need to worry about one reader (the message recipient), then you could simply add a “read” column to the table you store the messages in – but it’s better design-wise to use a separate table.