Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Unique Style for Discussion Starter
Hey guys, just a few weeks back I posted a discussion regarding styling the first post of a discussion - CSS Styling the first post.
While still in the design stages for my forum, I had an idea but not sure if it's possible to implement, and if it is, how? Basically I'd like it so that for each discussion, the member who starts the discussion to have a unique first post style, for example a light red background or something along those lines, nothing overly complicated. For every other post in the discussion, the normal style would apply. However, whenever the original discussion starter makes another post within the discussion, I would like it for the original first post style to apply. I'm not really sure whether my description's clear enough to understand but I can provide basic mockups to show what I mean if required.
As far as I know, theoretically, a check would have to be made to see whether the poster id is equal to the id of the member who started the discussion. If true, then that style applies, else default style would show. I'm not much of a programmer so I have no idea where to start or anything, but I'm pretty fluent with the client-side end of things. It's just that if PHP is involved, I can work my way around with no problems at all, I just can't hand code myself as well as I'd like to haha!
Looking forward to seeing what you guys have in mind about this sort of idea and if anyone could guide me on how I can achieve this. Many thanks in advance.
While still in the design stages for my forum, I had an idea but not sure if it's possible to implement, and if it is, how? Basically I'd like it so that for each discussion, the member who starts the discussion to have a unique first post style, for example a light red background or something along those lines, nothing overly complicated. For every other post in the discussion, the normal style would apply. However, whenever the original discussion starter makes another post within the discussion, I would like it for the original first post style to apply. I'm not really sure whether my description's clear enough to understand but I can provide basic mockups to show what I mean if required.
As far as I know, theoretically, a check would have to be made to see whether the poster id is equal to the id of the member who started the discussion. If true, then that style applies, else default style would show. I'm not much of a programmer so I have no idea where to start or anything, but I'm pretty fluent with the client-side end of things. It's just that if PHP is involved, I can work my way around with no problems at all, I just can't hand code myself as well as I'd like to haha!
Looking forward to seeing what you guys have in mind about this sort of idea and if anyone could guide me on how I can achieve this. Many thanks in advance.
0
This discussion has been closed.
Comments
- You write a delegate function (CommentGrid, PostCommentOptionsRender) that uses some sort of string function (str_replace(), probably) to add a css class to the first comment, as determined by the $RowNumber delegate parameter comment. This has the advantage that admins just need to enable the extension and go.
- You write a new theme file does the same function as above. Doing this would probably be easier and more efficient, wouldn't necessarily be compatible with all themes.
- You write some sort of javascript that changes the DOM, but I'm not great with javascript, so I can't help you there.
EDIT: I really should read the post fully before responding.Here's what you do: Write either a delegate function or a new theme file that checks $Comment->AuthUserID with $CommentGrid->Discussion->AuthUserID. If they are the same, add a css class as outlined above.