MyBB Community Forums

Full Version: MyBB Patches for Javascript Files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Is there a MyBB Patches plugin to manage Core File edits for Javascript files?
Patches works fine for JavaScript (only requirement is /* */ comments).

It's a different story for minified JS I guess. But if you serve it gzipped, minification of JS is not particularly important.
I never knew it worked for Javascript files too. I just didn't want to try it out to prevent getting errors.

I tried it with html a few days ago, and it definitely doesn't work, you can see the patches commenting being outputted live. Does anyone know if there is a Patches plugin for html?
I'm not sure why you would want to patch HTML... what's the use-case?
(2014-08-03, 10:09 AM)frostschutz Wrote: [ -> ]I'm not sure why you would want to patch HTML... what's the use-case?

Well if there is html in MyBB Core files that aren't wrapped around PHP tags or formatted correctly to be in PHP tags, it is just html. So I would need to modify core files that contain html.
PHP that has HTML in it is still PHP. You can wrap the entire thing in an output buffer or just echo your own HTML instead. It's not pinpoint precision, but it's something. It's also the better solution as it does not saturate the output with original code. If your intention was to remove certain information from the output, with Patches it'd still be there in the HTML source.
(2014-08-03, 11:34 AM)frostschutz Wrote: [ -> ]PHP that has HTML in it is still PHP. You can wrap the entire thing in an output buffer or just echo your own HTML instead. It's not pinpoint precision, but it's something. It's also the better solution as it does not saturate the output with original code. If your intention was to remove certain information from the output, with Patches it'd still be there in the HTML source.

I know that it is still PHP, I was talking about HTML code that is not formatted in PHP code, but outside the <?php ?> code. Is that possible? I tried it and it doesn't work.
Your patch would have to pull it inside PHP.

If you absolutely want to use patches with <!-- style comments... you'd have to adapt PluginLibrary's edit_core() function for that.
IIRC 1.8 removed that kind of code (HTML outside PHP tags, etc).
^^ In-fact there is no PHP close tag in 1.8 (?>) and there is no hardcoded HTML inside PHP either. Right?
Pages: 1 2