Total users online [message #11993] |
Thu, 24 July 2003 18:50 |
ctbk
Messages: 142 Registered: April 2002 Location: Milan, Italy
Karma: 0
|
Senior Member |
|
|
I tried to add the total of the users online in the logedin section of the homepage without success.
I'd like something like:
"There are 153 users online, of wich 81 are registered members, 21 are invisible and 51 are guests."
Where I've got to make the sum? I'm not very familiar with the template system you used, so I tried adding a variable containing the sum in logedin.inc.t (after modifing the msg entry) with no result.
Thanx
~
~
:wq
|
|
|
Re: Total users online [message #11994 is a reply to message #11993] |
Thu, 24 July 2003 18:54 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
You need to store the sum of the guests, members & invisible inside a variable.
The modify the msg file of the translation you are using (status_line:) to display the sum.
FUDforum Core Developer
|
|
|
Re: Total users online [message #11997 is a reply to message #11994] |
Thu, 24 July 2003 19:03 |
ctbk
Messages: 142 Registered: April 2002 Location: Milan, Italy
Karma: 0
|
Senior Member |
|
|
I did those things, without result!
I added the following line in logedin.inc.t:
$obj->online_users_tot = $obj->online_users_anon + $obj->online_users_hidden + $obj->online_users_reg;
in logedin.inc.t
and then changed the status_line entry, putting a
<!-- tot:{VAR: $obj->online_users_tot} --> in the text. Result:
<!-- tot: -->
~
~
:wq
|
|
|
Re: Total users online [message #11999 is a reply to message #11997] |
Thu, 24 July 2003 19:06 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
{VAR: } will automatically add a $, so you don't need to write it yourself.
FUDforum Core Developer
|
|
|
|
Re: Total users online [message #12005 is a reply to message #12002] |
Thu, 24 July 2003 19:25 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Are you sure you've put the $obj->online_users_tot = ... inside the display code and not inside the cache code?
You can open the compiled file, logedin.inc and take a look in there to make sure everything is in the right place.
Judging from the output you're getting the variable is either empty or is not avaliable.
FUDforum Core Developer
|
|
|
Re: Total users online [message #12006 is a reply to message #12005] |
Thu, 24 July 2003 19:35 |
ctbk
Messages: 142 Registered: April 2002 Location: Milan, Italy
Karma: 0
|
Senior Member |
|
|
I checked the logedin.inc and the code is in the right place.
here's a piece of logedin.inc:
$obj->online_users_anon = q_singleval('SELECT count(*) FROM fud2_ses s WHERE time_sec>'.$tm_expire.' AND user_id>2000000000');
$obj->online_users_hidden = q_singleval('SELECT count(*) FROM fud2_ses s INNER JOIN fud2_users u ON u.id=s.user_id WHERE s.time_sec>'.$tm_expire.' AND u.invisibl
$obj->online_users_reg = q_singleval('SELECT count(*) FROM fud2_ses s INNER JOIN fud2_users u ON u.id=s.user_id WHERE s.time_sec>'.$tm_expire.' AND u.invisible_m
$obj->online_users_tot = $obj->online_users_anon + $obj->online_users_hidden + $obj->online_users_reg;
And this is the status_line in msg:
status_line: <!-- totale: {VAR: obj->online_users_tot} -->Ci sono <b>{VAR: st_obj->online_users_reg}</b> utenti, <b> [...]
(it's the italian translation)
~
~
:wq
|
|
|
Re: Total users online [message #12009 is a reply to message #12006] |
Thu, 24 July 2003 19:44 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Actually that's the wrong place, that's where the cache is made.
You should've added your code right below the
if ($FORUM_INFO == 'Y') {
line
FUDforum Core Developer
|
|
|
|
|
|
|
Re: Total users online [message #12097 is a reply to message #12034] |
Mon, 28 July 2003 17:08 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Here is a patch that after it is applied makes the forum display the total logged in users in () brackets.
Index: src/logedin.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/logedin.inc.t,v
retrieving revision 1.19
diff -u -r1.19 logedin.inc.t
--- src/logedin.inc.t 14 May 2003 06:14:08 -0000 1.19
+++ src/logedin.inc.t 28 Jul 2003 17:27:49 -0000
@@ -64,6 +64,7 @@
} else {
$logedin = '';
}
+ $ttl_users = $st_obj->online_users_reg + $st_obj->online_users_hidden + $st_obj->online_users_anon;
$logedin = '{TEMPLATE: logedin}';
}
if ($FORUM_INFO == 'Y') {
Index: thm/default/i18n/english/msg
===================================================================
RCS file: /forum21/install/forum_data/thm/default/i18n/english/msg,v
retrieving revision 1.76
diff -u -r1.76 msg
--- thm/default/i18n/english/msg 24 Jul 2003 22:47:38 -0000 1.76
+++ thm/default/i18n/english/msg 28 Jul 2003 17:27:49 -0000
@@ -141,7 +141,7 @@
size: Size:
started_on: Started On
status: Status:
-status_line: There are <b>{VAR: st_obj->online_users_reg}</b> members(s), <b>{VAR: st_obj->online_users_hidden}</b> invisible members and <b>{VAR: st_obj->online_users_anon}</b> guest(s) visiting this board.
+status_line: There are ({VAR: ttl_users}) <b>{VAR: st_obj->online_users_reg}</b> members(s), <b>{VAR: st_obj->online_users_hidden}</b> invisible members and <b>{VAR: st_obj->online_users_anon}</b> guest(s) visiting this board.
sticky: sticky:
stop_ignoring: stop ignoring this user
sub_to_thread: Subscribe to topic
FUDforum Core Developer
|
|
|
|
Re: Total users online [message #26790 is a reply to message #26785] |
Fri, 12 August 2005 15:00 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
This feature was added in CVS and will be available in the next release.
FUDforum Core Developer
|
|
|
|
Re: Total users online [message #26798 is a reply to message #26796] |
Fri, 12 August 2005 19:41 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Well, I expect to release RC1 within a week, the final release will depend on how release candidate holds up.
FUDforum Core Developer
|
|
|
|