News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Post and PM Inline Attachments

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

Previous topic - Next topic

KittyGalore

Quote from: davejo on August 17, 2020, 03:01:56 AM
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.
I don't have the max file uploads in my php file on my cpanel any ideas of what i can do to fix this as i tried adding it in in the editor mode but still it only posts 20 at a time.
SMF Curve 2.0x

Dave J

Quote from: KittyGalore on August 17, 2020, 01:07:04 PM
Quote from: davejo on August 17, 2020, 03:01:56 AM
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.
I don't have the max file uploads in my php file on my cpanel any ideas of what i can do to fix this as i tried adding it in in the editor mode but still it only posts 20 at a time.

I couldn't either but I have a php.ini file on my public.html page of my site and just changed the number in there and it worked fine.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Sectomy

i have the Advanced Editor Installed, is it that cause, if i press the insert Attachment Button nothing happens.
Is it maybe a Theme thing ?
ive read that some had the same issue.... but im unsure if there was an solution for this, or what is the solution :)
maybe someone can give me a hint or maybe a helping hand in fixing this behaviour :)

thank you
greets
andi

Sectomy


GL700Wing

Quote from: Sectomy on August 21, 2020, 09:00:06 AM
i have the Advanced Editor Installed, is it that cause, if i press the insert Attachment Button nothing happens.

Quote from: Sectomy on August 28, 2020, 08:02:33 AM
seems to be an impossible thing :o
I have helped dougiefresh with supporting this mod but unfortunately I cannot investigate the issue you've reported as the Advanced Editor is a paid mod and I don't own a copy of it.
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

Uploaded v6.17 - October 2, 2020
o Fixes for single line download count options not displaying on same line as filename.
o Added filesize and download count option for non-image (eg, mp3, pdf, zip, etc) files.
o Added support for Who Downloaded Attachment mod.
o Added support for Lazyload mod.
o Added support for Images on Print Page mod.
o Added support for SMFPacks Advanced Editor mod.
o Removed support for SMF 2.1 (all versions).
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

Uploaded v6.18 - October 2, 2020
o Minor bug fix to v6.17.
o Improved integration with Automatic Attachment Rotation (and Resize) mod.
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

sam666

Using 6.18 with PHP 7.4.4 on SMF 2.0.17 . Using Firefox, there is a notification when in Admin that shows this:
Deprecated: The behaviour of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /Sources/Subs-InlineAttachmentsAdmin.php on line 296.
Something to add to your to-do list perhaps.
Thanks for maintaining this mod.

Sir Osis of Liver

Trying to install this in Nightbreeze theme, getting a lot of 'Test failed (Ignore Errors)' in PersonalMessage.template.php, no target code.  Will mod work?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

GL700Wing

Quote from: Sir Osis of Liver on December 20, 2020, 04:55:49 PM
Trying to install this in Nightbreeze theme, getting a lot of 'Test failed (Ignore Errors)' in PersonalMessage.template.php, no target code.  Will mod work?
I've just installed this mod with the Nightbreeze theme on a clean SMF 2.0.17 system and it's working fine.

This mod works with the PM Attachments mod and the changes it makes to PersonalMessage.template.php are specifically for that mod - the 'Test failed (Ignore Errors)' will occur in that template file if you don't have the PM Attachments mod installed.

Also, and because this mod is integrated with quite a few other mods (and sometimes different versions of those mods) and the installation code was written in such a way that it can install without throwing false-positive errors, 'Test failed (Ignore Errors)' may may occur in other files when the changes relate to other mods and/or different versions of those mods.
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

Sir Osis of Liver

They've been using this mod without the PM Attachments mod, doesn't seem to have caused any problems so I'll leave it in.  Thanks.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

@rjen

I am testing witch SMF 2.0.18 (beta testing) on 7.4 and this MOD is throwing some errors.
I fixed it and do not have the exact error now, but the code required code change is very minor and shown below

File: ./Sources/Subs-InlineAttachmentsAdmin.php

Find:

<input type="hidden" name="count2" value="' . $context['ila_completed'] + ($count - $start). '" />


Replace by:

<input type="hidden" name="count2" value="' . ($context['ila_completed'] + ($count - $start)). '" />

Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GL700Wing

Quote from: @rjen on January 13, 2021, 05:38:39 AM
I am testing witch SMF 2.0.18 (beta testing) on 7.4 and this MOD is throwing some errors.
I fixed it and do not have the exact error now, but the code required code change is very minor and shown below

File: ./Sources/Subs-InlineAttachmentsAdmin.php

Find:

<input type="hidden" name="count2" value="' . $context['ila_completed'] + ($count - $start). '" />


Replace by:

<input type="hidden" name="count2" value="' . ($context['ila_completed'] + ($count - $start)). '" />


Thanks - I'd already fixed that one (but not yet released an updated version) thanks to a report stoneageman made in October last year.
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

Uploaded V7.00 - February 03, 2021
o Per stoneageman's post - fixed issue with PHP 7.4.
o Fixed bug where incorrect video file names/download links were displayed if other files were attached after the video attachment(s).
o Added two board permissions that prevent attachments displayed inline and/or below the post from being downloaded (only thumbnails and/or attachment names will be shown and Guests are prompted to login if they click on the thumbnail/attachment name) - the permissions are 'Do NOT allow attachments displayed inline to be downloaded' and 'Do NOT allow attachments displayed below post to be downloaded'.
  o Also added three board permission profiles (copied from the 'Default' board profile) to enable the new board permissions to be applied to boards for Guests – the profiles are 'ILA - Prevent Download for Guests – Inline', 'ILA - Prevent Download for Guests - Below Post' and 'ILA - Prevent Download for Guests - Inline and Below Post'.
o Improved support for Images on Print Page mod.
o Added option to display attachments that are shown below the post in a line/row with a separate download counter to the one used for attachments that are displayed inline - this feature is implemented using hooks.
  Important Note: This feature replaces the New Hooks and Custom View of Attachments mods which MUST be uninstalled before this v7.00 or later of this mod is installed.
  This feature supports the following mods:
  o Play Media Attachments
  o Who Downloaded Attachment
  o Lazyload
  o Highslide Image Viewer
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

#874
Hi,

I followed the instructions and uninstalled the previous version.

I went to install the new version 7.0 and a warning was given at the top of the install page that there was an error, but on looking at the list there were no errors highlighted (see attached images) so I continued with the install.

In a post where I have already posted images, it's showing the file names and not the thumbnails as it did previously with the old version installed (see attached image) I have posted a test image in my admin area and that also doesn't show a thumbnail.

Once the mod was installed I got the following error

https://www.xxxxxxxxx.co.uk/index.php?topic=505.msg824
Undefined variable: override_show
File: /home2/xxxxxxxxxx/public_html/Sources/Display.php
Line: 1514

==>1514: 'is_image' => !empty($attachment['width']) && !empty($attachment['height']) && (!empty($modSettings['attachmentShowImages']) || $override_show),


Can you help please?
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GL700Wing

Quote from: Dave J on February 03, 2021, 06:16:43 AM
Hi,

I followed the instructions and uninstalled the previous version.

I went to install the new version 7.0 and a warning was given at the top of the install page that there was an error, but on looking at the list there were no errors highlighted (see attached images) so I continued with the install.

In a post where I have already posted images, it's showing the file names and not the thumbnails as it did previously with the old version installed (see attached image) I have posted a test image in my admin area and that also doesn't show a thumbnail.

Once the mod was installed I got the following error

https://www.xxxxxxxxx.co.uk/index.php?topic=505.msg824
Undefined variable: override_show
File: /home2/xxxxxxxxxx/public_html/Sources/Display.php
Line: 1514

==>1514: 'is_image' => !empty($attachment['width']) && !empty($attachment['height']) && (!empty($modSettings['attachmentShowImages']) || $override_show),


Can you help please?

The 'override_show' variable was used in previous versions of this mod but is not used in v7.00 so I suspect a previous version did not uninstall properly.

The correct code for that line is:
'is_image' => !empty($attachment['width']) && !empty($attachment['height']) && !empty($modSettings['attachmentShowImages']),
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

Thanks,

I've removed that line but the photos are still not showing thumbnails.

I've had a thought that could it be that the hooks didn't install and thats what the error was when I installed it?

I know somewhere there is a code to check hooks so I see if I can find it
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GL700Wing

Quote from: Dave J on February 04, 2021, 01:27:22 AM
I've removed that line but the photos are still not showing thumbnails.
You shouldn't have removed that line - you should have changed it to this:
'is_image' => !empty($attachment['width']) && !empty($attachment['height']) && !empty($modSettings['attachmentShowImages']),

Quote
I've had a thought that could it be that the hooks didn't install and thats what the error was when I installed it?

I know somewhere there is a code to check hooks so I see if I can find it
Sorry - I don't know. 

I've installed v7.00 of the mod without any installation or functional issues on a new SMF 2.0.18 forums and on several SMF 2.0.17 forums (each of which have between 100 and 140 other mods installed).

I think you should uninstall this mod and use the following instructions if you encounter any issues during the uninstall process before reinstalling it (and also use these instructions if installation errors are reported) : https://wiki.simplemachines.org/smf/Error_in_mod_installation
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

Thanks for the reply.

Sorry I should have worded that better

I changed the line to what you posted.

'is_image' => !empty($attachment['width']) && !empty($attachment['height']) && !empty($modSettings['attachmentShowImages']),

Also if you look at the attachments I added in the first post you will see that there was an error which was not listed, so I'm sorry but if it's not listed then how do we know where to look for the error.

I also notice that in the package there is a 'Display.Template.php' file that seems to serve no purpose and all it has in it is:


./Themes/default/Display.template.php

Add $user_info

function template_main()
{
    global $context, $settings, $options, $txt, $scripturl, $modSettings, $user_info;


I am going to test install this on my test site and see what happens.

For the time being I will uninstall it and temporarily re-install the previous version which did work fine

If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

GL700Wing

Quote from: Dave J on February 04, 2021, 03:14:29 AM
Sorry I should have worded that better

I changed the line to what you posted.
Thanks for letting me know - just wanted to make sure!

QuoteAlso if you look at the attachments I added in the first post you will see that there was an error which was not listed, so I'm sorry but if it's not listed then how do we know where to look for the error.
I've never seen anything like that before so I really don't know what advice to offer in relation to investigating the error(s).

QuoteI also notice that in the package there is a 'Display.Template.php' file that seems to serve no purpose
Oops - don't know how that got in there but thankfully it wasn't being installed and it won't be in the next package file.

QuoteI am going to test install this on my test site and see what happens.
I've spent most of today trying to work out what could be causing the issue you reported and I cannot reproduce it.  That said, I did find and fix some other minor bugs I found.

QuoteFor the time being I will uninstall it and temporarily re-install the previous version which did work fine.
It'd be great if you can let me know if the previous version works again and also if you give me a list of the mods you have installed - happy for you to send the list by PM if you're using a lot of mods ...
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

Advertisement: