PDA

View Full Version : Number of online users in header / footer!


Admin
12-07-2001, 10:00 PM
I already posted this hack here, but not fully:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=32610

Anyway, you can use this hack to show the number of online:

guests
members
all users (guests + members)

in either your header or footer templates.

Very easy to install, only to edit one file - global.php (in the forums folder, not admin nor mod folders!).
Instructions attached to this post.

For a demo... look at the header of this. :)

Have fun! :D

Admin
12-08-2001, 06:07 PM
The variables to use to show each number:

Number of guests - $headerguests
Number of members - $headerusers
Number of total users - $headeronline

squawell
12-08-2001, 06:50 PM
FireFly~~~i got this error

Parse error: parse error in /home/jihchi/public_html/squawell/forums/vbb220/global.php on line 281

Fatal error: Call to undefined function: getpermissions() in /home/jihchi/public_html/squawell/forums/vbb220/index.php on line 10

Admin
12-10-2001, 11:28 AM
Make sure you edit everything you needed to and not anything else.

squawell
12-10-2001, 11:57 AM
ok ~~i'll try it again!!

squawell
12-10-2001, 12:04 PM
FireFly~~i try it again~~and i still got same error~~~

Admin
12-10-2001, 12:52 PM
E-mail me your file and I will fix it for you.

squawell
12-10-2001, 01:01 PM
ok~~

i already sended to u!!

thankz again~~

Freddie Bingham
12-11-2001, 01:59 AM
*psst!* stick it in the phpinclude template === no file editing.

Dalius
12-11-2001, 02:22 AM
Preview, Anyone?

Admin
12-11-2001, 05:06 AM
[QUOTE]Originally posted by freddie
*psst!* stick it in the phpinclude template === no file editing.

FWC
12-11-2001, 05:09 AM
[QUOTE]Originally posted by FireFly
Dalius, look at the top. It's there.

Admin
12-11-2001, 05:14 AM
Of course, sorry. :)
I just didn't know where to place it.

FWC
12-11-2001, 05:16 AM
[QUOTE]Originally posted by FireFly
Of course, sorry. :)
I just didn't know where to place it.

RobAC
12-12-2001, 01:48 AM
I must be missing something, because I don't see anything different at the top of this page :confused:

FWC
12-12-2001, 01:54 AM
[QUOTE]Originally posted by RobAC
I must be missing something, because I don't see anything different at the top of this page :confused:

KuraFire
12-24-2001, 02:02 PM
FF/Chen, just a quick question: is there any special modification needed to make the online users appear on a non-vb page (like here on vb.org, the first page, which is one directory lower than the forums itself) ??

I'd like to install this hack on my own portal page.... :)

Gutspiller
01-17-2002, 11:06 PM
FireFly, I have been having problems with this hack. After I installed it the PM is intermittent and sometimes doesn't work. I posted in a new thread and somebody replied and said that adding stuff to the phpinclude template sometimes causes this.

I was wondering if you had any experiance with this? I am running 2.0.3 and this is the only hack that is in that template. Do you know anything about this or anything else that might be causing it???

If you could please respond I would greatly appreciate it.

Thanks.

Admin
01-18-2002, 12:46 PM
Only thing I can think of is the $datecut variable... try changing all its intances in the hack to $headerdatecut.

Admin
01-18-2002, 12:46 PM
Only thing I can think of is the $datecut variable... try changing all its instances in the hack to $headerdatecut.

Gutspiller
01-18-2002, 02:52 PM
Thanks. I will keep you updated if this fixed the problem. :up:

Lucky
02-02-2002, 05:04 PM
[QUOTE]Originally posted by KuraFire
FF/Chen, just a quick question: is there any special modification needed to make the online users appear on a non-vb page (like here on vb.org, the first page, which is one directory lower than the forums itself) ??

I'd like to install this hack on my own portal page.... :)

Gutspiller
02-02-2002, 06:01 PM
BTW I am still having the same problem. :(

dost
02-02-2002, 09:02 PM
[QUOTE]Originally posted by KuraFire
FF/Chen, just a quick question: is there any special modification needed to make the online users appear on a non-vb page (like here on vb.org, the first page, which is one directory lower than the forums itself) ??

I'd like to install this hack on my own portal page.... :)

Lucky
02-03-2002, 08:58 AM
I thought I was the only one with this problem.

I had this hack working on 2.2.1, but I decided to upgrade to 2.2.2 with vbportal and this will not work with any of the variables that I have tried.

Any ideas?

Firefly to the rescue...

KuraFire
02-03-2002, 12:23 PM
[QUOTE]Originally posted by KuraFire
FF/Chen, just a quick question: is there any special modification needed to make the online users appear on a non-vb page (like here on vb.org, the first page, which is one directory lower than the forums itself) ??

I'd like to install this hack on my own portal page.... :)

Admin
02-03-2002, 01:16 PM
A hack exists to display on non-vB pages (tubedogg).

Add anywhere to phpinclude template.

Not sure about vbPortal... sorry.

KuraFire
02-03-2002, 01:21 PM
Thanks, it's working now.

Only need to figure out how to make it working on www.kurafire.com (very much the same as vbulletin.org itself :))
I'll look for Tubedogg's hacks :)

Lucky
02-06-2002, 08:35 PM
Firefly,

If I may, I would ask what you did on this board here so that the online #'s show up. The link works, but the variable to show the amount of users is not.
Are you using tubedoggs hack, or something you made yourself?
I have tried almost everything, and I can't get this hack going.
Even in just my forums. I had it all working good with 2.2.1, but when I upgraded to 2.2.2 I also upgraded to vbp3.0pr7 so my board now has a portal just like here. I notice one difference though. Your's is working and well mine....lol:)

Any ideas to get this going like you have here would be greatly appreciated as usual buddy.
My users are in need.

KuraFire
02-07-2002, 11:50 AM
Wow, that hack by tubedogg's a lot of work to implement, bah :(

FireFly, is there no easier way? I have admin/functions.php and global.php loaded on www.kurafire.com so is there really no way I could have the number of users showing on that page in an easier way? Tubedogg's hack is for non-vB pages but wouldn't the addition of functions.php and global.php make it a vB page again??

Lucky
02-09-2002, 03:20 PM
So did you get it going.

Still no over here.

TECK
02-09-2002, 03:40 PM
[QUOTE]Originally posted by Lucky
Firefly,
If I may, I would ask what you did on this board here so that the online #'s show up. The link works, but the variable to show the amount of users is not....

James Cridland
02-09-2002, 04:02 PM
As an addition to this hack...

If you add this into the php_include code
$headertotal=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM user WHERE lastactivity > " . mktime(0,0,0,date("m"),date("d"),date("Y")) . " ORDER BY username");
$headertotal=$headertotal[count];

...you now have a total for how many users you've had so far today.

Use it in your header template like:
$headeronline users online now
$headertotal so far today

Idea from https://vborg.vbsupport.ru/showthread.php?s=&threadid=34014 which is rather OTT for what I wanted.

Lucky
02-10-2002, 08:04 PM
Still don't work.

I add the php include and then add the headeronline to the p_themeheader and it still doesn't work.

I am at a standstill with this and this is just about my favorite hack. Any help would be great.
Thanks.

Admin
02-11-2002, 08:55 AM
Where is the p_themeheader template eval()ed? It must be called after the phpinclude template so it can use the info from there.

Lucky
02-11-2002, 09:43 PM
Thanks for taking the time buddy,

I have attached what both of my templates (p_themeheader, php include) look like.

I am not sure where it is eval()ed.

I believe it would be called upon by my root/index.php (not forums/index.php or forums/admin/index.php either)

I would really love to include this to my site.

If you need anything else, just let me know.

Thanks.

Admin
02-12-2002, 09:58 AM
And is the code in the phpinclude you showed me before or after my code for this hack? Also what's with vbp_includes.php?

KuraFire
02-12-2002, 11:50 AM
I just like to say that if you use a script like PluhNews, that works a bit like vBPortal but is far less complex and more easy to use, you can simply add $headeronline on such pages as well, without any additional hacking.

www.kurafire.com - look below the second line of buttons. :up:

Lucky
02-12-2002, 06:21 PM
I added your phpinclude stuff before instead of after this:
--------------------------------------------------------
if (!isset($mainfile)){
include("../vbp_includes.php");
}
--------------------------------------------------------
then I added $headeronlineusers in my p_themeheader.

Now it works in my forum perfectly. Thanks.

Now I just need it to work on my non vb index.php page.
Any ideas?

Destee
02-26-2002, 06:44 PM
another nice one FireFly ... thanks :)

Lucky
02-26-2002, 11:04 PM
[QUOTE]Originally posted by Lucky
Now I just need it to work on my non vb index.php page.
Any ideas?

5861king
02-28-2002, 09:42 PM
Does this hack work on VB 2.2.2 , coz it will not work for me I get this error message.

Database error in vBulletin 2.2.2:

Invalid SQL: SELECT count(DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lastactivity>1014938748
mysql error: You have an error in your SQL syntax near 'DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lasta' at line 1

mysql error number: 1064

Tim Wheatley
03-18-2002, 02:42 PM
Works with 2.2.4 - thanks :)

Decoder
03-30-2002, 04:44 AM
ok
i'm realy confused
all i want to do is all the online users to a box in my main page

what code do i need to do this???
and i need to make it call to a separete URL since my boards are on a subdomain

Decoder
04-08-2002, 03:53 AM
bump

Vivi Ornitier
04-08-2002, 04:10 AM
Now is this possible to do on a non-vb page? I've been wanthing this for my main page, not any forums page. Any suggestions?

FleaBag
05-21-2002, 12:48 PM
Why does this thread say that you have to edit a file, when the hack install instructions just tell you to add code to your phpinclude template?

Smalley
05-25-2002, 05:40 PM
i put it from the first time and it's work ok with me with $headeronline :)

FleaBag
05-28-2002, 12:13 AM
Same question once more.

James Cridland
06-09-2002, 01:23 PM
[QUOTE]Originally posted by FireFly
Very easy to install, only to edit one file - global.php

weallgoboing
10-06-2002, 11:40 AM
Is there a way for this to work on a front page.

I use a non-vb front page (but php with pluhnews).

I would quite like to display the user infor on the front page a la vbportal.

freakyshiat
10-06-2002, 08:07 PM
Is there a way to include that code in forumdisplay.php and not phpinclude?

Mono
10-06-2002, 10:49 PM
Works well thank you.

Link14716
10-07-2002, 12:18 AM
[QUOTE]Originally posted by Fazle
Is there a way to include that code in forumdisplay.php and not phpinclude?

freakyshiat
10-07-2002, 05:16 AM
[QUOTE]Originally posted by Link14716


phpinclude is not a page. phpinclude is included in all pages! ;)

FleaBag
10-11-2002, 10:45 PM
Working a dream on 2.2.7, thanks FireFly! :)

FleaBag
10-29-2002, 07:53 PM
Working with 2.2.8. :)

James Cridland
11-10-2002, 04:56 PM
You probably want to update the first post here.

It says:
Very easy to install, only to edit one file - global.php (in the forums folder, not admin nor mod folders!).
Instructions attached to this post.

...but actually, you don't need to edit any files, according to the instructions attached... just edit a template. Which makes it even better, of course.

glo
03-20-2003, 10:51 PM
Has anyone been abel to use this in 2.2.9 or is this a standard feature in 2.3.0?

I am also looking for a way to include guests and members on nonVB pages in the "XX Online users" on a non VB page!

Any comments or help is greatly appreciated.

Xyphen
04-05-2003, 01:35 AM
chen, your the greatest!!

glo
04-25-2003, 09:38 AM
[QUOTE]03-21-03 at 10:51 AM glo said this in Post #59 (https://vborg.vbsupport.ru/showthread.php?postid=370256#post370256)
Has anyone been abel to use this in 2.2.9 or is this a standard feature in 2.3.0?

I am also looking for a way to include guests and members on nonVB pages in the "XX Online users" on a non VB page!

Any comments or help is greatly appreciated.

Koutaru
05-16-2003, 08:29 AM
it's not a standard feature, it's still a hack

afterglow
08-30-2003, 02:59 AM
Does this hack work on ver. 3.0 RC5? Please i need an update on this one.

regards,
afterglow

KuraFire
08-30-2003, 09:35 AM
You can just put the code in the phpinclude_start template on vB3 beta 5, and it will work.

Edison Chen
06-10-2004, 11:48 AM
Installed. ;)