Post and PM Inline Attachments

Started by dougiefresh, July 26, 2014, 09:14:08 PM

Previous topic - Next topic

BellGab.com

Hi.  I have these two errors in the log.  Any thoughts?

8: Undefined variable: dimensions
Sources/Subs-InlineAttachments.php
==>914:   '<span class="smalltext" style="display:block; ' . ($attachment['is_image'] ? 'max-' : '') . 'width:' . ($attachment['is_image'] && $dimensions['width'] > 0 ? (!empty($modSettings['ila_max_width']) && $modSettings['ila_max_width'] < $dimensions['width'] ? $modSettings['ila_max_width'] : $dimensions['width']) : 240) . 'px;">' .




8: Undefined index: webm
Sources/Subs-InlineAttachments.php
==>896:    '<param name="flashVars" value="controlbar=over&amp;' . (!empty($img) ? 'image=' . urlencode($img) . '&amp;' : '') . 'file=' . (!empty($file['mp4']['href']) ? urlencode($file['mp4']['href']) : urlencode($file['webm']['href'])) . '" />' .

Thanks.

silverpt36

Hey,

I'm having trouble with this mod on my forum.

It's posting the attachments inline as it should but they still show under de posts as a "normal" attachment. I'm using the mod mostly to attach images to the posts so i have them all duplicated both inline and under the the post. I have the option "Remove attachment image under post after in-post use?" checked.

SMF Version: 2.0.15
Theme: Flexive

Any clues?

Thanks in Advance!

GL700Wing

Quote from: BellGab.com on January 20, 2020, 07:57:35 PM
Hi.  I have these two errors in the log.  Any thoughts?

8: Undefined variable: dimensions
Sources/Subs-InlineAttachments.php
==>914:   '<span class="smalltext" style="display:block; ' . ($attachment['is_image'] ? 'max-' : '') . 'width:' . ($attachment['is_image'] && $dimensions['width'] > 0 ? (!empty($modSettings['ila_max_width']) && $modSettings['ila_max_width'] < $dimensions['width'] ? $modSettings['ila_max_width'] : $dimensions['width']) : 240) . 'px;">' .




8: Undefined index: webm
Sources/Subs-InlineAttachments.php
==>896:    '<param name="flashVars" value="controlbar=over&amp;' . (!empty($img) ? 'image=' . urlencode($img) . '&amp;' : '') . 'file=' . (!empty($file['mp4']['href']) ? urlencode($file['mp4']['href']) : urlencode($file['webm']['href'])) . '" />' .

Thanks.
A few questions:
1.  Which version of this mod are you using;
2.  Do either/both issues occur for all attachment types or only some attachment types (if only some attachment types please provide details); and
3.  What other mods (including versions) are also installed.

PS:  I am using this mod without any issues/error conditions on three production forums all of which have custom themes and between 120 and 140 other mods installed.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Quote from: silverpt36 on February 06, 2020, 06:36:52 AM
Hey,

I'm having trouble with this mod on my forum.

It's posting the attachments inline as it should but they still show under de posts as a "normal" attachment. I'm using the mod mostly to attach images to the posts so i have them all duplicated both inline and under the the post. I have the option "Remove attachment image under post after in-post use?" checked.

SMF Version: 2.0.15
Theme: Flexive

Any clues?

Thanks in Advance!
I installed the theme Flexive on a brand new SMF 2.0.17 forum (ie, it had no mods installed) and then installed this mod (ensuring it was also updated the Flexive theme) and the mod is working correctly (ie, inline attachments are not also listed under the post).

However, if I install the mod without updating the Flexive theme it behaves as you described.

Please try uninstalling the mod, reinstall it making sure it also updates the Flexive theme and let me know the outcome.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Does anyone know if the limit of 20 attachments per post can be increased for this mod please?

I have all my attachments settings at 0 in admin, see attachments below, but cannot put more that 20 in one post.


Sorry please ignore this or delete.

iLeoxmon

Is this module enable for others sites like regular websites?

gohanjaja


Deaks

Quote from: iLeoxmon on June 18, 2020, 02:43:08 PM
Is this module enable for others sites like regular websites?

Your posting on a support forum for SMF so it will only work on a SMF forum
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Deaks

Quote from: gohanjaja on June 18, 2020, 05:41:35 PM
plz, update for 2.1 rc2

The author has not been on since march and the topic is full of posts asking for assistance I'm afraid I cant see it being updated for a while
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Arantor

I assume he's been busy with that 'real life' thing and his job.
Holder of controversial views, all of which my own.


Sectomy

hi,
does anyone have this mod on the WYSIWYG Advanced editor working ?
i always struggle with Editor Mods, causing of the Advanced Editor, cause it didnt apply to it.
Can anyone tell me which files i have to modify if the "original" Editor is working fine, i just want to "copy it over to the new Editor"
like i click on add attachment to the Post, but in the new Editor, nothing happened, but if i manually do [attachment then it works.

davidblack1080

Hello,

If an user is logged he can see the link to the file. But if i the user is an anonimous user, appears this:

[You are not allowed to view attachments]

I need that unloggeg users can download an see de attachached files.

shadav

Quote from: davidblack1080 on July 17, 2020, 03:58:31 PM
Hello,

If an user is logged he can see the link to the file. But if i the user is an anonimous user, appears this:

[You are not allowed to view attachments]

I need that unloggeg users can download an see de attachached files.

in your admin under members go to permissions and for each member group that you want to be able to view attachments edit the permissions
make sure that the box is checked for View attachments

so in your case you want to edit the guests permissions

Dave J

Quote from: davejo on May 27, 2020, 02:48:23 AM
Does anyone know if the limit of 20 attachments per post can be increased for this mod please?

I have all my attachments settings at 0 in admin, see attachments below, but cannot put more that 20 in one post.


Sorry please ignore this or delete.

I started the above post and did strikethrough on the question because I thought I was wrong. But yesterday I created a post on my site with more than 20 attachments (photos) and all the photos after 19 didn't post (I have the first attachment as '0') and the message in the post was 'invalid attachment' for all after 19.

Now when I went back and edited the post and added the photos after 19 they posted OK. So my question is:

Does anyone know if the limit of 20 attachments per post (first posting) can be increased for this mod please?

I'm using

Post and PM Inline Attachments   6.16
SMF 2.0.17

link to post is here davejohnson.co.uk/index.php?topic=478.0

GL700Wing

Quote from: davejo on August 16, 2020, 04:00:12 AM
But yesterday I created a post on my site with more than 20 attachments (photos) and all the photos after 19 didn't post (I have the first attachment as '0') and the message in the post was 'invalid attachment' for all after 19.

Now when I went back and edited the post and added the photos after 19 they posted OK. So my question is:

Does anyone know if the limit of 20 attachments per post (first posting) can be increased for this mod please?
As you've already indicated the maximum number of attachments allowed per post is set in "Administration Center » Attachments and Avatars » Attachment Settings" and this mod does not alter that value - all it does is enable attachments to be inserted inline.

I've done some testing on an SMF 2.0.17 forum with no mods installed and discovered that regardless of the value set for the maximum number of attachments allowed per post only 20 attachments can be attached to a new/modified post at a time.  However, I also discovered that it is actually possible to attach more than 20 files to a new/modified post by previewing the message after the first 20 files have been attached and then attaching more files in groups of 20 up to the maximum number of attachments allowed.

Also, and as per the code in ./Sources/Post.php, only 50 attachments per post are allowed when the value is set to '0' (ie, unlimited).
./Sources/Post.php
$context['num_allowed_attachments'] = empty($modSettings['attachmentNumPerPostLimit']) ? 50 : min($modSettings['attachmentNumPerPostLimit'] - count($context['current_attachments']) + (isset($deleted_attachments) ? $deleted_attachments : 0), $modSettings['attachmentNumPerPostLimit']);
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Quote from: GL700Wing on August 16, 2020, 06:41:24 AM
Quote from: davejo on August 16, 2020, 04:00:12 AM
But yesterday I created a post on my site with more than 20 attachments (photos) and all the photos after 19 didn't post (I have the first attachment as '0') and the message in the post was 'invalid attachment' for all after 19.

Now when I went back and edited the post and added the photos after 19 they posted OK. So my question is:

Does anyone know if the limit of 20 attachments per post (first posting) can be increased for this mod please?
As you've already indicated the maximum number of attachments allowed per post is set in "Administration Center » Attachments and Avatars » Attachment Settings" and this mod does not alter that value - all it does is enable attachments to be inserted inline.

I've done some testing on an SMF 2.0.17 forum with no mods installed and discovered that regardless of the value set for the maximum number of attachments allowed per post only 20 attachments can be attached to a new/modified post at a time.  However, I also discovered that it is actually possible to attach more than 20 files to a new/modified post by previewing the message after the first 20 files have been attached and then attaching more files in groups of 20 up to the maximum number of attachments allowed.

Also, and as per the code in ./Sources/Post.php, only 50 attachments per post are allowed when the value is set to '0' (ie, unlimited).
./Sources/Post.php
$context['num_allowed_attachments'] = empty($modSettings['attachmentNumPerPostLimit']) ? 50 : min($modSettings['attachmentNumPerPostLimit'] - count($context['current_attachments']) + (isset($deleted_attachments) ? $deleted_attachments : 0), $modSettings['attachmentNumPerPostLimit']);

Thanks for the reply. Looks like I'll just have to resort to edit the post, as I did previously, and add the additional attachments.

GL700Wing

Quote from: davejo on August 16, 2020, 08:03:19 AM
Thanks for the reply. Looks like I'll just have to resort to edit the post, as I did previously, and add the additional attachments.
Alternatively you can preview the message after adding the first 20 attachments and then add more ...

I've logged this issue as a bug - see https://www.simplemachines.org/community/index.php?topic=574421.0
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Quote from: GL700Wing on August 16, 2020, 08:24:08 AM
Quote from: davejo on August 16, 2020, 08:03:19 AM
Thanks for the reply. Looks like I'll just have to resort to edit the post, as I did previously, and add the additional attachments.
Alternatively you can preview the message after adding the first 20 attachments and then add more ...

I've logged this issue as a bug - see https://www.simplemachines.org/community/index.php?topic=574421.0

Thanks very much

GL700Wing

Apparently you need to change the PHP setting 'max_file_uploads' which has a default of 20 - this can be done via cPanel (which makes it a site-wide setting) or in the php.ini for each affected forum on your website - see https://www.simplemachines.org/community/index.php?topic=574421.msg4065288#msg4065288
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Dave J

Quote from: GL700Wing on August 16, 2020, 06:11:41 PM
Apparently you need to change the PHP setting 'max_file_uploads' which has a default of 20 - this can be done via cPanel (which makes it a site-wide setting) or in the php.ini for each affected forum on your website - see https://www.simplemachines.org/community/index.php?topic=574421.msg4065288#msg4065288

I can confirm that this works. I set the php.ini files to [max_file_uploads = 40] and have just done a test post with 22 phots in it and that works fine.

Thank you GL700Wing and thanks to vbgamer45 for the advice.

Advertisement: