The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
What code do I put to show Number Of Users Online / Total Users somewhere else?
Just below my Navbar, I have a code that says: We have X users online, of a total X. I need to find the code to replace the X ====== Since this post, I have... ======== Found a hack that runs the queries in the header, but phpinclude_start template does not exist in 3.7. Where else can I add: Code:
if (strpos($_SERVER['PHP_SELF'], 'index.php') == false) { $datecut = TIMENOW - $vboptions['cookietimeout']; $headerguests=$DB_site->query_first("SELECT COUNT(*) AS count FROM session WHERE userid=0 AND lastactivity>$datecut"); $headerusers=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lastactivity>$datecut"); $headerguests=$headerguests[count]; $headerusers=$headerusers[count]; $totalonline=$headerguests+$headerusers; } |
#2
|
||||
|
||||
![]() Quote:
|
#3
|
|||
|
|||
![]()
I can't seem to find Parse_Template either :S
I am using vbulletin 3.7 |
#4
|
||||
|
||||
![]() Quote:
- Create New Plugin: Now create a new plugin for the parse_templates hook location: Admin CP -> Plugins & Products -> Add New Plugin - Next: hook = parse_templates title = whatever execution order = whatever php code = the code that used to go in the phpinclude template. |
#5
|
|||
|
|||
![]()
Thanks.
I have added all that into a plugin. I put $totalonline into the header but still nothing shows :| What's happening? |
#6
|
||||
|
||||
![]()
I?m gona try on my test forum, take a minute.
|
#7
|
|||
|
|||
![]()
Here are the install instructions then, has extra info to complete:
*WARNING* Do not create a plugin with the data as it causes MySql errors |
#8
|
||||
|
||||
![]()
Something like this?
|
#9
|
|||
|
|||
![]()
That's exactly what I want.
How exactly did you do it? I added you on msn, could you have a look for me? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|