Page 1 of 2

Why no override files in phpbb and css question

Posted: Sun Sep 16, 2018 3:37 pm
by durangod
I was just curious why there are not override files for both html and css custom changes to keep people from having to modify core files?

I was also curious why so many css files? Is it just for better management, is it to keep one file from being huge or is there an actual technical reason based on the structure of the script?

Thanks :)

Re: Why no override files in phpbb and css question

Posted: Sun Sep 16, 2018 3:42 pm
by Paul
You can create a new style that is based on prosilver and that inherits from it, and have your changes in their. You will only need the files in their that you change.

Re: Why no override files in phpbb and css question

Posted: Sun Sep 16, 2018 3:45 pm
by durangod
Thanks Paul, yes i see that but then if the style or extension dev upates their stuff then our changes are lost anyway, correct?

Would it be better just for us to create a custom.css file and then have that included by the script, it would mean adding a line to the code but thats better than losing a bunch of css.

Re: Why no override files in phpbb and css question

Posted: Sun Sep 16, 2018 5:19 pm
by Lumpy Burgertushie
the updates do not touch your custom styles at all.
of course if you delete the styles folder during updates then you will need to reupload your custom style after the file replacement/update.


if there are any changes to the style files that your custom style contains then you would need to do them manually.


robert

Re: Why no override files in phpbb and css question

Posted: Sun Sep 16, 2018 10:40 pm
by durangod
Yeah that much i knew, i was just curious if there was a functional reason why they decided not to have override files in the original dev phase.

Yeah it could be a security issue i guess if someone hacked the override, but if they were able to do that they would have access to much more than that anyway. And there are certainly calculated risks in everything we do online. So i was just curious maybe the dev's had a bad experience with a override file in their career and decided not to include them maybe.

WHMCS has language override files for their software and thats handling most peoples whole hosting business so it cant be that insecure to have one. Maybe not for html but at the minimum for css would certainly save all of us alot of time.

And the best thing is that it can be added with no take away from the original script, im thinking just one line of code and one empty file would do it

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 7:02 am
by Lumpy Burgertushie
been doing this stuff for a long time and I have no idea what you are talking about when you say "override files"

sorry,
robert

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 10:13 am
by durangod
Override file is a file the script uses to check for overrides to core code. The file name is coded into the core.

For example: lets say that you wanted to change some core css, you would put your custom css into a override file. That code is executed on top of the core css code. This allows users to put as much custom css as they want in the override file without worry of losing it because that file is not included in the install or updates. The user must create the file name (whatever that is) per instructions after the install.

We used override files alot for language keys.. So if someone wanted to change key 'welcome' => 'hello how are you' to 'how are you today' they would just put this in the override file

'welcome' => 'how are you today';

the core would use that custom data rather than the core language data. The same works for css, html, and some scripts even php but that is rare.

Some scripts out there dont want people touching the core files at all, so they give them the ability to use their own code and override the core code for custom work using override files.

Make sense now :)

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 10:50 am
by david63
I would suggest that you post your suggestion in the Ideas forum

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 12:07 pm
by Ger
You can just override language keys with an extension.

Create a file ./ext/vendor/name/language/en/override_common.php
There you set an array with language keys just like any other extension.

Next, hook into core.user_setup_after and load your language file. Everything you have there will overwrite language keys previously loaded.

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 1:28 pm
by durangod
OK thanks all :)

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 1:31 pm
by DavidIQ
durangod wrote:
Mon Sep 17, 2018 10:13 am
Some scripts out there dont want people touching the core files at all, so they give them the ability to use their own code and override the core code for custom work using override files.
Nowadays there's actually little to no need for editing core files. I would say that almost anything that needs customizing can be accomplished through extensions and events including things like changing behavior or what is returned for language keys. Plus adding a CSS override is as easy as adding a CSS file to the same extension that gets appended to the header and override classes there as needed. This is what I do for all clients that need customized style changes for their forums.

Of course if there is something you cannot accomplish with what is already available we'd definitely like to hear about it so we can address it.

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 3:49 pm
by Lumpy Burgertushie
also, this is basically what is already in place with custom styles, child styles and custom css files.

it would always be better to just create a child style for your custom changes to the css and/or the html.

your child style need only have the html files that have changes and you can create a custom css file and put all your css changes in it.

then you simply install that child style on your board and use it instead of prosilver. it will inherit from prosilver all the standard files.

when you update/upgrade you simply replace old files with new ones and then update your child style files if needed.

seems like that is basically what you are talking about with "override files"


robert

Re: Why no override files in phpbb and css question

Posted: Mon Sep 17, 2018 5:44 pm
by 3Di
Ger wrote:
Mon Sep 17, 2018 12:07 pm
You can just override language keys with an extension.
There are also events which allow to create mini-extensions that can override things for "that and this and there", not only language. :)

Re: Why no override files in phpbb and css question

Posted: Tue Dec 04, 2018 2:51 pm
by aeneas1
when you minify a custom.css file (custom.min.css), should you delete the custom.css file (the unminified file)? thanks!

Re: Why no override files in phpbb and css question

Posted: Tue Dec 04, 2018 3:25 pm
by david63
aeneas1 wrote:
Tue Dec 04, 2018 2:51 pm
when you minify a custom.css file (custom.min.css), should you delete the custom.css file (the unminified file)? thanks!
Not if you ever want to modify that file - although there are online utilities that will "unminify". Also if it part of an extension then both files should be in the extension.