Re: Mark topics as read v1.1
Which other mods?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Mark topics as read v1.1
Which other mods?
smilies, german plugins, votemod, and integration to my community system
OK, considering I recognize none of them (unless this is the smiley mod?) and 1.2.5 shouldn't change anything that interferes, might I suggest installing them, manually updating to 1.2.5, and then installing this mod?
oh sorry but, the forum is change in a lot of things. its integrated in a community system an a update make a lot of work. so i only need a version from this plugin, what go with 1.2.4
Once again, PunBB 1.2.4 is vulnerable. You NEED to upgrade or you are at risk of being hacked.
why? i think punbb isnt a beta version!
its a lot of work! why i dont choose a normal software like phpbb...
PunBB certainly is not a beta. Updates to fix bugs and security issues are normal. phpbb has had 4 updates this year as well so you would have the same problem.
Hi Miles et al,
I've installed the 1.1.3 version of this mod on my punBB 1.2.5 board... the mod is not working, and users (not admins) are seeing this error at the top of the page:
Notice: Undefined index: last_post in /var/www/cinema-obscura.com/viewtopic.php on line 118
I hope we can resolve this; I really hate the default behavior of the 'new posts' indicators.
Aha, I went over it and discovered that it was an installation error... however, it was an error that could have been easily avoided with a small change in the install instructions at 46.
The current install instructions say:
=========================================================
#
#---------[ 46. FIND (line: 105) ]--------------------------------------------
#
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
#
#---------[ 47. REPLACE WITH ]------------------------------------------------
#
// MOD: MARK TOPICS AS READ - 1 LINE MODIFIED CODE FOLLOWS
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.last_post, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
=====================================================================
The problem with this is that there are two lines that are both very very long and very very similar to each other in the immediate vicinity of line 105. Add a mod or two and it becomes pretty hazy which one is the right one to modify. I had the wrong one, and that generated the notice I mentioned, plus killed the function of the mod.
Sorry for the confusion. Out of curiosity, did you try installing it via the diff first? I'd be interested in how well it works when there are other mods installed.
I really detest the current standard mod format. It'd be awesome if PunBB had some sort of dedicated mod package system (since by design PunBB is lightweight and leaves much additional functionality to mods... but overly modding gets messy). I haven't looked at PunMod, so I don't know if it's the right solution. I was brainstorming some ideas for an implementation of a mod manager but I (a) don't know that it would be right for PunBB and (b) wouldn't want to compete with the existing standard.
Somebody tryed this on 1.2.6 ?
Miles, you looking into releasing this for 1.2.7?
Cheers
Steven Bullen
Not at this time.
Oh well...
Thanks for the quick reply anyway.
On the scale of 1-10, how hard do you think it would be for me to bodge the old one...
Cheers
Steven Bullen
Nothing has really changed
Ok will have a play. I only say it because it stops it running because of the version. I am sure that is easily bypassed and will have a look into it. Cheers
Odds are good that only the surrounding code has changed much. Adapting the mod should be a snap... I just get tired of the tedium of counting lines for each new point release.
Then don't bother counting
Ooh, I've got what I think is a bug
When I hit "new" on a thread, I don't get the "new" post since I last read that thread, I get the new post since my last visit time (which due to a high visit timeout I set and me visiting rather often was 12 hours ago)
Sorry. I found and fixed that bug three months ago but never posted the fix.
Step 45 of install.txt should actually be:
#
#---------[ 45. REPLACE WITH ]------------------------------------------------
#
// MOD: MARK TOPICS AS READ - 10 LINES NEW CODE FOLLOW
$result = $db->query('SELECT forum_id FROM '.$db->prefix.'topics WHERE id='.$id)
or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
$forum_id = $db->result($result);
$last_read = $pun_user['last_visit'];
if ($forum_id && !empty($pun_user['read_topics']['f'][$forum_id]) &&
$pun_user['read_topics']['f'][$forum_id] >= $last_read)
$last_read = $pun_user['read_topics']['f'][$forum_id];
if (!empty($pun_user['read_topics']['t'][$id]) &&
$pun_user['read_topics']['t'][$id] >= $last_read)
$last_read = $pun_user['read_topics']['t'][$id];
The root of the problem though is that in the old version I accidentally used $pun_user['read_topic'] (but 'topic' should have been plural).
This has become hard for me to debug in Safari with the anchor bug.
Just like to say that all done on 1.2.7.
All working ok... at the moment - fingers crossed.
Pretty easy to do the changes when put the effort in.
Anyway thanks for the orignal code to change much appreciated.
so after i install the mod for 1.2.7 what do i need to change to get it to work?
so after i install the mod for 1.2.7 what do i need to change to get it to work?
Apologies but I cannot help as I was tinkering left, right and centre. I wanted only specific forum groups to use this mod and some other groups not to use this mod, so I changed the code a little.
Any news or annoucements on my site I would prefer them to click a button to acknowledge reading it, as well as actually reading it. Just a double safety...
Sorry I couldnt help.
bump, need something that works for 1.2.10
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Mark topics as read v1.1
Powered by PunBB, supported by Informer Technologies, Inc.