2015-02-11, 10:17 AM
2015-02-12, 02:37 AM
Find where the table "Your Account Summary" is outputted in the core file and before that just type:
echo 'Hello';
2015-02-12, 03:06 AM
I can't, because in the core files it fetches the html as a template.
2015-02-12, 05:17 AM
Add a new variable, lets say:
Then use {$my_var} inside any template that gets eval'd after that line. If the template is eval'd inside a function you may need to use {$GLOBALS['my_var']} instead.
$my_var = "This is \$my_var value.";
Then use {$my_var} inside any template that gets eval'd after that line. If the template is eval'd inside a function you may need to use {$GLOBALS['my_var']} instead.
2015-02-12, 09:48 AM
Thank you Omar G. that is exactly what I needed to know.
I always wondered how to put the {$variables} in template files, and now I know.
I always wondered how to put the {$variables} in template files, and now I know.
2015-02-14, 06:35 AM
That is how hooks actually work. If you use a hook, lets say, "usercp_start", to achieve the same result as above you will need something like this:
If that hook doesn't works for you try using one that is executed before the one mentioned till you find the appropriate one. Always try to find the most appropriate hook for every piece of code you need to run.
Try it yourself.
$plugins->add_hook('usercp_start', 'foo');
function foo()
{
global $my_var;
$my_var = "This is \$my_var value.";
}
(2015-02-12, 05:17 AM)OmarĀ G. Wrote: [ -> ]Then use {$my_var} inside any template that gets eval'd after that line hook. If the template is eval'd inside a function you may need to use {$GLOBALS['my_var']} instead.
If that hook doesn't works for you try using one that is executed before the one mentioned till you find the appropriate one. Always try to find the most appropriate hook for every piece of code you need to run.
Try it yourself.