Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[2.2.4] Need some help replacing 'new' comment counter
Zhaan
✭✭
Hi again, VF! So, I want to replace the "x new" comment counter with an icon (font awesome, probably).. but I haven't figured out how to do it yet. I think it's somewhere in views/discussions/.
Just to be clear, I'm only talking about the "NEW" comment counter, and not the one for total comments.
Could you give me some directions?
Thanks!
0
Best Answer
-
hgtonight MVP
You could either override the
NewComments()
function in/applications/vanilla/views/discussions/helper_functions.php
to display your icon.Or you could use some locale definitions for
'%s new'
and'%s new plural'
like so:$Definition['%s new'] = '<span class="IconClass"> <span>'; $Definition['%s new plural'] = '<span class="IconClass"> <span>';
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
3
Answers
You could either override the
NewComments()
function in/applications/vanilla/views/discussions/helper_functions.php
to display your icon.Or you could use some locale definitions for
'%s new'
and'%s new plural'
like so:Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks, I'll try both.
Your suggestions worked perfectly, but I'd like to move the icon all the way to the left as well, right next to the discussion titles. Any clue how to do that?
I don't know much PHP so I'm not sure how to do this.
perhaps if you post what you did. both or either or.
float the class and tag and/or use positioning on the class tag in your css.
http://www.w3schools.com/css/css_float.asp
http://www.w3schools.com/css/css_positioning.asp
http://alistapart.com/article/css-positioning-101
or hide the originals. and create a plugin to display the icons on a different trigger event.
see wiki for events.
or get @vrijvlinder to make a house call.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I used helper_functions.php, but setting css float to left doesn't seem to do anything. How can I move the 'new' part out of the meta area entirely?
I don't know your theme or the tag you are trying to identify. but as an example
and these definitions may apply as well
or e.g.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
in my theme this is the line I used to move that. This only serves as an example, as peregrine says, I don't have a way of testing this unless I have a link to see it.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌