hey guys. regardless of all the fixes, the massive bug in this extension remains. i would suggest there is not much point patching and repatching a PM extension which is not actually 'private'.
Best to make a table with the columns of 'to' 'from' 'message' 'date_sent' 'read_status' and have this be what drives private messages. Delete function would physically delete the entry from the table.
I'm not sure how you'd integrate it with the current vanilla, nor am I sure how well it perform as the table grows in size... I imagine when you have 400 users, and some sending 10 to 20 messages a day, you will see degradation in performance and very large query sizes as the data has to be sorted all the time.
I guess if your pro-active you can have two tables, one for the inbox and one for outbox, and each sorts it as entries are added...
I've made a small patch to my forum to fix the "not really private" bug. I haven't thought this through, or tested it extensively, so I would appreciate some feedback. In extensions/PrivateMessages/default.php I changed the GetDiscussionByID() function around line 112. After
$s->AddWhere('t', 'DiscussionID', '', $DiscussionID, '=');
I added:
// temp fix for PM so only sender or receiver can see message
$s->AddWhere('t', 'AuthUserID', '', $this->UserID, '=','and','','',1);
$s->AddWhere('t', 'WhisperUserID', '', $this->UserID, '=','or');
$s->EndWhereGroup();
Basically to check if the currently logged in user is either the sender or the receiver of the message.
This causes one set of warning messages further down the page if someone is viewing the message that shouldn't be. Around line 414 (418 after adding the above four lines) there are a bunch of $this->pl statements. I just wrapped them all inside of
if ($this->Discussion) {
$this->pl...
$this->pl...
....
}
So those lines only process if there is a valid discussion (private message). Let me know if this works for anyone else or what other problems I might be missing.
Thanks.
Mike
I added mcargian fix (to pm 1.1 with all the bug)
http://code.google.com/p/vanilla-friends/source/detail?r=370
Can someone test it?
http://dl.getdropbox.com/u/83967/vanilla/PrivateMessages-1.2.beta.zip
anyone tested this yet? Also Dinoboff can you fork the development and upload this to the add-ons (mind you this versio breaks with 1.15 still correct?)
@scherem: I can't do that (Minisweeper and Mark can). However there is still nobody do manage this addon and there are still lots of patch to apply, so I don't really see the point.
will there be any more developement on that add-on?
Tried it and have the same problem als pipsnip and, like dinoboff said - all the links with developed versions are broken.
Has somebody of you a version that works - so please load them up, thanks
Hello to everyone!
I've issued some problems with this great add-on till now and those are:
1. The forum alert system on new message doesn't work properly. I will get this type of notification in just two cases:
a) When someone is replying to my discussion (I started it).
b) When someone is replaying to my comment in his/her discussion.
But, if someone sends me a message for the very first time (starting a whole new discussion), there will be no forum notification about that.
In that case I will get notification for the second, third... message only if I read this private discussion before (it is not important if I just read it or replay as well).
But for the unread discussions and comments within them there is no notification.
2. The email alert system on new message works properly in every case with no interaction with the first one system.
Also, could it be possible that main page shows up all private discussion (those that I started and those that my companion started as well, even if there are discussions with my commenst only / these right now appear only in SentMail section)?
These two types of private discussion maight be separated by different row colors (exp. blue and green) and they could be filtered by two Panel links:
Inbox - shows only those discussions (and included messages) that other person started.
SentMail - shows only those discussions (and included messages) that I started.
Thank you!
P.S.
I am talking about this function right here:
function GetNewMessagesCount() {
$TotalNumberOfRecords = 0;
$s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
$s->SetMainTable('Discussion', 't');
$s->AddSelect('DiscussionID', 't', 'Count', 'count');
$s->AddJoin('UserDiscussionWatch', 'utw', 'DiscussionID', 't', 'DiscussionID', 'left join', ' and utw.'.$this->Context->DatabaseColumns['UserDiscussionWatch']['UserID'].' = '.$this->UserID);
$s->AddWhere('utw', 'CountComments', 't', 'CountComments', '<', 'and', '', 0);
$s->AddWhere('t', 'Active', '', '1', '=');
$s->AddWhere('t', 'CategoryID', '', $this->CategoryID, '=');
$s->AddWhere('t', 'WhisperUserID', '', $this->UserID, '=', 'and', '', 1, 1);
$s->AddWhere('t', 'AuthUserID', '', $this->UserID, '=', 'or');
$s->EndWhereGroup();
$Result = $this->Context->Database->Select($s, $this->Name, 'GetNewMessagesCount', 'An error occurred while attempting to retrieve PM information.');
while ($Row = $this->Context->Database->GetRow($Result)) {
$TotalNumberOfRecords = $Row['Count'];
}
return $TotalNumberOfRecords;
}
umm, is there anything specific one must do to enable the new message notification? is it supposed to automatically relabel the page title? cause its not.
Hi,
I've tried this ( http://dl.getdropbox.com/u/83967/vanilla/PrivateMessages-1.2.beta.zip ) version of the extension and I can't make it delete old private messages. Is there any way to let users do that?
Thanks
Comments
I'm not sure how you'd integrate it with the current vanilla, nor am I sure how well it perform as the table grows in size... I imagine when you have 400 users, and some sending 10 to 20 messages a day, you will see degradation in performance and very large query sizes as the data has to be sorted all the time.
I guess if your pro-active you can have two tables, one for the inbox and one for outbox, and each sorts it as entries are added...
1) add this to the definitions part:
$Context->SetDefinition('ReceiveNewPrivateMessage', 'You have a new private message');
2) then, search for 'Menu' and change it like this:
// Menu control isn't available in People if (isset($Menu)) { $PrivateMessages = $Context->ObjectFactory->NewContextObject($Context, 'PrivateMessages'); $NewMessages = $PrivateMessages->GetNewMessagesCount(); $TabName = $Context->GetDefinition('PrivateMessagesTab').(($NewMessages >0) ? ' ('. $NewMessages.')' : ''); $Menu->AddTab($TabName, 'privatemessages', GetUrl($Configuration, 'extension.php', '', '', '', '', 'PostBackAction=PrivateMessages'), '', $Configuration['TAB_POSITION_PRIVATE_MESSAGES']); if($NewMessages >0) { $fmt = $Context->GetDefinition('YouHaveNewPrivateMessages'); $NoticeCollector->AddNotice(sprintf("<a href='".GetUrl($Configuration, 'extension.php', '', '', '', '', 'PostBackAction=PrivateMessages')."'>".$fmt."</a>", $NewMessages)); } }
voila!
now, does anybody have the version that allows messages deletion?
thanks
is it supposed to automatically relabel the page title? cause its not.
Hello,
sorry to reopen this very old post, this is a very useful plugin, is there any way to port it for Vanilla 2?
Best regards.
conversations=private messages
whisper in v2 (beta), are conversations linked to discussions. You have the best of both worlds.
grep is your friend.
hello, sorry but I don't understand what are you talking about,
private messages already exist in v2
grep is your friend.
oh, I see,
yes I knowt but only inbox folder, I mean it could be interesting also a sentbox folder, like the plugin in this discussion
how is that easier to follow, than a thread? Conversations has limitations but that isn't one of them.
grep is your friend.