Home

Your premium source for custom modification services for phpBB

  logo

HomeForumsBlogMOD ManagerFAQSearchRegisterLogin

Comments March 25, 2008

Post Notes Design (Beta)

Filed under: MOD Writing, phpBB — Dave Rathbun @ 8:55 am CommentsComments (0) 

In an earlier post I wrote about a new feature that I’m developing called Post Notes. This post will go into more detail about how the feature works.

Post Notes Design

I have Post Notes on a beta board now. So far I am the only one that has used it, so I don’t have a lot of (or any) feedback from users just yet. That should change over the next week or two. In a nutshell, there is one additional table that looks like this:

desc busobj_post_notes;
+---------------+-----------------------+------+-----+---------+----------------+
| Field         | Type                  | Null | Key | Default | Extra          |
+---------------+-----------------------+------+-----+---------+----------------+
| note_id       | int(11) unsigned      |      | PRI | NULL    | auto_increment |
| note_time     | int(11) unsigned      |      |     | 0       |                |
| post_id       | mediumint(8) unsigned |      | MUL | 0       |                |
| user_id       | mediumint(8)          |      |     | 0       |                |
| user_ip       | varchar(8)            |      |     |         |                |
| report_id     | int(11) unsigned      |      | MUL | 0       |                |
| auth_level    | tinyint(2) unsigned   |      |     | 3       |                |
| editable_flag | tinyint(1) unsigned   |      |     | 1       |                |
| note_text     | text                  | YES  |     | NULL    |                |
+---------------+-----------------------+------+-----+---------+----------------+

The columns are used as follows:

  • note_id – primary key, automatically generated by the database
  • note_time – just list post_time and managed the same way, a unix_timestamp() value of the date/time the note was entered
  • post_id – the foreign key to the post the note applies to
  • user_id – the user that entered the note
  • user_ip – the IP address the note was entered from
  • report_id – an optional foreign key to the post report table, more on this later
  • auth_level – a field that stores the minimum auth level required to view the note
  • editable_flag – certain post notes are system generated and therefore not editable
  • note_text – the text of the actual note

I originally experimented with a varchar(255) field (the maximum size) for the note text, but that was too limiting in some cases so I went with a full text field instead. That decision is still open for discussion at this point.

Authorization

The auth_level field gets assigned values from the “auth” constants. I don’t use Private, as I didn’t see a way to use that in a way that made sense. That leaves these:

define(’AUTH_ALL’, 0);
define(’AUTH_REG’, 1);
define(’AUTH_MOD’, 3);
define(’AUTH_ADMIN’, 5);

This flag is used to determine if a post note is visible to a user or not. Some post notes (such as moderator actions for moving or locking a topic) are visible to all users, and therefore the auth_level of the post is AUTH_ALL or zero. Some posts require a user to be logged in before they are visible, and those have an auth_level of AUTH_REG or 1. Moderator notes are assigned level 3, and Administrator notes are assigned a level 5. Administrators can, of course, see all notes no matter what the post note authorization level is. Moderators can see everything level 3 and lower, and so on down the line.

Post Notes Interface

One of the comments that I anticipate at this point is something along the lines of:

How can post notes be displayed without destroying the flow of the topic?

That’s a valid question. :) Some posts could have quite a few notes on them, and as a moderator (or administrator) I would rather read the topic in the normal flow without the post notes getting in the way. I am fairly pleased with the method that I have so far, as it hides the post notes until they are requested. It uses an icon that appears (or not) based on the existance of notes (or not) and my authorization to see them (or not). Here’s a screen shot:

screen shot #1

Most of this screen should look familiar. The top icons include reply (a MOD), quote, edit, delete, and IP (all standard) icons. But on the lower right-hand corner of the post are some new icons. The red button with the exclamation point is my icon for reporting the post. The next two icons are supposed to look like the yellow postit notes pads. :) One has a green plus, and the other is just a plain icon. The plain icon is used to view notes, and it only shows up if there are, in fact, notes to view. The “add a note” icon shows up only if you have permissions to add notes.

The final icon (the small red hammer) is the icon used for my Spammer Hammer project, which has never been released publicly.

The icons are quite small and do not take much space, and they occupy space that is otherwise unused in a subSilver-type of template.

Viewing the Notes

When you click the “view notes” icon the screen changes to this:

screen shot #2

If you look carefully at the screen you’ll see that there is a “tool tip” or title for the image that tells you how many notes there are. In this case there are two notes, and the screen shot captures that. The second note states that the notes are displayed chronologically, and that is true. However they will be sorted in the same order as your post preferences. In other words, if you have set up your viewing so that posts are displayed from most recent to oldest then the post notes will use the same setting. By default the post notes are displayed from oldest to newest, so that the newest notes are on the bottom.

The post notes icon includes a javascript reference:

javascript:fold(436010);

This function checks the visibility setting for the div named section436010 and switches it from hidden to visible and back on each click. By default the named div is invisible. It’s only a few lines of code and works quite well. The post_id is used as the unique div name.

The “add post” icon is only visible to users with proper permissions. If it is visible and clicked then the user is presented with a very basic entry screen that allows them to enter text. I do not currently support bbcode, html, or smilies in post notes, and I don’t see a need for either. If anything I might go with the argument that bbcode should be supported but that’s about it.

At the moment the icon for deleting a post note is missing. It looks like the same post note icon but with a red minus sign instead of a green plus sign. It will appear next to each post note that is editable (and therefore deletable) based on permissions. System generated notes will not be editable or deletable by anyone, not even a board administrator.

Conclusion

So that’s a basic preview of the Post Notes design and preliminary implementation. I will be rolling this out on my biggest board in a few weeks and will be able to get some feedback from my moderator team and board members at that point. More details to come. 8-)

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Tags allowed in comments:
<a href="" title=""> <acronym title=""> <blockquote cite=""> <code> <strong> <em> <u> <sup> <sub> <strike>

Confirm submission by clicking only the marked checkbox:

             *

Powered by WordPress