26

(1 replies, posted in Feature requests)

It would be very easy to mod extern.php to display the additional information that you want it to.

http://punbb.org/forums/extern.php?acti … amp;fid=48

Perhaps consider GUI's mod_rewrite mod?

http://www.google.com/search?q=site%3Aw … com+forums

Not bad, it could have been longer.  smile

Here ya go: Mark topics as read 1.1.2.

To be honest, I don't know.  You're welcome to try it on a test board and give me an official answer wink but I'll get around to making a bugfix and adding PunBB 1.2.2 support to this mod this weekend, I promise tongue

Aww, thanks.  It's feedback like that that makes me want to stamp out the last bug... as soon as I catch up on the schoolwork wink

The problem with this mod is that it prevents users from opening links in new tabs.

If you install Mark topics as read, clicking new posts will jump to the most recent post since you last read the topic.

I understand that you never intended to be possible, but if that's the case, you should return some sort of BBCode parsing error ("The BBCode syntax in the message is incorrect.  No BBCode allowed inside [ quote=]") instead of allowing it to happen but then dealing with it badly.

Personally, I would prefer it if this were a feature?possibly it can be fixed with a single stripslashes() in the right place.  Still, it's technically better to have no support for it instead of support that is buggy (and non-functional).

I've also seen people use images instead of names, but this is far less common than using URLs in the names.  However, phpBB handles this correctly also.

[img wrote:

http://punbb.org/img/logo_1_light.png[/img]]This quote was made by an image

It was a fairly common practice at the forum I frequent before we switched from phpBB to punBB.  It's a convenient way of quoting an external source and identifying it at the same time.

When urls are included in the quote tag, in the resulting HTML, the quotes in <a href=""> are improperly escaped with a backslash.

[quote="A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url]"]PunBB is delicious [i]and[/i] nutritious![/quote]
[quote=A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url]]PunBB is delicious [i]and[/i] nutritious![/quote]

results in:

A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url] wrote:

PunBB is delicious and nutritious!

A [url=http://en.wikipedia.org/ wrote:

Wikipedia[/url] article on PunBB]PunBB is delicious and nutritious!

with the HTML:

<blockquote><div class="incqbox"><h4>A <a href=\"http://en.wikipedia.org/\">Wikipedia</a> article on <a href=\"http://en.wikipedia.org/wiki/PunBB\">PunBB</a> wrote:</h4><p>PunBB is delicious <em>and</em> nutritious!</p></div></blockquote>
<blockquote><div class="incqbox"><h4>A <a href=\"http://en.wikipedia.org/\">Wikipedia</a> article on <a href=\"http://en.wikipedia.org/wiki/PunBB\">PunBB</a> wrote:</h4><p>PunBB is delicious <em>and</em> nutritious!</p></div></blockquote>

The markup for that line of code differs between the versions for PunBB 1.2.1 and 1.2.  MTaR v1.1.1 comes with two versions of the mod, so if you make sure you install the one for PunBB 1.2.1, it should output proper HTML.

Jérémie: glad this mod is useful to you. smile

I'm not sure what your problem could be; I would recommend trying a new install on a fresh copy of PunBB.  If that works, I would have to assume that the problem is either a mistake during installation, or a conflict with another mod you have installed.  In any case, I would be interested in seeing the debugging output.

You did help me realize that I fail to clear the topic_read cell for a user when they log out.  This shouldn't be causing any problems though; at worst, it'll make the database a bit larger if there are users that always log out without ever letting their visit timeout.  I'll fix it, but it shouldn't be causing any errors.

38

(35 replies, posted in Feature requests)

Here's another mod that will clear the new message indicator after you read a post.  It works on the server side by keeping track of topics read in the database, but I think its load is pretty light.

Mark topics as read v1.1.1

All right, Smartys, I made the fix, building on what you pointed out.  It's quick and easy to install. smile

Smartys wrote:

Oh, and if a topic is already read before the current visit, why does the mod need to do an UPDATE on the user setting? Doesn't it only need to record topics that are newer then the last visit but have been read?

After I submitted this mod in the wee hours of the morning, I realized that a topic didn't need to be mark read if it was older than the cut-off date (for the forum, or globally for last_visit).  Version 1.0.0 had just always marked a topic as read, which would have caused a lot of unnecessary UPDATEs when browsing through old topics, and greatly increased the size of the database, and, at first 1.1.0 had behaved the same way.  When I realized that, I quickly pulled the update, added that check, and reposted it.

I didn't, however, think about users viewing topics that had already been marked read by the mod.  You're right about that.  At first, I didn't think that it really mattered that much?it doesn't increase the size of the database at all, and users aren't very likely to reread threads they've just read if nobody has posted in them since?but I guess that this would apply to users reading multipage threads, and on a busy website, it's important to eliminate  every unnecessary UPDATE query.

Looking over that code now, I guess I did too much of a rush job (I test to see if $last_post >= $last_post hmm), so I'll fix that section and roll your suggestion in.

A sticky might help, too.

Smartys wrote:

Only problem I had was something with install_mod.php that you couldn't POSSIBLY have done tongue

require PUN_ROOT.'include/common.php';

That is odd, but that's the the way the MDK came.  For some reason I don't recall any error or notice when I ran install_mod.php... should I update the install_mod.php to fix that?

##
##
##        Mod title:  Mark topics as read
##
##      Mod version:  1.1.1
##   Works on PunBB:  1.2, 1.2.1
##     Release date:  2005-01-29
##           Author:  Miles Kaufmann
##
##      Description:  This mod makes it so that topics are no longer marked as
##                    "new" in the forum view after they have been read, if
##                    they have not been posted in since being read.  This 
##                    mod also works on the list of forums in index.php.
##
##   Affected files:  header.php
##                    include/functions.php
##                    index.php
##                    lang/English/common.php
##                    lang/English/misc.php
##                    moderate.php
##                    misc.php
##                    search.php
##                    viewforum.php
##                    viewtopic.php
##
##       Affects DB:  Yes; adds column "read_topics" to table "users".
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

PunRes project download
PunRes discussion thread


"Mark topics as read" is a PunBB mod which makes topics which have been viewed no longer appear as "new" in the forum view. It adds a single column to the "users" table, and uses no cookies. Installing this mod adds about 6KB of code to punBB.

I realize that the functionality of this mod overlaps with that of the PunJS New Posts mod by Shawn Brown; my main intention was to take the load off of the client and put it onto the server.  Unfortunately, the JavaScript solution doesn't work for me at all; in Safari, it adds about a five-second delay when viewing a forum page, and completely blanks the topic list, and Firefox/Mac has a similar problem with blank columns. hmm

I'm not trying to bash the competition, though.  wink  This is the second release of the mod, which fixed a bug that crept by me in testing, and has portions of the code substantially rewritten.  If you install it on your forums, I'd love to hear feedback.  Bug reports are equally welcome. smile

Thanks,
Miles

GUI wrote:

Now we will always wonder just how much Miles knows. tongue

You'll just have to keep wondering. tongue Although I never would have been searching for posts by you if you had just replied to my thread about the mod in the first place.  Ah well, time to find a new security hole.  I must try to keep quiet about this one hmm wink

Wow... somehow I've been operating under the assumption that 1.2.1 has already been released and is the latest version.

So I can see all the changes that have been made to 1.2 and will be available in the next version here?  What is changelogs/current.txt?

I'm assuming this one will be easy to fix, but capitalized search terms return no results.  They must be lowercase. v1.2

By searching for posts by moderators, and choosing to display results as posts, unprivileged users can get snippets of posts from a private, moderator-only forum.  I haven't checked out the source, but this seems to imply that punBB does no validation on whether a user has permission to view a topic when it's displayed in search results.