View Full Version : Showing users online on my website homepage
marcopolo
08-14-2008, 04:34 PM
Could anyone assist me as to what code to place in my index.htm from index.php so people visiting my site can see a list of who is online.
Don't seem to be getting anywhere fast.
Lynne
08-14-2008, 05:06 PM
Like this? Adding Currently Active Users to your own vB page (https://vborg.vbsupport.ru/showthread.php?t=187388)
marcopolo
08-14-2008, 08:29 PM
Erm not sure, looks a little too complicated for me, probably not to your average coder though.
I would have thought I could have just copied some code from the forum directory file index.php that refers to logged in users and placed it in my parent folder index.html.:confused:
Opserty
08-14-2008, 08:33 PM
Unless you know PHP & MySQL then you aren't going to get anywhere. In short, no can't just copy and paste.
PHP & HTML are two different programming languages.
Lynne
08-14-2008, 11:44 PM
Erm not sure, looks a little too complicated for me, probably not to your average coder though.
I would have thought I could have just copied some code from the forum directory file index.php that refers to logged in users and placed it in my parent folder index.html.:confused:
That is all copy/pasted from the index.php file. It's just all outlined what exactly needs to be copy/pasted.
marcopolo
08-15-2008, 06:36 AM
That is all copy/pasted from the index.php file. It's just all outlined what exactly needs to be copy/pasted.
It does not read like that at all I'm afraid, it starts of by talking about adding and finishes off by copying. I appreciate the help but I do not have a php page.
Opserty
08-15-2008, 09:01 AM
Its not possible to do this in a HTML file...
KatieG
08-15-2008, 10:44 AM
try vbexternal placed in an inline frame works for me.... ;)
marcopolo
08-17-2008, 07:05 AM
I tried the Vbexternal, got a portion of it to work but it doesn't seem to display what I require, I want is to show the usernames who are online, not just counts.
I've now got index.php for my website which will help.
Lynne, looking at your instructions again it seems to refer to items that I have not created, such as vb pages, which are not relevant to me. So I'm thinking there must be a way to change the folder for the code to display the 'logged in users', but how would I echo that info on my website?
Lynne
08-17-2008, 02:11 PM
Lynne, looking at your instructions again it seems to refer to items that I have not created, such as vb pages, which are not relevant to me. So I'm thinking there must be a way to change the folder for the code to display the 'logged in users', but how would I echo that info on my website?
I'm not sure what you mean by "change the folder for the code". The article simply outlines exactly what is present in vb's index.php page to display the Online Users. If someone wants to show the Online Users on some other non-vb page, then those are the things that must be present (the code, the included file, the template edit).
MoT3rror
08-17-2008, 11:01 PM
Maybe a look at online.php might help you better but that would require you to use php.
marcopolo
08-18-2008, 11:18 AM
I'm not sure what you mean by "change the folder for the code". The article simply outlines exactly what is present in vb's index.php page to display the Online Users. If someone wants to show the Online Users on some other non-vb page, then those are the things that must be present (the code, the included file, the template edit).
Lynne, my mistake, I obviously was not interpreting your instructions correctly. I've added the php code and copied the items from my vb index.php into a test1.php file in my website home folder.
My question is about the last template part, what part is this refering to? I know about the templates in vB or are you talking about something else?
You can see my result here http://www.os-db.net/test1.php
Lynne
08-18-2008, 02:57 PM
Lynne, my mistake, I obviously was not interpreting your instructions correctly. I've added the php code and copied the items from my vb index.php into a test1.php file in my website home folder.
My question is about the last template part, what part is this refering to? I know about the templates in vB or are you talking about something else?
You can see my result here http://www.os-db.net/test1.php
On your test1.php page, don't you have other information you are trying to show on there besides the usersonline? How do you spit that information out? The article I wrote is intended to show the code to *add to* your template and *add to* your php page. It is not stand alone code.
marcopolo
08-18-2008, 04:03 PM
On your test1.php page, don't you have other information you are trying to show on there besides the usersonline? How do you spit that information out? The article I wrote is intended to show the code to *add to* your template and *add to* your php page. It is not stand alone code.
My main page index.php (formerly.html) is simply html using a css, I have a small line of php code showing todays date and time.
I'm obviously missing the plot here because I can't beleive displaying the usersonline is so difficult to display.
Am I right in saying the PHP code is calling the info, so how do I display it?
Lynne
08-18-2008, 04:30 PM
How do you display you information on your index.php (formerly html) page? Is it straight php with no templates? If so, I suppose you could just add the html lines I posted in the article into your page. However, you do need to include the global.php and functions_bigthree.php pages in your php page in order to parse those vbphrases and such.
You might want to post your php page here and perhaps we can work out what you need to add.
marcopolo
08-18-2008, 04:44 PM
removed data
Lynne
08-18-2008, 05:21 PM
I'm getting an error on your index page and I think it's because you have not defined your doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
You didn't close the tag.
marcopolo
08-18-2008, 05:46 PM
There you go, basically I want to show the usersonline under the community area with no underline.
Lynne
08-18-2008, 06:14 PM
I just copied your code and put it up on my test site and I actually see a page without errors (although the page does have problems). Have you checked your "chdir" to make sure it's valid for you site? Try inputing the full path:
chdir ('/home/yoursite/public_html/forum');
marcopolo
08-18-2008, 06:51 PM
It must be something on the page index1.php because http://www.os-db.net/index3.php shows users online and this is basically your instructions with an echo echo $activeusers;
--------------- Added 1219091894 at 1219091894 ---------------
I've given up on this, thanks for the help Lynne but if it's this frustrating to add then it's not for me.
--------------- Added 1219130473 at 1219130473 ---------------
Right, since I've done so much work on this I'm finding it hard to let go.
This is what I've done, copied the sections into a index1.php and created a test.html and added the first part of the HTML code.
The outcome is here http://www.os-db.net/test.html
any ideas?
--------------- Added 1219131989 at 1219131989 ---------------
Ok,
I can only think that the html code that you have referred to is not enough here, what additional code do I need to place in the template (html file) to display the info.
Lynne
08-20-2008, 04:00 PM
I've sent you an email. We'll get this sorted out for you!
marcopolo
08-21-2008, 06:05 AM
I've sent you an email. We'll get this sorted out for you!
All I can say it that Lynne has been extremely helpful with this, to the point of actually doing 99.9% of the code for me which was much appreciated.
Thanks Lynne, you're a star :up:
Mark
KatieG
09-28-2008, 09:35 AM
I tried the Vbexternal, got a portion of it to work but it doesn't seem to display what I require, I want is to show the usernames who are online, not just counts.
It does show usernames who are online, As I have said I have it working on my site.
This version here (https://vborg.vbsupport.ru/showthread.php?t=83005&highlight=vbexternal) does allow this.
I don't know about the other version, Not tried them...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.