DONATE NOW TO HELP UPGRADE LIBCOM.ORG

No mark all as read option?

4 posts / 0 new
Last post
WeTheYouth
Offline
Joined: 16-10-03
Jul 26 2006 12:47
No mark all as read option?

The forums are looking realy good, i was just wondering if there is going to be a "mark all as read option" like we had on the last forums?

libcom's picture
libcom
Offline
Joined: 20-03-05
Jul 26 2006 13:09

working on it. Might take a little while but it should be possible yeah.

WeTheYouth
Offline
Joined: 16-10-03
Jul 26 2006 13:19

Okay coo.

ghostzart
Offline
Joined: 19-06-06
Jul 26 2006 13:41

It should be easy to implement. The MySQL database holds a table called "history" which keeps track of every node visited by every user, and the timestamp of the last visit. If you want to "mark all as read" you would simply store the current time in a variable, harvest a list of every forum topic, and then iterate through this list and SELECT all entries in the history table which contain both the nid (node identification number) and the uid (user identification number). Then you compare the history.timestamp for each positive match, subtract it from the saved UNIX timestamp, and if the value is greater than zero, set the timestamp in history to the saved variable. node.module already has a function for comparing these. All you'd really have to do is write a custom function to display the HTML link, put it in forum.module, and call the right method in node.module (I believe it's called node_tag_new()). I would have to really look at the Drupal code for awhile to work out a usable algorithm, but essentially it's just a for loop with calls to the existing library of functions in the modules dir.