View Full Version : Hook after all HTML contents are loaded?
EvoDarrenshan
09-28-2014, 07:53 AM
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?
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
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.
So you don't want to register a template variable and render it in the template itself?
EvoDarrenshan
09-28-2014, 10:11 AM
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 1411907926 at 1411907926 ---------------
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
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.
$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.
:)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.