Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Private Messaging Module

Discuss all other Modules here.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 3908 Views
  • lenix
    Avatar
    Community Member
    3 Posts

    Private Messaging Module Link to this post

    Hi,

    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

  • Breastfed
    Avatar
    Community Member
    44 Posts

    Re: Private Messaging Module Link to this post

    Any News about this Module?

    I am very interessted in that one.

    Thanks

  • Breastfed
    Avatar
    Community Member
    44 Posts

    Re: Private Messaging Module Link to this post

    any News?

  • jonm80
    Avatar
    Community Member
    10 Posts

    Re: Private Messaging Module Link to this post

    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 page.ss to give a notification heres the code for that

    Page.php

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

       }

    and Page.ss

    <% include PMNotify %>

    you'll also need to make a PMNotify.ss 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>
    </div>
    <% else %>
    <div class="pmnotify">
    <p>no messages</p>
    </div>
    <% 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
  • jonm80
    Avatar
    Community Member
    10 Posts

    Re: Private Messaging Module Link to this post

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

  • jonm80
    Avatar
    Community Member
    10 Posts

    Re: Private Messaging Module Link to this post

    made some more changes found bugs! lol

    update-
    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

    .privatemessaging{
       width:100%;
       position:relative;
    }
    .pmlinks{
    width:100%;
    display:inline;
    }
    .pmlink{
    width:20%;
    float:left;
    padding-top:10px;
    padding-bottom:10px;
    text-transform:capitalize;
    }
    .pmmessages{
    width:100%;
    float:left;
    clear:left;
    }
    .pmtable{
    width:100%;
    }
    .pmtable tr th{
    background: #111111 url(../images/eve/navbar.png) repeat-x;
    font-size:1.2em;
    font-weight:bold;
    text-transform:capitalize;
    }
    .pmrowodd{
    background: #222222;
    }
    .pmroweven{
    background: #333333;
    }


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

    Attached Files
  • Euphemismus
    Avatar
    Community Member
    82 Posts

    Re: Private Messaging Module Link to this post

    Hi,

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Private Messaging Module Link to this post

    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.

    3908 Views
Page: 1 2 3 4 5
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.