Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
getting VB vars to work in a misc php file in the forum directory? Details »»
getting VB vars to work in a misc php file in the forum directory?
Version: , by Gutspiller Gutspiller is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-04-2002 Last Update: Never Installs: 0
 
No support by the author.

How would I do this? It's a php news file ( http://www.theforumz.com/forumz/frontpage.php ), but I want to use some fo the variables in VB to call numbers and features, like getting the number of people that are online. (I have FireFly's lil' hack) or getting a PM box on the page, etc. I try it and instead of grabbing the variable, it just shows the variable text instead of getting it. Do I need to require certain VB files inorder to get this to work?


If somebody can help me, I would greatly appreciate it.

Thanks!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-04-2002, 06:53 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #13  
Old 03-05-2002, 02:01 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*bangs head against nearest wall*

HOW are you using $headeronline?! In a template, file, echoing it, what?
Reply With Quote
  #14  
Old 03-05-2002, 02:23 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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



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.
Reply With Quote
  #15  
Old 03-06-2002, 01:07 PM
M.Smith M.Smith is offline
 
Join Date: Feb 2002
Location: Durham, UK
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

err.... FireFly, how would i be able to call in templates like headinclude, header and footer?
Reply With Quote
  #16  
Old 03-06-2002, 02:12 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 )
Reply With Quote
  #17  
Old 03-06-2002, 04:27 PM
M.Smith M.Smith is offline
 
Join Date: Feb 2002
Location: Durham, UK
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06184 seconds
  • Memory Usage 2,261KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete