Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2014, 07:53 AM
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hook after all HTML contents are loaded?

Is there a hook that allows you to echo contents after everything has loaded?

I set my board to debug mode and the last hook loaded was page_templates. But when I make a plugin to test an echo, it gets rendered at the top of the page before all other HTML and breaks some AJAX.

Am I doing something wrong?
Reply With Quote
  #2  
Old 09-28-2014, 09:45 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It gets rendered at the top because functions/hooks are called before any output. The output rendering is the last thing executed.

What is it what you're trying to do?
Reply With Quote
  #3  
Old 09-28-2014, 09:54 AM
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
It gets rendered at the top because functions/hooks are called before any output. The output rendering is the last thing executed.

What is it what you're trying to do?
Output some HTML tags on the page but it uses PHP to generate a random number.

Template edits wouldn't give me the desired results because of this.
Reply With Quote
  #4  
Old 09-28-2014, 10:06 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So you don't want to register a template variable and render it in the template itself?
Reply With Quote
  #5  
Old 09-28-2014, 10:11 AM
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
So you don't want to register a template variable and render it in the template itself?
The problem is I want this to display on every page that global.php is included too or as close as possible to that.

--------------- Added [DATE]1411907926[/DATE] at [TIME]1411907926[/TIME] ---------------

Quote:
Originally Posted by Dave View Post
So you don't want to register a template variable and render it in the template itself?
actually i could do this and add it to every template. how would i create a vbvariable to hold my variable?

something along the lines of:

$somevar = '/somestring_' . substr(md5(rand()), 0, 2) . substr(rand(), 0, 4);

and yes this is neccessary.
Reply With Quote
  #6  
Old 09-29-2014, 08:23 PM
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #7  
Old 09-29-2014, 08:43 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EvoDarrenshan View Post
Anyone?
Take it easy, this site is run by volunteers, and all have lives, so don't expect immediate answers to your posts.

Read this on registering variables, https://vborg.vbsupport.ru/showthread.php?t=228078

Any more questions on coding need to be asked in the proper forum, https://vborg.vbsupport.ru/forumdisplay.php?f=252
Reply With Quote
  #8  
Old 09-29-2014, 08:43 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since the contents are not user supplied add it to the $show array through hook 'global start' or 'global setup complete', if it must be supplied from the $global.php. $show variable is a global template variable that is already registered -- should be used with caution.

Code:
  $show['somevar'] = '/somestring_' . substr(md5(rand()), 0, 2) . substr(rand(), 0, 4);

I am not sure how you are using this variable so I cannot say it will work for you this way.

Reply With Quote
Reply


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 01:54 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.04169 seconds
  • Memory Usage 2,227KB
  • 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
  • (1)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete