Showing "posts" and "topics" in a forum
3 posters
Page 1 of 1
Showing "posts" and "topics" in a forum
Hello all!
So currently this is what my forum looks like
http://prntscr.com/987j54
I have an edited
template. And I believe the part of code responsible for the upper changes is as follows :
However you can see an error in the screenshot I provided, it says "1 topics" which is grammatically incorrect.
Can someone help me with a javascript code that would make 'posts to post' and 'topics to topic' when their count is 0?
Thanks!
#phpbb3
Forum Link
So currently this is what my forum looks like
http://prntscr.com/987j54
I have an edited
|
- Code:
<dd class="posts">{catrow.forumrow.POSTS} {L_POSTS}</dd>
<dd class="topics">{catrow.forumrow.TOPICS} {L_TOPICS}</dd>
However you can see an error in the screenshot I provided, it says "1 topics" which is grammatically incorrect.
Can someone help me with a javascript code that would make 'posts to post' and 'topics to topic' when their count is 0?
Thanks!
#phpbb3
Forum Link
Last edited by Rhino.Freak on December 8th 2015, 11:03 am; edited 1 time in total
Re: Showing "posts" and "topics" in a forum
Do you want to change last posts, too?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Showing "posts" and "topics" in a forum
No I just want that it says "1 post" and "1 topic" instead of "1 posts" and "1 topics"
Re: Showing "posts" and "topics" in a forum
Hi @Rhino.Freak,
Go to Modules > JavaScript codes management > New
Placement : In all the pages
That should remove the "s" off the end of the texts if the value is equal to 1.
P.S.
Sorry for the late reply.
Go to Modules > JavaScript codes management > New
Placement : In all the pages
- Code:
$(function() {
for (var a = $('.topics, .posts, .views'), i = 0, j = a.length, s; i < j; i++) {
s = a[i].innerHTML;
if (+s.replace(/(\d+).*/, '$1') == 1) {
a[i].innerHTML = s.slice(0, s.length - 1);
}
}
});
That should remove the "s" off the end of the texts if the value is equal to 1.
P.S.
Sorry for the late reply.
Re: Showing "posts" and "topics" in a forum
Thank you so much Works just like how it should!
PS: Don't be sorry, it's not your job but voluntary help and I thank you for helping!
PS: Don't be sorry, it's not your job but voluntary help and I thank you for helping!
Re: Showing "posts" and "topics" in a forum
Topic solved and archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Make (Topics, Posts, and last posts bolder)
» category and posts&topics last posts
» Not showing the year when writing posts in my forum
» I want Forum Widgets on Index only and not Topics/Posts
» New topics and old Topics not showing as viewed
» category and posts&topics last posts
» Not showing the year when writing posts in my forum
» I want Forum Widgets on Index only and not Topics/Posts
» New topics and old Topics not showing as viewed
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum