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.
Hellow Everybody
I have been working on My CMS system and I want add to it the property of read and unread via PHP & MySQl
is this done through session or what and how ?
also I want make user groups with different permissions like edit , delete for users , supervisor , admins .. How this ??
That sort of info needs to be stored in the database, e.g.:
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?
thx traq , I build my own CMS , I want know the idea for making message unread after opening it ..
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.
are u mean I will make column "read" with two value 0,1 0-> unread & 1->read and if the reader get page will be turn from 0 to 1 ??
like this
right. note, however, that it is better from a database design standpoint to record this in a separate table, as in my first example.