Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 01-23-2008, 08:18 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Dismounted...And it's not even my issue.

I'm getting closer. Either I can pull the names of the active users or I can pull the stats on active users...Only in FORUMHOME I'm able to call both. I think it has to do with the lack of code:

Code:
  if (fetch_online_status($loggedin))
  {
   $numbervisible++;
   eval('$activeusers .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
  }

The problem is that if I hook that into global_start I end up getting a call function error:

Code:
Call to undefined function fetch_online_status()

Without that line, I won't be able to pull the names of active users in other pages. I'm missing something here...
Reply With Quote
  #12  
Old 01-23-2008, 08:22 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You forgot to include the dependants. Specifically in that case, functions_online.php. You also should add a conditional around it so it only runs on the required pages, otherwise, you'd be running it every time the vBulletin backend is called - not good.
Reply With Quote
  #13  
Old 01-23-2008, 09:08 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh...That makes sense. Thanks, Dismounted.

So for no mods, he wants to display the What's Going On? box on every page. In this case fetch_online_status, $activeusers and the rest of the codes for What's Going On? will be called. Is there a workaround so that by calling the processes on every page isn't a problem?
Reply With Quote
  #14  
Old 01-23-2008, 09:30 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It isn't a problem if you limit the calling with THIS_SCRIPT. It is a problem because the vBulletin backend is called for every function. Eg. quick replying. We don't need to do the processing on those calls, so we put a cap on it .
Reply With Quote
  #15  
Old 01-23-2008, 10:04 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Slowly all of this is making sense to me. No wonder when I called certain processes via plugin it shot through every page when it wasn't intended to. So would THIS_SCRIPT for this instance look something like:

Code:
<if condition="in_array(THIS_SCRIPT, array('index', 'forumdisplay', 'showthread', 'search'))">
   <div class="smallfont">
    <div style="white-space: nowrap">
<!-- currently active users -->
$vbphrase[currently_active_users]: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>).&nbsp;
<!-- / currently active users -->
<phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
    <div>$activeusers</div>
   </div>
</if>

Or am I out of the ballpark? Again, thanks for your patience. :up:
Reply With Quote
  #16  
Old 01-23-2008, 10:31 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, spot on with the conditional.
Reply With Quote
  #17  
Old 01-23-2008, 11:05 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hehe...You're a good teacher. :up:

I think my next step is to get the codes in function_online.php and combine them with $activeusers. Hopefully they'll call approprately across pages. First, I need sleep.

For coders, if they are calling a vB process do they typically write their own codes (a variation of vB codes) or do they take actual vB snippets here and there then put them together?
Reply With Quote
  #18  
Old 01-23-2008, 04:41 PM
no mods's Avatar
no mods no mods is offline
 
Join Date: Apr 2007
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Freesteyelz and Dismounted. Im still lost, but if anyone comes to a way to do this let me know.
Reply With Quote
  #19  
Old 01-23-2008, 09:08 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm still working on it...But if anyone else has an answer do share.
Reply With Quote
  #20  
Old 01-24-2008, 02:57 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Freesteyelz View Post
I think my next step is to get the codes in function_online.php and combine them with $activeusers. Hopefully they'll call approprately across pages. First, I need sleep.
Your next step is to find the whole "What's Going On?" box processing code (in index.php) and copy that into the plugin. Post whatever errors you get when accessing a page so I can help you with those.
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:10 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.12251 seconds
  • Memory Usage 2,249KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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