MyBB Community Forums

Full Version: Attachment field missing in newthread and newreply.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Just upgraded from 1826 to 1827. I noticed that on this MyBB-forum the newthread and newreply pages looks like this:

[Image: new.jpg]

However,on my forum it looks stil like this:

[Image: old.jpg]
(without the 'Click or drop her some files here to upload' field).

How do I get this field layout on my forum as well?
Did you navigate to Find Updated Templates after upgrading and make sure your templates were properly upgraded? If not, doing so will probably solve your problem.
Yes i did Laird, but the newthread.php and newreply.php files does'nt have any changes.
I assume those two templates are the ones i'm looking for?
You can see which templates were changed here:

https://github.com/mybb/mybb/pull/4195/f...e1655a424a

Here's the list: post_attachments_attachment, post_attachments_new, and post_javascript.
(2021-06-26, 05:53 AM)Laird Wrote: [ -> ]Did you navigate to Find Updated Templates after upgrading and make sure your templates were properly upgraded? If not, doing so will probably solve your problem.

(2021-06-26, 06:32 AM)Laird Wrote: [ -> ]You can see which templates were changed here:

https://github.com/mybb/mybb/pull/4195/f...e1655a424a

Here's the list: post_attachments_attachment, post_attachments_new, and post_javascript.

Thanks Laird, problem solved with your help.
I'm having the same problem after upgrading to the latest version.

When the page loads, i can see the attachment button for a few instants, after the page is fully loaded, the button isn't there.

Can you please help?

I'm using the Dark 1.8 theme.

Here are my templates:

post_attachments_attachment

<tr id="attachment_{$attachment['aid']}">
<td class="trow2" width="1" align="center">{$attachment['icon']}</td>
<td class="trow2" width="60%" style="white-space: nowrap"><span class="attachment_filename">{$attachment['filename']}</span> ({$attachment['size']})</td>
<td class="trow2" style="white-space: nowrap; text-align: center;">{$attach_mod_options} {$attach_rem_options} {$postinsert}</td>
</tr>

post_attachments_new

<tr>
<td class="trow1" width="1"><i class="fas fa-paperclip" style="color:red;"></i></td>
<td class="trow1" style="white-space: nowrap"><strong>{$lang->new_attachment}</strong> <input type="file" name="attachments[]" size="30" class="fileupload" multiple="multiple" /></td>
<td class="trow1" style="white-space: nowrap" align="center">{$attach_update_options} {$attach_add_options}</td>
</tr>
<tr style="display: none;">
    <td class="trow1" colspan="3">
        <div id="upload_bar" style="background: #0066A2; height: 5px; width: 0%;"></div>
        <div id="dropzone" style="padding: 50px 0; margin: 5px 10px 10px; cursor: pointer; border: 2px dashed #CCC; text-align: center;">
            <div style="pointer-events: none;"></div>
        </div>
    </td>
</tr>


post_javascript

			<script type="text/javascript">
				lang.add_attachment = "{$lang->add_attachment}";
				lang.update_attachment = "{$lang->update_attachment}";
				lang.update_confirm = "{$lang->update_confirm}";
				lang.attachment_missing = "{$lang->attachment_missing}";
				lang.attachment_too_many_files = "{$lang->attachment_too_many_files}";
				lang.attachment_too_big_upload = "{$lang->attachment_too_big_upload}";
				lang.attachment_max_allowed_files = "{$lang->attachment_max_allowed_files}";
				lang.error_maxattachpost = "{$lang->error_maxattachpost}";
				lang.drop_files = "{$lang->drop_files}";
				lang.upload_initiate = "{$lang->upload_initiate}";
				php_max_upload_size = {$php_max_upload_size};
				php_max_file_uploads = {$php_max_file_uploads};
				mybb_max_file_uploads = {$mybb->settings['maxattachments']};
			</script>
			<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1827"></script>
			


Thanks

[attachment=44748]
Also, check that css isn't hiding the new template by using same color as background.
Otherwise web inspector in whatever variant your browser provides is a handy tool to see what's up (or not).
I am afraid that Css has nothing to do with it.

Just trying to find the solution and after checking this page https://github.com/mybb/mybb/pull/4195/files

I have tried renaming the post.js file to post.js1, everything works as it should.

The attachment tab is back, i am able to upload the attachments and delete them also.

So, what is this js all about?

Can someone explain please?

Thanks
When you say "attachment tab", do you mean it's back as it was, or it's showing the drag and drop uploader? If you're not seeing a drag and drop uploader, then your templates are still outdated.
No, i'm not seeing the drag and drop uploader. I'm not using the default theme.

So, after manually updating the templates as of here:

https://github.com/mybb/mybb/pull/4195/files

And renaming the post.js file again to original name, it still doesn't work and shows no attachment tab.

New templates:

post_attachments_attachment
<tr id="attachment_{$attachment['aid']}">
<td class="trow2" width="1" align="center">{$attachment['icon']}</td>
<td class="trow2" width="60%" style="white-space: nowrap">{$attachment['filename']} ({$attachment['size']})</td>
<td class="trow2" width="60%" style="white-space: nowrap"><span class="attachment_filename">{$attachment['filename']}</span> ({$attachment['size']})</td>
<td class="trow2" style="white-space: nowrap; text-align: center;">{$attach_mod_options} {$attach_rem_options} {$postinsert}</td>
</tr>



post_attachments_new
<tr>
<td class="trow1" width="1"><img src="{$theme['imgdir']}/paperclip.png" alt="" /></td>
<td class="trow1" style="white-space: nowrap"><strong>{$lang->new_attachment}</strong> <input type="file" name="attachments[]" size="30" class="fileupload" multiple="multiple" /></td>
<td class="trow1" style="white-space: nowrap" align="center">{$attach_update_options} {$attach_add_options}</td>
</tr>
<tr style="display: none;">
<td class="trow1" colspan="3">
<div id="upload_bar" style="background: #0066A2; height: 5px; width: 0%;"></div>
<div id="dropzone" style="padding: 50px 0; margin: 5px 10px 10px; cursor: pointer; border: 2px dashed #CCC; text-align: center;">
<div style="pointer-events: none;"</div>
</div>
</td>
</tr>



post_javascript

<script type="text/javascript">
 lang.add_attachment = "{$lang->add_attachment}";
lang.update_attachment = "{$lang->update_attachment}";
lang.update_confirm = "{$lang->update_confirm}";
lang.attachment_missing = "{$lang->attachment_missing}";
lang.attachment_too_many_files = "{$lang->attachment_too_many_files}";
lang.attachment_too_big_upload = "{$lang->attachment_too_big_upload}";
lang.attachment_max_allowed_files = "{$lang->attachment_max_allowed_files}";
lang.error_maxattachpost = "{$lang->error_maxattachpost}";
lang.drop_files = "{$lang->drop_files}";
lang.upload_initiate = "{$lang->upload_initiate}";
php_max_upload_size = {$php_max_upload_size};
php_max_file_uploads = {$php_max_file_uploads};
mybb_max_file_uploads = {$mybb->settings['maxattachments']};
</script>

<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1827"></script>
Pages: 1 2 3