Hide Time Board wide [solved]

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Hide Time Board wide [solved]

Post by FCAC »

Hi! :D

I wonder if anyone could help me hide the time throughout my board please, I really don't want to see the time -anywhere- within my board.

Can it be done from only one main file please?

Thank you!! :D
Last edited by FCAC on Mon Apr 06, 2020 12:48 am, edited 1 time in total.

Code: Select all

  :shock:  
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Hide Time Board wide

Post by david63 »

There is no simple way to do this - you would need to edit many template files to remove it.

Out of curiosity why do you not want the time to show?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

Thank you David :)

The forum I am setting up is for a rather small community, and I found that in a previous forum I owned a few years back, of the same sort, people were rather judgemental about who posted when, like a member's unregular hours, so some members would not even log in for not wanting to be judged.

I guess I don't really want a time trail on posts, or when last logged in, or on last post, etc for members.

My concern is also of security.... I moderated a forum previously, and soam attack always happened at the forum's most quiet time..... Spammers knew the mods time regularities.

I guess I should go through every single file and search them then.....
Thank you David :D

Code: Select all

  :shock:  
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26908
Joined: Fri Aug 29, 2008 9:49 am

Re: Hide Time Board wide

Post by Mick »

As David said, there’s quite a lot involved in doing what you want, certainly no quick fix. The best thing to do would be to make an Extension Request.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

Thank you Mick :)
I just might.....
I appreciate

Code: Select all

  :shock:  
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26908
Joined: Fri Aug 29, 2008 9:49 am

Re: Hide Time Board wide

Post by Mick »

Make one, if no one takes it on you’ve lost nothing - it’s free😆
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

lol :shock:
I'm not even sure what html file does what!!!!!
and I don't even know if what I'm looking for us a board file or a style file!!
:oops:

Code: Select all

  :shock:  
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26908
Joined: Fri Aug 29, 2008 9:49 am

Re: Hide Time Board wide

Post by Mick »

I’m not saying you do it, make an extension request link supplied.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

O Pew!!!!!! Good!
Just done it:
viewtopic.php?f=496&t=2547761

see, Is there any real need for me to know that 12 years ago you registered at 5:49 am

Thank you for your hep!

Code: Select all

  :shock:  
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

Maybe you could give me a head start please? :D

Let say I want to get rid of the time on "Last Post" of each categorized forum on index page.
What would I need to change on which file please :D

Thank you so much!

Image https://drive.google.com/file/d/1lHpg7c ... sp=sharing

Code: Select all

  :shock:  
User avatar
EA117
Registered User
Posts: 2176
Joined: Wed Aug 15, 2018 3:23 am

Re: Hide Time Board wide

Post by EA117 »

I don't think you can actually solve what you want to solve by editing templates.

You're intending to change "Sun Apr 05, 2020 5:08 pm" to display as "Sun Apr 05, 2020" instead, correct? i.e. You just want to remove specifically and literally "the time", and not "remove the entire date stamp."

What you can achieve by editing templates is to "remove display of the date stamp entirely." i.e. Not even "Sun Apr 05, 2020" would be displayed.

An extension is definitely a good way to solve the issue of removing just the time "easily", but you'll have to wait for whomever will write the extension, if anyone.

There are alternatives, like changing the date formats offered by each installed language pack, and then editing the database to change both the board default time format as well as each individual user's selected time format, such that none of them include the actual time. But that's not a "definitive" solution, since technically phpBB allows a user to enter whatever time format they want. So your spammers or people who want to criticize the activity of others could still re-enable the time display for their own user accounts.

So in my mind, the only alternative to waiting for the extension is making a core code change in the date stamp display function. To do the same thing the extension would ostensibly do, which is to "strip out" any attempt to include the hour, minutes or AM/PM in the time display. Regardless of whether they are using one of the language pack-offered time formats, or had entered a custom time format of their own.

There was some other post on here where someone had needed something similar; let me see if I can find it....
User avatar
FCAC
Registered User
Posts: 39
Joined: Fri Apr 03, 2020 10:41 pm

Re: Hide Time Board wide

Post by FCAC »

Well Thank you EA117!


I appreciate the system is more elaborate than I had anticiated, me thinking that all times are drawn from one file on style was a little innocent.
A core code change sounds pretty elaborated.....
So in the meantime, whilst I was waiting for an answer here, I have tried to modify the php files but unsuccessfully :(

The end of it, push comes to shove, I have no objection in getting rid of the date along with the time, because the content is not only NOT time sensitive, but new topics are bumped to the top and announced on Last Post etc, so there's no real need for a date either, ................ if this is easier :D

I just don't know how to do that, both on Last Post, on posts themselves and on misc similar activities

Thank you again

Code: Select all

  :shock:  
User avatar
EA117
Registered User
Posts: 2176
Joined: Wed Aug 15, 2018 3:23 am

Re: Hide Time Board wide

Post by EA117 »

I was thinking of this discussion, but in that case they were only looking to change the "It is currently..." display at the top of the index page. In your case, you're wanting to make a change to "all time displays."

A relatively small quick & dirty change you could make is to inject these lines into the existing user->format_date() function:

Code: Select all

	// Remove common combinations like "g:i a" and "H:i" so that we remove the separator characters, too.
	// But ensure we strip out any non-standard usages trying to sneak past us as well.
	$remove_formats = array( ", g:i a", ", H:i", "g:i a, ", "H:i, ", "g:i a", "H:i", "a", "A", "B", "g", "G", "h", "H", "i", "c", "r", "U" );
	$format = str_replace( $remove_formats, "", $this->date_format );
This goes right before the existing return $time->format($format, $forcedate) line in the user->format_date() function in /phpbb/user.php.

A pre-edited version of the /phpbb/user.php file for phpBB 3.3.0 which includes this change is attached. Rename and/or replace your existing /phpbb/user.php with the attached one. You could purge the phpBB cache from the ACP General page just to be sure; but many usages will already change even without purging the cache. If you want back to shipping phpBB 3.3.0 behavior, just put the original /phpbb/user.php from the phpBB 3.3.0 download (or the renamed one you saved) and purge your phpBB cache again.

This is a "bad way to solve it", because now when phpBB 3.3.1 or any future version comes out, you have to re-implement this change along with whatever changes phpBB might have made to the user.php file. It's also not attempting to discriminate at all, and affects "every attempt to display the date and time", including cases you probably didn't want to change such as the ACP Maintenance log time stamps. But it is at least something within your control and "can do now", in absence of an extension to achieve this particular behavior.

If after seeing this you think you'd still rather take the template approach to remove the date display entirely, just let us know and we can point out where to make those edits instead.
    You do not have the required permissions to view the files attached to this post.
    User avatar
    FCAC
    Registered User
    Posts: 39
    Joined: Fri Apr 03, 2020 10:41 pm

    Re: Hide Time Board wide

    Post by FCAC »

    W :shock: W ..... EA117...... YOU'RE AWESOME!
    Looks like my coding is about to improve ;)
    and my board too!
    Thank you so much for your amazing help!

    [EDIT] It actually works beautifully, and you made it so easy with the gifted file...no coding. I'm super happy. Thank you

    Code: Select all

      :shock:  

    Return to “[3.3.x] Support Forum”