Remove time from "joined"? (Profile field)

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Remove time from "joined"? (Profile field)

Post by JoQ »

Hi!

One thing that i think is quite annoying is that the "joined" date inlcudes the time, like this:

Code: Select all

Joined: 09 jan 2008 09:49 am
Is it possbile to remove "09:49 am" and only have the date left? It is taking to much place in the profile-field!

By the way, how do i change the time, and to 24hour format? Even though i set the date-format to 19:06..... it still says 07:06 pm

Thanks!

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Remove time from "joined"? (Profile field)

Post by karlsemple »

Each user can customise the data format they see in their user control panel under the board preferences, it uses the php date() format.
Image

JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Re: Remove time from "joined"? (Profile field)

Post by JoQ »

If i want everyone to use the same format, how do i do?

And most important, how do i remove the "time" from "joined"?

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Remove time from "joined"? (Profile field)

Post by karlsemple »

JoQ wrote:If i want everyone to use the same format, how do i do?
You can not, not really. I suppose you could go through the hassle of directly editing the database, but there would be nothing stopping users from changing again afterwards. As for new users they will get the fomat set in the board settings via the Admin panel and guests will use this one also.

As for removing the "joined" you can remove it by editing the templates viewtopic_body.html

Find:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
Replace With:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{postrow.POSTER_JOINED}<!-- ENDIF -->
Image

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51939
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Remove time from "joined"? (Profile field)

Post by Brf »

How about here in memberlist.php:

Code: Select all

'JOINED'		=> $user->format_date($data['user_regdate']),
That format_date() function has a 2nd parameter that is a format override. Put whatever format you want in there.

JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Re: Remove time from "joined"? (Profile field)

Post by JoQ »

karlsemple wrote:
JoQ wrote:If i want everyone to use the same format, how do i do?
You can not, not really. I suppose you could go through the hassle of directly editing the database, but there would be nothing stopping users from changing again afterwards. As for new users they will get the fomat set in the board settings via the Admin panel and guests will use this one also.

As for removing the "joined" you can remove it by editing the templates viewtopic_body.html

Find:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
Replace With:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{postrow.POSTER_JOINED}<!-- ENDIF -->
Now i aint quite sure what you mean, the things u wrote is the exact same, without the texted Joined before ;S
I meant I don't want it to show the whole thing, now it is date and time, what i want is ONLY the date of joining :P

goethe
Registered User
Posts: 162
Joined: Fri May 11, 2007 8:26 pm

Re: Remove time from "joined"? (Profile field)

Post by goethe »

JoQ wrote:
karlsemple wrote:
JoQ wrote:If i want everyone to use the same format, how do i do?
You can not, not really. I suppose you could go through the hassle of directly editing the database, but there would be nothing stopping users from changing again afterwards. As for new users they will get the fomat set in the board settings via the Admin panel and guests will use this one also.

As for removing the "joined" you can remove it by editing the templates viewtopic_body.html

Find:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
Replace With:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{postrow.POSTER_JOINED}<!-- ENDIF -->
Now i aint quite sure what you mean, the things u wrote is the exact same, without the texted Joined before ;S
I meant I don't want it to show the whole thing, now it is date and time, what i want is ONLY the date of joining :P
Why is there stuff written in comments? I thought php used <?php and ?> tags. This is what confuses me about the source, just when I think I have studied PHP to be able to get the gist of things, I find something else!

Aye! So ein Mist!
I can translate German in both directions:
German to English
English to German
If you want a translation, drop me a PM.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51939
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Remove time from "joined"? (Profile field)

Post by Brf »

goethe wrote: Why is there stuff written in comments? I thought php used <?php and ?> tags. This is what confuses me about the source, just when I think I have studied PHP to be able to get the gist of things, I find something else!
Because that is not PHP. It is a phpBB template, which has its own syntax.

Did you see my comments up there on how you can set that date format for all users?

JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Re: Remove time from "joined"? (Profile field)

Post by JoQ »

Brf wrote: Did you see my comments up there on how you can set that date format for all users?
Yes, but i dont really understand :/

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51939
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Remove time from "joined"? (Profile field)

Post by Brf »

In memberlist.php, look for:

Code: Select all

'JOINED'		=> $user->format_date($data['user_regdate']),
and replace with:

Code: Select all

'JOINED'		=> $user->format_date($data['user_regdate'],'d M Y'),

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Remove time from "joined"? (Profile field)

Post by karlsemple »

JoQ wrote: Now i aint quite sure what you mean, the things u wrote is the exact same, without the texted Joined before ;S
I meant I don't want it to show the whole thing, now it is date and time, what i want is ONLY the date of joining :P

That is not what you said, I can only tell you to do what you ask, I am sorry I do not read minds ;) To remove it from the viewtopic page you remove all the code I posted.
Image

JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Re: Remove time from "joined"? (Profile field)

Post by JoQ »

Brf wrote:In memberlist.php, look for:

Code: Select all

'JOINED'		=> $user->format_date($data['user_regdate']),
and replace with:

Code: Select all

'JOINED'		=> $user->format_date($data['user_regdate'],'d M Y'),
That was what im looking for, it worked excellent on memberslist, but i cant figure out how to use it on viewtopic_body, this row:

Code: Select all

<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
Can i change to date there?

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Remove time from "joined"? (Profile field)

Post by karlsemple »

In viewtopic.php, look for:

Code: Select all

'joined'		=> $user->format_date($row['user_regdate']),
and replace with:

Code: Select all

'joined'		=> $user->format_date($row['user_regdate'], 'd M Y'),
Same change more or less, different file ;)
Image

JoQ
Registered User
Posts: 23
Joined: Sat Oct 20, 2007 8:45 pm

Re: Remove time from "joined"? (Profile field)

Post by JoQ »

Perfect, that solved everything. Thanks for your patience :)

User avatar
Kerry1
Registered User
Posts: 11
Joined: Sun Dec 16, 2007 9:36 pm

Re: Remove time from "joined"? (Profile field)

Post by Kerry1 »

Hi

I am also keen to do this but can't find viewtopic.php only viewtopic_body.html and viewtopic_print.html. Where should I be looking? :oops:

Thanks a mil
www.sa-mom.com
Chat forum for South African parents

Locked

Return to “[3.0.x] Support Forum”