Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Could be able this Module display the sender's name as an option? It could be usefull, I think.
Comment | File | Size | Author |
---|---|---|---|
#26 | before.jpg | 23.69 KB | gorgo |
#26 | after.jpg | 24.38 KB | gorgo |
#22 | use_theme_functions.patch | 7.52 KB | Berdir |
#8 | pmgrowl.patch | 7.47 KB | gwen |
#7 | jgrowl-example.png | 15.67 KB | George2 |
Comments
Comment #1
Dave.Ingram CreditAttribution: Dave.Ingram commentedI had that thought as well at one point. Currently it shows the subject of the message and then the first part of the body of the message (or the whole thing, if that's short enough.) What would make the most sense to you? to show the Name and Body? or the Name and Subject? ...I think all three might get a bit too cluttered.
Comment #2
rajo CreditAttribution: rajo commentedMy priorities:
Name and Subject and Body
Name and Body
Subject and Body
Name and Subject
In any case, it's Great module.
Comment #3
igorik CreditAttribution: igorik commentedHi, i subscribe this, i am missing sender's name. Maybe there could be in module settings checkboxes where admin check which informations he want's to show in pgrowl.
Comment #4
Dave.Ingram CreditAttribution: Dave.Ingram commentedWhat makes the most sense here is that we add token support to the subject and message string, making sure tokens are available for sender's name, message, subject, maybe receiver's name as well, then everyone can customize the output exactly as they see fit. I won't have time to work on this immediately, but I'd like to see this feature get in, so if anyone would like to take this on and submit a patch, then I'll gladly review it. Otherwise, I'll work on this as soon as I can free up some time.
Comment #5
George2 CreditAttribution: George2 commentedwell, realname may add a real name token. not tested. however, after discussion with dave, if privatemsg could add tokens, then it would make this so much easier, and much more future compatible with other modules:
http://drupal.org/node/511796
Comment #6
George2 CreditAttribution: George2 commentedalso, by not doing "select *" in the _json db query, and instead just grabbing the messageid (mid), and then using _privatemsg_load, a whole load of user data, and message data is available for processing... working on a solution atm
Comment #7
George2 CreditAttribution: George2 commentedok, so this is an example of what i've knocked together. i've added two theme functions, one for the alert subject, and one for the alert body.
in this example the subject doesn't have the message subject, but just a string, and the user name, and the body has the avatar, and a trimmed message body. of course user pictures have to be enabled and imagecache enabled. so, either options could be added to pmgrowl to enable the avatar and what imagecache preset to use, or a basic body template function can be provided, with a note of an example template function override in the docs.
no tokens, but template functions you can override. think it's good enough? it's workable with some css magic!
here are the template functions:
i guess that's going to be easy to work with!
Comment #8
gwen CreditAttribution: gwen commentedI wanted similar functionality to this and liked George2's approach, so attached is a patch expanding the work from the comments above. In addition to the 2 modified theme functions:
* setting to make user picture optional
* setting to choose which imagecache size to use for pics
* theme functions for the 'new message' subject and body
* simple css file
My work was against privatemsg version 6.x-1.0-rc2. From George2's comments, it sounds like things may have changed from an earlier version b/c I found that _privatemsg_load() did not return any extra information useful for themeing. I instead grabbed the relevant user info by doing a user_load() using the message author's uid.
Comment #9
pheraph CreditAttribution: pheraph commentedAny chance to port the patch to the latest version?
Comment #10
Witch CreditAttribution: Witch commentedhi gwen, i will test your patch right now :)
Comment #11
Witch CreditAttribution: Witch commentedgwen, your patch is awesome. Everything works fine. great work. Thank you for this.
Did you already look on this issue? Maybe you can solve this! http://drupal.org/node/573906
Comment #12
Dave.Ingram CreditAttribution: Dave.Ingram commentedHi everyone, sorry to be gone for so long.. who all has tested this patch? can it be considered RTBC? George2, have you tried the latest patch?
Thanks again everyone.
Comment #13
MichaelP CreditAttribution: MichaelP commentedNice module, nice patch! Just installed, will report back on testing issues.
Thanks all.
Comment #14
Babalu CreditAttribution: Babalu commentedpatch works great
but when i'm not check my settings after patching it shows me null null in the message notification
Comment #15
Witch CreditAttribution: Witch commentedWill this patch ever be commited? I used in further versions and it worked very great but now i have to upgrade to latest version.
Any ideas how to get imagecache presets into to latest version?
Greetings
Comment #16
Tamela CreditAttribution: Tamela commentedWas this added to the most recent version? I could really use this. The messaging become so confusing if you have more than one person sending you a message at one time because you can't tell who it's from.
I've never been able to patch so I'm eagerly waiting for it to be in an updated version.
Thanks!
Comment #17
doitDave CreditAttribution: doitDave commentedHey, that patch committed would be a good base for some further extensions I have now added for my "home use". Shouldn't it be released after now more than a year? :-)
Comment #18
BerdirBecause the patch doesn't apply anymore. Help to re-roll is welcome.
We should probably rework this part and use privatemsg_message_load_multiple() to load all messages and then just call the theme functions on it. This also means that the query can be simplified a bit to only return mid's.
This needs to be updated to use the correct format for that message. Note that the current code does that already, but in a different place.
The whole thing should be updated to use privatemsg_message_load_multiple() so that all information of the message is available to the theme function. Also, the query function can the be simplified to use return message id's.
Needs an ending point (same for other theme functions)
Note that privatemsg now supports different formats, this function must use the correct one. Note that the current code in pmgrowl_json() already does this, the code can be taken from there.
This should use theme('username', $author) (and !user instead of @user) so that it works together with realname.module.
This can easily be written in a single line :)
This should use format_plural() to provide a version for single and multiple new messages. Also, it is common for such strings to use something like unread messages" to provide a bit more context to the person that is translating this and make it possible to translate it into RTL languages.
Powered by Dreditor.
Comment #19
BerdirComment #20
YK85 CreditAttribution: YK85 commentedsubscribing
Comment #21
gorgo CreditAttribution: gorgo commentedDoes anybody have a working patch for version 2.x?
Comment #22
BerdirAttaching a revised patch for 6.x-2.x-dev.
Fixes the issues I mentioned above and also uses improved strings and makes the author clickable.
Please test, especially the imagecache part, I don't have that configured locally.
Comment #23
gorgo CreditAttribution: gorgo commentedThanks Berdir!
The patch DOES work for me.
There was one minor problem, that the image goes beyond the black notification area. I easily fixed it by adding this to the new css file:
.pmgrowl-body {
overflow:hidden;
}
I don't know how to write patches myself (yet) so not sure how to add this to your patch.
apart from that it seems to work as expected...
Comment #24
BerdirThanks for testing!
Can you provide a before/after screenshot with your change?
Comment #25
BerdirOh, and regarding patch creation, see http://drupal.org/patch/create. But don't worry, I'll include it in the patch myself...
Comment #26
gorgo CreditAttribution: gorgo commentedSure man!
Pics attached, and thanks for the link. it's about time i learn how to deal with patches properly. still applying them manually...
Comment #27
BerdirCommited to 6.x-1.x and 6.x-2.x.
Will port to 7.x-1.x soon.
Comment #28
BerdirPorted to 7.x. Note that it needs #1021564: Allow to set image style when using theme('user_picture') for the image style selector to work in Drupal 7.
Comment #29
Berdir