vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   getting VB vars to work in a misc php file in the forum directory? (https://vborg.vbsupport.ru/showthread.php?t=35713)

Gutspiller 03-04-2002 06:53 PM

Maybe I don't understand the quesiton?

If you want to know what code the $headeronline var calls here are the instructions written by you. :)

Code:


************************************************
** Number of online users in header / footer! **
************************************************

1. Add the following code to your phpinclude template (PHP-Parsed code):
************************************************************
// start - get online users (hack by firefly)
$datecut=time()-$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];
$headeronline=$headerguests+$headerusers;
// end - get online users (hack by firefly)
************************************************************

2. Save the template changes.

3. Place $headeronline wherever you want in either your header or footer templates to show number of online users. In addition, you can also use $headerguests to show number of online guests, or $headerusers to show number of online members.

Enjoy the hack. :-)

Is that what you wanted? :confused:

Admin 03-05-2002 02:01 PM

*bangs head against nearest wall*

HOW are you using $headeronline?! In a template, file, echoing it, what?

Gutspiller 03-05-2002 02:23 PM

Duh.... me likes VB.. :?:

:D

OK, well since I am still a complete noob and I have no idea what "echoing" even means, it's hard to answer your questions.

If you want to know how I am using it in my forum in my

forumdisplay_threadslist

file I added this line: <a href="http://www.theforumz.com/forumz/online.php"><b> $headeronline </b></a> Currently Online Users

Other than that I have given you everything I have done. The way I put it in the misc. php file that's in my forum directory, the instructions on how I got the users to be in a var from your instructions, the pages themselves, how I put it into forum pages.

If you want more you will have to convert your speaking to newbie terms, because I still don't understand. Is all I want it to do is make is to that my misc php file that I have in my forum directory to act like my forum templates and when I type $headeronline in my misc php file I don't want it to show "$headeronline", I want it to actually go get the number of people that were online.

Can you please help me to understand what you are saying and what I need to do?


(Sorry for being such a noob) :(

Thanks.

M.Smith 03-06-2002 01:07 PM

err.... FireFly, how would i be able to call in templates like headinclude, header and footer?

Gutspiller 03-06-2002 02:12 PM

Quote:

Originally posted by Sn2
err.... FireFly, how would i be able to call in templates like headinclude, header and footer?
If you are looking to include the users online in your header, follow the instructions I posted of FireFly's in post 11 of this thread. ( https://vborg.vbsupport.ru/showthrea...814#post225814 )

M.Smith 03-06-2002 04:27 PM

no, i mean actually call a template into a misc php file that has global.php included.


All times are GMT. The time now is 01:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00944 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete