EXT PHPBB

The section where we discuss phpBB extensions.
User avatar
J. H. Rasmussen
Administrator
Posts: 1340
Joined: Thu Nov 07, 2019 9:13 pm
Latest blog post: Play » « on Web Browser Games
Answers: 0
Reputation: 619
Location: Copenhagen, Denmark
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: EXT PHPBB

Post by J. H. Rasmussen »

This are alternatives you can use instead of the last code quote in my previous post in this thread.

This will show "(1 Connected)" (without the quotes) if one user is viewing the forum, if more than one user is viewing it will always show "(2 Connected)" (without the quotes):

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><!-- IF forumrow.JHR_FORUM_USER_COUNT --> <span class="users_viewing"><!-- IF forumrow.JHR_FORUM_USER_COUNT eq 1 -->(1 Connected)<!-- ELSE -->(2 Connected)<!-- ENDIF --></span><!-- ENDIF -->
This will show "(1 Connected)" (without the quotes) if one user is viewing the forum, if more than one user is viewing it will show "(x Connected)" (without the quotes) where x is the user count:

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><!-- IF forumrow.JHR_FORUM_USER_COUNT --> <span class="users_viewing"><!-- IF forumrow.JHR_FORUM_USER_COUNT eq 1 -->(1 Connected)<!-- ELSE -->({forumrow.JHR_FORUM_USER_COUNT} Connected)<!-- ENDIF --></span><!-- ENDIF -->
To set the color, we will add a selector to "/styles/prosilver/theme/colours.css" at the end of the file:

Code: Select all

.users_viewing
{
	color: orange;
}
This will make the text orange.

Like my previous post in this thread, this is how to do it with prosilver style, and you will need to make the change to all the styles your forum uses, that shows the user viewing count, and that you want to change the color or/and other style of the user viewing text.

User avatar
alon
Normal Member
Posts: 31
Joined: Tue Feb 22, 2022 7:47 pm
Answers: 0
Reputation: 4
Has thanked: 10 times
Been thanked: 8 times

Re: EXT PHPBB

Post by alon »

Hi, obviously this only works for forums and not subforums. That's okay thank you very much you're a friend
beer1.gif
beer1.gif (3.94 KiB) Viewed 1298 times

User avatar
J. H. Rasmussen
Administrator
Posts: 1340
Joined: Thu Nov 07, 2019 9:13 pm
Latest blog post: Play » « on Web Browser Games
Answers: 0
Reputation: 619
Location: Copenhagen, Denmark
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: EXT PHPBB

Post by J. H. Rasmussen »

You're welcome. But i don't understand why you say it does not work in sub-forums, on the test forum i set up i does show viewers in sub-forums?

Maybe it's because your forum think more or less all users are on the index page?

User avatar
alon
Normal Member
Posts: 31
Joined: Tue Feb 22, 2022 7:47 pm
Answers: 0
Reputation: 4
Has thanked: 10 times
Been thanked: 8 times

Re: EXT PHPBB

Post by alon »

In fact I don't know, question... does it work in subforums too?

User avatar
J. H. Rasmussen
Administrator
Posts: 1340
Joined: Thu Nov 07, 2019 9:13 pm
Latest blog post: Play » « on Web Browser Games
Answers: 0
Reputation: 619
Location: Copenhagen, Denmark
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: EXT PHPBB

Post by J. H. Rasmussen »

It should, and does here on the forum, and in the test forum i set up, running the same version of phpBB you use(phpBB 3.3.2).

User avatar
alon
Normal Member
Posts: 31
Joined: Tue Feb 22, 2022 7:47 pm
Answers: 0
Reputation: 4
Has thanked: 10 times
Been thanked: 8 times

Re: EXT PHPBB

Post by alon »

Ok let's hope it works.
Do you know why I tell you this, because at the moment I have many connected and few users in the forums
1 / 2 connected in some forum. I wouldn't want the problem of who's online to bring it back to this one.

User avatar
J. H. Rasmussen
Administrator
Posts: 1340
Joined: Thu Nov 07, 2019 9:13 pm
Latest blog post: Play » « on Web Browser Games
Answers: 0
Reputation: 619
Location: Copenhagen, Denmark
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: EXT PHPBB

Post by J. H. Rasmussen »

Maybe we don't understand each other.

You wrote:
I need to figure out how to set the plural of the text
(1 Connected) (2 Connected) if more than one gives me (2 Connected)
I would also like to color the text thanks :)
Which means(to me) that if one user is viewing the forum (1 Connected) is shown, if more than one user is viewing the forum (2 Connected) is shown, even if 35 users are viewing the forum it still only shows (2 Connected). That is how i read your post. And that is the first code quote i posted in the alternative code post:

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><!-- IF forumrow.JHR_FORUM_USER_COUNT --> <span class="users_viewing"><!-- IF forumrow.JHR_FORUM_USER_COUNT eq 1 -->(1 Connected)<!-- ELSE -->(2 Connected)<!-- ENDIF --></span><!-- ENDIF -->
However, i did get the idea that you may just have wanted users to be singular or plural text, that is why i also posted an alternative(second code quote) where it either show (1 Connected) or (x Connected) where x is the amount of viewers in the individual forum sections. This is the second code quote i posted in the alternative code post:

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><!-- IF forumrow.JHR_FORUM_USER_COUNT --> <span class="users_viewing"><!-- IF forumrow.JHR_FORUM_USER_COUNT eq 1 -->(1 Connected)<!-- ELSE -->({forumrow.JHR_FORUM_USER_COUNT} Connected)<!-- ENDIF --></span><!-- ENDIF -->
So if you use the first alternative code quote, then it will only show 1 or 2 connected, even if there is more viewers in the forum section, so if you want to show all viewers in the forum section, be sure to use the second code quote.

User avatar
alon
Normal Member
Posts: 31
Joined: Tue Feb 22, 2022 7:47 pm
Answers: 0
Reputation: 4
Has thanked: 10 times
Been thanked: 8 times

Re: EXT PHPBB

Post by alon »

I'll try this then and let you know if it works.
Thank you for the moment, you are always kind ;)

Code: Select all

<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><!-- IF forumrow.JHR_FORUM_USER_COUNT --> <span class="users_viewing"><!-- IF forumrow.JHR_FORUM_USER_COUNT eq 1 -->(1 Connected)<!-- ELSE -->({forumrow.JHR_FORUM_USER_COUNT} Connected)<!-- ENDIF --></span><!-- ENDIF -->

Post Reply

Return to “PhpBB Extensions”

Who is online

Users browsing this forum: No members and 10 guests