1 (edited by bedroom 2010-08-30 07:55)

Topic: Track topics in database (version 1.0.1)

Download here (version 1.0.1 with the warning removed - see below)

(License : WTFPL)

Back in the days of PunBB 1.2, new posts were highlighted until you logged out (or timed out), even when you had read them (unless you used this mod). PunBB 1.3 improved this by keeping track of the posts you read in a tracking cookie, which is simple enough but not suited to my needs.

In the default installation, PunBB is configured with a visit timeout of 10 minutes, which means that you have to read all the new posts right away : if you go take a walk or something for 20 minutes, you'll lose track of everything you hadn't read.

To accomodate my users who like to idle all day long but not miss one post, my PunBB board is set up with o_timeout_visit = 86400 (24 hours). Problem is, some of us log in from different locations during the day (home, office, iPhone) and so posts that we have read are marked as new.

With this extension, your read posts are stored in the database (new column "tracked_topics" in the "users" table)

You could say that my extension corrects a self-inflicted problem, and you'd be right, but maybe a PunBB board admin somewhere needs it too, so there it is.

PLEASE NOTE :
- This extension might hurt your database performance a tiny bit (count 1 more UPDATE query for each topic view by each user)
- Not useful if your o_timeout_visit is lower than 1 or 2 hours, or if each of your users only has one computer
- Just after installing the extension, users currently logged in will see some already read messages reappear as new : this is perfectly normal since the new tracking has to start somewhere ! Everything will be back to normal once the users mark those messages as read.
- You might want to fix your board and get rid of this bug while you're at it (suggested fix inside)

Re: Track topics in database (version 1.0.1)

Thanks for extension wink
It is very helpful, my users were mad about this problem with 10 minutes.

3

Re: Track topics in database (version 1.0.1)

With this extension, your read posts are stored in the database (new column "tracked_topics" in the "users" table)

You could say that my extension corrects a self-inflicted problem, and you'd be right, but maybe a PunBB board admin somewhere needs it too, so there it is.

That's awesome! Great job.

Re: Track topics in database (version 1.0.1)

Hi there

I have been looking for something like this however on installing I get this error - can you help?

Warning: Missing argument 4 for DBLayer::add_field(), called in /var/www/vhosts/ollysguitar.com/subdomains/forums/httpdocs/admin/extensions.php(176) : eval()'d code on line 3 and defined in /var/www/vhosts/ollysguitar.com/subdomains/forums/httpdocs/include/dblayer/mysqli.php on line 364

Re: Track topics in database (version 1.0.1)

Hey ollyno1uk,

It's only a warning, not an error, so I guess the install should be successful ? If it's not, try changing line 22 in the file manifest.xml:

$forum_db->add_field('users', 'tracked_topics', 'TEXT');

to this:

$forum_db->add_field('users', 'tracked_topics', 'TEXT', true);

Re: Track topics in database (version 1.0.1)

Hi bedroom

Thanks a lot for the quick reply.

I have done this and I get no warnings although I personally do not get any new posts so I am unsure if it working or not at the moment.

Have you done any other extensions at all? If so, do you have a list? It is nice to see someone still active around here!

7

Re: Track topics in database (version 1.0.1)

ollyno1uk wrote:

Have you done any other extensions at all? If so, do you have a list? It is nice to see someone still active around here!

*cough*If so, we'd appreciate if you'd add it to the Wiki btw wink*cough*

Eraversum - scifi browser-based online webgame

Re: Track topics in database (version 1.0.1)

ollyno1uk, the code you installed has been working perfectly fine for me and my users for over a year, so I'm not too worried smile

I have made a bunch of other extensions but haven't released them so far, I only use them on my private forum. If time permits I will gladly post the more interesting ones.

Re: Track topics in database (version 1.0.1)

Thanks! That is reassuring!

I look forward to hearing about your extensions! I'm already very intrigued!

All the best!

Olly