MyBB Community Forums

Full Version: put var into footer.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
i need to put this var: {$l['stats_newestuser']} on the footer.
how can i do it?
This variable will only work on index. If you want to add this in index footer somewhere then Insert the following variable in index template;
{$lang->stats_newestuser}
(2012-07-12, 03:22 PM)Yaldaram Wrote: [ -> ]This variable will only work on index. If you want to add this in index footer somewhere then Insert the following variable in index template;
{$lang->stats_newestuser}
i want that at any page this var gonna showed.
And want to show in footer ? Open ./global.php and search for global_end hook. Paste the following code just ABOVE to the hook line;
$lang->load("index");
$stats = $cache->read("stats");
	if(!$stats['lastusername'])
	{
		$newestmember = "no-one";
	}
	else
	{
		$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
	}
$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember);

Now paste {$lang->stats_newestuser} variable in footer template where you want it to show. Smile
(2012-07-12, 04:04 PM)Yaldaram Wrote: [ -> ]And want to show in footer ? Open ./global.php and search for global_end hook. Paste the following code just ABOVE to the hook line;
$lang->load("index");
$stats = $cache->read("stats");
	if(!$stats['lastusername'])
	{
		$newestmember = "no-one";
	}
	else
	{
		$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
	}
$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember);

Now paste {$lang->stats_newestuser} variable in footer template where you want it to show. Smile
don't work Sad
Are you sure you're adding code in ./global.php file , and above that global_end hook ?
Are you sure you're adding the variable in right template set's footer template ?
(2012-07-12, 04:15 PM)Yaldaram Wrote: [ -> ]Are you sure you're adding code in ./global.php file , and above that global_end hook ?
Are you sure you're adding the variable in right template set's footer template ?
the code need look like this:
$lang->load("index");
$stats = $cache->read("stats");
    if(!$stats['lastusername'])
    {
        $newestmember = "no-one";
    }
    else
    {
        $newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
    }
$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember); 

// Run hooks for end of global.php
$plugins->run_hooks("global_end");

$globaltime = $maintimer->getTime();
?>
In ./global.php , find;
$plugins->run_hooks("global_start");
and Paste the code provide just BELOW that hook line.
(2012-07-12, 04:46 PM)Yaldaram Wrote: [ -> ]In ./global.php , find;
$plugins->run_hooks("global_start");
and Paste the code provide just BELOW that hook line.
what are you mean?
under this row add the text?
Yes..
Pages: 1 2