MyBB Community Forums

Full Version: change what's in the...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do you change what's in the {1} {2} etc?
They're passed to the method call MyLanguage::sprintf(). The first argument is the language key and the ones that follow are what the placeholders will be replaced with.

Example:

$lang->sprintf($lang->generated_in, $totaltime, $querycount, $memory_usage);

$totaltime is {1}, $querycount is {2}, and so on.
(2013-06-16, 10:15 PM)Nathan Malcolm Wrote: [ -> ]They're passed to the method call MyLanguage::sprintf(). The first argument is the language key and the ones that follow are what the placeholders will be replaced with.

Example:

$lang->sprintf($lang->generated_in, $totaltime, $querycount, $memory_usage);

$totaltime is {1}, $querycount is {2}, and so on.

So where would that be at?
(2013-06-16, 10:20 PM)MYBB GHOST Wrote: [ -> ]
(2013-06-16, 10:15 PM)Nathan Malcolm Wrote: [ -> ]They're passed to the method call MyLanguage::sprintf(). The first argument is the language key and the ones that follow are what the placeholders will be replaced with.

Example:

$lang->sprintf($lang->generated_in, $totaltime, $querycount, $memory_usage);

$totaltime is {1}, $querycount is {2}, and so on.

So where would that be at?

Wherever you want it to be. Wink $lang->sprintf() is a type of function, where it is called is dependant on what you want to change. Like the line Nathan mentioned, it's at about line 171 in admin/inc/class_page.php, it is for the text at the bottom of the Admin CP (Generated in 0.0003523456 seconds with 9 queries, for example).