Forum OpenACS Development: new functionality in forums HEAD

I have commited code to the forums (and forums-portlet) package in HEAD which stores reading info per user and thread, and displays the read status of threads, and also the number of unread threads. The functionality is meant to be optional and to be configured with a site-wide package parameter. Since these are not yet implemented, for the moment you have to change function forum::use_ReadingInfo_p in forums-procs.tcl.
We do not use Oracle, thus I could not provide the queries for it. Can anyone interested in this functionality and using Oracle, contribute them?
Collapse
Posted by David Arroyo Menéndez on
Hi Michael,

I would like to help you. I'm implementing this features on uned http://dev.innova.uned.es/foros/forum-view?forum%5fid=29818

Regards.

Collapse
Posted by Michael Totschnig on
Thank you David! Also if you have suggestions about improving, I would like to hear about it! If you do not have CVS write access, can you send me your changes?
Collapse
Posted by Michael Totschnig on
Here is a more complete description of what this code does:
It creates a feature called use_ReadingInfo, which can be activated in function forum::use_ReadingInfo_p.
It stores information about which threads a user has already read in two tables forums_reading_info and forums_reading_info_user. Thus it can render unread threads in bold, instead of the default behavior, which considers as new threads changes during the last 24 hours. In the forums overview as well as in the forums-portlet it displays the number of unread threads. The code tries to update reading info when threads are moved between forums, when messages are moved between threads, and when messages are approved, rejected or deleted.
Collapse
Posted by David Arroyo Menéndez on

I've began to port this funcionality to oracle, such as you've done.

I had written this feature using views and I store if a message is visited when someone calls to row.tcl

I'm losting some information using views, because I can't know when the thread was viewed, but perhaps the worst problem is that when someone want to know if a thread is read, we must to do a count and it maybe not very fast if the thread is large. What do you think about it?

Collapse
Posted by Michael Totschnig on
I had a look at the views package and I think it is worth using it if it makes available a service we can use.

You say that you cannot know when the thread was viewed. But in the datamodel I see that there is a field last_viewed in table views, and also it is not that important when it was viewed, but if it was viewed.

I do not understand either why you say that you have to do a count to know if a thread is read. But it seems important to me to store the number of read threads per forum in a denormalized table, as my code does in table forums_reading_info_user.

I think that we could use the views package instead of table forums_reading_info, but still use table forums_reading_info_user (possibly with another name) for storing the count of read threads.