[SOLVED] [Boost] Moodle 3.3 - How do I modify the current user name in top right?

[SOLVED] [Boost] Moodle 3.3 - How do I modify the current user name in top right?

by Sam Mudle -
Number of replies: 3

Hi,

I want to put extra characters around the displayed current logged in user first and surname that appears in every page of the boost theme.

So for example, I want it to display

--->  Testy Tester <---

or

$$$ Testy Tester $$$



Ah I figured it out:

Needed to hack the user/lib.php file.

Average of ratings: -
In reply to Sam Mudle

Re: [SOLVED] [Boost] Moodle 3.3 - How do I modify the current user name in top right?

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

That is a horrible, horrible (so bad I had to type it twice) and maintenance unfriendly solution.  Far better to find the code in the theme that outputs the username (probably with the help of a $USER global attribute) and have a child theme of Boost to implement the extra characters around it.

Average of ratings: Useful (1)
In reply to Sam Mudle

Re: [SOLVED] [Boost] Moodle 3.3 - How do I modify the current user name in top right?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

What about a background image?

You could setup a set of different images that could be set ramdomly using CSS & a bit of PHP. All in the themes layout file.

https://css-tricks.com/snippets/php/randomize-background-image/

Cheers

Mary

In reply to Mary Evans

Re: [SOLVED] [Boost] Moodle 3.3 - How do I modify the current user name in top right?

by Sam Mudle -

What about a background image?

You could setup a set of different images that could be set ramdomly using CSS & a bit of PHP. All in the themes layout file.

https://css-tricks.com/snippets/php/randomize-background-image/

Cheers

Mary

You might think this is silly, but I added a custom user profile field to that allows an animated gif to appear next the user's name.  It's sorta a 2nd profile pict.  The main profile pict doesn't support animated gifs and I lock that part anyway so they can't change it for the rest of the year.

Students can choose from about 50 different animated gifs and they can change them whenever they want.  For high school students, this is pretty cool.

So, there's no way really easy way to do this with CSS. Yeah I have to keep track of the code hacks, but I'm just a single high school teacher, not a university.

Here's the concept: