MyBB Community Forums

Full Version: [SOLVED] Change how "welcome back {user}" looks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
In the post: http://community.mybboard.net/thread-428...#pid292018 , I asked DragonFever a way to "pretty up" the way the date is shown in the code he gave.
The problem is that now I see in the "welcome back {user}":
Quote:Welcome back {user}, your last visit was on, , {date}
Please note the two(2) commas ", , ".
Can you tell me where I can find the format of this message? I did find it at the 'global.lang.php' file, but this only has the text it self - not the two(2) commas.
I did want to add a variable to the 'functions.php' code that will tell the date format function that the calling function is the 'timeAgo' function that DragonFever wrote (and is placed at the bottom of the 'functions.php' file - read the thread). The idea was to use an 'if / else' function so that date formats that do come from the 'timeAgo' are treated differently then all other. I found that I can't do that, as the variable I wanted to use isn't a global one and so (as we/I know from code writing, every function builds it from scratch, and thus doesn't know about the one build by the other function) isn't passed between the functions.


Thanks,
Ori...
Link to your forum and a test account?
http://www.ithelp.co.il/forum
user: tempuser
pass: 12345
to see some dates (look for 'היום' and 'אתמול' as they are 'Today' and 'Tomorrow' in Hebrew) you can look at this forum .
(this user cannot do anything in the forum but view - like guest and then some).
Please note that the forum is in Hebrew. but you'll see my point at the top left corner, just down the logo. This is way I gave an English named user.
DennisTT, I know that what I explained is correct as a user that his last visit was yesterday, the "welcome back" date has a '-ב' (it equivalent to 'at'/'on' in English) between the two(2) commas - this is how I changed the code (again, look at what DragonFever and I wrote).


Ori...
FOUND IT!
It took some searching, but I found that the piece of code that creates the 'welcome back {user}' is inside 'global.php'. I changed it so it stops adding a comma by itself and thus uses the comma added on the 'inc/functions.php' file at the code DragonFever gave to get me timecodes nice and pretty.

Thanks all,
Ori...