vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Hook after all HTML contents are loaded? (https://vborg.vbsupport.ru/showthread.php?t=314555)

EvoDarrenshan 09-28-2014 07:53 AM

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?

Dave 09-28-2014 09:45 AM

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?

EvoDarrenshan 09-28-2014 09:54 AM

Quote:

Originally Posted by Dave (Post 2516720)
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.

Dave 09-28-2014 10:06 AM

So you don't want to register a template variable and render it in the template itself?

EvoDarrenshan 09-28-2014 10:11 AM

Quote:

Originally Posted by Dave (Post 2516722)
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 (Post 2516722)
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.

EvoDarrenshan 09-29-2014 08:23 PM

Anyone?

ozzy47 09-29-2014 08:43 PM

Quote:

Originally Posted by EvoDarrenshan (Post 2516940)
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

tbworld 09-29-2014 08:43 PM

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.

:)


All times are GMT. The time now is 10:27 PM.

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.01508 seconds
  • Memory Usage 1,726KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete