Firefox PHP

Message icons module

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date  
message_icons-1.0.4.tar.gz 4.2 KB open | download Maurice Makaay 09/01/2006 Read message
message_icons-1.0.4.zip 7.6 KB open | download Maurice Makaay 09/01/2006 Read message
Message icons module
January 16, 2006 04:34AM
In the message list, this module will append an attachment icon to the subject of those messages that have attachments and prepend an icon which indicates the type of message. The append and prepend strings can be changed in the language files for this module (so you can also use plain text strings if you like). You can use HTML in the language strings.

The module is activated on my development environment: [phorum-dev.gitaar.net]

Changelog:
2006-09-01 v1.0.4, the "momo" release

    - French translation completed (some strings were still missing).

    - A new icon for moved threads was added.

    - Closed sticky threads were marked as closed threads before, but
      now they are shown as sticky (same treatment as announcements).

2006-07-26 v1.0.3

    - Messages for which the user is not allowed to post a reply are
      also marked as closed (thanks to Oliver Riesen for the suggestion).

2006-01-30 v1.0.2

    - Added alt="" and title="" tags to all images.

2006-01-18 v1.0.1

    - Icons are now also applied in read mode.

    - Updated positioning of the icons a little bit for a better look.

2006-01-16 v1.0.0

    - Initial release


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 2 time(s). Last edit at 09/01/2006 06:34AM by mmakaay.
Attachments:
open | download - message_icons-1.0.4.tar.gz (4.2 KB)
open | download - message_icons-1.0.4.zip (7.6 KB)
Re: Message icons module
January 19, 2006 08:09AM
Hey Maurice,

I am running some form of a hack on my list.tpl. I was wondering if you could add an image for unread messages? I presume this wouldnt be too much hussle. That way I can dump the hacked tpl file and use this instead.

Groetjes,

Sergei

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Message icons module
January 30, 2006 06:42AM
Nice module, but it will be good to have possibility to made alts or titles to images
Re: Message icons module
January 30, 2006 06:51AM
That is something that will probably be added to the module. For now you can simply change the language file you are using. The full HTML code is in there, so adding alt tags only means changing that file.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Message icons module
February 13, 2006 06:21PM
Maurice,

How difficult would it be to add some logic to this mod so that if the body of the message contained an embedded "img src" or a ".jpg, .jpeg, .gif, .png" then the message would get tagged with a camera icon or something to indicate an image is inside?

Thanks
Re: Message icons module
February 13, 2006 06:45PM
Not too hard I guess. Looking for "<img " would be enough. But to make that work on the list page, you'd have to retrieve and check all message bodies when building the list page. Moreover, you'd have to format each message using the actual formatting rules, because images will be different in the message source ( by bbcode mod, [attachment 123 image.gif] by inline image mod, any other mod that puts images in the body). This would mean a serious performance penalty. The same goes for reading messages in threaded mode.

Changing it in such a way that it is performance-friendly, would mean that on posting or updating a message you'd look at the body to see if there's an image in there. If it is, you can set a flag in the message meta-data that can be used for displaying an extra icon. Next to that, a script should be written to update the flag for all messages that are already in the database (when installing such a mod on an already running system or when the rules for flagging are changed).

When doing this, you'll also have to look at available attachments. If there are non-image attachments in the message, the regular attachment icon should still be shown. I think too that only a camera should be shown in case there are only image attachments (regardless if they are simpley attached or shown in the body).

I like the idea, but it won't be a feature I will build in on a short notice.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 02/14/2006 03:38AM by mmakaay.
Re: Message icons module
February 14, 2006 06:58AM
Regarding the "camera" idea - this could be hacked fairly easily. All that would be needed is to set up a smiley that works in the subject header of messages called :camera: and prepend this to the subject of any post that contains an image at post time.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Message icons module
February 14, 2006 07:20AM
Updating a message should be handled as well (also think about removing the :camera: in case there's no embedded image left).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Message icons module
February 14, 2006 08:10AM
Agreed.
So the module design would seem to be:

- configurable text to prepend to the subject header of the message, depending on the presence of a user defined tag in the message (defaulted to "img").
- this text should only be added if it is not already present in the subject (otherwise subsequent edits would result in lots of cameras!)
- the text should be removed on edit in case the images have been removed.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Message icons module
February 14, 2006 08:56AM
That would about do it. However, I really dislike modifying the original data that Phorum has produced in the database for this kind of mod. It's way better to keep track of this using a flag in the message metadata. That way you can do things like change the exact code that is added to the subject and disable the module without getting into the process of having to fix back the subjects (especially important when thinking of people that just try out the mod to see if they want it or not). When writing the module for a large audience, then these kind of considerations should be taken into account.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login