MyBB Community Forums

Full Version: Trying to change welcome back message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am looking to change the welcome back message in the top left to say "Welcome Back, (Name with color from group)!"

Below is the code from my global.php but i dont know what to change it too

// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);

$searchlink = '';
if($mybb->usergroup['cansearch'] == 1)
{
eval('$searchlink = "'.$templates->get('header_welcomeblock_member_search').'";');
}
instead of changing the core file, you can try using the plugin provided here
(2019-05-07, 02:49 PM).m. Wrote: [ -> ]instead of changing the core file, you can try using the plugin provided here

and how exactly would i go about using this?
^ you can upload given file to plugins folder of your files server
& activate that plugin from plugins page of forum admin panel.
So i got it activated but im not sure how to go in and edit it and make sure its working?

it still just has the basic welcome back message at the top?
Literally did both of these and nothing is working its still just has this

https://i.imgur.com/DmY6856.png
In global.php line #529

Changing:
// Format the welcome back message
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link(htmlspecialchars_uni($mybb->user['username']), $mybb->user['uid']), $lastvisit);

To:

// Format the welcome back message    
$welcome_back_user = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']);
$lang->welcome_back = $lang->sprintf($lang->welcome_back, build_profile_link($welcome_back_user, $mybb->user['uid']), $lastvisit);
 

Works fine as you can see here:

[Image: npfink.png]

The only thing that may be stopping that from working would be if say your custom theme has css styling overriding that specific text coloring.
Its not working for me because i changed the code in the global.php

https://i.imgur.com/fJWSlso.png

Then I activated the plugin that you sent me

https://i.imgur.com/1ZTHL2m.png

And then I still have it looking like this

https://i.imgur.com/7OBbUHk.png
The code change above does not require a plugin. The plugin suggested in the linked post I suggested is to cover usergroup styling boardwide and can be used with the welcomeblock edit or not. As far as the welcomeblock specific plugin you were trying, did you disable it before trying the global.php edit as with the edit said plugin is not neede and may conflict. Also have you looked at your default theme to see if after said edit it is working, now I mention that because if it is working in default theme, then that would hint to it being a styling conflict in your custom theme.
Pages: 1 2