MyBB Community Forums

Full Version: Current Time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This {$lang->welcome_current_time} displays this "Current time: 03-08-2013, 04:41 PM" in Panel but I don't want the whole thing, just want the current time which is 04:41 PM. How can I just pull the current time.
Also I need to know other variables like just the user name not "Welcome back, admin", just the admin part.

Is there any list available where I can get this information easily?
You can check for the variable in global.php, and then copy the string inside.
(2013-03-08, 05:01 PM)ElectricShock Wrote: [ -> ]You can check for the variable in global.php, and then copy the string inside.

Yes thanks, not the easiest way but it works. Smile
For full variable list create new text file and rename it to dump.php and paste the following code inside
<?php
define("IN_MYBB", 1);

require_once "./global.php";

echo '<pre>';
print_r($mybb);
die('</pre>');
?>

, upload it to your forum root and execute it (credits to paveman).
(2013-03-08, 06:21 PM)Johnny S Wrote: [ -> ]For full variable list create new text file and rename it to dump.php and paste the following code inside
<?php
define("IN_MYBB", 1);

require_once "./global.php";

echo '<pre>';
print_r($mybb);
die('</pre>');
?>

, upload it to your forum root and execute it (credits to paveman).

Thanks a lot. Smile
I've done it with my site.

Open global.php and find:

$lang->welcome_current_time = $lang->sprintf($lang->welcome_current_time, $datenow.', '.$timenow);

and replace with:

$lang->welcome_current_time = $lang->sprintf($datenow.', '.$timenow);
{$timenow} will you give you only the time ^^ .
Something fancy:
http://demonate.com/thread-770.html

You can fetch the time (of user's computer) by that trick too ...