MyBB Community Forums

Full Version: Global.php and Global.lang.php problem!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well in the welcome block i want to change the welcome_back variable.


what i want to do.

instead of:
Welcome back, apropowerranger. You last visited: 02-29-2008, 10:06 AM

i want:
AProPowerRanger, You Last Visited: 02-29-2008, 10:06 AM

what i do:
in global.php i change welcome_back to this:
$lang->welcome_back = sprintf($lang->$mybb->user['username'], $lastvisit);
before it was
$lang->welcome_back = sprintf($lang->welcome_back, $mybb->user['username'], $lastvisit);

in global.lang.php i change welcome_back to this:
$l['welcome_back'] = "{1}, You last visited: {2}";
[b]before it was this:[/b]
$l['welcome_back'] = "<strong>Welcome back, {1}</strong>. You last visited: {2}";

at the end i get this error:

Parse error: syntax error, unexpected '{', expecting ')' in /hosted/subs/ulmb.com/u/n/mybb/public_html/mybb/global.php on line 254

MAY SOMEONE PLEASE MAKE A CODE TO DO AS I WISH SO I CAN JUST ADD IT TO BOTH FILES?

GREAT THANKS,
APROPOWERRANGER!
The first argument in sprintf should be the language variable, in this case $lang->welcome_back.

In this case, you shouldn't need to modify global.php so you can revert the changes. Rather, just change the value of $l['welcome_back'] to this...

$l['welcome_back'] = "{1}, you last visited: {2}";
Thanks,

basically what your saying is that i only need to edit the global.lang.php file?
Yes, you need only edit the language string, using {1} to represent the username and {2} to represent the last visit time.