PDA

View Full Version : Currently Active Users In Header


Renmiri
28 Jul 2006, 14:58
A request (http://www.vbulletin.org/forum/showthread.php?p=1039329) that I happened to need ASAP so I did my first hack (be gentle!)

Inspired on vBExternal (http://www.vbulletin.org/forum/showthread.php?t=83005&page=24) and live stats on header (http://www.vbulletin.org/forum/showthread.php?t=95493)

1. Add the plugin to set the value of $onlineusers
2. Edit header template to add $onlineusers

If you want to put it under the logo, the same place the live stats on header (http://www.vbulletin.org/forum/showthread.php?t=95493) puts it, do this:

In the header template:

Find: (ususally at the end of the template file)
<!-- content table -->
$spacer_open

$_phpinclude_output

Add Above:
<!-- Currently Active Users in Header Template -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="left"><span class="smallfont"><a href="online.php$session[sessionurl_q]"><b>Online: </b> $usersonline</a>
</span></div>
</td>
<td align="left" width="20%"> </td>
</tr>
</table>
<!-- Currently Active Users in Header Template -->

Check it out (I put mine by the site logo)

http://sinsdawn.ffproject.net/index.php

Note: If your forum is very active (lucky you), your current online string gets too big. The plugin stops the gathering of user names when the string reaches 80 charaters. If you want more than that, just edit the plugin and at the bottom find
while($User = $db->fetch_array($UsersOnline) and strlen($Data)<80){

and change the 80 to your preferred size

Snake
28 Jul 2006, 16:15
Thanks, just installed it on my forums. ;)

http://www.finalfantasyforums.net

albibak
28 Jul 2006, 16:31
Thanks for this mod.
Do you know how I can do for display only the numer of member, and not the name?

exemple : online : 13

bashy
28 Jul 2006, 16:42
Hi

You would need to use this

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



In place of


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I just tested what i put and it works

Hope this helps :)

Renmiri
28 Jul 2006, 16:52
Thanks for this mod.
Do you know how I can do for display only the numer of member, and not the name?

exemple : online : 13
just get the live stats on header plugin. they have number online, # threads...

or do what Bashy said :)

albibak
30 Jul 2006, 09:34
Thx a lot for your help :)

Bison
09 Oct 2006, 18:31
Hi

You would need to use this

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



In place of


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I just tested what i put and it works

Hope this helps :)

The numbers do not show up for me. Am I missing something?

Renmiri
12 Oct 2006, 17:03
The numbers do not show up for me. Am I missing something?
Are you in 3.6 ?

Lionel
13 Oct 2006, 06:24
works on 3.62.... but it displays all invisible members

|oR|Greg
10 Dec 2006, 17:46
Works great in 3.6.0!

www.amacny.com

|oR|Greg
10 Dec 2006, 18:16
Anyway to make the usernames links to the users profiles? I tried, but no dice.

Renmiri
11 Dec 2006, 01:25
Anyway to make the usernames links to the users profiles? I tried, but no dice.

OK, this works on my 3.5.4 (http://forums.ffproject.net/)

Go to the Plugin Editor, find the online_users plugin (under parse_templates)

FIND


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



REPLACE WITH


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Hopefully it also works on 3.6 :D