Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorbshultz
    • CommentTimeJan 19th 2007 edited
     # 51
    * the date e.g. '2 hours ago' reflects the date of the first message in the exchange, not the most recent

    Change line 42 in PrivateMessages/discussion_grid.php from:
    <td class="MailBoxDate">'.TimeDiff($this->Context, $Discussion->DateCreated).'</td>
    to:
    <td class="MailBoxDate">'.TimeDiff($this->Context, $Discussion->DateLastActive,mktime()).'</td>
    •  
      CommentAuthorSTE7130
    • CommentTimeJan 27th 2007 edited
     # 52
    hm ... i tried to fix the friendly URL Problem
    how can i get a string with this url:
    http://www.coolr.de/extension/?DiscussionID=123&PostBackAction=PrivateMessages&View=Message

    from this:
    $ItemUrl = GetUrl($this->Context->Configuration, 'extension.php',
    '', 'DiscussionID', $Discussion->DiscussionID, '', 'PostBackAction=PrivateMessages&View=Message');
    •  
      CommentAuthorSTE7130
    • CommentTimeJan 27th 2007
     # 53
    HELP ... pllllleaaaaaaaaase! :(
    • CommentAuthorcircuit
    • CommentTimeFeb 2nd 2007
     # 54
    bump...
    •  
      CommentAuthorSTE7130
    • CommentTimeFeb 2nd 2007
     # 55
    this is the only problem what i have with friendly-urls ...

    why no one can help?
    • CommentAuthornecrotic
    • CommentTimeFeb 13th 2007
     # 56
    We have the same issue with the Friendly URLs. A fix would be greatly appreciated as many of our users would like this feature.

    Thanks!
    •  
      CommentAuthorWanderer
    • CommentTimeFeb 13th 2007
     # 57
    It seems there are so many problems associated with Friendly URLs.

    Am I missing something? Is it really that useful an extension that people put up with so many incompatibilities and issues?

    Posted: Wednesday, 14 February 2007 at 11:20AM (AEDT)

  1.  # 58
    circuit
    - WYSIWYG toolbar does not appear


    look at the page url of where the textarea is, and add that page in default.php of ur WYSIWYG.
    it should look like this
    if ( in_array($Context->SelfUrl, array("post.php", "comments.php")) )
    •  
      CommentAuthor[-Stash-]
    • CommentTimeFeb 14th 2007
     # 59
    FriendlyURLs is useful from an SEO and simply a human readability point of view.

    Also, it's not really an extension, but a core feature IMO since it's bundled with the main download and enabled in a different way to every other extension out there. I think the incompatibility comes from extension authors not testing with both FriendlyURLs turned on and turned off. Either that, or the MOD_REWRITE rules in FriendlyURLs don't encompass everything that extensions can do by default? Certainly FriendlyURLs is a feature that is very attractive to a large number of people.
    • CommentAuthorreap
    • CommentTimeFeb 14th 2007
     # 60
    Hmm it's not sending emails saying a PM has been sent.

    Cool ext - hope an update rolls through soon :)
    • CommentAuthornecrotic
    • CommentTimeFeb 14th 2007 edited
     # 61
    Something I'd like to see until the Friendly URLs is made more "extension friendly" is a way to disable it using a parameter in GetUrl(). Extensions like this don't neeed Friendly URLs outside of aesthetics.
    • CommentAuthorbshultz
    • CommentTimeFeb 14th 2007
     # 62
    I've been tinkering with this extension and may have solved a few problems. I do have an important usability question, however... Which messages should actually be in the Inbox? Or more specifically, which of the following is the expected behavior:

    A. New messages come to you in the Inbox. Responding keeps the discussion in the Inbox.
    B. New messages come to you in the Inbox. Responding moves the discussion to the Sent Mail folder.
    • CommentAuthornecrotic
    • CommentTimeFeb 15th 2007
     # 63
    I think Option A would work best. It's what most people would expect. Also, if you send a message and it's responded too it should be in the "Inbox," too, so they can find it easier.

    If you figure out a way to have it show "Sent" messages in the Sent Mail folder as well as the corresponding discussion in the "Inbox" that would be killer.
    • CommentAuthorbshultz
    • CommentTimeFeb 15th 2007
     # 64
    I figured "A" was best, but I've never really used any forum's PM system. That said, my users really, really want this feature.

    I think I have the Inbox query worked out, but the real problem is keeping the messages in the Sent Mail folder. As I see it, there are two fields to play with: AuthUserID and LastUserID.

    AuthUserID of course, is who initiated the discussion, so no problem assigning those posts to the Sent Mail folder. So what *is* the problem? Say a user responds, but didn't start the discussion... If they're the last commenter, no worries, as we can easily query that field, but what if they're somewhere in the middle? That, I have no idea how to find.
    • CommentAuthorbshultz
    • CommentTimeFeb 16th 2007
     # 65
    I think I have in Inbox/Sent Mail boxes working as described above. I would appreciate if someone could help test, substituting the two below functions in place of the originals in PrivateMessages/default.php:

    function GetDiscussionCount($View) {
    $TotalNumberOfRecords = 0;
    $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
    $s->SetMainTable('Discussion', 't');
    // MINOR KLUDGE: There's not apparent way w/ SqlBuilder to add 'DISTINCT' within
    // the MySQL function Count(). It works just fine, but breaks the rules a bit.
    $s->AddSelect('DISTINCT t.DiscussionID', '', 'Count', 'count');
    $s->AddWhere('t', 'Active', '', '1', '=');
    $s->AddWhere('t', 'CategoryID', '', $this->CategoryID, '=');
    if ($View == 'Inbox') {
    // Count discussions in the Inbox when they are addressed directly to you.
    $s->AddWhere('t', 'WhisperUserID', '', $this->UserID, '=', 'and', '', 1, 1);
    // Count discussions in the Inbox that *you* have sent, but only after one or
    // more reply has been made. This may or may not be how you want
    //this to work.
    $s->AddWhere('t', 'CountComments', '', 1, '>', 'or', '', 1, 1);
    $s->AddWhere('t', 'AuthUserID', '', $this->UserID, '=', 'and');
    $s->EndWhereGroup();
    $s->EndWhereGroup();
    } else {
    // Add join to access all users who have contributed to a discussion.
    // Trying work this with AuthUserID or LastUserId just doesn't cut it.
    $s->AddJoin('Comment', 'co', 'DiscussionID', 't', 'DiscussionID', 'join');
    $s->AddWhere('co', 'AuthUserID', '', $this->UserID, '=');
    }
    $result = $this->Context->Database->Select($s, $this->Name, 'GetDiscussionCount', 'An error occurred while retrieving Discussion information.');
    while ($rows = $this->Context->Database->GetRow($result)) {
    $TotalNumberOfRecords = $rows['Count'];
    }
    return $TotalNumberOfRecords;
    }
    function GetDiscussionList($RowsPerPage, $CurrentPage, $View) {
    $TotalNumberOfRecords = 0;
    if ($RowsPerPage > 0) {
    $CurrentPage = ForceInt($CurrentPage, 1);
    if ($CurrentPage < 1) $CurrentPage == 1;
    $RowsPerPage = ForceInt($RowsPerPage, 50);
    $FirstRecord = ($CurrentPage * $RowsPerPage) - $RowsPerPage;
    }
    $s = $this->GetDiscussionBuilder();
    $s->AddJoin('Comment', 'm', 'CommentID', 't', 'FirstCommentID', 'join');
    $s->AddSelect('Body', 'm');
    $s->AddWhere('t', 'Active', '', '1', '=');
    $s->AddWhere('t', 'CategoryID', '', $this->CategoryID, '=');
    if ($View == 'Inbox') {
    // Display discussions in the Inbox when they are addressed directly to you.
    $s->AddWhere('t', 'WhisperUserID', '', $this->UserID, '=', 'and', '', 1, 1);
    // Display discussions in the Inbox that *you* have sent, but only after one or
    // more reply has been made. This may or may not be how you want
    //this to work.
    $s->AddWhere('t', 'CountComments', '', 1, '>', 'or', '', 1, 1);
    $s->AddWhere('t', 'AuthUserID', '', $this->UserID, '=', 'and');
    $s->EndWhereGroup();
    $s->EndWhereGroup();
    } else {
    // Add join to access all users who have contributed to a discussion.
    // Trying work this with AuthUserID or LastUserId just doesn't cut it.
    $s->AddJoin('Comment', 'co', 'DiscussionID', 't', 'DiscussionID', 'join');
    $s->AddWhere('co', 'AuthUserID', '', $this->UserID, '=');
    }
    $s->AddOrderBy('DateLastActive', 't', 'desc');
    if ($RowsPerPage > 0) $s->AddLimit($FirstRecord, $RowsPerPage);
    return $this->Context->Database->Select($s, $this->Name, 'GetDiscussionList', 'An error occurred while retrieving discussions.');
    }


    Another issue to keep in mind:
    By default, this extension allows you to PM yourself. This throws in all sorts of problems with counting and sorting. For clarity, I added a bit of code to put a stop to that.

    Up top at the end of the $Context->Dictionary definitions, add something along the lines of:
    $Context->Dictionary['ErrNoWhisperToSelf'] = 'You cannot send a Private Message to yourself. Please choose a valid recipient.';

    In function PrivateMessageForm, change:
    if (ForceIncomingString('WhisperUsername', '') == '') {
    $ResultDiscussion = false;
    $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrWhisperUsernameMandatory'));
    } else {
    $ResultDiscussion = $dm->SaveDiscussion($this->Discussion);
    }

    To:
    if (ForceIncomingString('WhisperUsername', '') == '') {
    $ResultDiscussion = false;
    $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrWhisperUsernameMandatory'));
    } elseif(ForceIncomingString('WhisperUsername', '') == $this->Context->Session->User->Name) {
    $ResultDiscussion = false;
    $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrNoWhisperToSelf'));
    } else {
    $ResultDiscussion = $dm->SaveDiscussion($this->Discussion);
    }
    •  
      CommentAuthor[-Stash-]
    • CommentTimeFeb 16th 2007
     # 66
    To make life easier on other people testing this, it might be worth packaging up everything you've done into a ZIP file for people to download? Not everyone that's happy to test is happy to hack in new code ;) Just a friendly suggestion.

    If things work out then a diff can always be made by various means to integrate the changes into the main package.
    • CommentAuthormahodder
    • CommentTimeFeb 16th 2007
     # 67
    @bshultz: Nice work! I added all your changes and it works great. Now if you could just fix the e-mail notifys not sending you would be my hero, lol.
    • CommentAuthormahodder
    • CommentTimeFeb 16th 2007
     # 68
    Oh Private messages will work fine with the option: "Enable Whispers" unchecked under your forum settings, but it will not send out e-mails when you get new messages unless this box is checked! Didn't know that, everything works great now with a little hacking from bshultz ;)
    • CommentAuthorbshultz
    • CommentTimeFeb 19th 2007 edited
     # 69
    Ok, still tinkering with this because it's an extension I *really* need. There's a few more issues to fix and then I'll release a zip of my modified files. Of the list of bugs and feature requests posted up-thread (plus some of my own), here's the status:

    Fixed:
    email notification
    a reply to a sent message does not count towards the message count in the inbox
    the inbox shows sent messages
    the date e.g. '2 hours ago' reflects the date of the first message in the exchange, not the most recent
    folder message counts
    WYSIWYG toolbar does not appear

    Done:
    req: friendly URLs compatibility
    req: unread message count on the tab
    req: notification on the discussion list of a new PM

    Unresolved:
    req: ability to delete messages (**No idea how to handle this)

    Unknown:
    senders of messages are not shown in the inbox/outbox lists
    • CommentAuthoralani
    • CommentTimeFeb 20th 2007
     # 70
    hi bshultz,

    Have tried your patches, they work great. Thanks.

    In GetDiscussionList you have a line

    $s->AddJoin('Comment', 'm', 'CommentID', 't', 'FirstCommentID', 'join');

    can this be changed to

    $s->AddJoin('Comment', 'm', 'CommentID', 't', 'FirstCommentID', 'left join');

    I have a host with a very old Mysql 3.23.xx and this line gave me an SQL Syntax
    error. With left join it seems to work fine too.

    thx,

    alani
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 71
    Bschultz, we are very much looking forward to your .zip file :)
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 72
    Also, if you could wrap your fixes thus far, that would be great. However, if you can't that's also fine, thanks for any changes.
    • CommentAuthorbshultz
    • CommentTimeFeb 20th 2007 edited
     # 73
    @alani: Thanks.

    My modified version of the Private Messages extension can be found here:
    http://www.sendspace.com/file/q0vl9j
    http://www.sendspace.com/file/qpyzi6 (updated)

    Notes:
    1. Feedback/Bugs
    I tested the modified code on a fresh Vanilla install (along with the following extensions: Wordpress Integration, BetterBBCode, BBInsertBar, Post Preview) and have Private Messages working as expected. Of course, what works for one person may well fly into a billion pieces for others. That in mind, please let me know if you find bugs or have feedback.

    2. WYSIWYG Toolbar, et.al.
    Extensions such as the BBInsertBar and Preview Post will now work as expected with one important caveat: you must modify the desired extensions' default.php to make it aware of Private Messages.

    To give an example, with the BBInsertBar, I changed the following line from:
    if (in_array($Context->SelfUrl, array("post.php", "comments.php")){
    To:
    if (in_array($Context->SelfUrl, array("post.php", "comments.php"))
    || ($Context->SelfUrl == 'extension.php' && ForceIncomingString('PostBackAction', '') == 'PrivateMessages')){


    3. Friendly URLs
    My fix for Friendly URLs might not please everyone. I would have preferred formatting URLs as such: http://some.host/extension/PrivateMessages/19/Message
    Due to the way URLs are formed via GetUrl(), however, I had to push everything into the query string: http://some.host/extension/?PostBackAction=PrivateMessages&DiscussionID=19&View=Message
    Since SEO is not a concern in this case (these are private messages after all), I hope this is acceptable to most.
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 74
    Found a bug.... on the Extensions page (and maybe the rest, I dunno) the "Send Private Message" button is not below the start a discussion button, it is below the settings.
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 75
    Also, does this fix the Inbox tab display issue?

    At any rate, thanks :) !
    • CommentAuthorbshultz
    • CommentTimeFeb 20th 2007
     # 76
    @birdmanx35: I found the "Send Private Message" button to be misplaced on the Account page. Everywhere else seemed to render as expected. Should be fixed now.

    Updated zip:
    http://www.sendspace.com/file/qpyzi6

    Also: what is the Inbox tab display issue?
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 77
    Thanks for the update, your work is much appreciated.

    Earlier in the discussion, Jazzman mentioned that the tab did not display Inbox (1) or some such if there was a new message... And you said you fixed this. However I have not received any new messages so I can't know if you added this...

    I have two other feature requests, both of which I think should be easy...

    1) If you fixed the Inbox tab display, could you mimic this on the panel, so that if there were new messages it would say so in the Private Messages block?
    2) How does one integrate TinyMCE and Private Messages? I didn't understand your BBInsertbar comments so I can't possibly convert to TinyMCE.

    Again, many thanks!
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 20th 2007
     # 78
    Refound the bug... except my Vanilla install is now very slow, don't know if the new PM is related or not.

    The bug is showing up on all settings pages for me, but is no longer on the Account Page. BTW, the server's back, no worries.
    • CommentAuthornecrotic
    • CommentTimeFeb 20th 2007
     # 79
    bshultz, thanks for fixing this extension. It works like a charm now!
    • CommentAuthorcircuit
    • CommentTimeFeb 21st 2007
     # 80
    unfortunately the CSS seems messed up in IE6 and leaves a large gap above the PM list. otherwise it works like a dream. thank you bshultz.
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 21st 2007
     # 81
    Perhaps we could salvage some of the old CSS to fix that? IE6 is unfortunately still quite prevalent..
    • CommentAuthorcircuit
    • CommentTimeFeb 26th 2007
     # 82
    the css issue is the same as the one in the audioscrobbler extension. so a fix for one would probably fix both.
    • CommentAuthormorphcore
    • CommentTimeFeb 26th 2007
     # 83
    okay i haven't read the whole thread by now, but i'm using this extension now for a few weeks.

    some of the main problems i recognized are:
    - cannot delete or edit private messages
    - no compatibility with BBInsertBar, EditInPlace, BetterBBCode, Htmlformatter & PreviewPost

    features i would like to have:
    - new message notification on the discussion/categories page


    thanks for this great extension although.
    • CommentAuthorbshultz
    • CommentTimeFeb 26th 2007 edited
     # 84
    @morphcore:
    See my above posts for items 2 &3.
    •  
      CommentAuthorJazzman
    • CommentTimeFeb 27th 2007
     # 85
    Hello bshultz!!

    Thanks for your work on Private Messages!! I've been away from the community for a while because of other work things. I'm glad you have resolved a few issues and I'd like to update the extension in the add-ons repository with your version if permitted. Can you send me the latest version you're using? My email address is: mkrijtenberg@gmail.com

    Jazzman
    • CommentAuthormorphcore
    • CommentTimeFeb 27th 2007 edited
     # 86
    hey bshultz and jazzman,

    thank you for your great work by now, but there are few problems i still have.
    i don't like that the private message menu always shows up on the mainpage
    when the new version is installed. it looks a bit, hmm disturbing.
    editing and deleting messages still won't work.
    perhaps you're able to fix this or tell me how i can do this, cause i'm a noob! ;)

    thank you for hard working on this extension i think this will be one of the
    best vanilla-extensions ever soon!
    • CommentAuthorbirdmanx35
    • CommentTimeFeb 27th 2007
     # 87
    Still a lot of work to do, but nice job.

    My #1 request is that the tab at the top change if you have new messages - like Inbox -> Inbox (1).
    • CommentAuthorquickguap
    • CommentTimeFeb 28th 2007
     # 88
    I can't remember if this is the right place i wanted to post this, but.. oh well..



    I'm not sure what values you need since you weren't very clear. But if you need to extract information for the url. you can do this...


    <?php
    $remote_uri = '/extension/?DiscussionID=123&PostBackAction=PrivateMessages&View=Message'; //$_SERVER['REQUEST_URI'];
    $remote_uri = str_replace('/','',$remote_uri);
    $remote_uri_split = array('?','&');
    $remote_uri = str_replace($remote_uri_split,',',$remote_uri);
    $remote_uri = explode(',',$remote_uri);
    echo '<pre>';
    print_r($remote_uri);
    echo '</pre>';
    ?>


    will output:

    Array
    (
    [0] => extension
    [1] => DiscussionID=123
    [2] => PostBackAction=PrivateMessages
    [3] => View=Message
    )


    and you can ofcourse continue the manipulation to go even further.

    or...


    $url = 'http://www.coolr.de'.str_replace('.php','',$_SERVER['SCRIPT_NAME']).'/?DiscussionID'.$Discussion->DiscussionID.'/PostBackAction=PrivateMessages&View=Message';


    based on what little information you provided those are two, kinda sorta ways to do it.

    just let me know exactly what information you need, from what, and where your trying to send it, and i can code you something up pretty quick
    • CommentAuthorcircuit
    • CommentTimeFeb 28th 2007
     # 89
    one comment:

    the username field is not long enough for some of my users' login names. (i use wordpress integration; wordpress does not limit your login name length). i think the length restriction could be removed safely on this field.

    one question:

    if you send a message, it appears as unread in your sent mail. if you then read this message in your sent mail, does the other recipient see it as read? or is it still an unread message for them? i just wanted to check.
    •  
      CommentAuthorrayk
    • CommentTimeFeb 28th 2007
     # 90
    Is it possible to add quick pm functionality (like quick whisper plugin) ?
    • CommentAuthornolefan
    • CommentTimeMar 1st 2007
     # 91
    I'm getting ready to install this extension but I'm not quite sure which is the most recent/stable version?
  2.  # 92
    Get the most recent version and change to BSchultz's code.
    •  
      CommentAuthor[-Stash-]
    • CommentTimeMar 1st 2007
     # 93
    Or wait until Jazzman releases the next official version with the updates in it :)
    • CommentAuthormorphcore
    • CommentTimeMar 1st 2007
     # 94
    that's what i will do....waiting for jazz, man. ;)
    • CommentAuthorcircuit
    • CommentTimeMar 1st 2007
     # 95
    i got the working version from the link above.

    http://www.sendspace.com/file/qpyzi6
    • CommentAuthornolefan
    • CommentTimeMar 1st 2007
     # 96
    I'll wait for Jazzman to repackage it... maybe we'll have a few easter eggs
    • CommentAuthorjehul
    • CommentTimeMar 9th 2007
     # 97
    hi!

    i just added the delete message feature to bschultz's
    (actually it just hides the discussion for this user)

    if someone want to test it i will upload the new files.
    •  
      CommentAuthorsjeeps
    • CommentTimeMar 9th 2007
     # 98
    Hi jehul

    Delete message sounds like a nice feature and I'd like to test it.
    Thanks
  3.  # 99
    Ideally, it would delete messages... but beggars can't be choosers.
    • CommentAuthorjehul
    • CommentTimeMar 10th 2007 edited
     # 100
    hi!

    i uploaded it here:
    http://www.sendspace.com/file/r2jw6t
    the translations in the top of default.php are in german, just copy them from bschultz if you wish it in english...

    my changelog:
    - Delete Message added (it hides them)
    - All Users are shown with realnames, no usernames should be visible (needed for my forum)
    - on new message to a user the input field "to user" gets disabled and shows the realname instead

    birdmax35:
    maybe if both user delete (hide) the discussion it could be deleted instead.

    regards, Jehul

    edit: i forgot to post the mysql statement for the hide-table:

    CREATE TABLE `LUM_UserDiscussionHide` (
    `UserID` int(10) NOT NULL default '0',
    `DiscussionID` int(8) NOT NULL default '0',
    PRIMARY KEY (`UserID`,`DiscussionID`)
    );