Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Private Messaging Module

Go to End

34 Posts   4036 Views


19 December 2008 at 5:08pm Community Member, 3 Posts


i would like to rework the privatemessaging module a little so i could use it to replace phpBB2's pm functions. these are the things i would like to change/add:

1.) sort messages into 3 folders -- "Inbox", "Sent", "Archive". these can be virtual and wouldn't need an extra table, just another column to seperate "Inbox" from "Archive".

2.) support bbcode in messages, should be trivial since you could just copy&paste from the blog-module.

3.) seperate the "PrivateMessage" table into 2 tables, one for "from", "to" and "status" (read/unread) informations and another one for the message itself (date, subject, body). this way the sender can keep a message in his "Sent" folder while the recipient can delete the message already or the other way around. only if all references in the "from and to" table to a message are deleted the message itself will be deleted, too.

4.) enable multiple recipients per message. after 3.) is done this should be easy, too.

5.) make the list of available recipients "Nickname"-based since the forum uses this attribute to represent a member all over the place.

About 5: i'm going to use privatemessaging as a forum-feature mainly, but there might be sites which want to use PM without having the forum installed. there's another problem when using forum and PM together: members might choose to keep there First- and Surname private, but PM would still reveal them in the "Sent to" dialog. I'm not sure how to solve this, maybe an option in the backend which allows to configure the format of an item in the recipients list?

please let me know what you think about all this :-)

// lenix


9 March 2009 at 7:31am Community Member, 44 Posts

Any News about this Module?

I am very interessted in that one.



8 April 2009 at 11:33pm Community Member, 44 Posts

any News?


15 January 2010 at 3:56am Community Member, 10 Posts

i have customised this module here are the files (i intend to do more still working on it)

whats been changed?
added inbox,readbox and sentbox folders
added another template contains divs for folder links like Inbox(n of messages) - inbox(5)

removed the member select box when sending messages -> just type the nickname in, you can also type multiple nicknames seperated by a comma jon,bob,eddy etc
(the only thing with this is it will give you multiple sent items for the 1 message at the moment)

also modified my page.php file and to give a notification heres the code for that


   function getpm3(){
      $me = Member::currentUser();
            $pm = DataObject::get("PrivateMessage", "", "Created DESC ", "WHERE ToID = $me->ID AND red=0");
                     $this->unread2 = 0;
                     foreach ($pm as $k=>$v){
                        if($v->red == 0){
                           $this->unread2 = $this->unread2 +1;
                     return $this;
                  return null;



<% include PMNotify %>

you'll also need to make a page in your themes Include dir

<% control getpm3 %>
<% if getpm3 %>
<div class="pmnotify">
<p><a href="private-messages/">you have $unread2 unread messages. click here to read</a></p>
<% else %>
<div class="pmnotify">
<p>no messages</p>
<% end_if %>
<% end_control %>

please note that im new to silverstripe, so there might be a few glitches here, im activley working on this so will update it soon
there is no styling with this other than what was done by the original author

ofcourse full credit to the original author, comments and suggestions welcome

Attached Files

15 January 2010 at 4:03am Community Member, 10 Posts

i also use the forum module, i plan on coding some form of integration for that too suck as pm links


15 January 2010 at 7:12am Community Member, 10 Posts

made some more changes found bugs! lol

added bounce message if nick is not found
made changes to template files added divs & styling
added redirect back to current folder when deleting messages
accounted for a sender or reciever deleting pm so both parties are not effected
added "sent to"

heres the css you'll need to add the Require line in mysite/code/Page.php

.pmtable tr th{
background: #111111 url(../images/eve/navbar.png) repeat-x;
background: #222222;
background: #333333;

thats all for now, will update this thread in a week if theres any bugs will sort these asap

Attached Files

15 January 2010 at 7:22am Community Member, 82 Posts


this is just too funny ;-) Since I'm building a community module for a musician-search platform, I stumbled upon this module yesterday.
The basic code is quite nice and efficient and I've got a lot of ideas... So I started coding last night.
And today I see there are other people interested.
Question is: Do you want to focus on forums-integration or do you intend to build something generic that could be reused for several things.
In general I'm more the generic-things-guy. Why not build this thing with switchable forums-support? E.g. checkbox to enable/disable nickname support, add a switchable e-mail notification for new messages, ...
Anyone interested in cooperation?


15 January 2010 at 7:55am 4085 Posts

I'll be building something like this for a major project over the next few months. I'll be sure to post my code when I'm done.

Go to Top