MyBB Community Forums

Full Version: Remove PHP time format on Memberlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

First up I want to say a massive THANKS for the awesome forum software.
I have checked out other forum software, but yours is by far so easy for a noob like me.
I have found great success by searching the support forums.
But now I have a new question of my own:

How can I remove the PHP time format on the memberlist?
I want to keep the PHP date format, but ditch the time format.
On the screencap below, I have marked in the purple boxes what I want to remove.

For example, I would like to change the Stooj account
  • From: 21-01-2009, 09:30 PM
  • To: 21-01-2009
I would like this to apply to the "JOINED" and the "LAST VISIT" columns on the Memberlist page only.
I do not want to lose the PHP time format on any other views across the forum.

HELP!!! hehehe

[Image: screencap01kh8.jpg]
go to Configuration > Data and Time Formats and delete "h:i A"
No he said he only want it on the member list, doing that would remove the time everywhere I'd assume.
Hi guys,

Thanks heaps for your replies.

MattR is quite correct.
I do not want to remove the time from the whole board.
I only want to remove it on the Memberlist.

Here's hoping for an answer by one of our resident gurus.
(2009-01-28, 03:32 AM)Stooj Wrote: [ -> ]Here's hoping for an answer by one of our resident gurus.

Hope I'm worthy Toungue

Remember to backup all files and your database before making changes to your forum (in this instance, it probably isn't needed, but it's good advice anyway). The very least is to mark this change down in a plain text file, and store it somewhere on your PC. That way, when you come to upgrade your board, you know what you've changed and where.

In memberlist.php, find (circa line 322):

		$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']).", ".my_date($mybb->settings['timeformat'], $user['regdate']);
		$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);;

Replace with:

		$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate'], "", 0);
		$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive'], "", 0);

That will just make the date appear. If you want it to say "Today" and "Yesterday" (not much point IMO if there is no time there), change it to

		$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']);
		$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']);
Tom.M mate......

You are MORE than worthy!
You helped me EXACTLY as I wanted.

I chose to go with your second option.
This allows me to keep the "Today" or "26.01.2009" features.

$user['regdate'] = my_date($mybb->settings['dateformat'], $user['regdate']);
$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']); 

This also allows me to make my columns width nice and uniform.

<tr>
<td class="tcat" width="1%"><span class="smalltext"><strong>{$lang->avatar}</strong></span></td>
<td class="tcat"><span class="smalltext"><strong>{$lang->username}</strong></span></td>
<td class="tcat" width="12%" align="center"><span class="smalltext"><strong>{$lang->joined}</strong></span></td>
<td class="tcat" width="12%" align="center"><span class="smalltext"><strong>{$lang->lastvisit}</strong></span></td>
<td class="tcat" width="12%" align="center"><span class="smalltext"><strong>Topic Count</strong></span></td>
<td class="tcat" width="12%" align="center"><span class="smalltext"><strong>{$lang->posts}</strong></span></td>
</tr>

And this is the result:

[Image: screencap2pm3.jpg]

Tom.M......I salute you!
Thanks so much for helping me with my request.
Actually, I think this is a wonderful change. I don't think my users should (or need to) know the exact time someone joined the forum.
In that note, I would, however, like that admins an super mods (the current logged user - not the user being displayed) would see this info. Can you tell me the correct IF statement (just the IF itself - the insides of th '{' '}' 'else' '{' '}' are more then obvious).

Ori...
Made it a plugin to make it easier. Can see this being useful to some people.

http://community.mybboard.net/thread-443...#pid304754