The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
X online Users (full site)
Hello...
I recently converted my site to PHP. I want to link my php pages to VB and have VB be able to count the total number of active users and guests around my entire site. Then I want to be able to php print how many active users are online. Not just people on the forums of course. |
#2
|
|||
|
|||
Have you found out how to do this yet? I'm trying to figure out how to do this also.
|
#3
|
||||
|
||||
Yes I have...
Plus I will tell you how to do something extra that you'll be interested in! <?php chdir("/home/youruser/www/forum"); require_once('global.php'); ?> Just put that anywhere on the PHP files. I use frames so I only put this on pages with content, not frame borders. Now once you do this you're going to see ... Unknown Location /fiction/fiction-artwork.php Unfortunitly there is only one slow but sure way to fix this if you care to of course... This is a VB Hack, so be sure to... 1.) Back up the original VB file; I do save oringal files in a BAK folder. 2.) Back up your hacked file once you have it working! 3.) Make sure you can upload the original file in case it screws anything up! Ok, you will want to edit includes/functions_online.php. Also an important note DONT edit pages online, always edit them locally on your computer. This idea has led to many great disasters in the past, thankfully not to me! There are two parts you will have to edit...I will just copy and paste two pages I have modded, and the code before it. So you just have to look for the code and mod it for your own page.... /////Mod 1 (of 2)////////// case 'index': $userinfo['action'] = $vbphrase['viewing_index']; $userinfo['where'] = "<a href=\"$vboptions[forumhome].php?$session[sessionurl]\">$vboptions[bbtitle]</a>"; break; case 'home-about': $userinfo['action'] = 'Home Section'; $userinfo['where'] = "<a href=\"http://www.jabcreations.com/home/home-about.php\">About</a>"; break; case 'home-articles': $userinfo['action'] = 'Home Section'; $userinfo['where'] = "<a href=\"http://www.jabcreations.com/home/home-articles.php\">Articles</a>"; break; \\end mod part 1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Now you will have to scroll down a bit... /////mod part 2///////////// case 'forumdisplay.php': $userinfo['activity'] = 'forumdisplay'; break; case 'attachment.php': $userinfo['activity'] = 'attachment'; break; case '/': case '': case 'home-about.php': $userinfo['activity'] = 'home-about'; break; case 'home-articles.php': $userinfo['activity'] = 'home-articles'; break; \\\\\\\\end mod part 2\\\\\\\\\\ My home section is in a different folder that is on the same level as my VB folder. I don't think you have to worry as it will use that file wherever it is on your page. Your result will be like this.... Guest 03:42 PM Home Section Latest News Guest 03:41 PM Home Section Downloads Enjoy ! :classic: |
#4
|
|||
|
|||
Thank you. I will have to try this out.
|
#5
|
||||
|
||||
yes for vb to track your other files just require_once('./global.php'); and it should track the file. Also to show locations correctly in whos online just edit /includes/functions_online.php
|
#6
|
|||
|
|||
Quote:
|
#7
|
||||
|
||||
Make sure you are defining your server path in absolute...
instead of.... ../../file.php use... /home/shared_server_username/www/vbfolder/thefileyouwant.php Full example.... <?php chdir("/home/jabsite/www/community"); require_once('global.php'); ?> |
#8
|
|||
|
|||
Quote:
chdir("/home/virtual/site1/fst/var/www/html/forums"); require_once("./global.php"); Login works on all pages using this, but the users aren't showing up on Who's Online (nor in the sessions table in the db), unless they actually go into the forums. |
#9
|
||||
|
||||
are you actually running any queries in that file?
|
#10
|
|||
|
|||
Would something like this cause a slowdown on the forums for high traffic sites?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|