PDA

View Full Version : Currently Active Users In Header


Renmiri
07-27-2006, 10:00 PM
A request (https://vborg.vbsupport.ru/showthread.php?p=1039329) that I happened to need ASAP so I did my first hack (be gentle!)

Inspired on vBExternal (https://vborg.vbsupport.ru/showthread.php?t=83005&page=24) and live stats on header (https://vborg.vbsupport.ru/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 (https://vborg.vbsupport.ru/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
07-28-2006, 02:15 PM
Thanks, just installed it on my forums. ;)

http://www.finalfantasyforums.net

albibak
07-28-2006, 02:31 PM
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
07-28-2006, 02:42 PM
Hi

You would need to use this <div align="left"><span class="smallfont"><b>Online: </b> $totalonline</a>

In place of
<div align="left"><span class="smallfont"><a href="online.php$session[sessionurl_q]"><b>Online: </b> $usersonline</a>

I just tested what i put and it works

Hope this helps :)

Renmiri
07-28-2006, 02:52 PM
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
07-30-2006, 07:34 AM
Thx a lot for your help :)

Bison
10-09-2006, 04:31 PM
Hi

You would need to use this <div align="left"><span class="smallfont"><b>Online: </b> $totalonline</a>

In place of
<div align="left"><span class="smallfont"><a href="online.php$session[sessionurl_q]"><b>Online: </b> $usersonline</a>

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
10-12-2006, 03:03 PM
The numbers do not show up for me. Am I missing something?
Are you in 3.6 ?

Lionel
10-13-2006, 04:24 AM
works on 3.62.... but it displays all invisible members

|oR|Greg
12-10-2006, 03:46 PM
Works great in 3.6.0!

www.amacny.com

|oR|Greg
12-10-2006, 04:16 PM
Anyway to make the usernames links to the users profiles? I tried, but no dice.

Renmiri
12-10-2006, 11:25 PM
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
$Data .= $glue.$User['username'];

REPLACE WITH
$Data .= $glue."<a href='/member.php?u=".$User['userid']."'>".$User['username']."</a>";


Hopefully it also works on 3.6 :D