MyBB Community Forums

Full Version: Attachments not showing up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
<snip>
Do you have a test account we can login with? It sounds like it's just any image that is generated by PHP that fails.
<snip>
Ah, yeah it's what I thought it was, some text is being appended to the top of the output. 'Script timezone differs from ini-set timezone', do you know why that's there? It's being outputted at the top of all scripts, including PHP generated images, which will corrupt the image. If you use Chrome, go here:

view-source:attachment.php?thumbnail=5

See it says that at the top? That shouldn't be there, and will cause any PHP generated images (and probably AJAX calls, too) to fail. I'd assume your host is adding this in as it's not something MyBB does, but why it's being done is a mystery.
I know exactly what it is, though this IS interesting!

The default installation is giving me some problems concerning the timezone, I've done the exact same thing on 1.6.8 and I did not have an attachment problem then. (note: I do not have access to php.ini, due to my hoster) The reason I changed it gave me a lot of clutter.

Here is the files I have changed:

inc/functions.php
admin/modules/tools/tasks.php
admin/modules/tools/system_health.php

(Note: I have put them into an original state and attachments work! Smile)

I have added this bit to them, to try and resolve the issue (I have as good as no knowledge in scripting).
date_default_timezone_set('America/Los_Angeles');

$script_tz = date_default_timezone_get();

if (strcmp($script_tz, ini_get('date.timezone'))){
    echo 'Script timezone differs from ini-set timezone.';
} else {
    echo 'Script timezone and ini-set timezone match.';
}

If I do not use this, I get things like this:

[attachment=30306]

(edit: I understand that this prevented GZIP compression as well, my edits made the main site (except for the ACP, oddly enough) to go 404 on me)