Closed (fixed)
Project:
Privatemsg
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Dec 2010 at 15:43 UTC
Updated:
1 Feb 2011 at 12:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirNo, there isn't.
I guess the only easy thing would be to load the whole thread and then look at the messages array.
What are you trying to do?
Comment #2
Michsk commentedi want to change some visual things on the last message.
Comment #3
berdirOk, so we're talking about theming :)
I think it would be useful to have the same classes that listings/tables have by default... first/last/even/odd.
Comment #4
Michsk commentedThat would be great yes. But i would also really love to just have a function that returns me if the current $message is the last, just like we do with is_new.
Comment #5
litwol commented@#3 yep. similar to the way core menu items do it. first, menu-item-N, last, etc etc. (even and odd too :) )
Comment #6
berdir#4: That would be enough, but it would actually be more complicated than it sounds, because a single message does not know anything about the thread.
Adding a bunch of CSS classes is much easier, please try the attached patch.
Comment #7
Michsk commentedOk this is a good start. I really need a is_last tough, i need to add some extra content when the message is last. Real html content not only theming. Guess i'll have to wait. But could we make a new issue for the css class to keep things clear?
Comment #8
berdirAll you need to do then is check if one of the classes is "privatemsg-message-last", you should be able to use the following code in privatemsg-view.tpl.php:
Comment #9
Michsk commentedyeh lol, this also just came to me a sec ago. Thanks!
Comment #10
berdirHehe, ok, please report back once you got it working, then I'll commit the patch.
Comment #11
Michsk commentedWill do. Probably today.
Comment #12
berdirDid you have a chance to test this? ;)
Comment #13
BenK commentedSubscribing...
Comment #14
Michsk commentedbit late, but wil do this today. Working on the project at this moment so wil do this also.
Comment #15
Michsk commentedworks like a charm.
Comment #16
berdirCommited.
Also changing issue title and moving to 7.x, will port later.
Comment #17
berdirPorted and commited to 7.x-1.x